query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
FIND ALL FLIGHTS find all entities
List<Flight> findAllFlights();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<TransportEntity> getAllEntityOfQuery();", "List<WebCrawlerData> retrieveAllEntity();", "public List<Flight> fetchFlights() {\n\t\tSession session = SessionBuilder.buildSession();\n\t\tString query = \"from Flight\";\n\t\tQuery q = session.createQuery(query);\n\t\tList<Flight> flights = q.getResultList();\n\t\treturn flights;\n\t}", "public List<LugarEntity> findall(){\n Query q = em.createQuery(\"SELECT p FROM LugarEntity p\");\n return q.getResultList();\n }", "public List<EntityPropertyLocation> find();", "@Override\r\n public List<? extends DataStoreEntity> getAllEntities(boolean recursive) {\n return null;\r\n }", "List<FinancingSourceEntity> getAllFinancingSource();", "@Query(value = \"from Flight\")\n\tList<Flight> listAllFlights();", "@Override\n @Transactional(readOnly = true)\n public List<FonctionsDTO> findAll() {\n log.debug(\"Request to get all Fonctions\");\n return fonctionsRepository.findAll().stream()\n .map(fonctionsMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n\tpublic List<FoodType> FindAllType() {\n\t\treturn ftb.FindAllType();\n\t}", "public List<Entity> getAll() {\n return entities;\n }", "@Override\n\tpublic List<flightmodel> getflights() {\n\t\t\n\t\tSystem.out.println(\"heloo\"+repo.findAll());\n\t\treturn repo.findAll();\n\t}", "public static Iterable<Entity> getAllEntities() {\n\t\treturn Util.listEntities(\"RecetteId\", null, null);\n\t}", "@Nonnull\n List<Telegraf> findTelegrafs();", "@Override\r\n\tpublic List<ScheduledFlights> retrieveAllScheduledFlights() {\t\r\n\t\tTypedQuery<ScheduledFlights> query = entityManager.createQuery(\"select s from ScheduledFlights s, Flight f,Schedule sc where s.flight = f and s.schedule=sc\",ScheduledFlights.class);\r\n\t\tList<ScheduledFlights> flights = query.getResultList();\r\n\t\treturn flights;\r\n\t}", "@Override\n public List<Defendant> getAllDefendants(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,3);\n List<Defendant> defendants = new ArrayList<>();\n try {\n List<Map<String,Object>> data = get(\"SELECT * FROM TblDefendants\");\n for(Map<String,Object> map: data)\n defendants.add(new Defendant(map));\n return defendants;\n } catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "@Override\n\tpublic List<Factura> findAll() {\n\t\treturn facturaRepository.findAll();\n\t}", "public static List<FoundObject> findAll() {\n\t\treturn getPersistence().findAll();\n\t}", "@Query(\"FROM Flight WHERE flightState=true\")\r\n\tpublic List<Flight> viewAll();", "public abstract List<T> findEntities(int pFirstRow, int pNumberOfRows);", "public List<DataSet> findDataSetEntities() {\n return findDataSetEntities(true, -1, -1);\n }", "List<Chofer> findAll();", "public List<PokemonEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todas los trayectos\");\n // Se crea un query para buscar todas las ciudades en la base de datos.\n TypedQuery query = em.createQuery(\"select u from PokemonEntity u\", PokemonEntity.class);\n // Note que en el query se hace uso del método getResultList() que obtiene una lista de ciudades.\n return query.getResultList();\n}", "@Override\n public List<LineEntity> findAll() {\n return null;\n }", "public Fence[] getAllFences() {\n/* 622 */ Set<Fence> fenceSet = new HashSet<>();\n/* 623 */ if (this.fences != null)\n/* */ {\n/* 625 */ for (Fence f : this.fences.values())\n/* */ {\n/* 627 */ fenceSet.add(f);\n/* */ }\n/* */ }\n/* */ \n/* 631 */ VolaTile eastTile = this.zone.getTileOrNull(this.tilex + 1, this.tiley);\n/* 632 */ if (eastTile != null) {\n/* */ \n/* 634 */ Fence[] eastFences = eastTile.getFencesForDir(Tiles.TileBorderDirection.DIR_DOWN);\n/* 635 */ for (int x = 0; x < eastFences.length; x++)\n/* */ {\n/* 637 */ fenceSet.add(eastFences[x]);\n/* */ }\n/* */ } \n/* */ \n/* 641 */ VolaTile southTile = this.zone.getTileOrNull(this.tilex, this.tiley + 1);\n/* 642 */ if (southTile != null) {\n/* */ \n/* 644 */ Fence[] southFences = southTile.getFencesForDir(Tiles.TileBorderDirection.DIR_HORIZ);\n/* 645 */ for (int x = 0; x < southFences.length; x++)\n/* */ {\n/* 647 */ fenceSet.add(southFences[x]);\n/* */ }\n/* */ } \n/* */ \n/* 651 */ if (fenceSet.size() == 0) {\n/* 652 */ return emptyFences;\n/* */ }\n/* 654 */ return fenceSet.<Fence>toArray(new Fence[fenceSet.size()]);\n/* */ }", "public java.util.List<DataEntry> findAll();", "public List<FacturaEntity> getFacturas() {\n LOGGER.info(\"Inicia proceso de consultar todos los facturas\");\n List<FacturaEntity> factura = facturaPersistence.findAll();\n LOGGER.info(\"Termina proceso de consultar todos los facturas\");\n return factura;\n }", "@Override\n public List<SideDishEntity> findAll() {\n return null;\n }", "private void populateEntitiesLists() {\n\t\tfor (StaticEntity entity : ((ClientTiledMap) map).staticEntities) {\n\t\t\tregisterStaticEntity(entity);\n\t\t}\n\t}", "@Override\n public List<Part> findAll() {\n List<Part> resultList = new ArrayList<>();\n repositoryPart.findAll().iterator().forEachRemaining(resultList::add);\n return resultList;\n }", "@Transactional(readOnly = true) \n public List<Heater> findAll() {\n log.debug(\"Request to get all Heaters\");\n List<Heater> result = heaterRepository.findAll();\n return result;\n }", "@Test\n\tpublic void findAll() {\n\t\tList<Farm> list = (List<Farm>) farmRepository.findAll();\n\n\t\tSystem.out.println(\"info:\"+ list);\n\t\tassert(true);\n\n\t}", "public void matchAllQuery(EsFeatureDrawable drawable) {\n QueryBuilder qb = termQuery(\"ZVH\", \"-999999\");\n\n //QueryBuilder qb = termQuery(\"ZI005_FNA\", \"Saint Louis Cathedral\");\n\n SearchResponse scrollResp = client.prepareSearch(esIndex)\n .addSort(SortParseElement.DOC_FIELD_NAME, SortOrder.ASC)\n .setScroll(new TimeValue(60000))\n .setQuery(qb)\n .setSize(100).execute().actionGet(); //100 hits per shard will be returned for each scroll\n\n do {\n for (SearchHit hit : scrollResp.getHits().getHits()) {\n HashMap map = (HashMap) hit.getSource().get(\"shape\");\n\n if (map != null) {\n drawable.drawFeature(map);\n } else {\n logger.warn(\"<null> \\\"shape\\\" field found, not drawing shape\");\n }\n }\n\n scrollResp = client.prepareSearchScroll(scrollResp.getScrollId())\n .setScroll(new TimeValue(60000)).execute().actionGet();\n } while (scrollResp.getHits().getHits().length == 0) ;\n }", "public List<Tile> findTargets() {\n List<Tile> targets = new ArrayList<>(); // our return value\n int fearDistance = 2; // Ideally we're 2 spots away from their head, increases when we can't do that.\n int foodDistance = 3; // We look at a distance 3 for food.\n\n // If fearDistance gets this big, then its just GG i guess\n while (targets.size() == 0 && fearDistance < 15) {\n // Get the tiles around the Enemy's head\n targets = this.gb.nearByTiles(this.enemy_head_x, this.enemy_head_y, fearDistance);\n fearDistance += 1;\n }\n\n // Get the food tiles near us\n for (int i=0; i < foodDistance; i++) {\n List<Tile> nearBy = this.gb.nearByTiles(this.us_head_x, this.us_head_y, i);\n for (Tile t : nearBy) {\n if (t.isFood() && !targets.contains(t)) targets.add(t);\n }\n }\n return targets;\n }", "public List<EspecieEntity> encontrarTodos(){\r\n Query todos =em.createQuery(\"select p from EspecieEntity p\");\r\n return todos.getResultList();\r\n }", "@Override\n\tpublic Iterable<Flight> viewAllFlight() {\n\t\treturn flightDao.findAll();\n\t}", "@Override\n public List<R> getAll() {\n return onFindForList(getSession().createCriteria(entityClass).list());\n }", "List<Team> findAll();", "@Override\n\tpublic List findAll()\n\t{\n\t\treturn teataskMapper.findAll();\n\t}", "@Override\n\tpublic List<Fee_Entity> get_all_fee() {\n\t\treturn fee.get_all_fee();\n\t}", "@Override\n\tpublic Iterable<Oglas> findAll() {\n\t\treturn repository.findAll();\n\t}", "public static List<Enseignant> getAll() {\n\n // Creation de l'entity manager\n EntityManager em = GestionFactory.factory.createEntityManager();\n\n // Recherche\n @SuppressWarnings(\"unchecked\")\n List<Enseignant> list = em.createQuery(\"SELECT e FROM Enseignant e\").getResultList();\n\n return list;\n }", "void fetchFactFeeds();", "public List<SeatEntity> getAll();", "@Override\n\tpublic List<Floor> findAll() {\n\t\treturn floorDao.findAll();\n\t}", "public ArrayList<TEntity> getAll(){\n ArrayList<TEntity> list = new ArrayList<TEntity>();\n\n Cursor cursor = db.query(tableName, columns, null, null, null, null, null);\n\n cursor.moveToFirst();\n\n while (!cursor.isAfterLast()) {\n list.add(fromCursor(cursor));\n cursor.moveToNext();\n }\n\n return list;\n }", "public void getEntities() {\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\tEntityA entityA = exampleDao.getOne(1);\r\n\t\tEntityB entityB3 = entityBDao.getOne(3);\r\n\t \tEntityB entityB2 = entityBDao.getOne(2);\r\n\t \tEntityB entityB1 = entityBDao.getOne(1);\r\n\r\n\t \t\r\n\r\n\t\tentityA.setEntityBList(Arrays.asList(entityB2,entityB3,entityB1));\r\n\r\n\t}", "List<IViewEntity> getEntities();", "public List<Factura> getAllFacturas(){\n return facturaFacade.findAll();\n }", "@Override\r\n public List<EntityPath> getAllEntityPaths(boolean recursive) {\n return null;\r\n }", "@Override\r\n public List<Damagething> damfindAll() {\n return userMapper.damfindAll();\r\n }", "@Test\n public void query_ALLTag() throws AtlasBaseException {\n SearchParameters params = new SearchParameters();\n params.setClassification(ALL_CLASSIFICATION_TYPES);\n params.setQuery(\"sales\");\n\n List<AtlasEntityHeader> entityHeaders = discoveryService.searchWithParameters(params).getEntities();\n\n Assert.assertTrue(CollectionUtils.isNotEmpty(entityHeaders));\n assertEquals(entityHeaders.size(), 5);\n }", "private FeatureCollection<SimpleFeatureType, SimpleFeature> findFeatures( FeatureStore<SimpleFeatureType, SimpleFeature> store, List<String> fidList ) throws SOProcessException {\n \n\n try {\n FidFilter filter = FILTER_FACTORY.createFidFilter();\n filter.addAllFids(fidList);\n \n FeatureCollection<SimpleFeatureType, SimpleFeature> features = store.getFeatures(filter);\n return features;\n \n } catch (IOException e) {\n final String msg = e.getMessage();\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n }", "@Override\n\tpublic List<FoodTruckEntity> getAllFoodTrucks() {\n\t\t\n\t\t//modelmapper.addConverter(converter);\n\t\tList<FoodTruckEntity> list=repo.findAll();\n\t\treturn list;\n\t}", "@Override\n\tpublic List<Trainee> getAll() {\n\t\tQuery q=em.createQuery(\"select m from Trainee m\");\n\t\tList<Trainee> l=q.getResultList();\n\t\treturn l;\n\t}", "@Override\n\tpublic List<Factura> findAllFacturas() {\n\t\treturn facturaDao.findAll();\n\t}", "public List<T> findAll() {\n\t Query q = getEntityManager().createQuery(\"select u from \" + getEntityClass().getSimpleName() + \" u\");\n\t return q.getResultList();\n\t }", "List<T> findAll() ;", "public List<Entity> getAllEntities()\n\t{\n\t\treturn this.entities;\n\t}", "List<NegozioDTO> findAll();", "@Override\r\n\tpublic List<Food> queryFoods() {\n\t\tString sql=\"select * from food\";\r\n\t\tList<Food> list=(List<Food>) BaseDao.select(sql, Food.class);\r\n\t\treturn list;\r\n\t}", "@Test\n public void givenListEntity_whenFindAll_thenReturnListEntity() {\n ThreeEntity entity = new ThreeEntity(1, 1);\n ThreeEntity entity2 = new ThreeEntity(1,2, 2);\n\n given(threeDao.findAll()).willReturn(Arrays.asList(entity, entity2));\n\n List<ThreeEntity> founds = threeService.findAll();\n\n assertEquals(entity.getId(), founds.get(0).getId());\n assertEquals(entity.getParentId(), founds.get(0).getParentId());\n assertEquals(entity.getValue(), founds.get(0).getValue());\n\n assertEquals(entity2.getId(), founds.get(1).getId());\n assertEquals(entity2.getParentId(), founds.get(1).getParentId());\n assertEquals(entity2.getValue(), founds.get(1).getValue());\n }", "List<TbFreightTemplate> selectAll();", "private static ArrayList<FighterModel> getAllFighter() {\n ArrayList<FighterModel> allFighters = new ArrayList<FighterModel>();\n FighterModel fighter = null;\n try {\n // Class.forName(\"com.mysql.jdbc.Driver\");\n Connection con = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/FighterRank?autoReconnect=true&useSSL=false\", \"root\", \"codingroot1!\");\n PreparedStatement ps = con.prepareStatement(\n \"Select `FighterInfo`.FighterID, FirstName, LastName, NickName, Age, Gender, Height, Weight, WeightClass, Wins, Losses, Draws, NoContent, Striking, Grappling From `FighterInfo` \\n\"\n + \"Join `FighterBody` ON `FighterInfo`.FighterID = `FighterBody`.FighterID \\n\"\n + \"Join `FighterRecord` ON `FighterInfo`.FighterID = `FighterRecord`.FighterID \\n\"\n + \"Join `FighterStyle` ON `FighterInfo`.FighterID = `FighterStyle`.FighterID\");\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n int fighterID = rs.getInt(\"FighterID\");\n fighter = SearchDatabase.getFighterBySearch(fighterID);\n allFighters.add(fighter);\n }\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n return allFighters;\n }", "public List<FeatureDataBean> getAllFeatures() throws GenericDatabaseException {\n List<String> ids = new ArrayList<>();\n ids.add(UMFeatureDao.PARENT);\n \n Map<String,Object> equals=new HashMap<>();\n equals.put(UMFeatureDao.IS_ACTIVE, Boolean.TRUE);\n \n Map<QueryOperators, Object> criteria = new HashMap<>();\n criteria.put(QueryOperators.IS_NULL, ids);\n criteria.put(QueryOperators.EQUAL, equals);\n \n return (convertFeatureDataBeanToFeatureModel(featureService.retrieveFeatures(null, criteria, null)));\n }", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Ubigeo> getUbigeoFindAll() {\n return em.createNamedQuery(\"Ubigeo.findAll\", Ubigeo.class).getResultList();\n }", "public List<E> findAll();", "@Override\n @Transactional(readOnly = true)\n public List<ModeDTO> findAll() {\n log.debug(\"Request to get all Modes\");\n return modeRepository.findAll().stream()\n .map(modeMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "List<E> findAll();", "List<E> findAll();", "List<E> findAll();", "public List<Food> findAllfood() {\n\t\treturn foodDao.findAllfood();\r\n\t}", "private void initEntities() {\n \n for (int i = 0; i < 15; ++i) {\n \n //generate random position and direction\n Vector3 pos = new Vector3(\n ((ValuesUtil.rand.nextFloat() * 2.0f) - 1.0f) *\n TransformationsUtil.getOpenGLDim().x,\n ((ValuesUtil.rand.nextFloat() * 2.0f) - 1.0f) *\n TransformationsUtil.getOpenGLDim().y,\n 0.0f);\n float rot = ValuesUtil.rand.nextFloat() * 360.0f;\n \n entities.add(new GlowFish(pos, new Vector3(0.0f, 0.0f, rot)));\n }\n \n //fader\n entities.add(new Fader(FadeDirection.FADE_IN, 0.02f,\n new Vector4(0.0f, 0.0f, 0.0f, 1.0f), true));\n }", "@Override\n public List<T> findAll() {\n return manager\n .createQuery(\"from \" + elementClass.getSimpleName() + \" e\", elementClass)\n .getResultList();\n }", "@Query(\"select classe from Classe classe join fetch classe.ecole\")\n public Iterable<Classe> findAll();", "private List<Entity> getLoadableEntities() { \n ArrayList<Entity> choices = new ArrayList<Entity>();\n // If current entity is null, nothing to do\n if (ce() == null) {\n return choices;\n }\n List<Entity> entities = clientgui.getClient().getGame()\n .getEntitiesVector();\n for (Entity other : entities) { \n if (other.isSelectableThisTurn() && ce().canLoad(other, false)) {\n choices.add(other);\n }\n }\n return choices;\n }", "public List<Etudiant> FindAll() {\n\t\treturn null;\n\t}", "List<T> findAll();", "List<T> findAll();", "List<T> findAll();", "public List<Article> findAll();", "@Override\n\tpublic List<FlightDTO> getAllFlights(SimpleCriteria sc) {\n\t\tCriteriaBuilder cb = em.getCriteriaBuilder();\n\t\tCriteriaQuery<Flight> q = cb.createQuery(Flight.class);\n\t\tRoot<Flight> root = q.from(Flight.class);\n\n\t\tParameterExpression<Date> from = null;\n\t\tPredicate fp = null;\n\t\tif (sc.dateFrom != null) {\n\t\t\tfrom = cb.parameter(Date.class, \"dateFrom\");\n\t\t\tfp = cb.greaterThanOrEqualTo(root.<Date>get(\"dateOfDeparture\"), from);\n\t\t}\n\t\t\n\t\tParameterExpression<Date> to = null;\n\t\tPredicate tp = null;\n\t\tif (sc.dateTo != null) {\n\t\t\tto = cb.parameter(Date.class, \"dateTo\");\n\t\t\ttp = cb.lessThanOrEqualTo(root.<Date>get(\"dateOfDeparture\"), to);\n\t\t}\n\n\t\t// timestampy\n\t\tif (fp != null && tp != null) {\n\t\t\tq.where(fp, tp);\n\t\t} else if (tp != null) {\n\t\t\tq.where(tp);\n\t\t} else if (fp != null) {\n\t\t\tq.where(fp);\n\t\t}\n\t\t\n\t\t// razeni\n\t\tif (sc.order != null) {\n\t\t\tif (sc.order.orderType.equals(SimpleOrderType.ASC)) {\n\t\t\t\tq.orderBy(cb.asc(root.get(sc.order.attrName)));\n\t\t\t} else {\n\t\t\t\tq.orderBy(cb.desc(root.get(sc.order.attrName)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// samotna query\n\t\tTypedQuery<Flight> fq = em.createQuery(q);\n\t\tif (fp != null) {\n\t\t\tfq.setParameter(from, sc.dateFrom, TemporalType.TIMESTAMP);\n\t\t}\n\t\tif (tp != null) {\n\t\t\tfq.setParameter(to, sc.dateTo, TemporalType.TIMESTAMP);\n\t\t}\n\t\t\n\t\t// strankovani\n\t\tif (sc.firstResult != null) {\n\t\t\tfq.setFirstResult(sc.firstResult);\n\t\t\tif (sc.offset != null) {\n\t\t\t\tfq.setMaxResults(sc.firstResult + sc.offset);\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<Flight> resultList = fq.getResultList();\n\t\tList<FlightDTO> dtos = new ArrayList<>();\n\t\tfor (Flight f : resultList) {\n\t\t\tdtos.add(new FlightDTO(f));\n\t\t}\n\t\t\n\t\treturn dtos;\n\t}", "private static ImmutableList<Class<?>> applicationEntities() {\n List<String> paths = new ArrayList<>(List.of(PREFIX_STRING));\n if (additionalPaths != null) {\n paths.addAll(additionalPaths);\n }\n\n final List<Class<?>> collect = paths\n .stream()\n .map(path -> {\n logger.info(\"Scanning {} for Hibernate entities\", path);\n final Reflections reflections = new Reflections(path);\n final Set<Class<?>> entities = reflections.getTypesAnnotatedWith(Entity.class);\n logger.info(\"Found {} Hibernate entities\", entities.getClass());\n if (logger.isDebugEnabled()) {\n entities.forEach((entity) -> logger.debug(\"Registered {}.\", entity.getName()));\n }\n return entities;\n })\n .flatMap(Collection::stream)\n .collect(Collectors.toList());\n\n return ImmutableList.copyOf(collect);\n }", "@Transactional(readOnly = true)\n public List<HarnaisDTO> findAll() {\n log.debug(\"Request to get all Harnais\");\n return harnaisRepository.findAll().stream()\n .map(harnaisMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n\tpublic List<Staff> FindAll() {\n\t\treturn sessionFactory.getCurrentSession()\n\t\t\t\t.createQuery(\"from Staff\")\n\t\t\t\t.list();\n\t}", "public void retractAll(ObjectFilter filter) {\n LOGGER.info(\"Retracting all facts matching filter...\");\n for (FactHandle handle : getFactHandles(filter)) {\n retract(handle);\n }\n }", "private void initializeEntities() {\n arrAttack = new ArrayList<>();\n arrCollidable = new ArrayList<>();\n entities = new ArrayList<>();\n\n arrAttack = scene.entityManager.getEntitiesWithComponents(attackComponent.getClass(), tool.getClass());\n\n arrCollidable = scene.entityManager.getEntitiesWithComponents(collidable.getClass(), Playable.class);\n\n for (int i = 0; i < arrAttack.size(); i++) {\n\n tool = scene.entityManager.getEntityComponentInstance(arrAttack.get(i), tool.getClass());\n\n //A -1 means that the entity is not attacking, at least with that weapon\n if (tool.currentActive != -1) {\n entities.add(arrAttack.get(i));\n }\n }\n\n //adding collidables to entities\n for (int i = 0; i < arrCollidable.size(); i++) {\n entities.add(arrCollidable.get(i));\n }\n }", "@GetMapping(\"/familles\")\n public List<FamilleDTO> getAllFamilles() {\n log.debug(\"REST request to get all Familles\");\n return familleService.findAll();\n }", "protected abstract List<FluidStack> getAllFluids();", "@Override\r\n\tpublic List<Factura> findAllFacturas() {\n\t\ttry {\r\n\t\t\treturn facturaDao.findAllFacturas();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void iterateMainEntity(Entity e, OsmDbAccessorContext ctx) throws SQLException {\n \t\tif (e instanceof Way && e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null ){\n \t\t\tBuildingInterpolation type = null;\n \t\t\tint interpolationInterval = 0;\n \t\t\tif(e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null) {\n \t\t\t\ttry {\n \t\t\t\t\ttype = BuildingInterpolation.valueOf(e.getTag(OSMTagKey.ADDR_INTERPOLATION).toUpperCase());\n \t\t\t\t} catch (RuntimeException ex) {\n \t\t\t\t\ttry {\n \t\t\t\t\t\tinterpolationInterval = Integer.parseInt(e.getTag(OSMTagKey.ADDR_INTERPOLATION));\n \t\t\t\t\t} catch(NumberFormatException ex2) {\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (type != null && interpolationInterval > 0) {\n \t\t\t\tList<Node> nodesWithHno = new ArrayList<Node>();\n \t\t\t\tfor (Node n : ((Way) e).getNodes()) {\n \t\t\t\t\tif (n.getTag(OSMTagKey.ADDR_HOUSE_NUMBER) != null && n.getTag(OSMTagKey.ADDR_STREET) != null) {\n \t\t\t\t\t\tnodesWithHno.add(n);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (nodesWithHno.size() > 1) {\n \t\t\t\t\tfor (int i = 1; i < nodesWithHno.size(); i++) {\n \t\t\t\t\t\tNode first = nodesWithHno.get(i - 1);\n \t\t\t\t\t\tNode second = nodesWithHno.get(i);\n \t\t\t\t\t\tboolean exist = streetDAO.findBuilding(first);\n \t\t\t\t\t\tif (exist) {\n \t\t\t\t\t\t\tstreetDAO.removeBuilding(first);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\t\t\tSet<Long> idsOfStreet = getStreetInCity(first.getIsInNames(), first.getTag(OSMTagKey.ADDR_STREET), null, l);\n \t\t\t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\t\t\tBuilding building = new Building(first);\n \t\t\t\t\t\t\tbuilding.setInterpolationInterval(interpolationInterval);\n \t\t\t\t\t\t\tbuilding.setInterpolationType(type);\n \t\t\t\t\t\t\tbuilding.setName(first.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));\n \t\t\t\t\t\t\tbuilding.setName2(second.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));\n \t\t\t\t\t\t\tbuilding.setLatLon2(second.getLatLon());\n \t\t\t\t\t\t\tstreetDAO.writeBuilding(idsOfStreet, building);\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\tif (e.getTag(OSMTagKey.ADDR_HOUSE_NUMBER) != null && e.getTag(OSMTagKey.ADDR_STREET) != null) {\n \t\t\tboolean exist = streetDAO.findBuilding(e);\n \t\t\tif (!exist) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\tSet<Long> idsOfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.ADDR_STREET), null, l);\n \t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\tBuilding building = new Building(e);\n \t\t\t\t\tString hno = e.getTag(OSMTagKey.ADDR_HOUSE_NUMBER);\n \t\t\t\t\tint i = hno.indexOf('-');\n \t\t\t\t\tif(i != -1) {\n \t\t\t\t\t\tbuilding.setInterpolationInterval(1);\n \t\t\t\t\t\tif(e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null) {\n \t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\tbuilding.setInterpolationType(BuildingInterpolation.valueOf(e.getTag(OSMTagKey.ADDR_INTERPOLATION).toUpperCase()));\n \t\t\t\t\t\t\t} catch (RuntimeException ex) {\n \t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\tbuilding.setInterpolationInterval(Integer.parseInt(e.getTag(OSMTagKey.ADDR_INTERPOLATION)));\n \t\t\t\t\t\t\t\t} catch(NumberFormatException ex2) {\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\tbuilding.setName(hno.substring(0, i));\n \t\t\t\t\t\tbuilding.setName2(hno.substring(i + 1));\n \t\t\t\t\t} else {\n \t\t\t\t\t\tbuilding.setName(hno);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tstreetDAO.writeBuilding(idsOfStreet, building);\n \t\t\t\t}\n \t\t\t}\n \t\t} else if (e instanceof Way /* && OSMSettings.wayForCar(e.getTag(OSMTagKey.HIGHWAY)) */\n \t\t\t\t&& e.getTag(OSMTagKey.HIGHWAY) != null && e.getTag(OSMTagKey.NAME) != null) {\n \t\t\t// suppose that streets with names are ways for car\n \t\t\t// Ignore all ways that have house numbers and highway type\n \t\t\t\n \t\t\t// if we saved address ways we could checked that we registered before\n \t\t\tboolean exist = streetDAO.findStreetNode(e);\n \n \n \n \t\t\t// check that street way is not registered already\n \t\t\tif (!exist) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\tSet<Long> idsOfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.NAME), e.getTag(OSMTagKey.NAME_EN), l);\n \t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\tstreetDAO.writeStreetWayNodes(idsOfStreet, (Way) e);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif (e instanceof Relation) {\n \t\t\tif (e.getTag(OSMTagKey.POSTAL_CODE) != null) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tpostalCodeRelations.add((Relation) e);\n \t\t\t}\n \t\t}\n \t}", "public static List findAll() {\n\t\tSession session = DBManager.getSession();\n\t\treturn session.createQuery(\"SELECT e FROM Estoque e\").list();\n\t}", "public static List<Sighting> all() {\n\t\tString sql = \"SELECT id, name, location, rangerName FROM sightings\";\n\t\ttry(Connection con = DB.sql2o.open()) {\n\t\t\treturn con.createQuery(sql).executeAndFetch(Sighting.class);\n\t\t}\n\t}", "public LiveData<List<FoodEntity>> getAllFoods() {\n return mDb.foodDAO().getAll();\n }", "List<Office> findAll();", "@Override\n public List<SideDishEntity> findAll(Iterable<Long> ids) {\n return null;\n }", "@Override\r\n\tpublic List<?> findAll(Class<?> entity) {\n\t\treturn null;\r\n\t}", "public Set<Frage> getAlleFragen() {\r\n Set<Frage> result = new HashSet<Frage>();\r\n Set<FrageDTO> fragen = dataStore.getAlleFragen();\r\n for (FrageDTO dto : fragen) {\r\n int frageId = dto.getId();\r\n List<String> antworten = dataStore.getAntwortenById(frageId);\r\n List<Integer> votes = dataStore.getVotings(frageId);\r\n Frage frage = new Frage(dto.getId(), dto.getText(),\r\n dto.getStatus(), antworten, votes);\r\n result.add(frage);\r\n }\r\n return result;\r\n }", "List<ProgramFeedBackDTO> findAll();", "@Override\r\n\tpublic List getAllOtherList() {\n\t\tString HQL = \"\";\r\n\t\tHQL += \" from XzfyOtherSuggest x\";\r\n\t\tHQL += \" where 1 = 1 \";\t\r\n\t\treturn super.find(HQL);\r\n\t}" ]
[ "0.58980507", "0.5739583", "0.569785", "0.5680651", "0.56668526", "0.56583345", "0.5645099", "0.55677867", "0.5564338", "0.5547493", "0.55358386", "0.5513301", "0.5511514", "0.5500344", "0.54248774", "0.54123205", "0.54122835", "0.54109806", "0.53888905", "0.53790176", "0.5370274", "0.5365004", "0.5339777", "0.5334224", "0.5325063", "0.53079975", "0.52739286", "0.52708733", "0.5261421", "0.52563", "0.52516556", "0.5239399", "0.52265006", "0.5217622", "0.521567", "0.5212737", "0.5211121", "0.52095264", "0.5209216", "0.520535", "0.5198556", "0.5197094", "0.5190651", "0.5189165", "0.51827925", "0.51746917", "0.51680917", "0.51450247", "0.5139873", "0.51389444", "0.5133155", "0.51300466", "0.51129234", "0.51118743", "0.5108545", "0.51080227", "0.5098357", "0.50956595", "0.50913286", "0.50911397", "0.50902635", "0.5087564", "0.5087332", "0.50873", "0.50765556", "0.50701547", "0.5069627", "0.50640094", "0.5061861", "0.5061861", "0.5061861", "0.5060744", "0.5059174", "0.505411", "0.50504667", "0.5046547", "0.5030696", "0.5029223", "0.5029223", "0.5029223", "0.5028308", "0.50254494", "0.502354", "0.5015352", "0.50135654", "0.50113326", "0.5007507", "0.5002741", "0.49992415", "0.49967167", "0.4991483", "0.4991369", "0.4985762", "0.49849895", "0.4983477", "0.498317", "0.49817166", "0.49751243", "0.49686858", "0.49650234" ]
0.58951986
1
Add steward to flight
Flight addStewardToFlight(Flight flight, Steward steward);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void insertFlightseat(AirFlightseat dRef);", "public void bookFlight(){\n //Steps\n //1 Show the available flights. (at least one seat with 0)\n //2 User select a flight, and the system automatically set the seat with his id. he is not able to select the seat\n //3 User confirm the reservation \n //4 Flight reserved\n \n //1\n //FlightRepository.availableFlights();\n //Scanner input = new Scanner(System.in);\n //String flightNumber = input.nextLine();\n \n //2,3 and 4\n Flight flightObject = FlightRepository.getFlight(this.number);\n if (flightObject == null){\n System.out.println(\"Please select a valid flight number\");\n }\n flightObject.setPassengerSeat(this.PassengerID);\n }", "Flight updateFlight(Flight flight);", "public boolean addFlight(Flight addFlight){\r\n return flights.add(addFlight);\r\n }", "public static void updateFlight() {\n\n String flightId;\n String flightDestination;\n String flightOrigin;\n String airline;\n\n Flights myFlights = new Flights();\n\n if (myFlights == null) {\n System.out.println(\"Flight not available.\");\n updateFlight();\n\n } else {\n flightId = writeText(\"Please enter new flight ID: \");\n myFlights.setFlightId(flightId);\n\n flightDestination = writeText(\"Please enter new destination: \");\n myFlights.setFlightDestination(flightDestination);\n\n flightOrigin = writeText(\"Please enter new flight origin: \");\n myFlights.setFlightOrigin(flightOrigin);\n\n airline = writeText(\"Please enter new airline: \");\n myFlights.setAirline(airline);\n\n }\n\n }", "public void addflight(Flight f)\n {\n \t this.mLegs.add(f);\n \t caltotaltraveltime();\n \t caltotalprice();\n }", "void addFlight(Node toNode);", "public void addStation(String station) {\n this.station = station;\n }", "Flight saveFlight(Flight flight);", "public void book(Passenger ps) {\r\n\t\tps.addFlight(this);\r\n\t\tps.setTotalPrice(ps.getTotalPrice() + ps.pricePerFlight(this));\r\n\t\tps.setNumFlights();\r\n\t}", "public void add(Flight flight) {\n if (validAdd(flight)) {\n addFlight(flight);\n }\n }", "void enleverBrouillard(Soldat s);", "public void makeOfferRouteStata() {\n\t\tlog(String.format(\"Making DEBUG Offer for Vassar-1\"));\n\n\t\tResRequest res = new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\");\n\t\tres = new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\");\n\t\tres.done = true;\n\t\tres.completed = getTime();\n\t\tres.tokenString = \"DEBUG\";\n\t\tres.signature = \"DEBUG\";\n\t\tres.issued = getTime();\n\t\tres.expires = getTime() + 30 * 60 * 1000;\n\t\tres.hardDeadline = res.completed\n\t\t\t\t+ Globals.REQUEST_DIRECT_PUT_DEADLINE_FROM_NOW;\n\t\tthis.offers.add(res);\n\n\t\tlog(String.format(\"Added to offers: %s\", res.regionId));\n\t}", "org.landxml.schema.landXML11.RoadwayDocument.Roadway addNewRoadway();", "public void bookFlight(String name) {\n\t\tSystem.out.println(\"Flight booked for name:\"+name);\n\t}", "public void setStewardOther(String stewardOther) {\r\n\t\tthis.stewardOther = stewardOther;\r\n\t}", "public void addSpaceStation()\n\t{\n\t\t//if a space station is already spawned, one will not be added\n\t\tif (gameObj[5].size() == 0)\n\t\t{\n\t\t\tgameObj[5].add(new SpaceStation());\n\t\t\tSystem.out.println(\"SpaceStation added\");\n\t\t}else{\n\t\t\tSystem.out.println(\"A space station is already spawned\");\n\t\t}\n\t}", "public void addDataToStowage(final StowbaseObject stowage) {\n stowage.put(\"moves\", moves);\n\n }", "@Override\r\n\tpublic ScheduledFlights addScheduledFlights(ScheduledFlights sflight) {\r\n\t\tentityManager.persist(sflight);\r\n\t\treturn sflight;\r\n\t}", "public Flight save(Flight flight);", "public void addWasher() {\r\n\t\tdo {\r\n\t\t\tString brand = getToken(\"Enter washer brand: \");\r\n\t\t\tString model = getToken(\"Enter washer model: \");\r\n\t\t\tdouble price = getDouble(\"Enter washer price: \");\r\n\t\t\tWasher washer = store.addWasher(brand, model, price);\r\n\t\t\tif (washer != null) {\r\n\t\t\t\tSystem.out.println(washer);\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Washer could not be added.\");\r\n\t\t\t}\r\n\t\t} while (yesOrNo(\"Would you like to add another washer?\"));\r\n\t}", "stars.StarListDocument.StarList addNewStarList();", "@Override\r\n\tpublic void addSoftDrink() {\n\t\ttry {\r\n\t\t\toos = new ObjectOutputStream(new FileOutputStream(\"softDrink.txt\"));\r\n\t\t\r\n\t\t\tint flag = 1;\r\n\t\t\twhile (flag == 1) {\r\n\t\t\t\tSystem.out.println(\"Enter your sid\");\r\n\t\t\t\tint sId = sc.nextInt();\r\n\t\t\t\tSystem.out.println(\"Enter your sname\");\r\n\t\t\t\tString sName = sc.next();\r\n\t\t\t\tSystem.out.println(\"Enter your sprice\");\r\n\t\t\t\tdouble sPrice = sc.nextDouble();\r\n\t\t\t\tSystem.out.println(\"enter icequantity\");\r\n\t\t\t\tint sqty = sc.nextInt();\r\n\t\t\t\tSoftDrinkBean sdb = new SoftDrinkBean(sId, sName, sPrice, sqty);\r\n\t\t\t\tdrink.add(sdb);\r\n\t\t\t\tSystem.out\r\n\t\t\t\t\t\t.println(\"Do you want to add one more record press 1 otherwise any number\");\r\n\t\t\t\tflag = sc.nextInt();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\toos.writeObject(drink);\r\n\t\t\t\toos.flush();\r\n\t\t\t\toos.close();\r\n\t\t\t\tSystem.out.println(\"----SoftDrinks succesfully added\");\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}", "public Flight(String name, int number, String home, String away) \n {\n airlineName = name;\n flightNumber = number;\n origin = home;\n destination = away;\n \n }", "public boolean bookSeat(User user, FlightRoute f, int classId) throws SQLException {\n\t\tConnection conn = null;\n\t\tBooking b = new Booking(true);\n\t\tBookingPayment bp;\n\t\tBookingUser bu;\n\t\tFlightBooking fb;\n\t\tPassenger p;\n\t\tint bookingId = 0;\n\t\tswitch (classId) {\n\t\tcase 1:\n\t\t\tf.getFlight().setReservedSeats(f.getFlight().getReservedSeats() + 1);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tf.getFlight().setReservedSeats2(f.getFlight().getReservedSeats2() + 1);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tf.getFlight().setReservedSeats3(f.getFlight().getReservedSeats3() + 1);\n\t\t\tbreak;\n\t\t}\n\t\ttry {\n\t\t\tconn = util.getConnection();\n\t\t\tconn.setAutoCommit(false);\n\t\t\tBookingDAO b1 = new BookingDAO(conn);\n\t\t\tBookingPaymentDAO bp1 = new BookingPaymentDAO(conn);\n\t\t\tBookingUserDAO bu1 = new BookingUserDAO(conn);\n\t\t\tPassengerDAO p1 = new PassengerDAO(conn);\n\t\t\tFlightBookingDAO fb1 = new FlightBookingDAO(conn);\n\t\t\tFlightDAO f1 = new FlightDAO(conn);\n\t\t\t// insert and read booking\n\t\t\tbookingId = b1.create(b);\n\n\t\t\t// add passenger birthday/gender/address preset for now\n\t\t\tp = new Passenger(bookingId, user.getGivenName(), user.getFamilyName(), LocalDate.of(1996, 5, 15), \"n/a\",\n\t\t\t\t\t\"n/a\");\n\t\t\tp1.create(p);\n\n\t\t\t// not sure what stripe id is so I'll insert this\n\t\t\tbp = new BookingPayment(bookingId, \"\", false);\n\t\t\tbp1.create(bp);\n\n\t\t\t// insert booking user\n\t\t\tbu = new BookingUser(bookingId, user.getId());\n\t\t\tbu1.create(bu);\n\n\t\t\t// create flight_booking\n\t\t\tfb = new FlightBooking(f.getFlight().getId(), bookingId, classId);\n\t\t\tfb1.create(fb);\n\n\t\t\t// update flight seating\n\t\t\tf1.update(f.getFlight());\n\n\t\t\tconn.commit();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tconn.rollback();\n\t\t\treturn false;\n\t\t} finally {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean rebookSeat(User user, FlightRoute f) throws SQLException {\n\t\tConnection conn = null;\n\t\tBooking b;\n\t\tBookingPayment bp;\n\t\tFlightBooking fb;\n\t\ttry {\n\t\t\tconn = util.getConnection();\n\t\t\tconn.setAutoCommit(false);\n\t\t\tFlightBookingDAO fb1 = new FlightBookingDAO(conn);\n\t\t\tBookingDAO b1 = new BookingDAO(conn);\n\t\t\tFlightDAO f1 = new FlightDAO(conn);\n\t\t\tBookingPaymentDAO bp1 = new BookingPaymentDAO(conn);\n\n\t\t\tb = b1.read(user.getId(), f.getFlight().getId());\n\t\t\tif (b.isActive()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfb = fb1.read(user.getId(), f.getFlight().getId());\n\t\t\t// read from inner joining flight and user\n\t\t\tbp = bp1.read(user.getId(), f.getFlight().getId());\n\n\t\t\t// increments seat belonging to its class\n\t\t\tswitch (fb.getClassId()) {\n\t\t\tcase 1:\n\t\t\t\tf.getFlight().setReservedSeats(f.getFlight().getReservedSeats() + 1);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tf.getFlight().setReservedSeats2(f.getFlight().getReservedSeats2() + 1);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tf.getFlight().setReservedSeats3(f.getFlight().getReservedSeats3() + 1);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tb.setActive(true);\n\t\t\tbp.setRefunded(false);\n\t\t\tb1.update(b);\n\t\t\tf1.update(f.getFlight());\n\t\t\tbp1.update(bp);\n\n\t\t\t// delete passenger may be needed\n\t\t\tconn.commit();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tconn.rollback();\n\t\t\treturn false;\n\t\t} finally {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "Long createSteward(StewardCreateDTO steward);", "private void addFlight(Flight flight) {\n this.itinerary.add(flight);\n \n // Updates all relevant fields in this Itinerary.\n this.arrivalDateTime = flight.getArrivalDateTime();\n this.destination = flight.getDestination();\n this.travelTime = arrivalDateTime.timeDiff(departDateTime);\n this.price += flight.getCost();\n this.places.add(destination);\n }", "StewardDTO getSteward(Long id);", "public boolean addFlight(int id, int flightNum, int flightSeats, int flightPrice)\n throws RemoteException;", "Long addWayBill(WayBill wayBill);", "public void add_switch(String symbol, SLR1_automat.State state) throws Exception;", "public void startSnake()\n {\n int thisA = (150+1260)/2; //705\n int thisB = (150+630)/2 -195; //195\n \n for(int i=0 ; i<3; i++)\n {\n list.add(new Location(thisA,thisB));\n //drawSegment(g,thisA,thisB);\n thisB += 15;\n \n }\n head.setA(thisA);\n head.setB(thisB-15); //to adjust for the extra +15 at the end of the last for loop run through \n }", "public void enterShipment(){\n Shipment shipment = new Shipment();\n shipment.setShipmentID(data.numberOfShipment());\n shipment.setReceiver(new Customer(data.numberOfCustomer(), GetChoiceFromUser.getStringFromUser(\"Enter Receiver FirstName: \"),\n GetChoiceFromUser.getStringFromUser(\"Enter Receiver Last Name: \"),data.getBranchEmployee(ID).getBranchID()));\n shipment.setSender(new Customer(data.numberOfCustomer(), GetChoiceFromUser.getStringFromUser(\"Enter Sender First Name: \"),\n GetChoiceFromUser.getStringFromUser(\"Enter Sender Last Name: \"),data.getBranchEmployee(ID).getBranchID()));\n shipment.setCurrentStatus(getStatus());\n shipment.setTrackingNumber(getUniqueTrackingNumber());\n shipment.setBranchID(data.getBranchEmployee(ID).getBranchID());\n data.getBranch(shipment.getBranchID()).addShipment(shipment);\n data.addShipment(shipment,shipment.getReceiver());\n System.out.printf(\"Your Shipment has added with tracking Number %d !\\n\",shipment.getTrackingNumber());\n }", "private void scout() {\n\t\ttargetFlower = null;\n\t\t// fly to flower if nearby\n\t\tif(foundFlower()) {\n\t\t\tstate = \"TARGETING\";\n\t\t}\n\t\t// otherwise keep scouting\n\t\telse{\n\t\t\t// change angle randomly during flight\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "public boolean addFlight(Flight f) {\n assert f!=null;\n\n if (flights.size()>=3) return false;\n\n Layover l;\n try {\n l = Layover.ofFlights(flights.get(flights.size()-1), f);\n } catch (IllegalArgumentException e) {\n return false;\n }\n\n this.flights.add(f);\n this.seatClass.add(f.checkSeatClass(preferredSeatClass));\n this.layovers.add(l);\n this.numFlights = this.flights.size();\n\n return true;\n }", "public void addSegment()\n { \n Location tail = new Location();\n \n if(up)\n {\n tail.setA(list.get(0).getA());\n tail.setB(list.get(0).getB()+15);\n }\n else if(down)\n {\n tail.setA(list.get(0).getA());\n tail.setB(list.get(0).getB()-15);\n }\n else if(left)\n {\n tail.setA(list.get(0).getA()+15);\n tail.setB(list.get(0).getB());\n }\n else if(right)\n {\n tail.setA(list.get(0).getA()-15);\n tail.setB(list.get(0).getB());\n } \n \n ArrayList<Location> temp = new ArrayList<Location>();\n \n \n temp.add(tail);\n \n for(int i=0 ; i<list.size() ; i++)\n {\n temp.add(list.get(i));\n }\n list = temp; \n }", "public void processAddStation() {\n AppTextEnterDialogSingleton dialog = AppTextEnterDialogSingleton.getSingleton();\n\n // POP UP THE DIALOG\n dialog.show(\"Add Metro Station\", \"Enter Name of the Metro Station:\");\n \n // CHANGE THE CURSOR\n Scene scene = app.getGUI().getPrimaryScene();\n scene.setCursor(Cursor.CROSSHAIR);\n \n // CHANGE THE STATE\n dataManager.setState(mmmState.ADD_STATION_MODE);\n }", "FuelingStation createFuelingStation();", "private static void craftStair(ItemStack input, ItemStack output)\r\n\t{\r\n\t\tGameRegistry.addRecipe(output, new Object[] { \"# \", \"## \", \"###\", '#', input });\r\n\t}", "public void addFlights(List<Flight> newFlights) {\n\t\tSession session = connector.getSession();\n\t\tTransaction transaction = session.beginTransaction();\n\n\t\tfor (Flight flight : newFlights) {\n\t\t\tFlight targetFlight = session.get(Flight.class, flight.getFlightNum());\n\t\t\tif (targetFlight == null)\n\t\t\t\tsession.save(flight);\n\t\t}\n\t\ttransaction.commit();\n\t}", "public static void updateAFlight() {\n \n \n\n int flightOptions;\n String flightId;\n String flightDestination;\n String flightOrigin;\n String airline;\n\n Flights myFlights;\n\n myFlights = new Flights();\n\n \n flightOptions = determineNumber(\"Please enter flight option: \");\n \n myFlights = (Flights) Flights.displayFlight(flightOptions);\n\n if (myFlights == null) {\n System.out.println(\"Flight not available.\");\n updateAFlight();\n\n } else {\n flightId = enterText(\"Please enter new flightID: \");\n myFlights.setFlightId(flightId);\n\n flightDestination = enterText(\"Please enter new flight destination: \");\n myFlights.setFlightDestination(flightDestination);\n\n flightOrigin = enterText(\"Please enter new flight origin: \");\n myFlights.setFlightOrigin(flightOrigin);\n\n airline = enterText(\"Please enter new airline: \");\n myFlights.setAirline(airline);\n flightManager();\n }\n\n }", "@Override\n void setJourney(String line, TransitCard transitCard) {\n SubwayLine subwayLine = SubwaySystem.getSubwayLineByName(line);\n int startIndex = subwayLine.getStationList().indexOf(this.startLocation);\n int endIndex = subwayLine.getStationList().indexOf(this.endLocation);\n if (startIndex < endIndex) {\n while (!subwayLine\n .getStationList()\n .get(startIndex)\n .getNodeName()\n .equals(this.endLocation.getNodeName())) {\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n transitCard.increaseStationReached();\n startIndex++;\n }\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n } else {\n while (!subwayLine\n .getStationList()\n .get(startIndex)\n .getNodeName()\n .equals(this.endLocation.getNodeName())) {\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n transitCard.increaseStationReached();\n startIndex--;\n }\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n }\n double d =\n Distance.getDistance(\n startLocation.getNodeLocation().get(0),\n startLocation.getNodeLocation().get(1),\n endLocation.getNodeLocation().get(0),\n endLocation.getNodeLocation().get(1));\n Administrator.getListOfDays()\n .get(Administrator.getListOfDays().size() - 1)\n .incrementDistance(d);\n Administrator.getListOfDays()\n .get(Administrator.getListOfDays().size() - 1)\n .incrementPassengers();\n }", "public Trip(Flight flight, SeatClass preferredSeatClass) {\n assert flight!=null;\n this.numFlights = 1;\n this.preferredSeatClass = preferredSeatClass;\n this.seatClass = new ArrayList<>();\n this.seatClass.add(flight.checkSeatClass(preferredSeatClass));\n this.flights = new ArrayList<>();\n this.flights.add(flight);\n this.layovers = new ArrayList<>();\n }", "public abstract void addTurtle(Turtle turtle, boolean isActive);", "private void addAnotherElement() {\n\t\t SnakeSquare ss = sSquare.get(sSquare.size() - 1);\n\t\t double velX = ss.getDX();\n\t\t double velY = ss.getDY();\n\t\t \n\t\t double x = ss.getX();\n\t\t double y = ss.getY();\n\t\t double len = ss.getLength();\n\t\t Color c = ss.getColor();\n//\t\t double snakeSize = 10.0f;\n\t\t \n\t\t if(velX == 0 && velY == 0){sSquare.add(new SnakeSquare(x, y + snakeSize, c, len));}\n\t\t if(velX == 0 && velY == 1){sSquare.add(new SnakeSquare(x, y - snakeSize, c, len));}//move down;\n\t\t if(velX == 0 && velY == -1){sSquare.add(new SnakeSquare(x, y + snakeSize, c, len));}//move up;\n\t\t if(velX == 1 && velY == 0){sSquare.add(new SnakeSquare(x+ snakeSize, y, c, len));}//move right;\n\t\t if(velX == -1 && velY == 0){sSquare.add(new SnakeSquare(x - snakeSize, y, c, len));}// move left;\n\t\t\n\t}", "public static void addFlight(Flight flightObj) {\r\n flightMap.put(flightObj.getFlightNumber(), flightObj);\r\n }", "@Override\n\tpublic void insert(UserFlight userFlight) {\n\t\t\n\t}", "public void addOrUpdateFlight(Flight flight) {\r\n // Add all values to mapped to their associated column name\r\n ContentValues value = new ContentValues();\r\n value.put(\"flightNumber\", flight.getFlightNumber());\r\n value.put(\"airline\", flight.getAirline());\r\n value.put(\"cost\", String.valueOf(flight.getCost()));\r\n value.put(\"departureDate\",\r\n new SimpleDateFormat(\"yyyy-MM-dd kk:mm\").format(flight.getDepartureDate()));\r\n value.put(\"arrivalDate\",\r\n new SimpleDateFormat(\"yyyy-MM-dd kk:mm\").format(flight.getArrivalDate()));\r\n value.put(\"origin\", flight.getOrigin());\r\n value.put(\"destination\", flight.getDestination());\r\n value.put(\"numSeats\", flight.getNumSeats());\r\n // Add a new row to the database if not already added. Else, update that row\r\n // with given Flight\r\n // info.\r\n sqlExecutor.updateOrAddRecords(\"flights\", value);\r\n }", "public Starter(String dishName) {\n super(dishName);\n this.setDishType(Type.st);\n }", "public void addWF(int f, int d){\n\t\tf= getIndirectAdress(f);\n\t\tint w = Worker.reg.getWReg(); \n\t\tint buf = getValFromBank(f)+w;\n\t\tint dc = (w & 15) + (getValFromBank(f) & 15);\n\t\tsetCFlag(buf);\n\t\tsetDCFlag(dc);\n\t\tbuf = buf&255;\n\t\tsetZFlag(buf);\n\t\tcheckDandInsert(buf,f,d);\n\t\tWorker.reg.increasePC();\n\t\tWorker.reg.addCycle();\n\t}", "public void addFlight(String flightNumber, String terminalname, String destinationCity, String departureTime)\n\t{\t\n\t\tflightList.putIfAbsent(flightNumber, new Departures(flightNumber, terminalname, destinationCity, departureTime));\n\t}", "org.landxml.schema.landXML11.RoadsideDocument.Roadside addNewRoadside();", "void addRide(String name, String park, Date ridden);", "public void takeACard(Card card){\n hand.add(card);\n }", "public void addAircrafts(Aircraft A) {\n\t\t\r\n\t\tfor (int y = 0; y < getServiceLineSize(); y++) {\r\n\t\t\tfor (int x = 0; x < getServiceStations(); x++) {\r\n\t\t\t\tif (!(SD[y][x].flag)) {\r\n\t\t\t\t\tSD[y][x] = A;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t}", "public Flight(String flightNumber, String airline, int passengerCapacity, String destination){\n this.flightNumber = flightNumber;\n this.airline = airline;\n this.passengerCapacity = passengerCapacity;\n this.destination = destination;\n passengerManifest = new ArrayList<Passenger>();\n\n }", "public StoneSword() {\n\t\tthis.ID = ItemReference.STONESWORD;\n\t\tthis.name = \"Stone Sword\";\n\t\tthis.attack = 50;\n\t\tthis.cost = Prices.STONE_SWORD;\n\t}", "public void holdSeat() {\n String seatNo = this.getSeatNo();\n this.setStatus(Status.HOLD);\n this.setHold(true);\n //call the db or service to hold the seat\n }", "public void buildStation(Station station) {\n stations.add(station);\n }", "public void addStar(Star s) {\n star.add(s);\n }", "public Builder addTransitFlights(\n int index, com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight value) {\n if (transitFlightsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureTransitFlightsIsMutable();\n transitFlights_.add(index, value);\n onChanged();\n } else {\n transitFlightsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public void addPartnerCard(Card card);", "public boolean bookSeat() {\n // check if the flight is full\n if (isfull()) {\n return false;\n } else {\n // otherwise increase the number of booked seats\n this.bookedSeats += 1;\n return true;\n }\n }", "private void hatch(Location currentLocation) {\n GameWorld.getPlayer().earnEcoPoints(hatchEarnings);\n currentLocation.addActor(babyDinosaur);\n currentLocation.removeItem(this);\n }", "stars.StarType addNewStar();", "public void addResourceSpace(Resource r,int srt){\n t.put(r.getName(),new SupplyNode(r,srt));\n t.get(r.getName()).setCurrent(srt);\n }", "public void addWinning1(Card card)\n {\n player1Hand.enqueue(card);\n }", "public void addSmartDevice() {\n getNavigator().addSmartDevice();\n }", "public void addShield(Shield sh) {\n setShield(getShield() + sh.getStrength());\n setShieldSlots(getShieldSlots() - 1);\n }", "void addHasSCF(SCF newHasSCF);", "public void addNewPassenger() throws SQLException {\n\t\tScanner input = new Scanner(System.in);\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = connUtil.getConnection();\n\t\t\t// call needed DAOs here\n\t\t\tPassengerDAO pdao = new PassengerDAO(conn);\n\t\t\tFlightDAO fdao = new FlightDAO(conn);\n\t\t\tRouteDAO rdao = new RouteDAO(conn);\n\t\t\tAirportDAO apodao = new AirportDAO(conn);\n\t\t\tAirplaneDAO apldao = new AirplaneDAO(conn);\n\n\t\t\tPassenger passenger = new Passenger();\n\t\t\tpassenger.setId(pdao.nextAvailableId());\n\t\t\tpassenger.setBookingId(1);\n\n\t\t\t// Sets passenger name\n\t\t\tSystem.out.println(\"Enter the passenger given name\");\n\t\t\tpassenger.setGivenName(input.nextLine());\n\t\t\tSystem.out.println(\"Enter the passenger family name\");\n\t\t\tpassenger.setFamilyName(input.nextLine());\n\n\t\t\t// Sets birthday\n\t\t\tSystem.out.println(\"Enter DOB (yyyy-mm-dd)\");\n\t\t\tDate date = Date.valueOf(input.nextLine());\n\t\t\tpassenger.setDob(date);\n\n\t\t\t// Sets gender\n\t\t\tSystem.out.println(\"Enter gender (male/female/other)\");\n\t\t\tpassenger.setGender(input.nextLine());\n\n\t\t\t// Sets address\n\t\t\tSystem.out.println(\"Enter the address of the passenger\");\n\t\t\tpassenger.setAddress(input.nextLine());\n\n\t\t\t// Adds passenger to passenger table\n\t\t\tpdao.addPassenger(passenger);\n\n\t\t\tconn.commit();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tconn.rollback();\n\t\t} finally {\n\t\t\tconn.close();\n\t\t}\n\t}", "public void addPassengerShip(Scanner sc){\n PassengerShip pShip = new PassengerShip(sc, portMap, shipMap, dockMap);\n if(hashMap.containsKey(pShip.getParent())){\n if(hashMap.get(pShip.getParent()).getIndex()>=10000 && hashMap.get(pShip.getParent()).getIndex() < 20000){\n currentPort = (SeaPort) hashMap.get(pShip.getParent());\n currentPort.setShips(pShip);\n currentPort.setAllShips(pShip);\n \n }\n else{\n currentDock = (Dock) hashMap.get(pShip.getParent());\n currentDock.addShip(pShip);\n currentPort = (SeaPort) hashMap.get(currentDock.getParent());\n currentPort.setAllShips(pShip);\n }\n \n \n }\n hashMap.put(pShip.getIndex(), pShip);\n shipMap.put(pShip.getIndex(), pShip);\n everything.add(pShip);\n }", "public boolean addFlight(int id, int flightNum, int flightSeats, int flightPrice)\n throws RemoteException, DeadlockException;", "public void move()\n\t{\n\t\tVector v = ship.v;\n\t\tb = b.getLocation().add(v).getBlock();\n\t\tif(triangle != null) triangle.move();\n\t\tif(rear != null) rear.move();\n\t\tif(foreAndAft != null) foreAndAft.move();\n\t\tif(sails != null) for(int i = 0; i < sails.size(); i++)\n\t\t{\n\t\t\tSail sail = sails.get(i);\n\t\t\tsail.move();\n\t\t}\n\t}", "public void addSpaceStation()\n\t{\n\t\t//if a space station is already spawned, one will not be added\n\n\t\tgameObj.add(new SpaceStation(getHeight(), getWidth()));\n\t\tSystem.out.println(\"Space station added\");\n\t\tnotifyObservers();\n\t}", "public Flight() {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.id = \"1520\";\n\t\tthis.departureDate = \"test-departure\";\n\t\tthis.departureTime = \"test-time\";\n\t\tthis.plane = new Airplane();\n\t\tthis.departureAirport = new Airport();\n\t\tthis.arrivalAirport=new Airport();\n\t\tthis.pilot = new Pilot();\n\t\tthis.passengers = new ArrayList<Passenger>();\n\t\tthis.availableSeat = 10;\n\t\tthis.price = 10;\n\t\tthis.duree = \"duration\";\n\t\t\n\t}", "private static void addNewScheduledTour()\r\n {\r\n\t String tourID;\r\n\t String description;\r\n\t double admissionFee;\r\n\t String tourDate;\r\n\t int maxGroupSize;\r\n\t String tourLeader;\r\n\t boolean duplicateID = false;\r\n\t \r\n System.out.println(\"Add New Scheduled Tour Feature Selected!\");\r\n System.out.println(\"--------------------------------------\");\r\n \r\n System.out.print(\"Enter Tour ID: \");\r\n tourID = sc.nextLine();\r\n \r\n System.out.print(\"Enter Tour Description: \");\r\n description = sc.nextLine();\r\n \r\n System.out.print(\"Enter Admission Fee: \");\r\n admissionFee = sc.nextDouble();\r\n sc.nextLine();\r\n \r\n System.out.print(\"Enter Tour Date: \");\r\n tourDate = sc.nextLine();\r\n \r\n System.out.print(\"Enter Maximum Group Size: \");\r\n maxGroupSize = sc.nextInt();\r\n sc.nextLine();\r\n \r\n System.out.print(\"Enter Tour Leader: \");\r\n tourLeader = sc.nextLine();\r\n System.out.println();\r\n \r\n // check if tourID is already in use in the booking system\r\n for(int i = 0; i < attractionCount; i++)\r\n {\r\n \t if(attractionList[i].getAttractionID().equalsIgnoreCase(tourID))\r\n \t {\r\n \t\t duplicateID = true;\r\n \t\t System.out.print(\"Error! Attraction / Tour with this ID already exists!\");\r\n \t\t System.out.println();\r\n \t }\r\n }\r\n \r\n if(duplicateID == false)\r\n {\r\n \t attractionList[attractionCount] = new ScheduledTour(tourID, description,\r\n \t\t\t admissionFee, tourDate, maxGroupSize, tourLeader);\r\n \t attractionCount++;\r\n }\r\n }", "private void addNewHead() {\t\t\n\t\tif(currentDirection == Direction.RIGHT) {\n\t\t\tsnake.addLast(new HeadComponent(\n\t\t\t\t\tsnake.getLast().getX() + SnakeComponent.imageSize, \n\t\t\t\t\tsnake.getLast().getY(),\n\t\t\t\t\tcurrentDirection\n\t\t\t));\n\t\t\tsnakeDirection = Direction.RIGHT;\n\t\t\t\n\t\t} else if(currentDirection == Direction.LEFT) {\n\t\t\tsnake.addLast(new HeadComponent(\n\t\t\t\t\tsnake.getLast().getX() - SnakeComponent.imageSize, \n\t\t\t\t\tsnake.getLast().getY(), \n\t\t\t\t\tcurrentDirection\n\t\t\t));\n\t\t\tsnakeDirection = Direction.LEFT;\n\t\t\t\n\t\t} else if(currentDirection == Direction.DOWN) {\n\t\t\tsnake.addLast(new HeadComponent(\n\t\t\t\t\tsnake.getLast().getX(), \n\t\t\t\t\tsnake.getLast().getY()+SnakeComponent.imageSize, \n\t\t\t\t\tcurrentDirection\n\t\t\t));\n\t\t\tsnakeDirection = Direction.DOWN;\n\t\t\t\n\t\t} else if(currentDirection == Direction.UP) {\n\t\t\tsnake.addLast(new HeadComponent(\n\t\t\t\t\tsnake.getLast().getX(), \n\t\t\t\t\tsnake.getLast().getY()-SnakeComponent.imageSize,\n\t\t\t\t\tcurrentDirection\n\t\t\t));\n\t\t\tsnakeDirection = Direction.UP;\n\t\t}\n\t}", "public void addWinning2(Card card)\n {\n player2Hand.enqueue(card);\n }", "public void moveToShelf(Long movie) throws IllegalOperationException;", "private void saveStation() {\n MainActivity.new_station = true;\n stationname = user_stationname_input.getText().toString();\n stationurl = user_station_input.getText().toString();\n Intent passStation = new Intent(addStationActivity.this, MainActivity.class);\n passStation.putExtra(\"stationurl\", stationurl);\n passStation.putExtra(\"stationname\", stationname);\n startActivity(passStation);\n }", "public AdminModel[] addNewFlight(int flightnumber, String departure, String arrival,\n\t\t\tString departDate, String departTime, String arrivalDate, String arrivalTime,\n\t\t\tint seats, int price) {\n\t\t\n\t\tadminManager.addNewFlight(flightnumber, departure, arrival, departDate, departTime, arrivalDate, arrivalTime, seats, price);\n\t\t\n\t\treturn null;\n\t}", "void addWay(Way w) {\n ways.put(w.id, w);\n }", "public void addKnight(Knight knight) {\n currentKnight = knight;\n }", "public void onboard(String passenger) {\n \t\r\n \tthis.passengers.add(passenger);\r\n }", "public Builder addTransitFlights(com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight value) {\n if (transitFlightsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureTransitFlightsIsMutable();\n transitFlights_.add(value);\n onChanged();\n } else {\n transitFlightsBuilder_.addMessage(value);\n }\n return this;\n }", "public void placePowerStation() {\n this.powerStation = true;\n\n }", "public org.landxml.schema.landXML11.WatershedsDocument.Watersheds addNewWatersheds()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.WatershedsDocument.Watersheds target = null;\r\n target = (org.landxml.schema.landXML11.WatershedsDocument.Watersheds)get_store().add_element_user(WATERSHEDS$4);\r\n return target;\r\n }\r\n }", "private void addRoute(Route rte) {\n\t\trteTbl.add(rte);\n\t}", "public org.apache.xmlbeans.XmlAnySimpleType addNewStationName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlAnySimpleType target = null;\r\n target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_attribute_user(STATIONNAME$12);\r\n return target;\r\n }\r\n }", "public void addCardToDeck(int index, SpoonsCard card){\r\n\t deck.add(index, card);\r\n }", "@Override\n\tpublic void goToStings() {\n\t\t\n\t}", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints addNewScans();", "private void addshangping(int shangping_id, String shangping_name, float price, int loadnumber) {\n\t\t\r\n\t}", "@Test(groups = \"his.wardadmission.test\")\n\tpublic void addWardTestCase() throws IOException, JSONException {\n\n\t\tJSONObject jsonRequestObject = new JSONObject(RequestUtil\n\t\t\t\t.requestByID(TestCaseConstants.ADD_WARD_ADMISSION));\n\t\t\n\t\tArrayList<String> resArrayList = getHTTPResponse(\n\t\t\t\tproperties\n\t\t\t\t\t\t.getProperty(TestCaseConstants.URL_APPEND_ADD_WARD_ADMISSION),\n\t\t\t\tTestCaseConstants.HTTP_POST, jsonRequestObject.toString());\n\n\t\tSystem.out.println(\"message :\"+resArrayList.get(0));\n\t\t\n\t\tJSONObject jsonObject = new JSONObject(resArrayList.get(0));\n\t\t\n\t\tBHT_No= jsonObject.getString(\"bhtNo\");\n\t\tPatient_ID = jsonObject.getJSONObject(\"patientID\").getString(\"patientID\");\n\t\tWard_No= jsonObject.getString(\"wardNo\");\n\n\t\tAssert.assertEquals(Integer.parseInt(resArrayList.get(1)),\n\t\t\t\tSUCCESS_STATUS_CODE);\n\t\tAssert.assertEquals(BHT_No,jsonRequestObject.getString(\"bhtNo\"));\n\t}", "@Override\n\tpublic int addStation(Station stationDTO) {\n\t\tcom.svecw.obtr.domain.Station stationDomain = new com.svecw.obtr.domain.Station();\n\t\tstationDomain.setStationName(stationDTO.getStationName());\n\t\tstationDomain.setCityId(stationDTO.getCityId());\n\t\treturn iStationDAO.addStation(stationDomain);\n\t}", "org.landxml.schema.landXML11.SpeedsDocument.Speeds addNewSpeeds();", "public boolean isStair() {\n return this.type == Type.STAIR;\n }", "public void addToStations(String lineName, ArrayList<String> s) \n\t{\n\t\t//put line name as key and arraylist as value to stations hashMap \n\t\tstations.put(lineName, new ArrayList<String>(s));\n\t}" ]
[ "0.60065764", "0.57747436", "0.5735861", "0.55893445", "0.5562254", "0.55509526", "0.5545575", "0.5520484", "0.5513133", "0.5509838", "0.548876", "0.5479571", "0.5445324", "0.5428199", "0.5397296", "0.53663546", "0.5345749", "0.53438556", "0.53407013", "0.5336883", "0.53075254", "0.5270432", "0.5227236", "0.5208384", "0.51904607", "0.5189675", "0.5189151", "0.51883227", "0.5177985", "0.5175535", "0.51742464", "0.5168574", "0.51659507", "0.5159564", "0.51552963", "0.5148542", "0.5148422", "0.51385856", "0.5124383", "0.5124012", "0.512322", "0.5101526", "0.5087972", "0.5080924", "0.5079152", "0.5071031", "0.5065803", "0.5053791", "0.505377", "0.5052984", "0.50520664", "0.50512093", "0.5046331", "0.50437135", "0.50340885", "0.5028325", "0.50233173", "0.5017825", "0.50154185", "0.49922755", "0.4983899", "0.49492115", "0.49473804", "0.49405405", "0.49330407", "0.4932131", "0.4925353", "0.49225926", "0.49203253", "0.4912406", "0.49075803", "0.49025255", "0.49024886", "0.48988694", "0.4895043", "0.48894113", "0.48822424", "0.48766923", "0.48731947", "0.48570788", "0.4852865", "0.4850737", "0.48480576", "0.48469839", "0.4844422", "0.48369986", "0.48366457", "0.48357606", "0.48355433", "0.48182988", "0.48175296", "0.480942", "0.48074704", "0.48063532", "0.4800002", "0.47887197", "0.47813687", "0.47788146", "0.47779065", "0.47767222" ]
0.8872268
0
Validate Flight parameters steward availibility, airplane availibility and time
boolean validateFlight(Flight flight);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validate() throws FlightCreationException {\n validateNotNull(\"number\", number);\n validateNotNull(\"company name\", companyName);\n validateNotNull(\"aircraft\", aircraft);\n validateNotNull(\"pilot\", pilot);\n validateNotNull(\"origin\", origin);\n validateNotNull(\"destination\", destination);\n validateNotNull(\"departure time\", scheduledDepartureTime);\n\n if (scheduledDepartureTime.isPast()) {\n throw new FlightCreationException(\"The departure time cannot be in the past\");\n }\n\n if (origin.equals(destination)) {\n throw new FlightCreationException(\"The origin and destination cannot be the same\");\n }\n }", "private boolean validParams(double dt, double runTime, int startDay, double initPop, String stage, \r\n\t\t\t\t\t\t\t\tdouble gtMultiplier, double harvestLag, double critcalT, double daylightHours) {\r\n\t\tif (dt <= 0 || runTime < 0 || initPop < 0) // positive values (dt > 0)\r\n\t\t\treturn false;\r\n\t\tif (gtMultiplier <= 0 || harvestLag < 0 || harvestLag > 365 || daylightHours < 0 || daylightHours > 24)\r\n\t\t\treturn false;\r\n\t\tfor (int j = 0; j < names.length; j ++) { // stage must be a valid swd lifestage\r\n\t\t\tif (stage.equals(names[j]))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "private void validateInputParameters(){\n\n }", "@Value.Check\n default void checkPreconditions()\n {\n RangeCheck.checkIncludedInInteger(\n this.feedback(),\n \"Feedback\",\n RangeInclusiveI.of(0, 7),\n \"Valid feedback values\");\n\n RangeCheck.checkIncludedInInteger(\n this.transpose(),\n \"Transpose\",\n RangeInclusiveI.of(-24, 24),\n \"Valid transpose values\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Level(),\n \"Pitch R1 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Rate(),\n \"Pitch R1 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Level(),\n \"Pitch R2 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Rate(),\n \"Pitch R2 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Level(),\n \"Pitch R3 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Rate(),\n \"Pitch R3 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Level(),\n \"Pitch R4 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Rate(),\n \"Pitch R4 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationDepth(),\n \"LFO Pitch Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid pitch modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationSensitivity(),\n \"LFO Pitch Modulation Sensitivity\",\n RangeInclusiveI.of(0, 7),\n \"Valid pitch modulation sensitivity values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoAmplitudeModulationDepth(),\n \"LFO Amplitude Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid amplitude modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoSpeed(),\n \"LFO Speed\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO speed values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoDelay(),\n \"LFO Delay\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO delay values\");\n }", "private boolean validateFields() {\n\t\tList<String> errorMsg = new ArrayList<>();\n\n\t\tif (aliasField.getText().equals(\"\"))\n\t\t\terrorMsg.add(\"Alias cannot be left empty.\\n\");\n\n\t\tif (carComboBox.getValue() == null)\n\t\t\terrorMsg.add(\"A car should be assigned to the trip.\\n\");\n\n\t\tif (routeComboBox.getValue() == null)\n\t\t\terrorMsg.add(\"A route should be assigned to the trip.\\n\");\n\n\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\tif (stopPoint.getTime() == null || stopPoint.getTime().equals(\"\"))\n\t\t\t\terrorMsg.add(\"You need to set an arriving time for '\" + stopPoint.toString() + \"'.\\n\");\n\t\t}\n\n\t\tif (endDatePicker.getValue() != null && startDatePicker.getValue() != null)\n\t\t{\n\t\t\tif (startDatePicker.getValue().isBefore(LocalDate.now())) {\n\t\t\t\terrorMsg.add(\"Trip start date should be after current date.\\n\");\n\t\t\t} else if (endDatePicker.getValue().isBefore(startDatePicker.getValue())) {\n\t\t\t\terrorMsg.add(\"Trip end date should be after start date.\\n\");\n\t\t\t} else {\n\t\t\t\tSet<DayOfWeek> recurrence = RecurrenceUtility.parseBitmaskToSet(getRecurrence());\n\t\t\t\tboolean isValidRecurrence = false;\n\t\t\t\tfor (LocalDate now = startDatePicker.getValue(); !now.isAfter(endDatePicker.getValue()); now = now.plusDays(1)) {\n\t\t\t\t\tif (recurrence.contains(now.getDayOfWeek()))\n\t\t\t\t\t\tisValidRecurrence = true;\n\t\t\t\t}\n\t\t\t\tif (!isValidRecurrence) {\n\t\t\t\t\terrorMsg.add(\"No recurrent day exists between trip start date and end date.\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg.add(\"Trip starts date or/and end date is invalid.\\n\");\n\t\t}\n\n\t\t// consistency check\n\t\t// WOF & registration cannot be expired before the end date of recurring trip\n\t\tCar car = carComboBox.getValue();\n\t\tif (endDatePicker.getValue() != null && startDatePicker.getValue() != null && car != null) {\n\t\t\tif (LocalDate.parse(car.getWof()).isBefore(endDatePicker.getValue()) ||\n\t\t\tLocalDate.parse(car.getRegistration()).isBefore(endDatePicker.getValue())) {\n\t\t\t\terrorMsg.add(String.format(\"The expiration date of a recurring trip cannot occur after the expiry date of car's WOF and registration.\\n\" +\n\t\t\t\t\t\t\t\t\"------------------------------------------------\\n\" +\n\t\t\t\t\t\t\t\t\"Details for car [%s]:\\n\" +\n\t\t\t\t\t\t\t\t\" a. WOF expire date is %s.\\n\" +\n\t\t\t\t\t\t\t\t\" b. Registration expire date is %s.\\n\" +\n\t\t\t\t\t\t\t\t\"------------------------------------------------\\n\",\n\t\t\t\t\t\tcar.getPlate(), car.getWof(), car.getRegistration()));\n\t\t\t}\n\t\t}\n\n\t\t// handle and show error message in dialog\n\t\tif (errorMsg.size() != 0) {\n\t\t\tStringBuilder errorString = new StringBuilder(\"Operation failed is caused by: \\n\");\n\t\t\tfor (Integer i = 1; i <= errorMsg.size(); i++) {\n\t\t\t\terrorString.append(i.toString());\n\t\t\t\terrorString.append(\". \");\n\t\t\t\terrorString.append(errorMsg.get(i - 1));\n\t\t\t}\n\t\t\tString headMsg = mode == Mode.ADD_MODE ? \"Failed to add the trip.\" : \"Failed to update the trip.\";\n\t\t\trss.showErrorDialog(headMsg, errorString.toString());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@DisplayName(\"Check get filtered Flights \")\n @Test\n public void validateGetFilteredFlights_shouldReturnOK() throws ApiException {\n Date dateFrom = new Date(121, 1,13);\n Date dateTo = new Date(121,1,28);\n FilterDTO filterDTO = new FilterDTO(\"Buenos Aires\",dateFrom,dateTo);\n //validate get some Flights\n assertDoesNotThrow(() -> flightService.getFlights(filterDTO));\n }", "private static boolean isValidateRecord(Map<String, Object> m)\n throws Exception{\n float crsArrTime = (float) m.get(\"CRS_ARR_TIME\");\n float crsDeptTime = (float) m.get(\"CRS_DEP_TIME\");\n float crsElapsedTime = (float) m.get(\"CRS_ELAPSED_TIME\");\n float actElapsedTime = (float) m.get(\"ACTUAL_ELAPSED_TIME\");\n float arrDelay = (float) m.get(\"ARR_DELAY\");\n float arrDelayMin = (float) m.get(\"ARR_DELAY_NEW\");\n float timeZone = crsArrTime - crsDeptTime - crsElapsedTime;\n float cancelledCheck = timeZone - actElapsedTime;\n float timeModulo = timeZone % 60;\n\n // CRSArrTime and CRSDepTime should not be zero\n // timeZone = CRSArrTime - CRSDepTime - CRSElapsedTime and timeZone % 60 should be 0\n if (crsArrTime == 0 || crsDeptTime == 0 || timeModulo != 0) return false;\n\n // AirportID, AirportSeqID, CityMarketID, StateFips, Wac should be larger than 0\n if ((float) m.get(\"ORIGIN_AIRPORT_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_AIRPORT_SEQ_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_CITY_MARKET_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_STATE_FIPS\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_WAC\") <= 0) return false;\n\n if ((float) m.get(\"DEST_AIRPORT_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_AIRPORT_SEQ_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_CITY_MARKET_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_STATE_FIPS\") <= 0) return false;\n if ((float) m.get(\"DEST_WAC\") <= 0) return false;\n\n // Origin, Destination, CityName, State, StateName should not be empty\n if (m.get(\"ORIGIN\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_CITY_NAME\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_STATE_ABR\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_STATE_NM\").toString().equals(\"\")) return false;\n if (m.get(\"DEST\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_CITY_NAME\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_STATE_ABR\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_STATE_NM\").toString().equals(\"\")) return false;\n\n // For flights that are not Cancelled: ArrTime - DepTime - ActualElapsedTime - timeZone should be zero\n if ((boolean)m.get(\"CANCELLED\") && cancelledCheck != 0) return false;\n\n // if ArrDelay > 0 then ArrDelay should equal to ArrDelayMinutes if ArrDelay < 0 then ArrDelayMinutes should be zero\n // if ArrDelayMinutes >= 15 then ArrDel15 should be true\n if (arrDelay > 0 && arrDelay != arrDelayMin) return false;\n if (arrDelay < 0 && arrDelayMin != 0) return false;\n if (arrDelayMin >= 15 && !(boolean)m.get(\"ARR_DEL15\")) return false;\n\n return true;\n }", "private void validation(Solution sol) {\n List<Route> routes = sol.getRoutes();\n double totalDist = 0;\n double totalPenalty = 0;\n for (Route route : routes) {\n double dist = 0;\n double penalty = 0;\n double time = 0;\n double load = 0;\n List<Node> routeNodes = route.getNodes();\n for (int i = 1; i < routeNodes.size(); i++) {\n Node prevNode = routeNodes.get(i - 1);\n Node node = routeNodes.get(i);\n load += node.getq();\n if (!Utils.doubleEqual(node.getQ(), load)) throw new IllegalArgumentException(\"Wrong with load.\");\n if (load < 0 || load > route.getVehicle().getCapacity()) throw new IllegalArgumentException(\"Load Violation.\");\n time = Math.max(node.getTw1(), prevNode.gets() + time + Utils.calculateDistance(prevNode, node));\n if (node.getMembership() == 1 && time > node.getTw2()) throw new IllegalArgumentException(\"Time window violation.\");\n if (!Utils.doubleEqual(time, node.getT())) throw new IllegalArgumentException(\"Wrong with time.\");\n double tempPenalty = Math.max(0, time - node.getTw2());\n if (!Utils.doubleEqual(tempPenalty, node.getDL())) throw new IllegalArgumentException(\"Wrong penalty\");\n penalty += tempPenalty;\n dist += Utils.calculateDistance(prevNode, node);\n }\n if (!Utils.doubleEqual(dist, route.getDist())) throw new IllegalArgumentException(\"Wrong route distance\");\n// System.out.println(penalty + \" \" + route.getPenalty());\n if (!Utils.doubleEqual(penalty, route.getPenalty())) throw new IllegalArgumentException(\"Wrong route penalty\");\n totalDist += dist;\n totalPenalty += penalty;\n }\n if (!Utils.doubleEqual(totalDist, sol.getTotalDist())) throw new IllegalArgumentException(\"Wrong solution distance\");\n if (!Utils.doubleEqual(totalPenalty, sol.getTotalPenalty())) throw new IllegalArgumentException(\"Wrong solution penalty\");\n }", "private void validateParameter(){\n\t\tif(hrNum > upperBound){\n\t\t\thrNum = upperBound;\n\t\t}\n\t\telse if(hrNum < lowerBound){\n\t\t\thrNum = lowerBound;\n\t\t}\n\t}", "private boolean checkInputFields(){\r\n\t\tString allertMsg = \"Invalid input: \" + System.getProperty(\"line.separator\");\r\n\t\t\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MCSTf.getText());\r\n\t\t\tif(testValue < 0 || testValue > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a MCS score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for relevance score weight and coherence score weight text fields\r\n\t\ttry{\r\n\t\t\tFloat relScoreW = Float.parseFloat(m_RelScoreTf.getText());\r\n\t\t\tFloat cohScoreW = Float.parseFloat(m_CohScoreTf.getText());\r\n\t\t\tif(relScoreW < 0 || relScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif(cohScoreW < 0 || cohScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif((relScoreW + cohScoreW) != 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a weight for relevance and coherence score.\" + System.getProperty(\"line.separator\");\r\n\t\t\tallertMsg += \"Sum of the weights for relevance and coherence score must be 1.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_KeyTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as multiplier for keyword concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for category confidence weight\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_CatConfTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for the weight of the category confidence of concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for weight of repeated concepts\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_RepeatTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for repeated concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for number of output categories\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MaxCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the maximum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MinCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the minimum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MinCatScoreTf.getText());\r\n\t\t\tif(testValue < 0.0f || testValue > 1.0f)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number between 0 and 1 as minimum category score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\tif(allertMsg.length() > 18){\r\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\talert.setContentText(allertMsg);\r\n\t\t\talert.showAndWait();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void checkValid() {\n getSimType();\n getInitialConfig();\n getIsOutlined();\n getEdgePolicy();\n getNeighborPolicy();\n getCellShape();\n }", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "Flight(String airline, String flightNumber, String src, String departDate, String departTime, String dest, String arriveDate, String arriveTime) {\n this.airline = airline;\n this.flightNumber = flightNumber;\n\n // src should be 3 characters! (no numbers or special characters)\n if(src.length() != 3 || Pattern.compile(\"[^a-zA-Z]\").matcher(src).find()) {\n throw new IllegalArgumentException(\"Airport code is not a 3 character letter-only code.\");\n }\n this.src = src;\n\n // Date should be in ##/##/#### format\n if(!departDate.matches(\"([0-9]{2})/([0-9]{2})/([0-9]{4})\")) {\n throw new IllegalArgumentException(\"Depart date is not in correct format. (##/##/####)\");\n }\n this.departDate = departDate;\n\n // Time should be in ##:## format\n if(!departTime.matches(\"([0-9]{2}):([0-9]{2})\")) {\n throw new IllegalArgumentException(\"Depart time is not in correct format. (##:##)\");\n }\n this.departTime = departTime;\n\n // src should be 3 characters! (no numbers or special characters)\n if(dest.length() != 3 || Pattern.compile(\"[^a-zA-Z]\").matcher(dest).find()) {\n throw new IllegalArgumentException(\"Airport code is not a 3 character letter-only code.\");\n }\n this.dest = dest;\n\n // Date should be in ##/##/#### format\n if(!arriveDate.matches(\"([0-9]{2})/([0-9]{2})/([0-9]{4})\")) {\n throw new IllegalArgumentException(\"Arrive date is not in correct format. (##/##/####)\");\n }\n this.arriveDate = arriveDate;\n\n // Time should be in ##:## format\n if(!arriveTime.matches(\"([0-9]{2}):([0-9]{2})\")) {\n throw new IllegalArgumentException(\"Arrive time is not in correct format. (##:##)\");\n }\n this.arriveTime = arriveTime;\n }", "@Test(groups = {\"SMOKE\"})\r\n public void airlinesTest() {\r\n new ChooseFlightPage(driver, url)\r\n .run(new PickFlightScenario(\"Paris\", \"Bunos Aires\"))\r\n .check(new FlightOptionsAssertion())\r\n .verifyFlightNumberOrder(flightNumbersOrderVA)\r\n .verifyFlightNumbersUnordered(flightNumbersUnordered);\r\n }", "private boolean validateFields(String pickupLocation, String destination, Date time, int noPassengers, ArrayList<String> notes){\n int errors = 0;\n\n if(!Validation.isValidNoPassengers(noPassengers)){\n errors++;\n noPassengersInputContainer.setError(getString(R.string.no_passengers_error));\n }\n\n if(pickupLocation.length() < 3 || pickupLocation.trim().length() == 0){\n errors++;\n pickupLocationInputContainer.setError(getString(R.string.pickup_location_error));\n }\n\n if(destination.length() < 3 || pickupLocation.trim().length() == 0){\n errors++;\n destinationInputContainer.setError(getString(R.string.destination_error));\n }\n\n if(!Validation.isValidBookingTime(time)){\n errors++;\n timeInputContainer.setError(getString(R.string.booking_time_error));\n }\n\n\n return errors == 0;\n }", "void validate() {\n int quality = mQuality;\n int matchType = mMatchType;\n if (mZoneId == null) {\n if (quality != QUALITY_NA || matchType != MATCH_TYPE_NA) {\n throw new RuntimeException(\"Invalid quality or match type for null zone ID.\"\n + \" quality=\" + quality + \", matchType=\" + matchType);\n }\n } else {\n boolean qualityValid = (quality == QUALITY_SINGLE_ZONE\n || quality == QUALITY_MULTIPLE_ZONES_WITH_SAME_OFFSET\n || quality == QUALITY_MULTIPLE_ZONES_WITH_DIFFERENT_OFFSETS);\n boolean matchTypeValid = (matchType == MATCH_TYPE_NETWORK_COUNTRY_ONLY\n || matchType == MATCH_TYPE_NETWORK_COUNTRY_AND_OFFSET\n || matchType == MATCH_TYPE_EMULATOR_ZONE_ID\n || matchType == MATCH_TYPE_TEST_NETWORK_OFFSET_ONLY);\n if (!qualityValid || !matchTypeValid) {\n throw new RuntimeException(\"Invalid quality or match type with zone ID.\"\n + \" quality=\" + quality + \", matchType=\" + matchType);\n }\n }\n }", "private void checkParams() throws InvalidParamException{\r\n String error = svm.svm_check_parameter(this.problem, this.param);\r\n if(error != null){\r\n throw new InvalidParamException(\"Invalid parameter setting!\" + error);\r\n }\r\n }", "protected void validateTuningSteps(cwterm.service.rigctl.xsd.TuningStep[] param) {\n }", "public boolean validFlight(LocalDateTime startDateTime, LocalDateTime endDateTime, LocalDateTime departureDateTime,\n\t\t\tLocalDateTime arrivalDateTime) {\n\t\tif (departureDateTime.isBefore(startDateTime)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (arrivalDateTime.isAfter(endDateTime)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void validateSchedular() {\n boolean startDateCheck = false, cronTimeCheck = false, dateFormatCheck = false;\n /*\n Schedular Properties\n */\n\n System.out.println(\"Date: \" + startDate.getValue());\n if (startDate.getValue() != null) {\n System.out.println(\"Date: \" + startDate.getValue());\n startDateCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Start Date should not be empty.\\n\");\n }\n\n if (!cronTime.getText().isEmpty()) {\n cronTimeCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Cron Time should not be empty.\\n\");\n }\n// if (!dateFormat.getText().isEmpty()) {\n// dateFormatCheck = true;\n// } else {\n// execptionData.append((++exceptionCount) + \". Date Format should not be empty.\\n\");\n// }\n\n if (startDateCheck == true && cronTimeCheck == true) {\n schedularCheck = true;\n } else {\n schedularCheck = false;\n startDateCheck = false;\n cronTimeCheck = false;\n dateFormatCheck = false;\n }\n\n }", "public \nMetroParams(AnnealForm annealForm, SystemDesign sdf, int annealTime) {\n\t\n annealForm_ = annealForm;\n systemDesign_ = sdf;\n annealTime_ = annealTime;\n \n // 1.1 this is a funky spaghetti interaction... fix???\n if (sdf.solveWithSurvivability_)\n\t\tpfailuresurviveCheck = true;\n\telse \n\tif (sdf.solveWithTraffic_)\n\t\tremotetrafficCheck = true;\n\telse\n\t\tpfailureCheck = true;\n\n // Do VB init stuff.\n //\n this.formLoad();\n\t}", "private ErrorCode checkParameters() {\n\t\t\n\t\t// Check Batch Size\n\t\ttry {\n\t\t\tInteger.parseInt(batchSizeField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.BatchSize;\n\t\t}\n\t\t\n\t\t// Check confidenceFactor\n\t\ttry {\n\t\t\tDouble.parseDouble(confidenceFactorField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.ConfidenceFactor;\n\t\t}\n\t\t\n\t\t// Check minNumObj\n\t\ttry {\n\t\t\tInteger.parseInt(minNumObjField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.MinNumObj;\n\t\t}\n\t\t\n\t\t// Check numDecimalPlaces\n\t\ttry {\n\t\t\tInteger.parseInt(numDecimalPlacesField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.NumDecimalPlaces;\n\t\t}\n\t\t\n\t\t// Check numFolds\n\t\ttry {\n\t\t\tInteger.parseInt(numFoldsField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.NumFolds;\n\t\t}\n\t\t\n\t\t// Check seed\n\t\ttry {\n\t\t\tInteger.parseInt(seedField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.Seed;\n\t\t}\n\t\t\n\t\treturn ErrorCode.Fine;\n\t\t\n\t}", "public boolean validateForm() {\r\n\t\tint validNum;\r\n\t\tdouble validDouble;\r\n\t\tString lengthVal = lengthInput.getText();\r\n\t\tString widthVal = widthInput.getText();\r\n\t\tString minDurationVal = minDurationInput.getText();\r\n\t\tString maxDurationVal = maxDurationInput.getText();\r\n\t\tString evPercentVal = evPercentInput.getText();\r\n\t\tString disabilityPercentVal = disabilityPercentInput.getText();\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.1 - Ensure all inputs are numbers\r\n\t\t */\r\n\t\t\r\n\t\t// Try to parse length as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(lengthVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Length must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(widthVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Width must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(minDurationVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Min Duration must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(maxDurationVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Max Duration must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidDouble = Double.parseDouble(evPercentVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"EV % must be a number\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidDouble = Double.parseDouble(disabilityPercentVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Disability % must be a number\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.2 - Ensure all needed inputs are non-zero\r\n\t\t */\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(lengthVal);\r\n\t\tif (validNum <= 0) {\r\n\t\t\tsetErrorMessage(\"Length must be greater than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(widthVal);\r\n\t\tif (validNum <= 0) {\r\n\t\t\tsetErrorMessage(\"Width must be greater than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(minDurationVal);\r\n\t\tif (validNum < 10) {\r\n\t\t\tsetErrorMessage(\"Min Duration must be at least 10\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(maxDurationVal);\r\n\t\tif (validNum < 10) {\r\n\t\t\tsetErrorMessage(\"Max Duration must be at least 10\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidDouble = Double.parseDouble(evPercentVal);\r\n\t\tif (validDouble < 0) {\r\n\t\t\tsetErrorMessage(\"EV % can't be less than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidDouble = Double.parseDouble(disabilityPercentVal);\r\n\t\tif (validDouble < 0) {\r\n\t\t\tsetErrorMessage(\"Disability % can't be less than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.3 - Ensure Max Duration can't be smaller than Min Duration\r\n\t\t */\r\n\t\t\r\n\t\tif (Integer.parseInt(minDurationVal) > Integer.parseInt(maxDurationVal)) {\r\n\t\t\tsetErrorMessage(\"Max Duration can't be less than Min Duration\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.4 - Ensure values aren't too large for the system to handle\r\n\t\t */\r\n\t\t\r\n\t\tif (Integer.parseInt(lengthVal) > 15) {\r\n\t\t\tsetErrorMessage(\"Carpark length can't be greater than 15 spaces\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (Integer.parseInt(widthVal) > 25) {\r\n\t\t\tsetErrorMessage(\"Carpark width can't be greater than 25 spaces\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (Integer.parseInt(minDurationVal) > 150) {\r\n\t\t\tsetErrorMessage(\"Min Duration can't be greater than 150\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Integer.parseInt(maxDurationVal) > 300) {\r\n\t\t\tsetErrorMessage(\"Max Duration can't be greater than 300\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Double.parseDouble(evPercentVal) > 100) {\r\n\t\t\tsetErrorMessage(\"EV % can't be greater than 100\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Double.parseDouble(disabilityPercentVal) > 100) {\r\n\t\t\tsetErrorMessage(\"Disability % can't be greater than 100\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Integer.parseInt(minDurationVal) > 150) {\r\n\t\t\tsetErrorMessage(\"Min Duration can't be greater than 150\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public void validateWaveDetails(String strWaveStatus, String strWaveRunDate, String strOrderLines, String strUnitsRequired, String strUnitsAllocated, String strUnitsShorted, String strTasks, String stroLPNs){\n\t\ttry{\n\t\t\tString actualWaveNumber=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:wave']\", \"XPATH\").getText();\n\t\t\tString actualWaveStatus=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:status']\", \"XPATH\").getText();\n\t\t\tString actualWaveRunDate=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:waveRunDate']\", \"XPATH\").getText();\n\t\t\tString actualOrderLines=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:OrderLinesSelected']\", \"XPATH\").getText();\n\t\t\tString actualUnitsRequired=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:UnitsRequired']\", \"XPATH\").getText();\n\t\t\tString actualUnitsAllocated=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:UnitsAllocated']\", \"XPATH\").getText();\n\t\t\tString actualUnitsShorted=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:UnitsShorted']\", \"XPATH\").getText();\n\t\t\tString actualTasks=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:Tasks']\", \"XPATH\").getText();\n\t\t\tString actualoLPNs=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:OLPNsSelected']\", \"XPATH\").getText();\n\t\t\tif(actualWaveStatus.trim().equals(strWaveStatus) && actualWaveRunDate.trim().equals(strWaveRunDate) && actualOrderLines.trim().equals(strOrderLines) && actualUnitsRequired.trim().equals(strUnitsRequired) && actualUnitsAllocated.trim().equals(strUnitsAllocated) && actualUnitsShorted.trim().equals(strUnitsShorted) && actualTasks.trim().equals(strTasks) && actualoLPNs.trim().equals(stroLPNs))\n\t\t\t{\n\t\t\t\treport.updateTestLog(\"Wave Details verification\", \"Wave Details verified successfully\", Status.PASS);\n\t\t\t}else\n\t\t\t{\n\t\t\t\treport.updateTestLog(\"Wave Details verification\", \"Wave Details verification failed \", Status.FAIL);\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\treport.updateTestLog(\"Element\", \"Element Not Found\", Status.FAIL);\n\n\n\t\t} \n\t}", "boolean hasValidIAta(AirportDTO airportDTO);", "public void checkParameters() {\n }", "@Test\n public void testIsValid() {\n assertTrue(scoutDec.isValid());\n scoutDec.setParameters(new DirectionParameters(null));\n assertFalse(scoutDec.isValid());\n }", "public void validate() throws org.apache.thrift.TException {\n if (version == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'version' was not present! Struct: \" + toString());\n }\n if (am_handle == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'am_handle' was not present! Struct: \" + toString());\n }\n if (user == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'user' was not present! Struct: \" + toString());\n }\n if (resources == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'resources' was not present! Struct: \" + toString());\n }\n // alas, we cannot check 'gang' because it's a primitive and you chose the non-beans generator.\n // check for sub-struct validity\n if (am_handle != null) {\n am_handle.validate();\n }\n if (reservation_id != null) {\n reservation_id.validate();\n }\n }", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "public boolean isValid() {\n\t\tif(goals1 == goals2 && !usedExtraTime)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public void validate() throws org.apache.thrift.TException {\n if (!is_set_status()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'status' is unset! Struct:\" + toString());\n }\n\n if (!is_set_data()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'data' is unset! Struct:\" + toString());\n }\n\n if (!is_set_feature()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'feature' is unset! Struct:\" + toString());\n }\n\n if (!is_set_predictResult()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'predictResult' is unset! Struct:\" + toString());\n }\n\n if (!is_set_msg()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'msg' is unset! Struct:\" + toString());\n }\n\n // check for sub-struct validity\n if (feature != null) {\n feature.validate();\n }\n }", "public boolean validData(String[] data) {\n\t\tboolean validData = true;\n\t\tint year, quarter, month;\n\t\ttry {\n\t\t\tyear = Integer.valueOf(data[0]);\n\t\t\tquarter = Integer.valueOf(data[1]);\n\t\t\tmonth = Integer.valueOf(data[2]);\n\t\t\tint CRSArrTime = Integer.valueOf(data[40]);\n\t\t\tint CRSDepTime = Integer.valueOf(data[29]);\n\t\t\tint timeZone = timeToMinute(Integer.valueOf(data[40])) - timeToMinute(Integer.valueOf(data[29])) - Integer.valueOf(data[50]);\n\t\t\tint origin_AirportID = Integer.valueOf(data[11]);\n\t\t\tint dest_AirportID = Integer.valueOf(data[20]);\n\t\t\tint origin_AirportSeqID = Integer.valueOf(data[12]);\n\t\t\tint dest_AirportSeqID = Integer.valueOf(data[21]);\n\t\t\tint origin_CityMarketID = Integer.valueOf(data[13]);\n\t\t\tint dest_CityMarketID = Integer.valueOf(data[22]);\n\t\t\tint origin_StateFips = Integer.valueOf(data[17]);\n\t\t\tint dest_StateFips = Integer.valueOf(data[26]);\n\t\t\tint origin_wac = Integer.valueOf(data[19]);\n\t\t\tint dest_wac = Integer.valueOf(data[28]);\n\t\t\tint cancelled = Integer.valueOf(data[47]);\n\t\t\tString origin = data[14];\n\t\t\tString dest = data[23];\n\t\t\tString origin_cityname = data[15];\n\t\t\tString dest_cityname = data[24];\n\t\t\tString origin_state = data[18];\n\t\t\tString dest_state = data[27];\n\t\t\tString origin_state_abr = data[16];\n\t\t\tString dest_state_abr = data[25];\n\t\t\t\n\t\t\tif ((CRSArrTime != 0 && CRSDepTime != 0) &&\n\t\t\t\t(timeZone%60 == 0) &&\t\n\t\t\t\t(origin_AirportID >0 && dest_AirportID > 0 && origin_AirportSeqID > 0 && dest_AirportSeqID > 0 \n\t\t\t\t\t\t&& origin_CityMarketID > 0 && dest_CityMarketID > 0 && origin_StateFips > 0 && dest_StateFips > 0 \n\t\t\t\t\t\t&& origin_wac > 0 && dest_wac > 0)\t&&\n\t\t\t\t(!origin.isEmpty() && !dest.isEmpty() && !origin_cityname.isEmpty() && !dest_cityname.isEmpty()\n\t\t\t\t\t\t&& !origin_state.isEmpty() && !dest_state.isEmpty() && !origin_state_abr.isEmpty() && !dest_state_abr.isEmpty())) {\n\t\t\t\t\n\t\t\t\t// for flights which are not cancelled\n\t\t\t\tif (cancelled != 1) {\n\t\t\t\t\tif (((timeToMinute(Integer.valueOf(data[41])) - timeToMinute(Integer.valueOf(data[30])) - Integer.valueOf(data[51]) - timeZone)/60)%24 == 0) {\n\t\t\t\t\t\tif (Float.valueOf(data[42]) > 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[42]).equals(Float.valueOf(data[43])))\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[42]) < 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[43]) == 0)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[43]) >= 15) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[44]) == 1)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// fill map\n\t\tif ((year == 2015) && (quarter == 1) && (month == 1)) {\n\t\t\ttry {\n\t\t\t\tString carrier = data[8];\n\t\t\t\tfloat price = Float.valueOf(data[109]);\n\t\t\t\t\n\t\t\t\tif (map_t.containsKey(carrier)) {\n\t\t\t\t\tArrayList<Float> list = map_t.get(carrier);\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t} else {\n\t\t\t\t\tArrayList<Float> list = new ArrayList<Float>();\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t}\t\t\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn validData;\n\t}", "private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }", "public void validate() throws org.apache.thrift.TException {\n if (ctpTradeId != null) {\n ctpTradeId.validate();\n }\n if (esunny3TradeId != null) {\n esunny3TradeId.validate();\n }\n if (esunny9TradeId != null) {\n esunny9TradeId.validate();\n }\n }", "private boolean validAdd(Flight flight) {\n double stopOverTime = getStopOverTime(flight);\n return (destination.equals(flight.getOrigin()) \n && stopOverTime <= 6 && stopOverTime >= 0 /*= 0 creates error*/\n && !(places.contains(flight.getDestination())));\n }", "public void validate() {\n transportStats.validate(this);\n\n for (String unitName : produces) {\n Args.validate(!UnitFactory.hasUnitForName(unitName), \"Illegal unit name \" + unitName + \" in build unit stats\");\n }\n\n for (Map.Entry<String, String> entry : buildCities.entrySet()) {\n String terrainName = entry.getKey();\n String cityName = entry.getValue();\n Args.validate(!TerrainFactory.hasTerrainForName(terrainName), \"Illegal terrain \" + terrainName + \" in build cities stats\");\n Args.validate(!CityFactory.hasCityForName(cityName), \"Illegal city \" + cityName + \" in build cities stats\");\n }\n\n for (String unitName : supplyUnits) {\n Args.validate(!UnitFactory.hasUnitForName(unitName), \"Illegal unit \" + unitName + \" in supply units stats\");\n }\n\n for (String unitName : supplyUnitsInTransport) {\n Args.validate(!UnitFactory.hasUnitForName(unitName), \"Illegal unit \" + unitName + \" in supply units in transport stats\");\n }\n\n Args.validate(StringUtil.hasContent(primaryWeaponName) && !WeaponFactory.hasWeapon(primaryWeaponName),\n \"Illegal primary weapon \" + primaryWeaponName + \" for unit \" + name);\n Args.validate(StringUtil.hasContent(secondaryWeaponName) && !WeaponFactory.hasWeapon(secondaryWeaponName),\n \"Illegal secondary weapon \" + secondaryWeaponName + \" for unit \" + name);\n }", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "private boolean checkValid() {\n\t\tif(openRadio.isSelected()) {\n\t\t\t//Open loop mode.\n\t\t\treturn checkInfusionRate() && checkPumpSelected() && checkMonitorSelected();\n\t\t} else {\n\t\t\t//Closed loop mode.\n\t\t\t//Check patient selected\n\t\t\t//Check QCore selected\n\t\t\t//Check BP monitor selected\n\t\t\t//Check target BP range\n\t\t\t//Check infusion rate.\n\t\t\treturn checkTargetBPRange() && checkInfusionRate() && checkPumpSelected() && checkMonitorSelected();\n\t\t}\n\t}", "public void validateRpd22s9()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void testCheckValidity_InvalidFields() throws Exception {\n expectCheckValidityFailure(msg -> msg.setSource(null));\n \n // null protocol\n expectCheckValidityFailure(msg -> msg.setProtocol(null));\n \n // null or empty topic\n expectCheckValidityFailure_NullOrEmpty((msg, value) -> msg.setTopic(value));\n \n // null payload\n expectCheckValidityFailure(msg -> msg.setPayload(null));\n \n // empty payload should NOT throw an exception\n Forward forward = makeValidMessage();\n forward.setPayload(\"\");\n forward.checkValidity();\n \n // null or empty requestId\n expectCheckValidityFailure_NullOrEmpty((msg, value) -> msg.setRequestId(value));\n \n // invalid hop count\n expectCheckValidityFailure(msg -> msg.setNumHops(-1));\n }", "boolean hasFlightdetails();", "private void validate() throws IllegalArgumentException {\n final String DEBUG_HEADER = \"validate(): \";\n String message = null;\n\n boolean ifMatchExists = ifMatch != null && !ifMatch.isEmpty();\n if (log.isDebug3())\n log.debug3(DEBUG_HEADER + \"ifMatchExists = \" + ifMatchExists);\n\n boolean ifModifiedSinceExists =\n\tifModifiedSince != null && !ifModifiedSince.isEmpty();\n if (log.isDebug3()) log.debug3(DEBUG_HEADER\n\t+ \"ifModifiedSinceExists = \" + ifModifiedSinceExists);\n\n boolean ifNoneMatchExists = ifNoneMatch != null && !ifNoneMatch.isEmpty();\n if (log.isDebug3())\n log.debug3(DEBUG_HEADER + \"ifNoneMatchExists = \" + ifNoneMatchExists);\n\n boolean ifUnmodifiedSinceExists =\n\tifUnmodifiedSince != null && !ifUnmodifiedSince.isEmpty();\n if (log.isDebug3()) log.debug3(DEBUG_HEADER\n\t+ \"ifUnmodifiedSinceExists = \" + ifUnmodifiedSinceExists);\n\n // Check whether there are both If-Match and If-None-Match preconditions.\n if (ifMatchExists && ifNoneMatchExists) {\n // Yes: Check whether there is an If-Modified-Since precondition.\n if (ifModifiedSinceExists) {\n\t// Yes: Report the problem.\n\tmessage = \"Invalid presence of If-Match, If-None-Match and \"\n\t + \"If-Modified-Since preconditions\";\n } else if (ifUnmodifiedSinceExists) {\n\t// Yes: Report the problem.\n\tmessage = \"Invalid presence of If-Match, If-None-Match and \"\n\t + \"If-Unmodified-Since preconditions\";\n } else {\n\t// No: Report the problem.\n\tmessage =\n\t \"Invalid presence of both If-Match and If-None-Match preconditions\";\n }\n\n log.error(message);\n throw new IllegalArgumentException(message);\n }\n\n // Check whether there are both If-Match and If-Modified-Since\n // preconditions.\n if (ifMatchExists && ifModifiedSinceExists) {\n // Yes: Report the problem.\n message = \"Invalid presence of both If-Match and If-Modified-Since \"\n\t + \"preconditions\";\n log.error(message);\n throw new IllegalArgumentException(message);\n }\n\n // Check whether there are both If-Modified-Since and If-Unmodified-Since\n // preconditions.\n if (ifModifiedSinceExists && ifUnmodifiedSinceExists) {\n // Yes: Report the problem.\n message = \"Invalid presence of both If-Modified-Since and \"\n\t + \"If-Unmodified-Since preconditions\";\n log.error(message);\n throw new IllegalArgumentException(message);\n }\n\n // Check whether there are both If-None-Match and If-Unmodified-Since\n // preconditions.\n if (ifNoneMatchExists && ifUnmodifiedSinceExists) {\n // Yes: Report the problem.\n message = \"Invalid presence of both If-None-Match and \"\n\t + \"If-Unmodified-Since preconditions\";\n log.error(message);\n throw new IllegalArgumentException(message);\n }\n\n // Check whether there are any If-Match precondition tags.\n if (ifMatchExists) {\n // Yes: Validate the syntax of the If-Match precondition tags.\n validateTagSyntax(ifMatch, \"If-Match\");\n }\n\n // Check whether there are any If-None-Match precondition tags.\n if (ifNoneMatchExists) {\n // Yes: Validate the syntax of the If-None-Match precondition tags.\n validateTagSyntax(ifNoneMatch, \"If-None-Match\");\n }\n }", "public void validate() {\n if (valid) return;\n \n layer = getAttValue(\"layer\").getString();\n hasFrame = getAttValue(\"hasframe\").getBoolean();\n\n valid = true;\n }", "private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}", "private boolean validateInput(){\n boolean operationOK = true;\n //perform input validation on the double values in the form\n String integrationTime = this.integrationTimeText.getText();\n String integrationFrequency = this.integrationFrequencyText.getText();\n \n if(!integrationTime.equals(\"\")){\n try {\n Double itime = Double.parseDouble(integrationTime);\n integrationTimeText.setBackground(Color.WHITE);\n integrationTimeText.setToolTipText(\"Time in seconds (s)\");\n } catch (NumberFormatException ex) {\n integrationTimeText.setBackground(Color.RED);\n operationOK=false;\n integrationTimeText.setToolTipText(\"This field has to be a valid double (eg. 1.5)\");\n }\n }\n if(!integrationFrequency.equals(\"\")){\n try {\n Double itime = Double.parseDouble(integrationFrequency);\n integrationFrequencyText.setBackground(Color.WHITE);\n integrationFrequencyText.setToolTipText(\"Frequency in Hertz (Hz)\");\n \n } catch (NumberFormatException ex) {\n operationOK=false;\n integrationFrequencyText.setBackground(Color.RED);\n integrationFrequencyText.setToolTipText(\"This field has to be a valid double (eg. 1.5)\");\n }\n }\n if(currentStepOperationsPanel!=null){\n operationOK = this.currentStepOperationsPanel.validateInput();\n \n }\n return operationOK;\n }", "public void validateRpd22s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s5()\n {\n // This guideline cannot be automatically tested.\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "@Override\n public void validate(Variable variable) throws Exception {\n \n super.validate(variable);\n doPinNames();\n \n for (int index=0; index<8; index++) {\n // Filter variables\n ChoiceVariable llwu_filt_filteVar = safeGetChoiceVariable(\"llwu_filt\"+index+\"_filte\");\n LongVariable llwu_filt_filtselVar = safeGetLongVariable(\"llwu_filt\"+index+\"_filtsel\");\n if ((llwu_filt_filteVar != null) && ((variable == null) || (variable == llwu_filt_filteVar))) {\n llwu_filt_filtselVar.enable(llwu_filt_filteVar.getValueAsLong() != 0);\n }\n }\n// // Warn if Rx and Tx signals not mapped\n// validateMappedPins(new int[]{0,1}, getPeripheral().getSignalTables().get(0).table);\n }", "public Flight() {\n\tthis.year = 0;\n\tthis.month = 0;\n\tthis.dayOfMonth = 0;\n\tthis.dayOfWeek = 0;\n\tthis.uniqueCarrier = \"\";\n\tthis.originAirportID = \"\";\n\tthis.destAirportID = \"\";\n\tthis.depDelay = 0.0;\n\tthis.arrDelay = 0.0;\n\tthis.cancelled = false;\n\tthis.carrierDelay = 0;\n\tthis.weatherDelay = 0;\n\tthis.nasDelay = 0;\n\tthis.securityDelay = 0;\n\tthis.lateAircraftDelay = 0;\n\tthis.divAirportLandings = 0;\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public static boolean validFlightData(String airline[], int rowNo,\r\n\t\t\tString airlineName) throws Exception {\r\n\t\tboolean isValid = true;\r\n\t\tif (airline[0].length() != 5) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (airline[1].length() != 3 || airline[2].length() != 3) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tDateParser.parseDate(airline[3]);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tisValid = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble(airline[5]);\r\n\t\t\tDouble.parseDouble(airline[6]);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tisValid = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif (!(airline[7].contains(GenericConstants.YES_OPTION) || airline[7]\r\n\t\t\t\t.contains(GenericConstants.NO_OPTION))) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (!(airline[8].contains(CSVReaderConstants.BUSINESS) || airline[8]\r\n\t\t\t\t.contains(CSVReaderConstants.ECONOMIC))) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (!isValid) {\r\n\t\t\tthrow new Exception(ConsoleMessages.INVAILD_FLIGHT_DETAILS + rowNo\r\n\t\t\t\t\t+ \" in \" + airlineName);\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "public void validateRpd22s4()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isOverSpeed(){ return vehicleAvarageSpeed > roadMaxSpeed; }", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "boolean hasOriginFlightLeg();", "public static void updateAFlight() {\n \n \n\n int flightOptions;\n String flightId;\n String flightDestination;\n String flightOrigin;\n String airline;\n\n Flights myFlights;\n\n myFlights = new Flights();\n\n \n flightOptions = determineNumber(\"Please enter flight option: \");\n \n myFlights = (Flights) Flights.displayFlight(flightOptions);\n\n if (myFlights == null) {\n System.out.println(\"Flight not available.\");\n updateAFlight();\n\n } else {\n flightId = enterText(\"Please enter new flightID: \");\n myFlights.setFlightId(flightId);\n\n flightDestination = enterText(\"Please enter new flight destination: \");\n myFlights.setFlightDestination(flightDestination);\n\n flightOrigin = enterText(\"Please enter new flight origin: \");\n myFlights.setFlightOrigin(flightOrigin);\n\n airline = enterText(\"Please enter new airline: \");\n myFlights.setAirline(airline);\n flightManager();\n }\n\n }", "private boolean isValid() throws InvalidStateException{\n if (this.homeTeam == null || this.visitingTeam == null){\n return false;\n }else{\n return true;\n }\n }", "@Test(expected = TrainException.class)\n\tpublic void testCreateFreightCarWithInvalidBothArguments() throws TrainException\n\t{\n\t\tString invalidGoodsType = \"K\";\n\t\tInteger invalidGrossWeight = -9;\n\t\t\n\t\t@SuppressWarnings(\"unused\")\n\t\tasgn2RollingStock.RollingStock freightCarWithInvalidGrossWeight = \n\t\t\t\tnew asgn2RollingStock.FreightCar(invalidGrossWeight , invalidGoodsType);\n\t}", "public void interestRate_Validation() {\n\t\thelper.assertString(interestRate_AftrLogin(), payOffOffer.interestRate_BfrLogin());\n\t\tSystem.out.print(\"The Interest Rate is: \" + interestRate_AftrLogin());\n\t}", "public void validate(IValidation results) {\n if (_inputGrids.isEmpty()) {\n results.error(_inputGrids, \"No input grids specified.\");\n } else {\n // Validate all selected grids are in either the time or depth domain.\n for (Grid3d inputGrid : _inputGrids.get()) {\n if (!inputGrid.isTimeGrid() && !inputGrid.isDepthGrid()) {\n results.error(_inputGrids, \"One or more input grids in not the time or depth domain.\");\n }\n }\n }\n\n // Validate that a velocity volume is selected.\n if (_velocityVolume.isNull()) {\n results.error(_velocityVolume, \"No velocity volume specified\");\n } else {\n // Validate the unit of the velocity volume are in the velocity domain.\n PostStack3d velocityVolume = _velocityVolume.get();\n Unit velocityUnit = velocityVolume.getDataUnit();\n if (velocityUnit != Unit.METERS_PER_SECOND && velocityUnit != Unit.FEET_PER_SECOND) {\n results.error(_velocityVolume, \"Invalid velocity units. Must be \" + Unit.METERS_PER_SECOND.getSymbol() + \" or \"\n + Unit.FEET_PER_SECOND.getSymbol() + \".\");\n }\n StorageOrder storageOrder = velocityVolume.getPreferredOrder();\n if (!storageOrder.equals(StorageOrder.INLINE_XLINE_Z) && !storageOrder.equals(StorageOrder.XLINE_INLINE_Z)) {\n results.error(_velocityVolume, \"Unsupported storage order: \" + storageOrder);\n }\n }\n\n // Validate that an area-of-interest is selected, if used.\n if (_aoiFlag.get()) {\n if (_aoi.isNull()) {\n results.error(_aoi, \"No area-of-interest specified.\");\n }\n }\n }", "@Override\n public boolean validate() {\n int numFeathers = c.getInventory().count(FEATHERS);\n return (c.getSkills().getRealLevel(Skill.FISHING) >= 20 && !c.isCollectFeathers());\n }", "public void validateRpd15s2()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateProperties() throws BuildException {\r\n if (this.port == null || this.port.length() == 0) {\r\n throw new BuildException(\"Attribute 'port' must be set.\");\r\n }\r\n if (this.depotPath == null || this.depotPath.length() == 0) {\r\n throw new BuildException(\"Attribute 'repositoryUrl' must be set.\");\r\n }\r\n if (this.userName == null || this.userName.length() == 0) {\r\n throw new BuildException(\"Attribute 'userName' must be set.\");\r\n }\r\n if (this.password == null || this.password.length() == 0) {\r\n throw new BuildException(\"Attribute 'password' must be set.\");\r\n }\r\n if (this.depotPath == null || this.depotPath.length() == 0) {\r\n throw new BuildException(\"Attribute 'repositoryUrl' must be set.\");\r\n }\r\n if (this.p4ExecutablePath == null || this.p4ExecutablePath.length() == 0) {\r\n throw new BuildException(\"Attribute 'p4ExecutablePath' must be set.\");\r\n }\r\n File p4Executable = new File(this.p4ExecutablePath);\r\n if (!p4Executable.exists()) {\r\n throw new BuildException(\"Attribute 'p4ExecutablePath' \" + this.p4ExecutablePath +\r\n \" does not appear to point to an actual file.\");\r\n }\r\n \r\n // If default* is specified, then all should be specified. \r\n if (((this.defaultHackystatAccount != null) || \r\n (this.defaultHackystatPassword != null) ||\r\n (this.defaultHackystatSensorbase != null)) &&\r\n ((this.defaultHackystatAccount == null) || \r\n (this.defaultHackystatPassword == null) ||\r\n (this.defaultHackystatSensorbase == null))) {\r\n throw new BuildException (\"If one of default Hackystat account, password, or sensorbase \" +\r\n \"is specified, then all must be specified.\");\r\n }\r\n \r\n // Check to make sure that defaultHackystatAccount looks like a real email address.\r\n if (!ValidateEmailSyntax.isValid(this.defaultHackystatAccount)) {\r\n throw new BuildException(\"Attribute 'defaultHackystatAccount' \" + this.defaultHackystatAccount\r\n + \" does not appear to be a valid email address.\");\r\n }\r\n \r\n // If fromDate and toDate not set, we extract commit information for the previous day.\r\n if (this.fromDateString == null && this.toDateString == null) {\r\n Day previousDay = Day.getInstance().inc(-1);\r\n this.fromDate = new Date(previousDay.getFirstTickOfTheDay() - 1);\r\n this.toDate = new Date(previousDay.getLastTickOfTheDay());\r\n }\r\n else {\r\n try {\r\n if (this.hasSetToAndFromDates()) {\r\n this.fromDate = new Date(Day.getInstance(this.dateFormat.parse(this.fromDateString))\r\n .getFirstTickOfTheDay() - 1);\r\n this.toDate = new Date(Day.getInstance(this.dateFormat.parse(this.toDateString))\r\n .getLastTickOfTheDay());\r\n }\r\n else {\r\n throw new BuildException(\r\n \"Attributes 'fromDate' and 'toDate' must either be both set or both not set.\");\r\n }\r\n }\r\n catch (ParseException ex) {\r\n throw new BuildException(\"Unable to parse 'fromDate' or 'toDate'.\", ex);\r\n }\r\n\r\n if (this.fromDate.compareTo(this.toDate) > 0) {\r\n throw new BuildException(\"Attribute 'fromDate' must be a date before 'toDate'.\");\r\n }\r\n }\r\n }", "private boolean isValid(String trailname, String trailcode, String traildate) {\n boolean isValid = true;\n if (TextUtils.isEmpty(trailname)) {\n trailName.setError(getString(R.string.trail_name_validation_ms));\n isValid = false;\n }\n if (TextUtils.isEmpty(trailcode)) {\n module.setError(getString(R.string.module_validation_ms));\n isValid = false;\n }\n if (TextUtils.isEmpty(trailcode)) {\n trailCode.setError(getString(R.string.code_validation_ms));\n isValid = false;\n }\n\n if (TextUtils.isEmpty(traildate)) {\n trailDate.setError(getString(R.string.date_validation_ms));\n isValid = false;\n }\n return isValid;\n }", "private boolean validateArrivingTime(StopPoint currentSP) {\n\t\ttry {\n\t\t\tint time = Integer.valueOf(hourComboBox.getValue()) * 60;\n\t\t\ttime += Integer.valueOf(minuteComboBox.getValue());\n\t\t\ttime += timeIndicatorComboBox.getValue().equals(\"PM\") ? 12 * 60 : 0;\n\t\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\t\tif (stopPoint.getTime() != null && !stopPoint.getTime().equals(\"\") && stopPoint != currentSP) {\n\t\t\t\t\tString[] spTimeString = stopPoint.getTime().split(\"[ :]+\");\n\t\t\t\t\tint spTime = Integer.valueOf(spTimeString[0]) * 60;\n\t\t\t\t\tspTime += Integer.valueOf(spTimeString[1]);\n\t\t\t\t\tspTime += spTimeString[2].equals(\"PM\") ? 12 * 60 : 0;\n\n\t\t\t\t\tif (time <= spTime + 5 && time >= spTime - 5) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public void validateRpd22s8()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isValid(){\n\t\treturn this.arm.isValid();\n\t}", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate() throws org.apache.thrift.TException {\n if (limb == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'limb' was not present! Struct: \" + toString());\n }\n if (pos == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'pos' was not present! Struct: \" + toString());\n }\n if (ori == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'ori' was not present! Struct: \" + toString());\n }\n if (speed == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'speed' was not present! Struct: \" + toString());\n }\n if (angls == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'angls' was not present! Struct: \" + toString());\n }\n if (mode == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'mode' was not present! Struct: \" + toString());\n }\n if (kin == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'kin' was not present! Struct: \" + toString());\n }\n // check for sub-struct validity\n if (pos != null) {\n pos.validate();\n }\n if (ori != null) {\n ori.validate();\n }\n if (speed != null) {\n speed.validate();\n }\n if (angls != null) {\n angls.validate();\n }\n }", "boolean valid() {\n boolean valid = true;\n\n if (!isAgencyLogoPathValid()) {\n valid = false;\n }\n if (!isMemFieldValid()) {\n valid = false;\n }\n if (!isLogNumFieldValid()) {\n valid = false;\n }\n\n return valid;\n }", "private void checkParameters()\n\t\tthrows DiameterMissingAVPException {\n\t\tDiameterClientRequest request = getRequest();\n\t\tDiameterAVPDefinition def = ShUtils.getUserIdentityAvpDefinition(getVersion());\n\t\tif (request.getDiameterAVP(def) == null) {\n\t\t\tthrow new DiameterMissingAVPException(def.getAVPCode());\n\t\t}\n\t\tdef = ShUtils.getDataReferenceAvpDefinition(getVersion());\n\t\tif (request.getDiameterAVP(def) == null) {\n\t\t\tthrow new DiameterMissingAVPException(def.getAVPCode());\n\t\t}\n\t}", "public void loanTerm_Validation() {\n\t\thelper.assertString(loanTerm_AftrLogin(), payOffOffer.loanTerm_BfrLogin());\n\t\tSystem.out.print(\"The loan Term is: \" + loanTerm_AftrLogin());\n\n\t}", "@Test\n public void is_restaurant_open_should_return_true_if_time_is_between_opening_and_closing_time_Failure_Scenario(){\n\n int isRestaurantOpened = restaurant.isRestaurantOpen().size();\n restaurant.isRestaurantOpen(\"Invalid Input\");\n assertEquals(\"Invalid Input\",restaurant.isRestaurantOpen().size());\n System.out.println(\"Enter proper timing in proper format 23:00:00\")\n\n }", "public static double sanityCheck(Match match)\n {\n Lane lane;\n Role role;\n \n int bot = 0;\n int bottom = 0;\n int jungle = 0;\n int mid = 0;\n int middle = 0;\n int top = 0;\n \n int solo = 0;\n int duo = 0;\n int duo_carry = 0;\n int duo_support = 0;\n int none = 0;\n \n\n \n for(int i = 0; i<10; i++)\n {\n lane = match.getParticipants().get(i).getTimeline().getLane();\n role = match.getParticipants().get(i).getTimeline().getRole();\n \n switch(lane)\n {\n case BOT:\n bot++;\n break;\n \n case BOTTOM:\n bottom++;\n break;\n \n case JUNGLE:\n jungle++;\n break;\n \n case MID:\n mid++;\n break;\n \n case MIDDLE:\n middle++;\n break;\n \n case TOP:\n top++;\n break;\n }\n \n switch(role)\n {\n case SOLO:\n solo++;\n break;\n \n case DUO:\n duo++;\n break;\n \n case DUO_CARRY:\n duo_carry++;\n break;\n \n case DUO_SUPPORT:\n duo_support++;\n break;\n \n case NONE:\n none++;\n break;\n }\n }\n \n double total = 0;\n \n if(top == 2)\n total++;\n if(mid+middle == 2)\n total++;\n if(jungle == 2)\n total++;\n if(bot + bottom == 4)\n total++;\n \n if(solo == 4)\n total++;\n if(duo + duo_carry + duo_support == 4);\n total++;\n if( duo_carry == 2);\n total++;\n if(duo_support == 2)\n total++;\n if(none == 2)\n total++;\n \n //it would be total =/ 9 but I figured every time one is wrong it makes another wrong, but there's really only 1 error \n total = ((total/18.0)+.5);\n \n \n //TestPrints\n //System.out.println(\"Sanity Check:\\nTop: \"+ top + \"\\nJungle: \"+ jungle + \"\\nMid: \" + (mid+middle) + \"\\nBot: \" + (bot+bottom)+ \"\\n\\nSolo: \"+solo + \"\\nDuo: \" + (duo+duo_carry+duo_support)\n //+ \"\\n\\\"Bot\\\": \"+ duo+\"\\nADC: \"+ duo_carry+ \"\\nSupport: \"+duo_support+ \"\\nNone: \" + none + \"\\nTotal Score: \" +total);\n \n \n \n return total;\n \n }", "boolean checkValidity();", "@Test\n public void validSetFlightInformation() {\n testUser.setUsername(\"username\");\n testUser.setLastName(\"lastname\");\n testUser.setPassword(\"password\");\n testUser.setFirstName(\"firstname\");\n\n Assertions.assertEquals(\"username\", testUser.getUsername());\n Assertions.assertEquals(\"lastname\", testUser.getLastName());\n Assertions.assertEquals(\"password\", testUser.getPassword());\n Assertions.assertEquals(\"firstname\", testUser.getFirstName());\n }", "private void validateOptionalParams(StringBuilder errors) throws Exception {\n // Validate RECON_PARTIAL_TRIGGER Option configuration.\n String paramValue = inputParams.getProperty(\"RECON_PARTIAL_TRIGGER\");\n if(paramValue!=null && !paramValue.trim().isEmpty()){\n StringTokenizer tokens = new StringTokenizer(paramValue, Constants.TOKEN_SEPARATOR);\n while(tokens.hasMoreElements()){\n try{\n PartialTriggerOptions.valueOf(tokens.nextToken());\n }catch(Exception ex){\n errors.append(\"Invalid Parameter Configuration for RECON_PARTIAL_TRIGGER. Please correct.\"\n + System.getProperty(\"line.separator\"));\n }\n }\n }\n // Validate TARGET_SHARED_IDSTORE_SEARCHBASE\n paramValue = inputParams.getProperty(\"TARGET_SHARED_IDSTORE_SEARCHBASE\");\n if(paramValue==null || paramValue.trim().isEmpty()){\n Logger.getLogger(IdentityReconciliationProcessor.class.getName()).log(Level.INFO, \n \"Parameter [Optional] TARGET_SHARED_IDSTORE_SEARCHBASE not configured. \" +\n \"Highly recommended to configure this parameter. Note that - This may result in performance issue.\");\n }\n paramValue = inputParams.getProperty(Constants.BATCH_SIZE_ATTR);\n if(paramValue!=null && !paramValue.trim().isEmpty()){\n try{\n getBatchSize(paramValue);\n }catch(Exception ex){\n errors.append(\"Invalid Parameter Configuration for Batch Size. Please correct.\"\n + System.getProperty(\"line.separator\"));\n }\n }\n }", "private void getValidity(){\n String start_time = spin_start.getSelectedItem().toString();\n String end_time = spin_end.getSelectedItem().toString();\n String day = spin_day.getSelectedItem().toString();\n\n String[] start = start_time.split(\":\");\n String[] end = end_time.split(\":\");\n\n //Set the 2 hours\n int hourStart = Integer.parseInt(start[0]);\n int hourEnd = Integer.parseInt(end[0]);\n\n //Set the minutes\n int minuteStart = Integer.parseInt(start[1]);\n int minuteEnd = Integer.parseInt(end[1]);\n\n boolean valid = true;\n\n if(hourStart == hourEnd && minuteStart >= minuteEnd)\n valid = false;\n if(hourStart > hourEnd)\n valid = false;\n if(valid) {\n valid = isAvailabilityExist(day, start_time, end_time);\n if (valid) {\n valid = isAppointmentExist(day, start_time, end_time);\n if (valid) {\n createAppointment(day, start_time, end_time);\n } else\n Toast.makeText(this, \"There is already an appointment at the time you try to use.\", Toast.LENGTH_LONG).show();\n\n } else\n Toast.makeText(this, \"Please make sure you select an appointment \" +\n \"in the availability of the service provider.\", Toast.LENGTH_LONG).show();\n\n }else\n Toast.makeText(this, \"The time you try to get an appointment is not valid.\", Toast.LENGTH_LONG).show();\n }", "public boolean checkSelf() {\n\t\tboolean ok = true;\n\t\tif (controller == null) {\n\t\t\tSystem.err.println(\"CRParameters :: controller not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (scenario.length() == 0 && controller.getWorld().getHasScenarios()) {\n\t\t\tSystem.err.println(\"CRParameters :: scenario not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (reportFolderName.length() == 0) {\n\t\t\tSystem.err.println(\"CRParameters :: report folder not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (trialDuration <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: trial duration not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\tif (numOfRuns <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: number of runs not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\tif (numOfTrials <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: number of trials not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\treturn ok;\n\t}", "protected boolean isAirlineValid(String airline) {\n return (airline.length() == 2 || airline.length() == 3) && airline.matches(\"[0-9A-Z]+\");\n }", "private void VehicleValidation(Vehicle vehicle) throws ServiceException {\n\n\n if (vehicle.getTitle() == null) {\n throw new ServiceException(\"Title is null ! \");\n }\n if (vehicle.getTitle().equals(\"\")) {\n throw new ServiceException(\"Title is empty ! \");\n }\n\n if (vehicle.getYear() == 0) {\n throw new ServiceException(\"year ist empty !\");\n }\n if (!isNumeric(vehicle.getYear() + \"\")) {\n throw new ServiceException(\"wrong format for year !\");\n }\n if (vehicle.getYear()<1885 || vehicle.getYear() >2018){\n throw new ServiceException(\"year has to be between 2018 and 1885 !\");\n }\n String s = vehicle.getYear() + \"\";\n if (s.length() != 4) {\n throw new ServiceException(\"only 4 digit ! \");\n }\n if (!isNumeric(vehicle.getSeats() + \"\")) {\n throw new ServiceException(\"only 1-10 !\");\n }\n if (!vehicle.getLicenseClass().isEmpty()) {\n if (vehicle.getLicensePlate().isEmpty()) {\n throw new ServiceException(\"License Plate is empty !\");\n }\n if (vehicle.getLicensePlate().equals(\"\")) {\n throw new ServiceException(\"License Plate is empty !\");\n }\n }\n if (!isNumeric(vehicle.getPrice() + \"\")) {\n throw new ServiceException(\"wrong format for Price !\");\n }\n if (vehicle.getPrice() == 0 || vehicle.getPrice() < 0) {\n throw new ServiceException(\"wrong format for Price !\");\n }\n\n if (vehicle.getTypeOfDrive().equals(\"motorized\")) {\n if (!isNumeric(vehicle.getPower() + \"\")) {\n throw new ServiceException(\"wrong format for power !\");\n }\n if (vehicle.getPower() == 0) {\n throw new ServiceException(\"power is empty!\");\n }\n }\n\n\n }", "public boolean C_enterTheZone(ListOfParameterLists parameterLists){\n //if(isEnter == true){\n if(debug)\n System.out.println(\"Condition from Rule7 :: is true\");\n\n\n return true;\n\n // }\n // else\n //return false;\n\n // Future work\n // Put the condition code here, eg. if the track is friendly, we\n // don't need to alert the analyst.\n\n }", "public boolean isValidPart() {\n boolean result = false;\n boolean isComplete = !partPrice.getText().equals(\"\")\n && !partName.getText().equals(\"\")\n && !inventoryCount.getText().equals(\"\")\n && !partId.getText().equals(\"\")\n && !maximumInventory.getText().equals(\"\")\n && !minimumInventory.getText().equals(\"\")\n && !variableTextField.getText().equals(\"\");\n boolean isValidPrice = isDoubleValid(partPrice);\n boolean isValidName = isCSVTextValid(partName);\n boolean isValidId = isIntegerValid(partId);\n boolean isValidMax = isIntegerValid(maximumInventory);\n boolean isValidMin = isIntegerValid(minimumInventory);\n boolean isMinLessThanMax = false;\n if (isComplete)\n isMinLessThanMax = Integer.parseInt(maximumInventory.getText()) > Integer.parseInt(minimumInventory.getText());\n\n if (!isComplete) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Missing Information\");\n errorMessage.setHeaderText(\"You didn't enter required information!\");\n errorMessage.setContentText(\"All fields are required! Your part has not been saved. Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isMinLessThanMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Entry\");\n errorMessage.setHeaderText(\"Min must be less than Max!\");\n errorMessage.setContentText(\"Re-enter your data! Your part has not been saved.Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isValidPrice) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Price is not valid\");\n errorMessage.setHeaderText(\"The value you entered for price is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered does\" +\n \" not include more than one decimal point (.), does not contain any letters, and does not \" +\n \"have more than two digits after the decimal. \");\n errorMessage.show();\n } else if (!isValidName) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Name\");\n errorMessage.setHeaderText(\"The value you entered for name is not valid.\");\n errorMessage.setContentText(\"Please ensure that the text you enter does not\" +\n \" include any quotation marks,\" +\n \"(\\\"), or commas (,).\");\n errorMessage.show();\n } else if (!isValidId) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect ID\");\n errorMessage.setHeaderText(\"The value you entered for ID is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Max Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Max is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMin) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Min Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Min is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else {\n result = true;\n }\n\n return result;\n }", "public boolean checkEntryInputs() {\n\t\tboolean isValid = true;\n\t\tif(sampleNumberTF.getText().equals(\"\")) {\n\t\t\tisValid = false;\n\t\t}\n\t\t\n\t\tif(materialDescriptionTF.getText().equals(\"\")) {\n\t\t\tisValid = false;\n\t\t}\n\t\t\n\t\tif(Double.valueOf(bacteroidesConcentrationTF.getText())==null) {\n\t\t\tisValid = false;\n\t\t}\n\t\treturn isValid;\n\t}", "@Test\r\n\tpublic void testValidationSuccess() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t} catch (ValidationException e) {\r\n\t\t\tAssert.fail(\"Found_Exception\");\r\n\t\t}\r\n\t}", "protected void checkValidity(Epml epml) {\n\t}", "@Override\n public boolean validate() throws ValidationException\n {\n boolean isValid = super.validate();\n return checkAAField() && isValid;\n }", "public String validate() {\n\t\tString msg=\"\";\n\t\t// for name..\n\t\tif(name==null||name.equals(\"\"))\n\t\t{\n\t\t\tmsg=\"Task name should not be blank or null\";\n\t\t}\n\t\tif(name.split(\" \").length>1)\n\t\t{\n\t\t\tmsg=\"multiple words are not allowed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t for(int i=0;i<name.length();i++)\n\t\t {\n\t\t\t char c=name.charAt(i);\n\t\t\t\tif(!(Character.isDigit(c)||Character.isLetter(c)))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"special characters are not allowed\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\t\n\t\t\n\t\t\t// for Description...\n\t\t\tif(desc==null||desc.equals(\"\"))\n\t\t\t{\n\t\t\t\tmsg=\"Task descrshould not be blank or null\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t // for tag...\n\t\t\t \n\t\t\t if(tag==null||tag.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"Task tags not be blank or null\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t // for date { imp here}\n\t\t\t if(tarik!=null)\n\t\t\t {\n\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t sdf.setLenient(false); // very imp here..\n\t\t\t try {\n\t\t\t\tDate d=sdf.parse(tarik);\n\t\t\t} catch (ParseException e) {\n\t\t\t\t\n\t\t\t//\tmsg=\"date should be correct foramat\";\n\t\t\t\tmsg=e.getMessage();\n\t\t\t}\n\t\t\t }\n\t\t\t// for prority..\n\t\t\t if(prio<1&&prio>10)\n\t\t\t {\n\t\t\t\t msg=\"prority range is 1 to 10 oly pa\";\n\t\t\t }\n\t\t\t\t\n\t\t\t\tif(msg.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\treturn Constant.SUCCESS;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\treturn msg;\n\t}", "public void validateAttributes() {\n if ((totalNumBuckets <= 0)) {\n throw new IllegalStateException(\n String.format(\n \"TotalNumBuckets %s is an illegal value, please choose a value greater than 0\",\n totalNumBuckets));\n }\n if ((redundancy < 0) || (redundancy >= 4)) {\n throw new IllegalStateException(\n String.format(\n \"RedundantCopies %s is an illegal value, please choose a value between 0 and 3\",\n redundancy));\n }\n for (final Object value : getLocalProperties().keySet()) {\n String propName = (String) value;\n if (!PartitionAttributesFactory.LOCAL_MAX_MEMORY_PROPERTY.equals(propName)) {\n throw new IllegalStateException(\n String.format(\"Unknown local property: '%s'\",\n propName));\n }\n }\n for (final Object o : getGlobalProperties().keySet()) {\n String propName = (String) o;\n if (!PartitionAttributesFactory.GLOBAL_MAX_BUCKETS_PROPERTY.equals(propName)\n && !PartitionAttributesFactory.GLOBAL_MAX_MEMORY_PROPERTY.equals(propName)) {\n throw new IllegalStateException(\n String.format(\"Unknown global property: '%s'\",\n propName));\n }\n }\n if (recoveryDelay < -1) {\n throw new IllegalStateException(\"RecoveryDelay \" + recoveryDelay\n + \" is an illegal value, please choose a value that is greater than or equal to -1\");\n }\n if (startupRecoveryDelay < -1) {\n throw new IllegalStateException(\"StartupRecoveryDelay \" + startupRecoveryDelay\n + \" is an illegal value, please choose a value that is greater than or equal to -1\");\n }\n if (fixedPAttrs != null) {\n List<FixedPartitionAttributesImpl> duplicateFPAattrsList =\n new ArrayList<>();\n Set<FixedPartitionAttributes> fpAttrsSet = new HashSet<>();\n for (FixedPartitionAttributesImpl fpa : fixedPAttrs) {\n if (fpa == null || fpa.getPartitionName() == null) {\n throw new IllegalStateException(\n \"Fixed partition name cannot be null\");\n }\n if (fpAttrsSet.contains(fpa)) {\n duplicateFPAattrsList.add(fpa);\n } else {\n fpAttrsSet.add(fpa);\n }\n }\n if (duplicateFPAattrsList.size() != 0) {\n throw new IllegalStateException(\n String.format(\"Partition name %s can be added only once in FixedPartitionAttributes\",\n duplicateFPAattrsList));\n }\n }\n }", "public Flight() {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.id = \"1520\";\n\t\tthis.departureDate = \"test-departure\";\n\t\tthis.departureTime = \"test-time\";\n\t\tthis.plane = new Airplane();\n\t\tthis.departureAirport = new Airport();\n\t\tthis.arrivalAirport=new Airport();\n\t\tthis.pilot = new Pilot();\n\t\tthis.passengers = new ArrayList<Passenger>();\n\t\tthis.availableSeat = 10;\n\t\tthis.price = 10;\n\t\tthis.duree = \"duration\";\n\t\t\n\t}", "public Checking(String n, String h, float min, float over, String route) {}", "public static void CheckIfParametersAreValid(String args[]) {\n\t\tif (args.length != 4) {\n\t\t\tSystem.err.printf(\"usage: %s server_name port\\n\", args[1]);\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tIP = args[0];\n\t\tPORT = Integer.parseInt(args[1]);\n\t\tBUFFER_SIZE = Integer.parseInt(args[2]);\n\t\tMSG_RATE = Integer.parseInt(args[3]);\n\n\t\t//Validating Ip - Splitting the ip in 4 numbers because they are dividied by \". \" when we get from input\n\t\tString[] ipSeparated = args[0].split(\"\\\\.\");\n\n\t\tif(ipSeparated.length<4 ){\n\t\t\tSystem.out.println(\"Invalid IP format.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tif (ipSeparated.length == 4) {\n\n\t\t\tfor (int i = 0; i < ipSeparated.length; i++) {\n\t\t\t\tif (Integer.valueOf(ipSeparated[i]) < 0 || Integer.valueOf(ipSeparated[i]) > 255 ) {//if ip is not complete i get error\n\t\t\t\t\tSystem.out.println(\"Invalid IP format.\");\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}else {\n\t\t\t\t\tIP = args[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Validating Port - The Port number has to be between 0 adn 65535\n\t\tif (Integer.parseInt(args[1])>= 0 && Integer.parseInt(args[1]) < 65535) {\n\t\t\tPORT = Integer.parseInt((args[1]));\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Invalid PORT Number.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t//Validating Buffer - The Buffer Size ahs to be between 0 and 2048\n\t\tif (Integer.parseInt(args[2]) > 0 || Integer.parseInt(args[2]) < 2048) {\n\t\t\tBUFFER_SIZE = Integer.parseInt((args[2]));\n\t\t}\n\n\t\telse {\n\t\t\tSystem.out.println(\"Invalid Buffer Size.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t//Checking the parameter order of the deserved place for message rate\n\t\tif (Integer.parseInt(args[3]) >= 0) {\n\t\t\tMSG_RATE = Integer.parseInt(args[3]);\n\t\t} else {\n\t\t\tSystem.out.println(\"Message RATE Invalid.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t}", "@Test(expected = TrainException.class)\n\tpublic void testPassengerCarAlightWithNegativeDepartingPassengers() throws TrainException\n\t{\n\t\tInteger grossWeight = 1;\n\t\tInteger numberOfSeats = 10;\n\t\tInteger newPassengers = 5;\n\t\tInteger departingPassengers = -10;\n\t\t\n\t\tasgn2RollingStock.RollingStock passengerCarUnderTest = \n\t\t\tnew asgn2RollingStock.PassengerCar((Integer)grossWeight, (Integer)numberOfSeats);\n\t\t\n\t\t((asgn2RollingStock.PassengerCar)passengerCarUnderTest).board((Integer) newPassengers);\n\t\t\n\t\t((asgn2RollingStock.PassengerCar)passengerCarUnderTest).alight((Integer) departingPassengers );\n\t\t\n\t\t\n\t}", "private boolean getTiltParams(TiltParam tiltParam, final boolean doValidation) {\n if (dialog == null) {\n return false;\n }\n try {\n tiltParam.setUseGpu(dialog.isUseGpuEnabled() && dialog.isUseGpuSelected());\n boolean fiducialess = dialog.isFiducialess();\n tiltParam.setFiducialess(fiducialess);\n if (fiducialess) {\n tiltParam.setTiltAngleOffset(dialog.getTiltAngleOffset(doValidation));\n tiltParam.setZShift(dialog.getZShift(doValidation));\n }\n tiltParam.setXAxisTilt(dialog.getXAxisTiltTotal(doValidation));\n tiltParam.setImageBinned(getBinning());\n tiltParam.setThickness(dialog.getThickness(doValidation));\n updateMetaData();\n return true;\n }\n catch (FieldValidationFailedException e) {\n return false;\n }\n }", "public void testFLYING_ATTITUDE1() throws Exception {\n\t\tObject retval = execLexer(\"FLYING_ATTITUDE\", 212, \"volant\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"FLYING_ATTITUDE\", expecting, actual);\n\t}", "public void validateRpd8s23()\n {\n // This guideline cannot be automatically tested.\n }" ]
[ "0.68103987", "0.60651565", "0.56858623", "0.56714994", "0.56280434", "0.56141436", "0.5612667", "0.5560385", "0.551301", "0.5504334", "0.5491156", "0.5467965", "0.5459695", "0.5417644", "0.5407046", "0.5385279", "0.5381938", "0.5380206", "0.53660905", "0.53507614", "0.53437734", "0.5306801", "0.5278639", "0.52661103", "0.52564", "0.52463835", "0.52447295", "0.52434033", "0.52299696", "0.5228781", "0.5227959", "0.5223425", "0.5219166", "0.5212915", "0.5209989", "0.5202111", "0.51976866", "0.51730233", "0.5170045", "0.51629555", "0.5151449", "0.5151213", "0.51420254", "0.51386094", "0.51376987", "0.51352847", "0.51201123", "0.51117826", "0.5106728", "0.50988597", "0.50858873", "0.5079602", "0.5072036", "0.50642556", "0.50593936", "0.50535685", "0.5047194", "0.50448716", "0.50434655", "0.5040381", "0.5039836", "0.5039804", "0.5038027", "0.5027581", "0.50210965", "0.50131285", "0.5012705", "0.49921", "0.49910697", "0.49895436", "0.49894097", "0.49881583", "0.49826798", "0.49818358", "0.49815112", "0.49738225", "0.49643776", "0.49624506", "0.49612546", "0.4959454", "0.4957739", "0.4954679", "0.49499407", "0.49460906", "0.49454564", "0.49421164", "0.49402368", "0.49388164", "0.49382782", "0.49372712", "0.49352056", "0.49323267", "0.493198", "0.49305952", "0.4929282", "0.4927545", "0.49264836", "0.4925379", "0.49250177", "0.49228328" ]
0.64929986
1
.appscode.kubernetes.v1beta2.Meta meta = 1;
boolean hasMeta();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.appscode.api.kubernetes.v1beta2.Meta getMeta();", "com.appscode.api.kubernetes.v1beta2.MetaOrBuilder getMetaOrBuilder();", "public Object getMeta() {\n return meta;\n }", "public void setMeta (boolean meta) {\n\tthis.meta = meta;\n }", "public void setMeta(org.thdl.lex.component.Meta meta);", "default @org.jetbrains.annotations.Nullable imports.k8s.ObjectMeta getMetadata() {\n return null;\n }", "int getMeta();", "@javax.annotation.Nullable\n @ApiModelProperty(example = \"{\\\"jira\\\":{\\\"issue_id\\\":\\\"value\\\"}}\", value = \"Metadata attached to the incident. Top level values must be objects.\")\n\n public Object getMetadata() {\n return metadata;\n }", "@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1ObjectMeta getMetadata() {\n return this.metadata!=null ?this.metadata.build():null;\n }", "@JsonSetter(\"metadata\")\n public void setMetadata (Object value) {\n this.metadata = value;\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"\\\"Spring Boot REST API for Vertica Developer Training\\\"\")\n .version(\"1.0.0\")\n .license(\"Apache License Version 2.0\")\n .licenseUrl(\"https://www.apache.org/licenses/LICENSE-2.0\\\"\")\n .contact(new Contact(\"Thingtrack\", \"https://www.thingtrack.com\", \"[email protected]\"))\n .build();\n }", "public void setMetadata(PDMetadata meta) {\n/* 557 */ this.stream.setItem(COSName.METADATA, meta);\n/* */ }", "public org.thdl.lex.component.Meta getMeta();", "@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1ObjectMeta getMetadata();", "@Override\n\tpublic int getMeta() {\n\t\t\n\t\treturn meta;\n\t}", "public edu.ustb.sei.mde.morel.resource.morel.IMorelMetaInformation getMetaInformation();", "public boolean getMeta () {\n\treturn meta;\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"Spring Boot REST API for Testing Project\")\n .version(\"v1.0\")\n .contact(new Contact(\"Blagovest Anev\", \"https://www.linkedin.com/in/blagovestanev/\", \"[email protected]\"))\n .build();\n }", "public void setMetaFile(String newMetaFile) {\r\n metaFile = newMetaFile;\r\n }", "public MetaDataHolder getMetaOfMeta ()\n\t{\n\t\treturn metaData;\n\t}", "public int getMetadata(int meta)\n\t{\n\t\treturn meta;\n\t}", "public void setMetaValue(String metaValue) {\n this.metaValue = metaValue;\n }", "public String getMetaValue() {\n return metaValue;\n }", "public int getMetadata(int meta) \n\t{\n\t\treturn meta;\n\t}", "public void setMetaKey(String metaKey) {\n this.metaKey = metaKey;\n }", "private void AddMetaRegistrationInformation(Registration reg) {\n }", "@Deprecated\n public V1ObjectMeta getMetadata() {\n return this.metadata!=null ?this.metadata.build():null;\n }", "public String getMetaFile() {\r\n return metaFile;\r\n }", "public void setMetadata(PDMetadata meta)\n {\n stream.setItem(COSName.METADATA, meta);\n }", "public void setMetaData(MetaData newMetaData);", "public void setMetaId(java.lang.Integer metaId);", "public Builder setMeta(io.emqx.exhook.RequestMeta value) {\n if (metaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n meta_ = value;\n onChanged();\n } else {\n metaBuilder_.setMessage(value);\n }\n\n return this;\n }", "public String getMetaKey() {\n return metaKey;\n }", "public interface Meta {\r\n\r\n /**\r\n * Get the Type of the OSM object\r\n * \r\n * @return the Type\r\n */\r\n @NotNull\r\n default Type getType() {\r\n throw new IllegalArgumentException(\"getType is unsupported\");\r\n }\r\n\r\n /**\r\n * Get the OSM elements tags\r\n * \r\n * @return a Map of KV tupels\r\n */\r\n @Nullable\r\n default Map<String, String> getTags() {\r\n throw new IllegalArgumentException(\"getTags is unsupported\");\r\n }\r\n\r\n /**\r\n * Get the OSM display name\r\n * \r\n * @return the OSM display name\r\n */\r\n String getUser();\r\n\r\n /**\r\n * Get the OSM id of the object\r\n * \r\n * @return the OSM id of the object\r\n */\r\n long getId();\r\n\r\n /**\r\n * Get the version of the object\r\n * \r\n * @return the version of the object\r\n */\r\n long getVersion();\r\n\r\n /**\r\n * Get the changeset id for this object\r\n * \r\n * @return the changeset id for this object\r\n */\r\n long getChangeset();\r\n\r\n /**\r\n * Get the timestamp (when this version of the object was created)\r\n * \r\n * @return the timestamp in seconds since the Unic EPOCH\r\n */\r\n long getTimestamp();\r\n\r\n /**\r\n * Get the state of the object\r\n * \r\n * @return a State\r\n */\r\n @NotNull\r\n State getState();\r\n\r\n /**\r\n * If the object is a Way check if it is closed\r\n * \r\n * @return true if the way is closed\r\n */\r\n boolean isClosed();\r\n\r\n /**\r\n * If the object is a Way return the number of way nodes\r\n * \r\n * @return the number of way nodes\r\n */\r\n int getNodeCount();\r\n\r\n /**\r\n * If the object is a Node return the number of ways it is a member of\r\n * \r\n * @return the number of ways the Node is a member of\r\n */\r\n int getWayCount();\r\n\r\n /**\r\n * If the object is a Relation return the number of members it has\r\n * \r\n * If not implemented this returns -1 which should always evaluate to false\r\n * \r\n * @return the number of members the Relation has\r\n */\r\n default int getMemberCount() {\r\n return Range.UNINITALIZED;\r\n }\r\n\r\n /**\r\n * If the object is a Way and closed return the area it covers\r\n * \r\n * @return the area it covers in m^2\r\n */\r\n int getAreaSize();\r\n\r\n /**\r\n * If the object is a Way return its length\r\n * \r\n * @return the the length in m\r\n */\r\n int getWayLength();\r\n\r\n /**\r\n * Get any roles the element has in Relations\r\n * \r\n * @return a Collection containing the roles\r\n */\r\n @NotNull\r\n Collection<String> getRoles();\r\n\r\n /**\r\n * Check if the element is selected\r\n * \r\n * @return true if selected\r\n */\r\n boolean isSelected();\r\n\r\n /**\r\n * Check if a relation has a member with role\r\n * \r\n * @param role the role\r\n * @return true if there is a member with the role\r\n */\r\n boolean hasRole(@NotNull String role);\r\n\r\n /**\r\n * Get a preset from a path specification\r\n * \r\n * @param presetPath the path\r\n * @return an Object that should be a instance of a preset for the syste,\r\n */\r\n @Nullable\r\n Object getPreset(@NotNull String presetPath);\r\n\r\n /**\r\n * Check if the object matches with a preset or a preset group\r\n * \r\n * @param preset the path to the preset or group\r\n * @return true if the object matches\r\n */\r\n boolean matchesPreset(@NotNull Object preset);\r\n\r\n /**\r\n * Check if the element is incomplete (this is not defined in the documentation)\r\n * \r\n * @return true if incomplete\r\n */\r\n boolean isIncomplete();\r\n\r\n /**\r\n * Check if the element is in the current view\r\n * \r\n * @return true if in view\r\n */\r\n boolean isInview();\r\n\r\n /**\r\n * Check if the element and all member elements is in the current view\r\n * \r\n * @return true if in view\r\n */\r\n boolean isAllInview();\r\n\r\n /**\r\n * Check if the element is in the downloaded areas\r\n * \r\n * @return true if in view\r\n */\r\n boolean isInDownloadedArea();\r\n\r\n /**\r\n * Check if the element and all member elements is in the downloaded areas\r\n * \r\n * @return true if in view\r\n */\r\n boolean isAllInDownloadedArea();\r\n\r\n /**\r\n * Check if the current element is a child of an element\r\n * \r\n * @param type type of the element\r\n * @param element the meta interface to the element\r\n * @param parents a List of elements\r\n * @return true if element is a child\r\n */\r\n default boolean isChild(@NotNull Type type, @NotNull Meta element, @NotNull List<Object> parents) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if the current element is a parent of an element\r\n * \r\n * @param type type of the element\r\n * @param meta the meta interface to the element\r\n * @param children a List of elements\r\n * @return true if element is a parent\r\n */\r\n default boolean isParent(@NotNull Type type, @NotNull Meta meta, @NotNull List<Object> children) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Return a List of Elements that match the condition c\r\n * \r\n * This is necessary so that we can cache these results in the caller\r\n * \r\n * @param c the Condition\r\n * @return a List of elements\r\n */\r\n @NotNull\r\n default List<Object> getMatchingElements(@NotNull Condition c) {\r\n return new ArrayList<>();\r\n }\r\n \r\n /**\r\n * Get an Meta implementing object \r\n * \r\n * @param o imput object\r\n * @return returns something that implements this interface\r\n */\r\n @NotNull\r\n Meta wrap(Object o);\r\n}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "public SimilarProductBuilder meta(\n @Nullable final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) {\n this.meta = meta;\n return this;\n }", "public String meta(String opt, String key, String value) throws Exception;", "public io.emqx.exhook.RequestMeta getMeta() {\n if (metaBuilder_ == null) {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n } else {\n return metaBuilder_.getMessage();\n }\n }", "public void setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n }", "public VariableMeta getMeta();", "public MetaData getMetaData() {\n return metaData;\n }", "public Long getMetaId() {\n return metaId;\n }", "public void setMetaData(MetaData metaData) {\n this.metaData = metaData;\n }", "public void setMetaService(boolean metaService) {\n this.metaService = metaService;\n }", "private ApiInfo metadata() {\n\t\treturn new ApiInfoBuilder().title(\"# Online Home Decor Store #\")\n\t\t\t\t.description(\"Suppliers and Categories operations are present\").build();\t\n\t}", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "@Override\n public DataMapMeta getMeta() {\n return null;\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "@Override\n protected MetaData makeMetaData() {\n return new MetaData();\n }", "@Override\n public io.emqx.exhook.RequestMeta getMeta() {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }", "public Map getMetadata() {\n return metadata;\n }", "@java.lang.Override\n public com.google.protobuf.Struct getMetadata() {\n return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_;\n }", "@JsonGetter(\"metadata\")\n public Object getMetadata ( ) {\n return this.metadata;\n }", "public void setMetadata(RavenJObject metadata) {\n this.metadata = metadata;\n }", "public MetaData getMetaData();", "Metadata getMetaData();", "public java.lang.Integer getMetaId();", "@POST( CONTROLLER + METADATA_PATH )\n VersionedObjectKey createMetadataObject( @Body CreateMetadataObjectRequest request );", "public interface MetadataValue<V> extends VersionedValue<V> {\n\n long getCreated();\n\n int getLifespan();\n\n long getLastUsed();\n\n int getMaxIdle();\n\n}", "@InputFile\n @Incremental\n @PathSensitive(PathSensitivity.NAME_ONLY)\n @Optional\n public abstract RegularFileProperty getAppMetadata();", "public Object getMetadata() {\n return this.metadata;\n }", "public void setMetaUrl(String newMetaUrl) {\r\n metaUrl = newMetaUrl;\r\n }", "com.google.cloud.compute.v1.Metadata getMetadata();", "public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n if (metaBuilder_ != null) {\n return metaBuilder_.getMessageOrBuilder();\n } else {\n return meta_ == null ?\n io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }\n }", "public void write(IMetaData<?, ?> meta) throws IOException;", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "com.cmpe275.grpcComm.MetaData getMetaData();", "public boolean isSetMeta() {\n return this.meta != null;\n }", "public FRMetaInfo getMetaInfo() {\n\t\treturn metaInfo;\n\t}", "@java.lang.Override\n public io.grafeas.v1.Metadata getMetadata() {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n }", "@Override\n public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n return getMeta();\n }", "public void setMetaId(Long metaId) {\n this.metaId = metaId;\n }", "@Override\n public boolean hasMeta() {\n return meta_ != null;\n }", "public Vector<YANG_Meta> getMetas() {\n\t\treturn metas;\n\t}", "void update(MetaTag metaTag);", "void setMetaLocal(Map<Integer, String> newMetaTable);", "public CCAudioMetaData getMetaData() {\n\t\treturn meta;\n\t}", "void create(MetaTag metaTag);", "void setMetadataValue(String name, String value) throws IOException;", "@JsonProperty(\"fieldsV1\")\n public IoK8sApimachineryPkgApisMetaV1FieldsV1 getFieldsV1() {\n return fieldsV1;\n }", "Map<Integer, String> getMetaLocal();", "Map<String, String> getCustomMetadata();", "public Builder setMetadata(io.grafeas.v1.Metadata value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n metadata_ = value;\n } else {\n metadataBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata();", "public String getMetaUrl() {\r\n return metaUrl;\r\n }", "public final void mT__29() throws RecognitionException {\n try {\n int _type = T__29;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:28:7: ( 'meta' )\n // InternalMyDsl.g:28:9: 'meta'\n {\n match(\"meta\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "protected void setMetdata(HashMap<PageMetadataEnum,String> m ){\r\n\t\tthis.metadata = m; \r\n\t}", "@JsonProperty(\"metadata\")\n @ApiModelProperty(value = \"The metadata for the dialog node.\")\n public Object getMetadata() {\n return metadata;\n }", "public MetaDataController getMetaDataController() {\n return metaDataController;\n }", "private void setMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n metadata_ = value;\n bitField0_ |= 0x00000002;\n }", "@Valid\n @JsonProperty(\"metaTitle\")\n public LocalizedString getMetaTitle();" ]
[ "0.840164", "0.77114445", "0.6447995", "0.6434399", "0.636537", "0.6283877", "0.6151779", "0.607437", "0.6063908", "0.6041019", "0.59978956", "0.59543705", "0.593035", "0.5923061", "0.58797395", "0.586517", "0.5833123", "0.5794263", "0.5772853", "0.5747371", "0.57468265", "0.5736213", "0.57251734", "0.572477", "0.5629103", "0.5614685", "0.56118035", "0.5591339", "0.5544698", "0.55339456", "0.5532921", "0.5529633", "0.5524363", "0.55124056", "0.54909563", "0.5476809", "0.5475237", "0.5460853", "0.54345", "0.54322004", "0.543161", "0.543098", "0.542932", "0.5420863", "0.54175615", "0.53975385", "0.5368864", "0.5368864", "0.5368864", "0.5368864", "0.5368864", "0.5364762", "0.5352164", "0.5352164", "0.5352164", "0.5352164", "0.5352164", "0.5346163", "0.5337029", "0.5330687", "0.5327916", "0.53241134", "0.53168195", "0.5301623", "0.5294374", "0.5288979", "0.52859", "0.52690154", "0.526577", "0.52495277", "0.5248857", "0.52349603", "0.5219111", "0.52120805", "0.5204374", "0.520056", "0.51875204", "0.5176287", "0.51758254", "0.51741457", "0.5171425", "0.51706266", "0.5170197", "0.51663154", "0.5163452", "0.513553", "0.51330227", "0.51086646", "0.5104472", "0.50982016", "0.5093761", "0.50846094", "0.5082047", "0.5071533", "0.5063557", "0.50603783", "0.50510776", "0.5041009", "0.50355834", "0.5035259" ]
0.5188533
76
.appscode.kubernetes.v1beta2.Meta meta = 1;
com.appscode.api.kubernetes.v1beta2.Meta getMeta();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.appscode.api.kubernetes.v1beta2.MetaOrBuilder getMetaOrBuilder();", "public Object getMeta() {\n return meta;\n }", "public void setMeta (boolean meta) {\n\tthis.meta = meta;\n }", "public void setMeta(org.thdl.lex.component.Meta meta);", "default @org.jetbrains.annotations.Nullable imports.k8s.ObjectMeta getMetadata() {\n return null;\n }", "int getMeta();", "@javax.annotation.Nullable\n @ApiModelProperty(example = \"{\\\"jira\\\":{\\\"issue_id\\\":\\\"value\\\"}}\", value = \"Metadata attached to the incident. Top level values must be objects.\")\n\n public Object getMetadata() {\n return metadata;\n }", "@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1ObjectMeta getMetadata() {\n return this.metadata!=null ?this.metadata.build():null;\n }", "@JsonSetter(\"metadata\")\n public void setMetadata (Object value) {\n this.metadata = value;\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"\\\"Spring Boot REST API for Vertica Developer Training\\\"\")\n .version(\"1.0.0\")\n .license(\"Apache License Version 2.0\")\n .licenseUrl(\"https://www.apache.org/licenses/LICENSE-2.0\\\"\")\n .contact(new Contact(\"Thingtrack\", \"https://www.thingtrack.com\", \"[email protected]\"))\n .build();\n }", "public void setMetadata(PDMetadata meta) {\n/* 557 */ this.stream.setItem(COSName.METADATA, meta);\n/* */ }", "public org.thdl.lex.component.Meta getMeta();", "@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1ObjectMeta getMetadata();", "@Override\n\tpublic int getMeta() {\n\t\t\n\t\treturn meta;\n\t}", "public edu.ustb.sei.mde.morel.resource.morel.IMorelMetaInformation getMetaInformation();", "public boolean getMeta () {\n\treturn meta;\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"Spring Boot REST API for Testing Project\")\n .version(\"v1.0\")\n .contact(new Contact(\"Blagovest Anev\", \"https://www.linkedin.com/in/blagovestanev/\", \"[email protected]\"))\n .build();\n }", "public void setMetaFile(String newMetaFile) {\r\n metaFile = newMetaFile;\r\n }", "public MetaDataHolder getMetaOfMeta ()\n\t{\n\t\treturn metaData;\n\t}", "public int getMetadata(int meta)\n\t{\n\t\treturn meta;\n\t}", "public void setMetaValue(String metaValue) {\n this.metaValue = metaValue;\n }", "public String getMetaValue() {\n return metaValue;\n }", "public int getMetadata(int meta) \n\t{\n\t\treturn meta;\n\t}", "public void setMetaKey(String metaKey) {\n this.metaKey = metaKey;\n }", "private void AddMetaRegistrationInformation(Registration reg) {\n }", "@Deprecated\n public V1ObjectMeta getMetadata() {\n return this.metadata!=null ?this.metadata.build():null;\n }", "public String getMetaFile() {\r\n return metaFile;\r\n }", "public void setMetadata(PDMetadata meta)\n {\n stream.setItem(COSName.METADATA, meta);\n }", "public void setMetaData(MetaData newMetaData);", "public void setMetaId(java.lang.Integer metaId);", "public Builder setMeta(io.emqx.exhook.RequestMeta value) {\n if (metaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n meta_ = value;\n onChanged();\n } else {\n metaBuilder_.setMessage(value);\n }\n\n return this;\n }", "public String getMetaKey() {\n return metaKey;\n }", "public interface Meta {\r\n\r\n /**\r\n * Get the Type of the OSM object\r\n * \r\n * @return the Type\r\n */\r\n @NotNull\r\n default Type getType() {\r\n throw new IllegalArgumentException(\"getType is unsupported\");\r\n }\r\n\r\n /**\r\n * Get the OSM elements tags\r\n * \r\n * @return a Map of KV tupels\r\n */\r\n @Nullable\r\n default Map<String, String> getTags() {\r\n throw new IllegalArgumentException(\"getTags is unsupported\");\r\n }\r\n\r\n /**\r\n * Get the OSM display name\r\n * \r\n * @return the OSM display name\r\n */\r\n String getUser();\r\n\r\n /**\r\n * Get the OSM id of the object\r\n * \r\n * @return the OSM id of the object\r\n */\r\n long getId();\r\n\r\n /**\r\n * Get the version of the object\r\n * \r\n * @return the version of the object\r\n */\r\n long getVersion();\r\n\r\n /**\r\n * Get the changeset id for this object\r\n * \r\n * @return the changeset id for this object\r\n */\r\n long getChangeset();\r\n\r\n /**\r\n * Get the timestamp (when this version of the object was created)\r\n * \r\n * @return the timestamp in seconds since the Unic EPOCH\r\n */\r\n long getTimestamp();\r\n\r\n /**\r\n * Get the state of the object\r\n * \r\n * @return a State\r\n */\r\n @NotNull\r\n State getState();\r\n\r\n /**\r\n * If the object is a Way check if it is closed\r\n * \r\n * @return true if the way is closed\r\n */\r\n boolean isClosed();\r\n\r\n /**\r\n * If the object is a Way return the number of way nodes\r\n * \r\n * @return the number of way nodes\r\n */\r\n int getNodeCount();\r\n\r\n /**\r\n * If the object is a Node return the number of ways it is a member of\r\n * \r\n * @return the number of ways the Node is a member of\r\n */\r\n int getWayCount();\r\n\r\n /**\r\n * If the object is a Relation return the number of members it has\r\n * \r\n * If not implemented this returns -1 which should always evaluate to false\r\n * \r\n * @return the number of members the Relation has\r\n */\r\n default int getMemberCount() {\r\n return Range.UNINITALIZED;\r\n }\r\n\r\n /**\r\n * If the object is a Way and closed return the area it covers\r\n * \r\n * @return the area it covers in m^2\r\n */\r\n int getAreaSize();\r\n\r\n /**\r\n * If the object is a Way return its length\r\n * \r\n * @return the the length in m\r\n */\r\n int getWayLength();\r\n\r\n /**\r\n * Get any roles the element has in Relations\r\n * \r\n * @return a Collection containing the roles\r\n */\r\n @NotNull\r\n Collection<String> getRoles();\r\n\r\n /**\r\n * Check if the element is selected\r\n * \r\n * @return true if selected\r\n */\r\n boolean isSelected();\r\n\r\n /**\r\n * Check if a relation has a member with role\r\n * \r\n * @param role the role\r\n * @return true if there is a member with the role\r\n */\r\n boolean hasRole(@NotNull String role);\r\n\r\n /**\r\n * Get a preset from a path specification\r\n * \r\n * @param presetPath the path\r\n * @return an Object that should be a instance of a preset for the syste,\r\n */\r\n @Nullable\r\n Object getPreset(@NotNull String presetPath);\r\n\r\n /**\r\n * Check if the object matches with a preset or a preset group\r\n * \r\n * @param preset the path to the preset or group\r\n * @return true if the object matches\r\n */\r\n boolean matchesPreset(@NotNull Object preset);\r\n\r\n /**\r\n * Check if the element is incomplete (this is not defined in the documentation)\r\n * \r\n * @return true if incomplete\r\n */\r\n boolean isIncomplete();\r\n\r\n /**\r\n * Check if the element is in the current view\r\n * \r\n * @return true if in view\r\n */\r\n boolean isInview();\r\n\r\n /**\r\n * Check if the element and all member elements is in the current view\r\n * \r\n * @return true if in view\r\n */\r\n boolean isAllInview();\r\n\r\n /**\r\n * Check if the element is in the downloaded areas\r\n * \r\n * @return true if in view\r\n */\r\n boolean isInDownloadedArea();\r\n\r\n /**\r\n * Check if the element and all member elements is in the downloaded areas\r\n * \r\n * @return true if in view\r\n */\r\n boolean isAllInDownloadedArea();\r\n\r\n /**\r\n * Check if the current element is a child of an element\r\n * \r\n * @param type type of the element\r\n * @param element the meta interface to the element\r\n * @param parents a List of elements\r\n * @return true if element is a child\r\n */\r\n default boolean isChild(@NotNull Type type, @NotNull Meta element, @NotNull List<Object> parents) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if the current element is a parent of an element\r\n * \r\n * @param type type of the element\r\n * @param meta the meta interface to the element\r\n * @param children a List of elements\r\n * @return true if element is a parent\r\n */\r\n default boolean isParent(@NotNull Type type, @NotNull Meta meta, @NotNull List<Object> children) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Return a List of Elements that match the condition c\r\n * \r\n * This is necessary so that we can cache these results in the caller\r\n * \r\n * @param c the Condition\r\n * @return a List of elements\r\n */\r\n @NotNull\r\n default List<Object> getMatchingElements(@NotNull Condition c) {\r\n return new ArrayList<>();\r\n }\r\n \r\n /**\r\n * Get an Meta implementing object \r\n * \r\n * @param o imput object\r\n * @return returns something that implements this interface\r\n */\r\n @NotNull\r\n Meta wrap(Object o);\r\n}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "public SimilarProductBuilder meta(\n @Nullable final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) {\n this.meta = meta;\n return this;\n }", "public String meta(String opt, String key, String value) throws Exception;", "public io.emqx.exhook.RequestMeta getMeta() {\n if (metaBuilder_ == null) {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n } else {\n return metaBuilder_.getMessage();\n }\n }", "public VariableMeta getMeta();", "public void setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public Long getMetaId() {\n return metaId;\n }", "public void setMetaData(MetaData metaData) {\n this.metaData = metaData;\n }", "public void setMetaService(boolean metaService) {\n this.metaService = metaService;\n }", "private ApiInfo metadata() {\n\t\treturn new ApiInfoBuilder().title(\"# Online Home Decor Store #\")\n\t\t\t\t.description(\"Suppliers and Categories operations are present\").build();\t\n\t}", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "@Override\n public DataMapMeta getMeta() {\n return null;\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "@Override\n protected MetaData makeMetaData() {\n return new MetaData();\n }", "@Override\n public io.emqx.exhook.RequestMeta getMeta() {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }", "public Map getMetadata() {\n return metadata;\n }", "@java.lang.Override\n public com.google.protobuf.Struct getMetadata() {\n return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_;\n }", "@JsonGetter(\"metadata\")\n public Object getMetadata ( ) {\n return this.metadata;\n }", "public void setMetadata(RavenJObject metadata) {\n this.metadata = metadata;\n }", "public MetaData getMetaData();", "Metadata getMetaData();", "public java.lang.Integer getMetaId();", "@POST( CONTROLLER + METADATA_PATH )\n VersionedObjectKey createMetadataObject( @Body CreateMetadataObjectRequest request );", "public interface MetadataValue<V> extends VersionedValue<V> {\n\n long getCreated();\n\n int getLifespan();\n\n long getLastUsed();\n\n int getMaxIdle();\n\n}", "@InputFile\n @Incremental\n @PathSensitive(PathSensitivity.NAME_ONLY)\n @Optional\n public abstract RegularFileProperty getAppMetadata();", "public Object getMetadata() {\n return this.metadata;\n }", "public void setMetaUrl(String newMetaUrl) {\r\n metaUrl = newMetaUrl;\r\n }", "com.google.cloud.compute.v1.Metadata getMetadata();", "public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n if (metaBuilder_ != null) {\n return metaBuilder_.getMessageOrBuilder();\n } else {\n return meta_ == null ?\n io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }\n }", "public void write(IMetaData<?, ?> meta) throws IOException;", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "com.cmpe275.grpcComm.MetaData getMetaData();", "boolean hasMeta();", "public boolean isSetMeta() {\n return this.meta != null;\n }", "public FRMetaInfo getMetaInfo() {\n\t\treturn metaInfo;\n\t}", "@java.lang.Override\n public io.grafeas.v1.Metadata getMetadata() {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n }", "@Override\n public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n return getMeta();\n }", "public void setMetaId(Long metaId) {\n this.metaId = metaId;\n }", "public Vector<YANG_Meta> getMetas() {\n\t\treturn metas;\n\t}", "@Override\n public boolean hasMeta() {\n return meta_ != null;\n }", "void update(MetaTag metaTag);", "void setMetaLocal(Map<Integer, String> newMetaTable);", "public CCAudioMetaData getMetaData() {\n\t\treturn meta;\n\t}", "void create(MetaTag metaTag);", "void setMetadataValue(String name, String value) throws IOException;", "@JsonProperty(\"fieldsV1\")\n public IoK8sApimachineryPkgApisMetaV1FieldsV1 getFieldsV1() {\n return fieldsV1;\n }", "Map<Integer, String> getMetaLocal();", "Map<String, String> getCustomMetadata();", "public Builder setMetadata(io.grafeas.v1.Metadata value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n metadata_ = value;\n } else {\n metadataBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata();", "public String getMetaUrl() {\r\n return metaUrl;\r\n }", "public final void mT__29() throws RecognitionException {\n try {\n int _type = T__29;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:28:7: ( 'meta' )\n // InternalMyDsl.g:28:9: 'meta'\n {\n match(\"meta\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "protected void setMetdata(HashMap<PageMetadataEnum,String> m ){\r\n\t\tthis.metadata = m; \r\n\t}", "@JsonProperty(\"metadata\")\n @ApiModelProperty(value = \"The metadata for the dialog node.\")\n public Object getMetadata() {\n return metadata;\n }", "public MetaDataController getMetaDataController() {\n return metaDataController;\n }", "private void setMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n metadata_ = value;\n bitField0_ |= 0x00000002;\n }", "@Valid\n @JsonProperty(\"metaTitle\")\n public LocalizedString getMetaTitle();" ]
[ "0.77100915", "0.6446217", "0.64315665", "0.6363506", "0.6283592", "0.61509615", "0.6073143", "0.60623497", "0.60402894", "0.59977263", "0.59517795", "0.5928647", "0.59208447", "0.58776945", "0.58625346", "0.58303875", "0.5794218", "0.5771239", "0.5745612", "0.5744357", "0.5734664", "0.57238394", "0.57223266", "0.56264496", "0.56135577", "0.5610325", "0.55899537", "0.55417484", "0.553267", "0.5531102", "0.5528381", "0.5522787", "0.5512892", "0.5489319", "0.5475554", "0.5472748", "0.5460501", "0.5432567", "0.54304916", "0.54300135", "0.5429466", "0.54274386", "0.5419405", "0.54149187", "0.5397417", "0.5367198", "0.5367198", "0.5367198", "0.5367198", "0.5367198", "0.5363685", "0.5349876", "0.5349876", "0.5349876", "0.5349876", "0.5349876", "0.5345953", "0.5335913", "0.532935", "0.53268707", "0.53233224", "0.5315395", "0.5300146", "0.52923995", "0.5287914", "0.52852213", "0.52695906", "0.526636", "0.5248233", "0.52472454", "0.52341443", "0.5217663", "0.5210445", "0.52031904", "0.5199727", "0.51857126", "0.5184458", "0.5174349", "0.5174117", "0.51734525", "0.516945", "0.5168816", "0.51676893", "0.51655394", "0.5162557", "0.513283", "0.5131595", "0.51078296", "0.5104832", "0.50978726", "0.5092568", "0.5082774", "0.5080315", "0.50699514", "0.50607634", "0.5058895", "0.5050131", "0.5039157", "0.503471", "0.5034505" ]
0.8400092
0
.appscode.kubernetes.v1beta2.Meta meta = 1;
com.appscode.api.kubernetes.v1beta2.MetaOrBuilder getMetaOrBuilder();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.appscode.api.kubernetes.v1beta2.Meta getMeta();", "public Object getMeta() {\n return meta;\n }", "public void setMeta (boolean meta) {\n\tthis.meta = meta;\n }", "public void setMeta(org.thdl.lex.component.Meta meta);", "default @org.jetbrains.annotations.Nullable imports.k8s.ObjectMeta getMetadata() {\n return null;\n }", "int getMeta();", "@javax.annotation.Nullable\n @ApiModelProperty(example = \"{\\\"jira\\\":{\\\"issue_id\\\":\\\"value\\\"}}\", value = \"Metadata attached to the incident. Top level values must be objects.\")\n\n public Object getMetadata() {\n return metadata;\n }", "@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1ObjectMeta getMetadata() {\n return this.metadata!=null ?this.metadata.build():null;\n }", "@JsonSetter(\"metadata\")\n public void setMetadata (Object value) {\n this.metadata = value;\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"\\\"Spring Boot REST API for Vertica Developer Training\\\"\")\n .version(\"1.0.0\")\n .license(\"Apache License Version 2.0\")\n .licenseUrl(\"https://www.apache.org/licenses/LICENSE-2.0\\\"\")\n .contact(new Contact(\"Thingtrack\", \"https://www.thingtrack.com\", \"[email protected]\"))\n .build();\n }", "public void setMetadata(PDMetadata meta) {\n/* 557 */ this.stream.setItem(COSName.METADATA, meta);\n/* */ }", "public org.thdl.lex.component.Meta getMeta();", "@java.lang.Deprecated\n public io.kubernetes.client.openapi.models.V1ObjectMeta getMetadata();", "@Override\n\tpublic int getMeta() {\n\t\t\n\t\treturn meta;\n\t}", "public edu.ustb.sei.mde.morel.resource.morel.IMorelMetaInformation getMetaInformation();", "public boolean getMeta () {\n\treturn meta;\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"Spring Boot REST API for Testing Project\")\n .version(\"v1.0\")\n .contact(new Contact(\"Blagovest Anev\", \"https://www.linkedin.com/in/blagovestanev/\", \"[email protected]\"))\n .build();\n }", "public void setMetaFile(String newMetaFile) {\r\n metaFile = newMetaFile;\r\n }", "public MetaDataHolder getMetaOfMeta ()\n\t{\n\t\treturn metaData;\n\t}", "public int getMetadata(int meta)\n\t{\n\t\treturn meta;\n\t}", "public void setMetaValue(String metaValue) {\n this.metaValue = metaValue;\n }", "public String getMetaValue() {\n return metaValue;\n }", "public int getMetadata(int meta) \n\t{\n\t\treturn meta;\n\t}", "public void setMetaKey(String metaKey) {\n this.metaKey = metaKey;\n }", "private void AddMetaRegistrationInformation(Registration reg) {\n }", "@Deprecated\n public V1ObjectMeta getMetadata() {\n return this.metadata!=null ?this.metadata.build():null;\n }", "public String getMetaFile() {\r\n return metaFile;\r\n }", "public void setMetadata(PDMetadata meta)\n {\n stream.setItem(COSName.METADATA, meta);\n }", "public void setMetaData(MetaData newMetaData);", "public void setMetaId(java.lang.Integer metaId);", "public Builder setMeta(io.emqx.exhook.RequestMeta value) {\n if (metaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n meta_ = value;\n onChanged();\n } else {\n metaBuilder_.setMessage(value);\n }\n\n return this;\n }", "public String getMetaKey() {\n return metaKey;\n }", "public interface Meta {\r\n\r\n /**\r\n * Get the Type of the OSM object\r\n * \r\n * @return the Type\r\n */\r\n @NotNull\r\n default Type getType() {\r\n throw new IllegalArgumentException(\"getType is unsupported\");\r\n }\r\n\r\n /**\r\n * Get the OSM elements tags\r\n * \r\n * @return a Map of KV tupels\r\n */\r\n @Nullable\r\n default Map<String, String> getTags() {\r\n throw new IllegalArgumentException(\"getTags is unsupported\");\r\n }\r\n\r\n /**\r\n * Get the OSM display name\r\n * \r\n * @return the OSM display name\r\n */\r\n String getUser();\r\n\r\n /**\r\n * Get the OSM id of the object\r\n * \r\n * @return the OSM id of the object\r\n */\r\n long getId();\r\n\r\n /**\r\n * Get the version of the object\r\n * \r\n * @return the version of the object\r\n */\r\n long getVersion();\r\n\r\n /**\r\n * Get the changeset id for this object\r\n * \r\n * @return the changeset id for this object\r\n */\r\n long getChangeset();\r\n\r\n /**\r\n * Get the timestamp (when this version of the object was created)\r\n * \r\n * @return the timestamp in seconds since the Unic EPOCH\r\n */\r\n long getTimestamp();\r\n\r\n /**\r\n * Get the state of the object\r\n * \r\n * @return a State\r\n */\r\n @NotNull\r\n State getState();\r\n\r\n /**\r\n * If the object is a Way check if it is closed\r\n * \r\n * @return true if the way is closed\r\n */\r\n boolean isClosed();\r\n\r\n /**\r\n * If the object is a Way return the number of way nodes\r\n * \r\n * @return the number of way nodes\r\n */\r\n int getNodeCount();\r\n\r\n /**\r\n * If the object is a Node return the number of ways it is a member of\r\n * \r\n * @return the number of ways the Node is a member of\r\n */\r\n int getWayCount();\r\n\r\n /**\r\n * If the object is a Relation return the number of members it has\r\n * \r\n * If not implemented this returns -1 which should always evaluate to false\r\n * \r\n * @return the number of members the Relation has\r\n */\r\n default int getMemberCount() {\r\n return Range.UNINITALIZED;\r\n }\r\n\r\n /**\r\n * If the object is a Way and closed return the area it covers\r\n * \r\n * @return the area it covers in m^2\r\n */\r\n int getAreaSize();\r\n\r\n /**\r\n * If the object is a Way return its length\r\n * \r\n * @return the the length in m\r\n */\r\n int getWayLength();\r\n\r\n /**\r\n * Get any roles the element has in Relations\r\n * \r\n * @return a Collection containing the roles\r\n */\r\n @NotNull\r\n Collection<String> getRoles();\r\n\r\n /**\r\n * Check if the element is selected\r\n * \r\n * @return true if selected\r\n */\r\n boolean isSelected();\r\n\r\n /**\r\n * Check if a relation has a member with role\r\n * \r\n * @param role the role\r\n * @return true if there is a member with the role\r\n */\r\n boolean hasRole(@NotNull String role);\r\n\r\n /**\r\n * Get a preset from a path specification\r\n * \r\n * @param presetPath the path\r\n * @return an Object that should be a instance of a preset for the syste,\r\n */\r\n @Nullable\r\n Object getPreset(@NotNull String presetPath);\r\n\r\n /**\r\n * Check if the object matches with a preset or a preset group\r\n * \r\n * @param preset the path to the preset or group\r\n * @return true if the object matches\r\n */\r\n boolean matchesPreset(@NotNull Object preset);\r\n\r\n /**\r\n * Check if the element is incomplete (this is not defined in the documentation)\r\n * \r\n * @return true if incomplete\r\n */\r\n boolean isIncomplete();\r\n\r\n /**\r\n * Check if the element is in the current view\r\n * \r\n * @return true if in view\r\n */\r\n boolean isInview();\r\n\r\n /**\r\n * Check if the element and all member elements is in the current view\r\n * \r\n * @return true if in view\r\n */\r\n boolean isAllInview();\r\n\r\n /**\r\n * Check if the element is in the downloaded areas\r\n * \r\n * @return true if in view\r\n */\r\n boolean isInDownloadedArea();\r\n\r\n /**\r\n * Check if the element and all member elements is in the downloaded areas\r\n * \r\n * @return true if in view\r\n */\r\n boolean isAllInDownloadedArea();\r\n\r\n /**\r\n * Check if the current element is a child of an element\r\n * \r\n * @param type type of the element\r\n * @param element the meta interface to the element\r\n * @param parents a List of elements\r\n * @return true if element is a child\r\n */\r\n default boolean isChild(@NotNull Type type, @NotNull Meta element, @NotNull List<Object> parents) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if the current element is a parent of an element\r\n * \r\n * @param type type of the element\r\n * @param meta the meta interface to the element\r\n * @param children a List of elements\r\n * @return true if element is a parent\r\n */\r\n default boolean isParent(@NotNull Type type, @NotNull Meta meta, @NotNull List<Object> children) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Return a List of Elements that match the condition c\r\n * \r\n * This is necessary so that we can cache these results in the caller\r\n * \r\n * @param c the Condition\r\n * @return a List of elements\r\n */\r\n @NotNull\r\n default List<Object> getMatchingElements(@NotNull Condition c) {\r\n return new ArrayList<>();\r\n }\r\n \r\n /**\r\n * Get an Meta implementing object \r\n * \r\n * @param o imput object\r\n * @return returns something that implements this interface\r\n */\r\n @NotNull\r\n Meta wrap(Object o);\r\n}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "public SimilarProductBuilder meta(\n @Nullable final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) {\n this.meta = meta;\n return this;\n }", "public String meta(String opt, String key, String value) throws Exception;", "public io.emqx.exhook.RequestMeta getMeta() {\n if (metaBuilder_ == null) {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n } else {\n return metaBuilder_.getMessage();\n }\n }", "public VariableMeta getMeta();", "public MetaData getMetaData() {\n return metaData;\n }", "public void setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n }", "public Long getMetaId() {\n return metaId;\n }", "public void setMetaData(MetaData metaData) {\n this.metaData = metaData;\n }", "public void setMetaService(boolean metaService) {\n this.metaService = metaService;\n }", "private ApiInfo metadata() {\n\t\treturn new ApiInfoBuilder().title(\"# Online Home Decor Store #\")\n\t\t\t\t.description(\"Suppliers and Categories operations are present\").build();\t\n\t}", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "@Override\n public DataMapMeta getMeta() {\n return null;\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "public io.dstore.engine.MetaInformation.Builder addMetaInformationBuilder() {\n return getMetaInformationFieldBuilder().addBuilder(\n io.dstore.engine.MetaInformation.getDefaultInstance());\n }", "@Override\n protected MetaData makeMetaData() {\n return new MetaData();\n }", "@Override\n public io.emqx.exhook.RequestMeta getMeta() {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }", "public Map getMetadata() {\n return metadata;\n }", "@java.lang.Override\n public com.google.protobuf.Struct getMetadata() {\n return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_;\n }", "@JsonGetter(\"metadata\")\n public Object getMetadata ( ) {\n return this.metadata;\n }", "public void setMetadata(RavenJObject metadata) {\n this.metadata = metadata;\n }", "public MetaData getMetaData();", "Metadata getMetaData();", "public java.lang.Integer getMetaId();", "@POST( CONTROLLER + METADATA_PATH )\n VersionedObjectKey createMetadataObject( @Body CreateMetadataObjectRequest request );", "public interface MetadataValue<V> extends VersionedValue<V> {\n\n long getCreated();\n\n int getLifespan();\n\n long getLastUsed();\n\n int getMaxIdle();\n\n}", "@InputFile\n @Incremental\n @PathSensitive(PathSensitivity.NAME_ONLY)\n @Optional\n public abstract RegularFileProperty getAppMetadata();", "public Object getMetadata() {\n return this.metadata;\n }", "public void setMetaUrl(String newMetaUrl) {\r\n metaUrl = newMetaUrl;\r\n }", "com.google.cloud.compute.v1.Metadata getMetadata();", "public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n if (metaBuilder_ != null) {\n return metaBuilder_.getMessageOrBuilder();\n } else {\n return meta_ == null ?\n io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }\n }", "public void write(IMetaData<?, ?> meta) throws IOException;", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "com.cmpe275.grpcComm.MetaData getMetaData();", "boolean hasMeta();", "public boolean isSetMeta() {\n return this.meta != null;\n }", "public FRMetaInfo getMetaInfo() {\n\t\treturn metaInfo;\n\t}", "@java.lang.Override\n public io.grafeas.v1.Metadata getMetadata() {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n }", "@Override\n public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n return getMeta();\n }", "public Vector<YANG_Meta> getMetas() {\n\t\treturn metas;\n\t}", "public void setMetaId(Long metaId) {\n this.metaId = metaId;\n }", "@Override\n public boolean hasMeta() {\n return meta_ != null;\n }", "void update(MetaTag metaTag);", "void setMetaLocal(Map<Integer, String> newMetaTable);", "public CCAudioMetaData getMetaData() {\n\t\treturn meta;\n\t}", "void create(MetaTag metaTag);", "void setMetadataValue(String name, String value) throws IOException;", "@JsonProperty(\"fieldsV1\")\n public IoK8sApimachineryPkgApisMetaV1FieldsV1 getFieldsV1() {\n return fieldsV1;\n }", "Map<Integer, String> getMetaLocal();", "Map<String, String> getCustomMetadata();", "public Builder setMetadata(io.grafeas.v1.Metadata value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n metadata_ = value;\n } else {\n metadataBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata();", "public String getMetaUrl() {\r\n return metaUrl;\r\n }", "public final void mT__29() throws RecognitionException {\n try {\n int _type = T__29;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:28:7: ( 'meta' )\n // InternalMyDsl.g:28:9: 'meta'\n {\n match(\"meta\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "protected void setMetdata(HashMap<PageMetadataEnum,String> m ){\r\n\t\tthis.metadata = m; \r\n\t}", "@JsonProperty(\"metadata\")\n @ApiModelProperty(value = \"The metadata for the dialog node.\")\n public Object getMetadata() {\n return metadata;\n }", "public MetaDataController getMetaDataController() {\n return metaDataController;\n }", "private void setMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n metadata_ = value;\n bitField0_ |= 0x00000002;\n }", "@Valid\n @JsonProperty(\"metaTitle\")\n public LocalizedString getMetaTitle();" ]
[ "0.84015614", "0.6446532", "0.64301836", "0.6361175", "0.6284969", "0.61524224", "0.60744894", "0.60640615", "0.6040436", "0.59993744", "0.595063", "0.59297776", "0.59229", "0.5878918", "0.586408", "0.58311355", "0.57959616", "0.5769778", "0.57466024", "0.57450056", "0.5733774", "0.5724536", "0.57229644", "0.5625714", "0.56123877", "0.5611803", "0.55904853", "0.55404353", "0.5531796", "0.55303484", "0.55279815", "0.5523706", "0.5513741", "0.549074", "0.54752016", "0.54711866", "0.54594404", "0.54339844", "0.54316145", "0.5431069", "0.5429261", "0.5428223", "0.54182875", "0.5413332", "0.5398614", "0.5368193", "0.5368193", "0.5368193", "0.5368193", "0.5368193", "0.53642124", "0.53507495", "0.53507495", "0.53507495", "0.53507495", "0.53507495", "0.53460777", "0.53366274", "0.5331147", "0.5329812", "0.5324931", "0.5314671", "0.53018886", "0.52942944", "0.52893937", "0.52856344", "0.52714396", "0.52670985", "0.52499723", "0.5246224", "0.52359104", "0.52190083", "0.52091306", "0.5204842", "0.5201732", "0.51863533", "0.51845926", "0.51766086", "0.51763237", "0.5174443", "0.5170036", "0.5168379", "0.51679707", "0.51644266", "0.5161269", "0.51342976", "0.51304466", "0.5107394", "0.5106156", "0.5098859", "0.50939053", "0.5083959", "0.5083111", "0.5070385", "0.5060992", "0.5058965", "0.50522643", "0.5041209", "0.503597", "0.50353706" ]
0.77115244
1
repeated .appscode.kubernetes.v1beta2.Rule rules = 2;
java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> getRulesList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<? extends com.appscode.api.kubernetes.v1beta2.RuleOrBuilder> \n getRulesOrBuilderList();", "com.appscode.api.kubernetes.v1beta2.Rule getRules(int index);", "com.appscode.api.kubernetes.v1beta2.RuleOrBuilder getRulesOrBuilder(\n int index);", "public Rules getRules()\r\n {\r\n return rules;\r\n }", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public interface RulesManager extends RulesService {\n\n boolean applyPortForwardingRules(long ipAddressId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyPortForwardingRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account caller);\n\n void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller);\n\n boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId, Account caller) throws ResourceUnavailableException;\n\n boolean revokeAllPFStaticNatRulesForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException;\n\n List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId);\n\n /**\n * Returns a list of port forwarding rules that are ready for application\n * to the network elements for this ip.\n * \n * @param ip\n * @return List of PortForwardingRule\n */\n List<? extends PortForwardingRule> listPortForwardingRulesForApplication(long ipId);\n\n List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(List<? extends IpAddress> addrs);\n\n boolean revokePortForwardingRulesForVm(long vmId);\n\n boolean revokeStaticNatRulesForVm(long vmId);\n\n FirewallRule[] reservePorts(IpAddress ip, String protocol, FirewallRule.Purpose purpose, boolean openFirewall, Account caller, int... ports) throws NetworkRuleConflictException;\n\n boolean releasePorts(long ipId, String protocol, FirewallRule.Purpose purpose, int... ports);\n\n List<PortForwardingRuleVO> listByNetworkId(long networkId);\n\n boolean applyStaticNatForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void getSystemIpAndEnableStaticNatForVm(UserVm vm, boolean getNewIp) throws InsufficientAddressCapacityException;\n\n boolean disableStaticNat(long ipAddressId, Account caller, long callerUserId, boolean releaseIpIfElastic) throws ResourceUnavailableException;\n\n}", "@Override\n public List getRules() {\n return rules;\n }", "int getRulesCount();", "public ConfigurationValidator2D(VersionRules theRules){\n\t\tthis.theRules = theRules;\n\t}", "int getDetectionRulesCount();", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "IRuleset add(IRuleset...rules);", "List<? extends Rule> getRules();", "public abstract List<NARule> getRules(Context context);", "@Override\n public ResponseEntity<List<Rule>> getRules() {\n\n String apiKeyId = (String) servletRequest.getAttribute(\"Application\");\n Optional<List<RuleEntity>> ruleEntities = ruleRepository.findByApiKeyEntityValue(apiKeyId);\n List<Rule> rules = new ArrayList<>();\n\n if (ruleEntities.isPresent()) {\n for (RuleEntity ruleEntity : ruleEntities.get()) {\n rules.add(toRule(ruleEntity));\n }\n }\n\n return ResponseEntity.ok(rules);\n }", "Rule getRule();", "@Deprecated\n public List<V1IngressRule> getRules();", "void setRule(Rule rule);", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "public interface Rule {\n \n /**\n * Determine if a rule meets all of its conditions.\n * @param OpSystem The overall system for this rule.\n * @return true if the rule meets its condition.\n */\n public boolean meetsCondition(OpSystem system);\n}", "public void addRules(ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(value);\n }", "String getRules();", "public Slicing setRules(BoundCodeDt<SlicingRulesEnum> theValue) {\n\t\tmyRules = theValue;\n\t\treturn this;\n\t}", "public void add_rule(Rule rule) throws Exception;", "com.google.privacy.dlp.v2.CustomInfoType.DetectionRule getDetectionRules(int index);", "public Slicing setRules(SlicingRulesEnum theValue) {\n\t\tgetRulesElement().setValueAsEnum(theValue);\n\t\treturn this;\n\t}", "public void setRule(int rule) {\n\t\tthis.rule = rule;\n\t}", "@Bean\n public RulesEngine getRulesEngine() {\n return new DefaultRulesEngine(new RulesEngineParameters().skipOnFirstAppliedRule(false));\n }", "private void loadRules2() {\n\t\t\r\n\t\tint type = Integer.valueOf(env.getProperty(\"sentinel.server.type\")) ;\r\n\t\t\r\n String appId = \"sentinel-demo\";\r\n String apolloMetaServerAddress = \"http://10.1.77.106:8080\";\r\n System.setProperty(\"app.id\", appId);\r\n System.setProperty(\"apollo.meta\", apolloMetaServerAddress);\r\n\r\n String namespaceName = \"application\";\r\n String flowRuleKey = \"flowRules\";\r\n // It's better to provide a meaningful default value.\r\n String defaultFlowRules = \"[]\";\r\n\r\n ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new ApolloDataSource<>(namespaceName,\r\n flowRuleKey, defaultFlowRules, source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {\r\n }));\r\n FlowRuleManager.register2Property(flowRuleDataSource.getProperty());\r\n ClusterFlowRuleManager.setPropertySupplier(namespace ->flowRuleDataSource.getProperty());\r\n \r\n\r\n\t\tif (ClusterStateManager.CLUSTER_SERVER == type) \r\n\t\t{\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_SERVER);\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_CLIENT);\r\n\t\t\tinitClientConfigProperty(namespaceName);\r\n\t\t\tinitClientServerAssignProperty(namespaceName);\r\n\t\t}\r\n \r\n \r\n \r\n \r\n }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public ArrayList<String> getRules() {\n return rules;\n }", "@Override\r\npublic void initRules(){\r\n\t\r\n}", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "public interface KubernetesSecretRule extends ExtensionPoint {\n\n /**\n * Check if the secret should be excluded.\n * @param secret secret will be checked.\n * @return true, if the secret should be excluded.\n */\n boolean exclude(V1Secret secret);\n\n static ExtensionList<KubernetesSecretRule> all() {\n return ExtensionList.lookup(KubernetesSecretRule.class);\n }\n\n static boolean shouldExclude(V1Secret secret) {\n ExtensionList<KubernetesSecretRule> filters = all();\n\n return filters.stream().anyMatch(e -> e.exclude(secret));\n }\n\n}", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "com.google.protobuf.ByteString\n getRuleBytes();", "@PUT(\"pushrules/global/{kind}/{ruleId}\")\n Call<Void> addRule(@Path(\"kind\") String kind, @Path(\"ruleId\") String ruleId, @Body JsonElement rule);", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "private void actOnRules() {\r\n\r\n\t\tfor(String key: myRuleBook.keySet())\r\n\t\t{\r\n\r\n\t\t\tRule rule = myRuleBook.get(key);\r\n\t\t\tSpriteGroup[] obedients = myRuleMap.get(rule);\r\n\r\n\t\t\tif(rule.isSatisfied(obedients))\r\n\t\t\t{\r\n\t\t\t\trule.enforce(obedients);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public TypeCheckerProofRule getRule ( ) ;", "@GET(\"pushrules/\")\n Call<PushRulesResponse> getAllRules();", "public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}", "IRuleset add(IRuleset rule);", "public void setRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.set(index, value);\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void addRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(index, value);\n }", "ConstRule createConstRule();", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "public int getNumberOfRules() {\n\t\treturn this.patternActionRules.size();\n\t}", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "FirewallRuleService firewallrule();", "FlowRule build();", "public void setRules(final ArrayList<NetworkSecurityRule> rulesValue) {\n this.rules = rulesValue;\n }", "public interface EntityOrAssetRule extends Rule {\n /**\n * Return the component id of the Entity or Asset that this rule should\n * belong to.\n * @return The component id.\n */\n public String getComponentId();\n \n /**\n * Given a mission objective and a system, find the corresponding component\n * to this rule, and add this rule to that component.\n * @param objective The mission objective.\n * @param system The system containing the component for this rule.\n */\n public void addToComponent(String objective, OpSystem system);\n}", "public int numberOfBrokenRules()\n {\n return mBrokenRules.size();\n }", "CmdRule createCmdRule();", "ControlBlockRule createControlBlockRule();", "@Test\n public void ruleNameTest() {\n // TODO: test ruleName\n }", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "E8Rule createE8Rule();", "@Override\n public List<Rule> getPriceRules() {\n return List.of(getMatchTravelCardHolderRule());\n }", "public HashMap<String,Rule> get_rules_to_action() throws Exception;", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public void setRule(java.lang.String rule) {\n this.rule = rule;\n }", "E9Rule createE9Rule();", "void checkRule(String rule) throws IOException;", "public void setRule(final String rule) {\r\n this.rule = rule;\r\n }", "public abstract void setRules (CellProfile rules);", "public interface Rule {\n\n /**\n * Process this security event and detects whether this represents a security breach from the perspective of this rule\n * \n * @param event\n * event to process\n * @return security breach - either a breach or not (could be delayed)\n */\n SecurityBreach isSecurityBreach(SecurityEvent event);\n\n /**\n * Detects whether this rule is applicable in the in-passed security mode. Each rule guarantees to return the very same value of this method at\n * runtime. E.g. if this method returns true for an instance, it is guaranteed it will always return true within the lifecycle of this object\n * \n * @param securityMode\n * security mode to test applicability of this rule against\n * @return true if so, false otherwise\n */\n boolean isApplicable(SecurityMode securityMode);\n\n /**\n * Detects whether this rule is enabled or not\n * \n * @return true if so, false otherwise\n */\n boolean isEnabled();\n\n /**\n * Get human readable description of this rule. It should be a unique string compared to all other rules\n * \n * @return unique description of this rule\n */\n String getDescription();\n\n /**\n * Gets Unique ID of this Rule\n * \n * @return integer identification of this rule\n */\n int getId();\n\n /**\n * Update this rule based on the in-passed rule detail (e.g. whether it is enabled, etc)\n * \n * @param ruleDetail\n * rule detail to use to update this rule\n */\n void updateFrom(RuleDetail ruleDetail);\n}", "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "public ValidationRule getRule()\r\n {\r\n return rule;\r\n }", "public interface FlowRule extends PiTranslatable {\n\n IndexTableId DEFAULT_TABLE = IndexTableId.of(0);\n int MAX_TIMEOUT = 60;\n int MIN_PRIORITY = 0;\n int MAX_PRIORITY = 65535;\n\n /**\n * Reason for flow parameter received from switches.\n * Used to check reason parameter in flows.\n */\n enum FlowRemoveReason {\n IDLE_TIMEOUT,\n HARD_TIMEOUT,\n DELETE,\n GROUP_DELETE,\n METER_DELETE,\n EVICTION,\n NO_REASON;\n\n /**\n * Covert short to enum.\n * @return reason in enum\n * @param reason remove reason in integer\n */\n public static FlowRemoveReason parseShort(short reason) {\n switch (reason) {\n case -1 :\n return NO_REASON;\n case 0:\n return IDLE_TIMEOUT;\n case 1:\n return HARD_TIMEOUT;\n case 2 :\n return DELETE;\n case 3:\n return GROUP_DELETE;\n case 4:\n return METER_DELETE;\n case 5:\n return EVICTION;\n default :\n return NO_REASON;\n }\n }\n }\n\n /**\n * Returns the ID of this flow.\n *\n * @return the flow ID\n */\n FlowId id();\n\n /**\n * Returns the application id of this flow.\n *\n * @return an applicationId\n */\n short appId();\n\n /**\n * Returns the group id of this flow.\n *\n * @return an groupId\n */\n GroupId groupId();\n\n /**\n * Returns the flow rule priority given in natural order; higher numbers\n * mean higher priorities.\n *\n * @return flow rule priority\n */\n int priority();\n\n /**\n * Returns the identity of the device where this rule applies.\n *\n * @return device identifier\n */\n DeviceId deviceId();\n\n /**\n * Returns the traffic selector that identifies what traffic this rule\n * should apply to.\n *\n * @return traffic selector\n */\n TrafficSelector selector();\n\n /**\n * Returns the traffic treatment that applies to selected traffic.\n *\n * @return traffic treatment\n */\n TrafficTreatment treatment();\n\n /**\n * Returns the timeout for this flow requested by an application.\n *\n * @return integer value of the timeout\n */\n int timeout();\n\n /**\n * Returns the hard timeout for this flow requested by an application.\n * This parameter configure switch's flow hard timeout.\n * In case of controller-switch connection lost, this variable can be useful.\n * @return integer value of the hard Timeout\n */\n int hardTimeout();\n\n /**\n * Returns the reason for the flow received from switches.\n *\n * @return FlowRemoveReason value of reason\n */\n FlowRemoveReason reason();\n\n /**\n * Returns whether the flow is permanent i.e. does not time out.\n *\n * @return true if the flow is permanent, otherwise false\n */\n boolean isPermanent();\n\n /**\n * Returns the table id for this rule.\n *\n * @return an integer.\n * @deprecated in Loon release (version 1.11.0). Use {@link #table()} instead.\n */\n @Deprecated\n int tableId();\n\n /**\n * Returns the table identifier for this rule.\n *\n * @return a table identifier.\n */\n TableId table();\n\n /**\n * {@inheritDoc}\n *\n * Equality for flow rules only considers 'match equality'. This means that\n * two flow rules with the same match conditions will be equal, regardless\n * of the treatment or other characteristics of the flow.\n *\n * @param obj the reference object with which to compare.\n * @return {@code true} if this object is the same as the obj\n * argument; {@code false} otherwise.\n */\n boolean equals(Object obj);\n\n /**\n * Returns whether this flow rule is an exact match to the flow rule given\n * in the argument.\n * <p>\n * Exact match means that deviceId, priority, selector,\n * tableId, flowId and treatment are equal. Note that this differs from\n * the notion of object equality for flow rules, which does not consider the\n * flowId or treatment when testing equality.\n * </p>\n *\n * @param rule other rule to match against\n * @return true if the rules are an exact match, otherwise false\n */\n boolean exactMatch(FlowRule rule);\n\n /**\n * A flowrule builder.\n */\n interface Builder {\n\n /**\n * Assigns a cookie value to this flowrule. Mutually exclusive with the\n * fromApp method. This method is intended to take a cookie value from\n * the dataplane and not from the application.\n *\n * @param cookie a long value\n * @return this\n */\n Builder withCookie(long cookie);\n\n /**\n * Assigns the application that built this flow rule to this object.\n * The short value of the appId will be used as a basis for the\n * cookie value computation. It is expected that application use this\n * call to set their application id.\n *\n * @param appId an application id\n * @return this\n */\n Builder fromApp(ApplicationId appId);\n\n /**\n * Sets the priority for this flow rule.\n *\n * @param priority an integer\n * @return this\n */\n Builder withPriority(int priority);\n\n /**\n * Sets the deviceId for this flow rule.\n *\n * @param deviceId a device id\n * @return this\n */\n Builder forDevice(DeviceId deviceId);\n\n /**\n * Sets the table id for this flow rule, when the identifier is of type {@link TableId.Type#INDEX}. Default\n * value is 0.\n * <p>\n * <em>Important:</em> This method is left here for backward compatibility with applications that specifies\n * table identifiers using integers, e.g. as in OpenFlow. Currently there is no plan to deprecate this method,\n * however, new applications should favor using {@link #forTable(TableId)}.\n *\n * @param tableId an integer\n * @return this\n */\n Builder forTable(int tableId);\n\n /**\n * Sets the table identifier for this flow rule.\n * Default identifier is of type {@link TableId.Type#INDEX} and value 0.\n *\n * @param tableId table identifier\n * @return this\n */\n Builder forTable(TableId tableId);\n\n /**\n * Sets the selector (or match field) for this flow rule.\n *\n * @param selector a traffic selector\n * @return this\n */\n Builder withSelector(TrafficSelector selector);\n\n /**\n * Sets the traffic treatment for this flow rule.\n *\n * @param treatment a traffic treatment\n * @return this\n */\n Builder withTreatment(TrafficTreatment treatment);\n\n /**\n * Makes this rule permanent on the dataplane.\n *\n * @return this\n */\n Builder makePermanent();\n\n /**\n * Makes this rule temporary and timeout after the specified amount\n * of time.\n *\n * @param timeout an integer\n * @return this\n */\n Builder makeTemporary(int timeout);\n\n /**\n * Sets the idle timeout parameter in flow table.\n *\n * Will automatically make it permanent or temporary if the timeout is 0 or not, respectively.\n * @param timeout an integer\n * @return this\n */\n default Builder withIdleTimeout(int timeout) {\n if (timeout == 0) {\n return makePermanent();\n } else {\n return makeTemporary(timeout);\n }\n }\n\n /**\n * Sets hard timeout parameter in flow table.\n * @param timeout an integer\n * @return this\n */\n Builder withHardTimeout(int timeout);\n\n /**\n * Sets reason parameter received from switches .\n * @param reason a short\n * @return this\n */\n Builder withReason(FlowRemoveReason reason);\n\n /**\n * Builds a flow rule object.\n *\n * @return a flow rule.\n */\n FlowRule build();\n\n }\n}", "public Builder setRuleBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n rule_ = value;\n onChanged();\n return this;\n }" ]
[ "0.6758241", "0.66073847", "0.6288047", "0.5882989", "0.58308566", "0.58160627", "0.56775767", "0.5629937", "0.5585979", "0.558538", "0.5547636", "0.5541968", "0.553581", "0.5533254", "0.55036545", "0.55036545", "0.55036545", "0.5481315", "0.54485416", "0.5419642", "0.53476197", "0.5337188", "0.53014475", "0.53004724", "0.52729964", "0.52644557", "0.526205", "0.52599156", "0.52554446", "0.52106124", "0.51971495", "0.5167773", "0.5162868", "0.5143033", "0.51352286", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.51316065", "0.51162964", "0.51018506", "0.5070313", "0.50133187", "0.501097", "0.5006078", "0.5005819", "0.499506", "0.49879688", "0.4986693", "0.49839061", "0.49765792", "0.49757215", "0.49669006", "0.49591646", "0.4949548", "0.49479246", "0.48998997", "0.4894581", "0.48887685", "0.48873442", "0.48845914", "0.4870449", "0.4862182", "0.4850548", "0.4848361", "0.48347676", "0.48257735", "0.48255107", "0.48247758", "0.48231375", "0.48219362", "0.48191807", "0.48171392", "0.4809339", "0.48059994", "0.48044145", "0.48017424", "0.4799419", "0.4795082", "0.47944537", "0.4792266", "0.47912973", "0.47909856", "0.47841352", "0.47763908", "0.47743317", "0.47739196", "0.47724056", "0.47707915" ]
0.6324158
2
repeated .appscode.kubernetes.v1beta2.Rule rules = 2;
com.appscode.api.kubernetes.v1beta2.Rule getRules(int index);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<? extends com.appscode.api.kubernetes.v1beta2.RuleOrBuilder> \n getRulesOrBuilderList();", "java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> \n getRulesList();", "com.appscode.api.kubernetes.v1beta2.RuleOrBuilder getRulesOrBuilder(\n int index);", "public Rules getRules()\r\n {\r\n return rules;\r\n }", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public interface RulesManager extends RulesService {\n\n boolean applyPortForwardingRules(long ipAddressId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyPortForwardingRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account caller);\n\n void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller);\n\n boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId, Account caller) throws ResourceUnavailableException;\n\n boolean revokeAllPFStaticNatRulesForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException;\n\n List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId);\n\n /**\n * Returns a list of port forwarding rules that are ready for application\n * to the network elements for this ip.\n * \n * @param ip\n * @return List of PortForwardingRule\n */\n List<? extends PortForwardingRule> listPortForwardingRulesForApplication(long ipId);\n\n List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(List<? extends IpAddress> addrs);\n\n boolean revokePortForwardingRulesForVm(long vmId);\n\n boolean revokeStaticNatRulesForVm(long vmId);\n\n FirewallRule[] reservePorts(IpAddress ip, String protocol, FirewallRule.Purpose purpose, boolean openFirewall, Account caller, int... ports) throws NetworkRuleConflictException;\n\n boolean releasePorts(long ipId, String protocol, FirewallRule.Purpose purpose, int... ports);\n\n List<PortForwardingRuleVO> listByNetworkId(long networkId);\n\n boolean applyStaticNatForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void getSystemIpAndEnableStaticNatForVm(UserVm vm, boolean getNewIp) throws InsufficientAddressCapacityException;\n\n boolean disableStaticNat(long ipAddressId, Account caller, long callerUserId, boolean releaseIpIfElastic) throws ResourceUnavailableException;\n\n}", "@Override\n public List getRules() {\n return rules;\n }", "int getRulesCount();", "public ConfigurationValidator2D(VersionRules theRules){\n\t\tthis.theRules = theRules;\n\t}", "int getDetectionRulesCount();", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "IRuleset add(IRuleset...rules);", "List<? extends Rule> getRules();", "public abstract List<NARule> getRules(Context context);", "@Override\n public ResponseEntity<List<Rule>> getRules() {\n\n String apiKeyId = (String) servletRequest.getAttribute(\"Application\");\n Optional<List<RuleEntity>> ruleEntities = ruleRepository.findByApiKeyEntityValue(apiKeyId);\n List<Rule> rules = new ArrayList<>();\n\n if (ruleEntities.isPresent()) {\n for (RuleEntity ruleEntity : ruleEntities.get()) {\n rules.add(toRule(ruleEntity));\n }\n }\n\n return ResponseEntity.ok(rules);\n }", "Rule getRule();", "void setRule(Rule rule);", "@Deprecated\n public List<V1IngressRule> getRules();", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "public interface Rule {\n \n /**\n * Determine if a rule meets all of its conditions.\n * @param OpSystem The overall system for this rule.\n * @return true if the rule meets its condition.\n */\n public boolean meetsCondition(OpSystem system);\n}", "public void addRules(ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(value);\n }", "String getRules();", "public Slicing setRules(BoundCodeDt<SlicingRulesEnum> theValue) {\n\t\tmyRules = theValue;\n\t\treturn this;\n\t}", "public void add_rule(Rule rule) throws Exception;", "com.google.privacy.dlp.v2.CustomInfoType.DetectionRule getDetectionRules(int index);", "public Slicing setRules(SlicingRulesEnum theValue) {\n\t\tgetRulesElement().setValueAsEnum(theValue);\n\t\treturn this;\n\t}", "public void setRule(int rule) {\n\t\tthis.rule = rule;\n\t}", "@Bean\n public RulesEngine getRulesEngine() {\n return new DefaultRulesEngine(new RulesEngineParameters().skipOnFirstAppliedRule(false));\n }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "private void loadRules2() {\n\t\t\r\n\t\tint type = Integer.valueOf(env.getProperty(\"sentinel.server.type\")) ;\r\n\t\t\r\n String appId = \"sentinel-demo\";\r\n String apolloMetaServerAddress = \"http://10.1.77.106:8080\";\r\n System.setProperty(\"app.id\", appId);\r\n System.setProperty(\"apollo.meta\", apolloMetaServerAddress);\r\n\r\n String namespaceName = \"application\";\r\n String flowRuleKey = \"flowRules\";\r\n // It's better to provide a meaningful default value.\r\n String defaultFlowRules = \"[]\";\r\n\r\n ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new ApolloDataSource<>(namespaceName,\r\n flowRuleKey, defaultFlowRules, source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {\r\n }));\r\n FlowRuleManager.register2Property(flowRuleDataSource.getProperty());\r\n ClusterFlowRuleManager.setPropertySupplier(namespace ->flowRuleDataSource.getProperty());\r\n \r\n\r\n\t\tif (ClusterStateManager.CLUSTER_SERVER == type) \r\n\t\t{\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_SERVER);\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_CLIENT);\r\n\t\t\tinitClientConfigProperty(namespaceName);\r\n\t\t\tinitClientServerAssignProperty(namespaceName);\r\n\t\t}\r\n \r\n \r\n \r\n \r\n }", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public ArrayList<String> getRules() {\n return rules;\n }", "@Override\r\npublic void initRules(){\r\n\t\r\n}", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "public interface KubernetesSecretRule extends ExtensionPoint {\n\n /**\n * Check if the secret should be excluded.\n * @param secret secret will be checked.\n * @return true, if the secret should be excluded.\n */\n boolean exclude(V1Secret secret);\n\n static ExtensionList<KubernetesSecretRule> all() {\n return ExtensionList.lookup(KubernetesSecretRule.class);\n }\n\n static boolean shouldExclude(V1Secret secret) {\n ExtensionList<KubernetesSecretRule> filters = all();\n\n return filters.stream().anyMatch(e -> e.exclude(secret));\n }\n\n}", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "com.google.protobuf.ByteString\n getRuleBytes();", "@PUT(\"pushrules/global/{kind}/{ruleId}\")\n Call<Void> addRule(@Path(\"kind\") String kind, @Path(\"ruleId\") String ruleId, @Body JsonElement rule);", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "private void actOnRules() {\r\n\r\n\t\tfor(String key: myRuleBook.keySet())\r\n\t\t{\r\n\r\n\t\t\tRule rule = myRuleBook.get(key);\r\n\t\t\tSpriteGroup[] obedients = myRuleMap.get(rule);\r\n\r\n\t\t\tif(rule.isSatisfied(obedients))\r\n\t\t\t{\r\n\t\t\t\trule.enforce(obedients);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public TypeCheckerProofRule getRule ( ) ;", "@GET(\"pushrules/\")\n Call<PushRulesResponse> getAllRules();", "public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}", "IRuleset add(IRuleset rule);", "public void setRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.set(index, value);\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void addRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(index, value);\n }", "ConstRule createConstRule();", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "public int getNumberOfRules() {\n\t\treturn this.patternActionRules.size();\n\t}", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "FirewallRuleService firewallrule();", "public void setRules(final ArrayList<NetworkSecurityRule> rulesValue) {\n this.rules = rulesValue;\n }", "FlowRule build();", "public interface EntityOrAssetRule extends Rule {\n /**\n * Return the component id of the Entity or Asset that this rule should\n * belong to.\n * @return The component id.\n */\n public String getComponentId();\n \n /**\n * Given a mission objective and a system, find the corresponding component\n * to this rule, and add this rule to that component.\n * @param objective The mission objective.\n * @param system The system containing the component for this rule.\n */\n public void addToComponent(String objective, OpSystem system);\n}", "ControlBlockRule createControlBlockRule();", "CmdRule createCmdRule();", "public int numberOfBrokenRules()\n {\n return mBrokenRules.size();\n }", "@Test\n public void ruleNameTest() {\n // TODO: test ruleName\n }", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "E8Rule createE8Rule();", "@Override\n public List<Rule> getPriceRules() {\n return List.of(getMatchTravelCardHolderRule());\n }", "public HashMap<String,Rule> get_rules_to_action() throws Exception;", "public void setRule(java.lang.String rule) {\n this.rule = rule;\n }", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public void setRule(final String rule) {\r\n this.rule = rule;\r\n }", "void checkRule(String rule) throws IOException;", "E9Rule createE9Rule();", "public abstract void setRules (CellProfile rules);", "public interface Rule {\n\n /**\n * Process this security event and detects whether this represents a security breach from the perspective of this rule\n * \n * @param event\n * event to process\n * @return security breach - either a breach or not (could be delayed)\n */\n SecurityBreach isSecurityBreach(SecurityEvent event);\n\n /**\n * Detects whether this rule is applicable in the in-passed security mode. Each rule guarantees to return the very same value of this method at\n * runtime. E.g. if this method returns true for an instance, it is guaranteed it will always return true within the lifecycle of this object\n * \n * @param securityMode\n * security mode to test applicability of this rule against\n * @return true if so, false otherwise\n */\n boolean isApplicable(SecurityMode securityMode);\n\n /**\n * Detects whether this rule is enabled or not\n * \n * @return true if so, false otherwise\n */\n boolean isEnabled();\n\n /**\n * Get human readable description of this rule. It should be a unique string compared to all other rules\n * \n * @return unique description of this rule\n */\n String getDescription();\n\n /**\n * Gets Unique ID of this Rule\n * \n * @return integer identification of this rule\n */\n int getId();\n\n /**\n * Update this rule based on the in-passed rule detail (e.g. whether it is enabled, etc)\n * \n * @param ruleDetail\n * rule detail to use to update this rule\n */\n void updateFrom(RuleDetail ruleDetail);\n}", "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "public ValidationRule getRule()\r\n {\r\n return rule;\r\n }", "@Override\n public List<Rule> getTotalRules() {\n return List.of(getTotalGreaterThan60Rule());\n }", "public Builder setRuleBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n rule_ = value;\n onChanged();\n return this;\n }" ]
[ "0.6759394", "0.6326128", "0.62893647", "0.58856606", "0.58349943", "0.58201325", "0.5679799", "0.5631358", "0.55889016", "0.5586249", "0.5550243", "0.55422217", "0.5539352", "0.5535983", "0.5505566", "0.5505566", "0.5505566", "0.54821724", "0.54510593", "0.54220575", "0.534961", "0.53392154", "0.53044033", "0.5303126", "0.52762437", "0.5266542", "0.52651465", "0.52626354", "0.52581", "0.5213075", "0.51981425", "0.51697505", "0.5166782", "0.51444465", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.5137854", "0.51378363", "0.5132829", "0.51194966", "0.5103526", "0.5071854", "0.50129837", "0.5012546", "0.5009812", "0.50081575", "0.49979517", "0.49908105", "0.49890324", "0.4985774", "0.49783748", "0.4977198", "0.4969139", "0.49609655", "0.4952383", "0.49495274", "0.49027663", "0.48969975", "0.4889777", "0.48881105", "0.48853248", "0.48731264", "0.48624018", "0.48520312", "0.4850704", "0.48360685", "0.4826982", "0.48267317", "0.48265326", "0.48243174", "0.48231098", "0.48197314", "0.48191842", "0.48114717", "0.48083717", "0.4805073", "0.48042", "0.48011434", "0.4798507", "0.47974476", "0.4795053", "0.47938284", "0.4793764", "0.47866237", "0.47788325", "0.47768041", "0.4775814", "0.4773382", "0.4772386" ]
0.66089016
1
repeated .appscode.kubernetes.v1beta2.Rule rules = 2;
int getRulesCount();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<? extends com.appscode.api.kubernetes.v1beta2.RuleOrBuilder> \n getRulesOrBuilderList();", "com.appscode.api.kubernetes.v1beta2.Rule getRules(int index);", "java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> \n getRulesList();", "com.appscode.api.kubernetes.v1beta2.RuleOrBuilder getRulesOrBuilder(\n int index);", "public Rules getRules()\r\n {\r\n return rules;\r\n }", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public interface RulesManager extends RulesService {\n\n boolean applyPortForwardingRules(long ipAddressId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyPortForwardingRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account caller);\n\n void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller);\n\n boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId, Account caller) throws ResourceUnavailableException;\n\n boolean revokeAllPFStaticNatRulesForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException;\n\n List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId);\n\n /**\n * Returns a list of port forwarding rules that are ready for application\n * to the network elements for this ip.\n * \n * @param ip\n * @return List of PortForwardingRule\n */\n List<? extends PortForwardingRule> listPortForwardingRulesForApplication(long ipId);\n\n List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(List<? extends IpAddress> addrs);\n\n boolean revokePortForwardingRulesForVm(long vmId);\n\n boolean revokeStaticNatRulesForVm(long vmId);\n\n FirewallRule[] reservePorts(IpAddress ip, String protocol, FirewallRule.Purpose purpose, boolean openFirewall, Account caller, int... ports) throws NetworkRuleConflictException;\n\n boolean releasePorts(long ipId, String protocol, FirewallRule.Purpose purpose, int... ports);\n\n List<PortForwardingRuleVO> listByNetworkId(long networkId);\n\n boolean applyStaticNatForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void getSystemIpAndEnableStaticNatForVm(UserVm vm, boolean getNewIp) throws InsufficientAddressCapacityException;\n\n boolean disableStaticNat(long ipAddressId, Account caller, long callerUserId, boolean releaseIpIfElastic) throws ResourceUnavailableException;\n\n}", "@Override\n public List getRules() {\n return rules;\n }", "public ConfigurationValidator2D(VersionRules theRules){\n\t\tthis.theRules = theRules;\n\t}", "int getDetectionRulesCount();", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "IRuleset add(IRuleset...rules);", "List<? extends Rule> getRules();", "public abstract List<NARule> getRules(Context context);", "@Override\n public ResponseEntity<List<Rule>> getRules() {\n\n String apiKeyId = (String) servletRequest.getAttribute(\"Application\");\n Optional<List<RuleEntity>> ruleEntities = ruleRepository.findByApiKeyEntityValue(apiKeyId);\n List<Rule> rules = new ArrayList<>();\n\n if (ruleEntities.isPresent()) {\n for (RuleEntity ruleEntity : ruleEntities.get()) {\n rules.add(toRule(ruleEntity));\n }\n }\n\n return ResponseEntity.ok(rules);\n }", "Rule getRule();", "void setRule(Rule rule);", "@Deprecated\n public List<V1IngressRule> getRules();", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "public interface Rule {\n \n /**\n * Determine if a rule meets all of its conditions.\n * @param OpSystem The overall system for this rule.\n * @return true if the rule meets its condition.\n */\n public boolean meetsCondition(OpSystem system);\n}", "public void addRules(ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(value);\n }", "String getRules();", "public Slicing setRules(BoundCodeDt<SlicingRulesEnum> theValue) {\n\t\tmyRules = theValue;\n\t\treturn this;\n\t}", "public void add_rule(Rule rule) throws Exception;", "com.google.privacy.dlp.v2.CustomInfoType.DetectionRule getDetectionRules(int index);", "public Slicing setRules(SlicingRulesEnum theValue) {\n\t\tgetRulesElement().setValueAsEnum(theValue);\n\t\treturn this;\n\t}", "public void setRule(int rule) {\n\t\tthis.rule = rule;\n\t}", "@Bean\n public RulesEngine getRulesEngine() {\n return new DefaultRulesEngine(new RulesEngineParameters().skipOnFirstAppliedRule(false));\n }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "private void loadRules2() {\n\t\t\r\n\t\tint type = Integer.valueOf(env.getProperty(\"sentinel.server.type\")) ;\r\n\t\t\r\n String appId = \"sentinel-demo\";\r\n String apolloMetaServerAddress = \"http://10.1.77.106:8080\";\r\n System.setProperty(\"app.id\", appId);\r\n System.setProperty(\"apollo.meta\", apolloMetaServerAddress);\r\n\r\n String namespaceName = \"application\";\r\n String flowRuleKey = \"flowRules\";\r\n // It's better to provide a meaningful default value.\r\n String defaultFlowRules = \"[]\";\r\n\r\n ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new ApolloDataSource<>(namespaceName,\r\n flowRuleKey, defaultFlowRules, source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {\r\n }));\r\n FlowRuleManager.register2Property(flowRuleDataSource.getProperty());\r\n ClusterFlowRuleManager.setPropertySupplier(namespace ->flowRuleDataSource.getProperty());\r\n \r\n\r\n\t\tif (ClusterStateManager.CLUSTER_SERVER == type) \r\n\t\t{\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_SERVER);\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_CLIENT);\r\n\t\t\tinitClientConfigProperty(namespaceName);\r\n\t\t\tinitClientServerAssignProperty(namespaceName);\r\n\t\t}\r\n \r\n \r\n \r\n \r\n }", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public ArrayList<String> getRules() {\n return rules;\n }", "@Override\r\npublic void initRules(){\r\n\t\r\n}", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "public interface KubernetesSecretRule extends ExtensionPoint {\n\n /**\n * Check if the secret should be excluded.\n * @param secret secret will be checked.\n * @return true, if the secret should be excluded.\n */\n boolean exclude(V1Secret secret);\n\n static ExtensionList<KubernetesSecretRule> all() {\n return ExtensionList.lookup(KubernetesSecretRule.class);\n }\n\n static boolean shouldExclude(V1Secret secret) {\n ExtensionList<KubernetesSecretRule> filters = all();\n\n return filters.stream().anyMatch(e -> e.exclude(secret));\n }\n\n}", "com.google.protobuf.ByteString\n getRuleBytes();", "@PUT(\"pushrules/global/{kind}/{ruleId}\")\n Call<Void> addRule(@Path(\"kind\") String kind, @Path(\"ruleId\") String ruleId, @Body JsonElement rule);", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "private void actOnRules() {\r\n\r\n\t\tfor(String key: myRuleBook.keySet())\r\n\t\t{\r\n\r\n\t\t\tRule rule = myRuleBook.get(key);\r\n\t\t\tSpriteGroup[] obedients = myRuleMap.get(rule);\r\n\r\n\t\t\tif(rule.isSatisfied(obedients))\r\n\t\t\t{\r\n\t\t\t\trule.enforce(obedients);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public TypeCheckerProofRule getRule ( ) ;", "@GET(\"pushrules/\")\n Call<PushRulesResponse> getAllRules();", "public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}", "IRuleset add(IRuleset rule);", "public void setRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.set(index, value);\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void addRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(index, value);\n }", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "ConstRule createConstRule();", "public int getNumberOfRules() {\n\t\treturn this.patternActionRules.size();\n\t}", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "FirewallRuleService firewallrule();", "FlowRule build();", "public void setRules(final ArrayList<NetworkSecurityRule> rulesValue) {\n this.rules = rulesValue;\n }", "public interface EntityOrAssetRule extends Rule {\n /**\n * Return the component id of the Entity or Asset that this rule should\n * belong to.\n * @return The component id.\n */\n public String getComponentId();\n \n /**\n * Given a mission objective and a system, find the corresponding component\n * to this rule, and add this rule to that component.\n * @param objective The mission objective.\n * @param system The system containing the component for this rule.\n */\n public void addToComponent(String objective, OpSystem system);\n}", "CmdRule createCmdRule();", "ControlBlockRule createControlBlockRule();", "public int numberOfBrokenRules()\n {\n return mBrokenRules.size();\n }", "@Test\n public void ruleNameTest() {\n // TODO: test ruleName\n }", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "@Override\n public List<Rule> getPriceRules() {\n return List.of(getMatchTravelCardHolderRule());\n }", "E8Rule createE8Rule();", "public HashMap<String,Rule> get_rules_to_action() throws Exception;", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public void setRule(java.lang.String rule) {\n this.rule = rule;\n }", "public void setRule(final String rule) {\r\n this.rule = rule;\r\n }", "E9Rule createE9Rule();", "void checkRule(String rule) throws IOException;", "public abstract void setRules (CellProfile rules);", "public interface Rule {\n\n /**\n * Process this security event and detects whether this represents a security breach from the perspective of this rule\n * \n * @param event\n * event to process\n * @return security breach - either a breach or not (could be delayed)\n */\n SecurityBreach isSecurityBreach(SecurityEvent event);\n\n /**\n * Detects whether this rule is applicable in the in-passed security mode. Each rule guarantees to return the very same value of this method at\n * runtime. E.g. if this method returns true for an instance, it is guaranteed it will always return true within the lifecycle of this object\n * \n * @param securityMode\n * security mode to test applicability of this rule against\n * @return true if so, false otherwise\n */\n boolean isApplicable(SecurityMode securityMode);\n\n /**\n * Detects whether this rule is enabled or not\n * \n * @return true if so, false otherwise\n */\n boolean isEnabled();\n\n /**\n * Get human readable description of this rule. It should be a unique string compared to all other rules\n * \n * @return unique description of this rule\n */\n String getDescription();\n\n /**\n * Gets Unique ID of this Rule\n * \n * @return integer identification of this rule\n */\n int getId();\n\n /**\n * Update this rule based on the in-passed rule detail (e.g. whether it is enabled, etc)\n * \n * @param ruleDetail\n * rule detail to use to update this rule\n */\n void updateFrom(RuleDetail ruleDetail);\n}", "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "public ValidationRule getRule()\r\n {\r\n return rule;\r\n }", "@Override\n public List<Rule> getTotalRules() {\n return List.of(getTotalGreaterThan60Rule());\n }", "public Builder setRuleBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n rule_ = value;\n onChanged();\n return this;\n }" ]
[ "0.6761806", "0.66100097", "0.63280153", "0.6291458", "0.5889406", "0.5837983", "0.5822912", "0.56824654", "0.5633473", "0.55924577", "0.5551186", "0.55422986", "0.5541291", "0.5538316", "0.55086076", "0.55086076", "0.55086076", "0.5485106", "0.5454866", "0.5424918", "0.53517264", "0.5342416", "0.5306755", "0.53051335", "0.5280046", "0.5269505", "0.5266849", "0.5265801", "0.5258824", "0.5214852", "0.51984066", "0.517059", "0.516767", "0.5146638", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51406324", "0.51394725", "0.5135072", "0.5123409", "0.5106322", "0.5073073", "0.50155604", "0.50133216", "0.50129443", "0.50110537", "0.4998812", "0.49916688", "0.49914306", "0.4987992", "0.49812818", "0.49797127", "0.49704924", "0.4963326", "0.495336", "0.49520534", "0.4905522", "0.48978946", "0.4892011", "0.48915476", "0.48870286", "0.4875918", "0.48643753", "0.48539564", "0.48537236", "0.48379043", "0.4828669", "0.48272377", "0.48270977", "0.48265016", "0.4824616", "0.48227352", "0.4822684", "0.48137686", "0.48118287", "0.48069912", "0.4806659", "0.48034683", "0.48005444", "0.48000577", "0.47966275", "0.47958022", "0.4795609", "0.47880882", "0.47808158", "0.47794428", "0.47785652", "0.4775063", "0.47742906" ]
0.55871236
10
repeated .appscode.kubernetes.v1beta2.Rule rules = 2;
java.util.List<? extends com.appscode.api.kubernetes.v1beta2.RuleOrBuilder> getRulesOrBuilderList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.appscode.api.kubernetes.v1beta2.Rule getRules(int index);", "java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> \n getRulesList();", "com.appscode.api.kubernetes.v1beta2.RuleOrBuilder getRulesOrBuilder(\n int index);", "public Rules getRules()\r\n {\r\n return rules;\r\n }", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public interface RulesManager extends RulesService {\n\n boolean applyPortForwardingRules(long ipAddressId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyPortForwardingRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account caller);\n\n void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller);\n\n boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId, Account caller) throws ResourceUnavailableException;\n\n boolean revokeAllPFStaticNatRulesForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException;\n\n List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId);\n\n /**\n * Returns a list of port forwarding rules that are ready for application\n * to the network elements for this ip.\n * \n * @param ip\n * @return List of PortForwardingRule\n */\n List<? extends PortForwardingRule> listPortForwardingRulesForApplication(long ipId);\n\n List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(List<? extends IpAddress> addrs);\n\n boolean revokePortForwardingRulesForVm(long vmId);\n\n boolean revokeStaticNatRulesForVm(long vmId);\n\n FirewallRule[] reservePorts(IpAddress ip, String protocol, FirewallRule.Purpose purpose, boolean openFirewall, Account caller, int... ports) throws NetworkRuleConflictException;\n\n boolean releasePorts(long ipId, String protocol, FirewallRule.Purpose purpose, int... ports);\n\n List<PortForwardingRuleVO> listByNetworkId(long networkId);\n\n boolean applyStaticNatForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void getSystemIpAndEnableStaticNatForVm(UserVm vm, boolean getNewIp) throws InsufficientAddressCapacityException;\n\n boolean disableStaticNat(long ipAddressId, Account caller, long callerUserId, boolean releaseIpIfElastic) throws ResourceUnavailableException;\n\n}", "@Override\n public List getRules() {\n return rules;\n }", "int getRulesCount();", "public ConfigurationValidator2D(VersionRules theRules){\n\t\tthis.theRules = theRules;\n\t}", "int getDetectionRulesCount();", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "IRuleset add(IRuleset...rules);", "List<? extends Rule> getRules();", "public abstract List<NARule> getRules(Context context);", "@Override\n public ResponseEntity<List<Rule>> getRules() {\n\n String apiKeyId = (String) servletRequest.getAttribute(\"Application\");\n Optional<List<RuleEntity>> ruleEntities = ruleRepository.findByApiKeyEntityValue(apiKeyId);\n List<Rule> rules = new ArrayList<>();\n\n if (ruleEntities.isPresent()) {\n for (RuleEntity ruleEntity : ruleEntities.get()) {\n rules.add(toRule(ruleEntity));\n }\n }\n\n return ResponseEntity.ok(rules);\n }", "Rule getRule();", "@Deprecated\n public List<V1IngressRule> getRules();", "void setRule(Rule rule);", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "public interface Rule {\n \n /**\n * Determine if a rule meets all of its conditions.\n * @param OpSystem The overall system for this rule.\n * @return true if the rule meets its condition.\n */\n public boolean meetsCondition(OpSystem system);\n}", "public void addRules(ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(value);\n }", "String getRules();", "public Slicing setRules(BoundCodeDt<SlicingRulesEnum> theValue) {\n\t\tmyRules = theValue;\n\t\treturn this;\n\t}", "public void add_rule(Rule rule) throws Exception;", "com.google.privacy.dlp.v2.CustomInfoType.DetectionRule getDetectionRules(int index);", "public Slicing setRules(SlicingRulesEnum theValue) {\n\t\tgetRulesElement().setValueAsEnum(theValue);\n\t\treturn this;\n\t}", "public void setRule(int rule) {\n\t\tthis.rule = rule;\n\t}", "@Bean\n public RulesEngine getRulesEngine() {\n return new DefaultRulesEngine(new RulesEngineParameters().skipOnFirstAppliedRule(false));\n }", "private void loadRules2() {\n\t\t\r\n\t\tint type = Integer.valueOf(env.getProperty(\"sentinel.server.type\")) ;\r\n\t\t\r\n String appId = \"sentinel-demo\";\r\n String apolloMetaServerAddress = \"http://10.1.77.106:8080\";\r\n System.setProperty(\"app.id\", appId);\r\n System.setProperty(\"apollo.meta\", apolloMetaServerAddress);\r\n\r\n String namespaceName = \"application\";\r\n String flowRuleKey = \"flowRules\";\r\n // It's better to provide a meaningful default value.\r\n String defaultFlowRules = \"[]\";\r\n\r\n ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new ApolloDataSource<>(namespaceName,\r\n flowRuleKey, defaultFlowRules, source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {\r\n }));\r\n FlowRuleManager.register2Property(flowRuleDataSource.getProperty());\r\n ClusterFlowRuleManager.setPropertySupplier(namespace ->flowRuleDataSource.getProperty());\r\n \r\n\r\n\t\tif (ClusterStateManager.CLUSTER_SERVER == type) \r\n\t\t{\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_SERVER);\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_CLIENT);\r\n\t\t\tinitClientConfigProperty(namespaceName);\r\n\t\t\tinitClientServerAssignProperty(namespaceName);\r\n\t\t}\r\n \r\n \r\n \r\n \r\n }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public ArrayList<String> getRules() {\n return rules;\n }", "@Override\r\npublic void initRules(){\r\n\t\r\n}", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "public interface KubernetesSecretRule extends ExtensionPoint {\n\n /**\n * Check if the secret should be excluded.\n * @param secret secret will be checked.\n * @return true, if the secret should be excluded.\n */\n boolean exclude(V1Secret secret);\n\n static ExtensionList<KubernetesSecretRule> all() {\n return ExtensionList.lookup(KubernetesSecretRule.class);\n }\n\n static boolean shouldExclude(V1Secret secret) {\n ExtensionList<KubernetesSecretRule> filters = all();\n\n return filters.stream().anyMatch(e -> e.exclude(secret));\n }\n\n}", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "com.google.protobuf.ByteString\n getRuleBytes();", "@PUT(\"pushrules/global/{kind}/{ruleId}\")\n Call<Void> addRule(@Path(\"kind\") String kind, @Path(\"ruleId\") String ruleId, @Body JsonElement rule);", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "private void actOnRules() {\r\n\r\n\t\tfor(String key: myRuleBook.keySet())\r\n\t\t{\r\n\r\n\t\t\tRule rule = myRuleBook.get(key);\r\n\t\t\tSpriteGroup[] obedients = myRuleMap.get(rule);\r\n\r\n\t\t\tif(rule.isSatisfied(obedients))\r\n\t\t\t{\r\n\t\t\t\trule.enforce(obedients);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public TypeCheckerProofRule getRule ( ) ;", "@GET(\"pushrules/\")\n Call<PushRulesResponse> getAllRules();", "public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}", "IRuleset add(IRuleset rule);", "public void setRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.set(index, value);\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void addRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(index, value);\n }", "ConstRule createConstRule();", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "public int getNumberOfRules() {\n\t\treturn this.patternActionRules.size();\n\t}", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "FirewallRuleService firewallrule();", "FlowRule build();", "public void setRules(final ArrayList<NetworkSecurityRule> rulesValue) {\n this.rules = rulesValue;\n }", "public interface EntityOrAssetRule extends Rule {\n /**\n * Return the component id of the Entity or Asset that this rule should\n * belong to.\n * @return The component id.\n */\n public String getComponentId();\n \n /**\n * Given a mission objective and a system, find the corresponding component\n * to this rule, and add this rule to that component.\n * @param objective The mission objective.\n * @param system The system containing the component for this rule.\n */\n public void addToComponent(String objective, OpSystem system);\n}", "public int numberOfBrokenRules()\n {\n return mBrokenRules.size();\n }", "CmdRule createCmdRule();", "ControlBlockRule createControlBlockRule();", "@Test\n public void ruleNameTest() {\n // TODO: test ruleName\n }", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "E8Rule createE8Rule();", "@Override\n public List<Rule> getPriceRules() {\n return List.of(getMatchTravelCardHolderRule());\n }", "public HashMap<String,Rule> get_rules_to_action() throws Exception;", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public void setRule(java.lang.String rule) {\n this.rule = rule;\n }", "E9Rule createE9Rule();", "void checkRule(String rule) throws IOException;", "public void setRule(final String rule) {\r\n this.rule = rule;\r\n }", "public abstract void setRules (CellProfile rules);", "public interface Rule {\n\n /**\n * Process this security event and detects whether this represents a security breach from the perspective of this rule\n * \n * @param event\n * event to process\n * @return security breach - either a breach or not (could be delayed)\n */\n SecurityBreach isSecurityBreach(SecurityEvent event);\n\n /**\n * Detects whether this rule is applicable in the in-passed security mode. Each rule guarantees to return the very same value of this method at\n * runtime. E.g. if this method returns true for an instance, it is guaranteed it will always return true within the lifecycle of this object\n * \n * @param securityMode\n * security mode to test applicability of this rule against\n * @return true if so, false otherwise\n */\n boolean isApplicable(SecurityMode securityMode);\n\n /**\n * Detects whether this rule is enabled or not\n * \n * @return true if so, false otherwise\n */\n boolean isEnabled();\n\n /**\n * Get human readable description of this rule. It should be a unique string compared to all other rules\n * \n * @return unique description of this rule\n */\n String getDescription();\n\n /**\n * Gets Unique ID of this Rule\n * \n * @return integer identification of this rule\n */\n int getId();\n\n /**\n * Update this rule based on the in-passed rule detail (e.g. whether it is enabled, etc)\n * \n * @param ruleDetail\n * rule detail to use to update this rule\n */\n void updateFrom(RuleDetail ruleDetail);\n}", "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "public ValidationRule getRule()\r\n {\r\n return rule;\r\n }", "public interface FlowRule extends PiTranslatable {\n\n IndexTableId DEFAULT_TABLE = IndexTableId.of(0);\n int MAX_TIMEOUT = 60;\n int MIN_PRIORITY = 0;\n int MAX_PRIORITY = 65535;\n\n /**\n * Reason for flow parameter received from switches.\n * Used to check reason parameter in flows.\n */\n enum FlowRemoveReason {\n IDLE_TIMEOUT,\n HARD_TIMEOUT,\n DELETE,\n GROUP_DELETE,\n METER_DELETE,\n EVICTION,\n NO_REASON;\n\n /**\n * Covert short to enum.\n * @return reason in enum\n * @param reason remove reason in integer\n */\n public static FlowRemoveReason parseShort(short reason) {\n switch (reason) {\n case -1 :\n return NO_REASON;\n case 0:\n return IDLE_TIMEOUT;\n case 1:\n return HARD_TIMEOUT;\n case 2 :\n return DELETE;\n case 3:\n return GROUP_DELETE;\n case 4:\n return METER_DELETE;\n case 5:\n return EVICTION;\n default :\n return NO_REASON;\n }\n }\n }\n\n /**\n * Returns the ID of this flow.\n *\n * @return the flow ID\n */\n FlowId id();\n\n /**\n * Returns the application id of this flow.\n *\n * @return an applicationId\n */\n short appId();\n\n /**\n * Returns the group id of this flow.\n *\n * @return an groupId\n */\n GroupId groupId();\n\n /**\n * Returns the flow rule priority given in natural order; higher numbers\n * mean higher priorities.\n *\n * @return flow rule priority\n */\n int priority();\n\n /**\n * Returns the identity of the device where this rule applies.\n *\n * @return device identifier\n */\n DeviceId deviceId();\n\n /**\n * Returns the traffic selector that identifies what traffic this rule\n * should apply to.\n *\n * @return traffic selector\n */\n TrafficSelector selector();\n\n /**\n * Returns the traffic treatment that applies to selected traffic.\n *\n * @return traffic treatment\n */\n TrafficTreatment treatment();\n\n /**\n * Returns the timeout for this flow requested by an application.\n *\n * @return integer value of the timeout\n */\n int timeout();\n\n /**\n * Returns the hard timeout for this flow requested by an application.\n * This parameter configure switch's flow hard timeout.\n * In case of controller-switch connection lost, this variable can be useful.\n * @return integer value of the hard Timeout\n */\n int hardTimeout();\n\n /**\n * Returns the reason for the flow received from switches.\n *\n * @return FlowRemoveReason value of reason\n */\n FlowRemoveReason reason();\n\n /**\n * Returns whether the flow is permanent i.e. does not time out.\n *\n * @return true if the flow is permanent, otherwise false\n */\n boolean isPermanent();\n\n /**\n * Returns the table id for this rule.\n *\n * @return an integer.\n * @deprecated in Loon release (version 1.11.0). Use {@link #table()} instead.\n */\n @Deprecated\n int tableId();\n\n /**\n * Returns the table identifier for this rule.\n *\n * @return a table identifier.\n */\n TableId table();\n\n /**\n * {@inheritDoc}\n *\n * Equality for flow rules only considers 'match equality'. This means that\n * two flow rules with the same match conditions will be equal, regardless\n * of the treatment or other characteristics of the flow.\n *\n * @param obj the reference object with which to compare.\n * @return {@code true} if this object is the same as the obj\n * argument; {@code false} otherwise.\n */\n boolean equals(Object obj);\n\n /**\n * Returns whether this flow rule is an exact match to the flow rule given\n * in the argument.\n * <p>\n * Exact match means that deviceId, priority, selector,\n * tableId, flowId and treatment are equal. Note that this differs from\n * the notion of object equality for flow rules, which does not consider the\n * flowId or treatment when testing equality.\n * </p>\n *\n * @param rule other rule to match against\n * @return true if the rules are an exact match, otherwise false\n */\n boolean exactMatch(FlowRule rule);\n\n /**\n * A flowrule builder.\n */\n interface Builder {\n\n /**\n * Assigns a cookie value to this flowrule. Mutually exclusive with the\n * fromApp method. This method is intended to take a cookie value from\n * the dataplane and not from the application.\n *\n * @param cookie a long value\n * @return this\n */\n Builder withCookie(long cookie);\n\n /**\n * Assigns the application that built this flow rule to this object.\n * The short value of the appId will be used as a basis for the\n * cookie value computation. It is expected that application use this\n * call to set their application id.\n *\n * @param appId an application id\n * @return this\n */\n Builder fromApp(ApplicationId appId);\n\n /**\n * Sets the priority for this flow rule.\n *\n * @param priority an integer\n * @return this\n */\n Builder withPriority(int priority);\n\n /**\n * Sets the deviceId for this flow rule.\n *\n * @param deviceId a device id\n * @return this\n */\n Builder forDevice(DeviceId deviceId);\n\n /**\n * Sets the table id for this flow rule, when the identifier is of type {@link TableId.Type#INDEX}. Default\n * value is 0.\n * <p>\n * <em>Important:</em> This method is left here for backward compatibility with applications that specifies\n * table identifiers using integers, e.g. as in OpenFlow. Currently there is no plan to deprecate this method,\n * however, new applications should favor using {@link #forTable(TableId)}.\n *\n * @param tableId an integer\n * @return this\n */\n Builder forTable(int tableId);\n\n /**\n * Sets the table identifier for this flow rule.\n * Default identifier is of type {@link TableId.Type#INDEX} and value 0.\n *\n * @param tableId table identifier\n * @return this\n */\n Builder forTable(TableId tableId);\n\n /**\n * Sets the selector (or match field) for this flow rule.\n *\n * @param selector a traffic selector\n * @return this\n */\n Builder withSelector(TrafficSelector selector);\n\n /**\n * Sets the traffic treatment for this flow rule.\n *\n * @param treatment a traffic treatment\n * @return this\n */\n Builder withTreatment(TrafficTreatment treatment);\n\n /**\n * Makes this rule permanent on the dataplane.\n *\n * @return this\n */\n Builder makePermanent();\n\n /**\n * Makes this rule temporary and timeout after the specified amount\n * of time.\n *\n * @param timeout an integer\n * @return this\n */\n Builder makeTemporary(int timeout);\n\n /**\n * Sets the idle timeout parameter in flow table.\n *\n * Will automatically make it permanent or temporary if the timeout is 0 or not, respectively.\n * @param timeout an integer\n * @return this\n */\n default Builder withIdleTimeout(int timeout) {\n if (timeout == 0) {\n return makePermanent();\n } else {\n return makeTemporary(timeout);\n }\n }\n\n /**\n * Sets hard timeout parameter in flow table.\n * @param timeout an integer\n * @return this\n */\n Builder withHardTimeout(int timeout);\n\n /**\n * Sets reason parameter received from switches .\n * @param reason a short\n * @return this\n */\n Builder withReason(FlowRemoveReason reason);\n\n /**\n * Builds a flow rule object.\n *\n * @return a flow rule.\n */\n FlowRule build();\n\n }\n}", "public Builder setRuleBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n rule_ = value;\n onChanged();\n return this;\n }" ]
[ "0.66073847", "0.6324158", "0.6288047", "0.5882989", "0.58308566", "0.58160627", "0.56775767", "0.5629937", "0.5585979", "0.558538", "0.5547636", "0.5541968", "0.553581", "0.5533254", "0.55036545", "0.55036545", "0.55036545", "0.5481315", "0.54485416", "0.5419642", "0.53476197", "0.5337188", "0.53014475", "0.53004724", "0.52729964", "0.52644557", "0.526205", "0.52599156", "0.52554446", "0.52106124", "0.51971495", "0.5167773", "0.5162868", "0.5143033", "0.51352286", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.51316065", "0.51162964", "0.51018506", "0.5070313", "0.50133187", "0.501097", "0.5006078", "0.5005819", "0.499506", "0.49879688", "0.4986693", "0.49839061", "0.49765792", "0.49757215", "0.49669006", "0.49591646", "0.4949548", "0.49479246", "0.48998997", "0.4894581", "0.48887685", "0.48873442", "0.48845914", "0.4870449", "0.4862182", "0.4850548", "0.4848361", "0.48347676", "0.48257735", "0.48255107", "0.48247758", "0.48231375", "0.48219362", "0.48191807", "0.48171392", "0.4809339", "0.48059994", "0.48044145", "0.48017424", "0.4799419", "0.4795082", "0.47944537", "0.4792266", "0.47912973", "0.47909856", "0.47841352", "0.47763908", "0.47743317", "0.47739196", "0.47724056", "0.47707915" ]
0.6758241
0
repeated .appscode.kubernetes.v1beta2.Rule rules = 2;
com.appscode.api.kubernetes.v1beta2.RuleOrBuilder getRulesOrBuilder( int index);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<? extends com.appscode.api.kubernetes.v1beta2.RuleOrBuilder> \n getRulesOrBuilderList();", "com.appscode.api.kubernetes.v1beta2.Rule getRules(int index);", "java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> \n getRulesList();", "public Rules getRules()\r\n {\r\n return rules;\r\n }", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public interface RulesManager extends RulesService {\n\n boolean applyPortForwardingRules(long ipAddressId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyPortForwardingRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account caller);\n\n void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller);\n\n boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId, Account caller) throws ResourceUnavailableException;\n\n boolean revokeAllPFStaticNatRulesForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException;\n\n List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId);\n\n /**\n * Returns a list of port forwarding rules that are ready for application\n * to the network elements for this ip.\n * \n * @param ip\n * @return List of PortForwardingRule\n */\n List<? extends PortForwardingRule> listPortForwardingRulesForApplication(long ipId);\n\n List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(List<? extends IpAddress> addrs);\n\n boolean revokePortForwardingRulesForVm(long vmId);\n\n boolean revokeStaticNatRulesForVm(long vmId);\n\n FirewallRule[] reservePorts(IpAddress ip, String protocol, FirewallRule.Purpose purpose, boolean openFirewall, Account caller, int... ports) throws NetworkRuleConflictException;\n\n boolean releasePorts(long ipId, String protocol, FirewallRule.Purpose purpose, int... ports);\n\n List<PortForwardingRuleVO> listByNetworkId(long networkId);\n\n boolean applyStaticNatForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void getSystemIpAndEnableStaticNatForVm(UserVm vm, boolean getNewIp) throws InsufficientAddressCapacityException;\n\n boolean disableStaticNat(long ipAddressId, Account caller, long callerUserId, boolean releaseIpIfElastic) throws ResourceUnavailableException;\n\n}", "@Override\n public List getRules() {\n return rules;\n }", "int getRulesCount();", "public ConfigurationValidator2D(VersionRules theRules){\n\t\tthis.theRules = theRules;\n\t}", "int getDetectionRulesCount();", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "IRuleset add(IRuleset...rules);", "List<? extends Rule> getRules();", "public abstract List<NARule> getRules(Context context);", "@Override\n public ResponseEntity<List<Rule>> getRules() {\n\n String apiKeyId = (String) servletRequest.getAttribute(\"Application\");\n Optional<List<RuleEntity>> ruleEntities = ruleRepository.findByApiKeyEntityValue(apiKeyId);\n List<Rule> rules = new ArrayList<>();\n\n if (ruleEntities.isPresent()) {\n for (RuleEntity ruleEntity : ruleEntities.get()) {\n rules.add(toRule(ruleEntity));\n }\n }\n\n return ResponseEntity.ok(rules);\n }", "Rule getRule();", "@Deprecated\n public List<V1IngressRule> getRules();", "void setRule(Rule rule);", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "public interface Rule {\n \n /**\n * Determine if a rule meets all of its conditions.\n * @param OpSystem The overall system for this rule.\n * @return true if the rule meets its condition.\n */\n public boolean meetsCondition(OpSystem system);\n}", "public void addRules(ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(value);\n }", "String getRules();", "public Slicing setRules(BoundCodeDt<SlicingRulesEnum> theValue) {\n\t\tmyRules = theValue;\n\t\treturn this;\n\t}", "public void add_rule(Rule rule) throws Exception;", "com.google.privacy.dlp.v2.CustomInfoType.DetectionRule getDetectionRules(int index);", "public Slicing setRules(SlicingRulesEnum theValue) {\n\t\tgetRulesElement().setValueAsEnum(theValue);\n\t\treturn this;\n\t}", "public void setRule(int rule) {\n\t\tthis.rule = rule;\n\t}", "@Bean\n public RulesEngine getRulesEngine() {\n return new DefaultRulesEngine(new RulesEngineParameters().skipOnFirstAppliedRule(false));\n }", "private void loadRules2() {\n\t\t\r\n\t\tint type = Integer.valueOf(env.getProperty(\"sentinel.server.type\")) ;\r\n\t\t\r\n String appId = \"sentinel-demo\";\r\n String apolloMetaServerAddress = \"http://10.1.77.106:8080\";\r\n System.setProperty(\"app.id\", appId);\r\n System.setProperty(\"apollo.meta\", apolloMetaServerAddress);\r\n\r\n String namespaceName = \"application\";\r\n String flowRuleKey = \"flowRules\";\r\n // It's better to provide a meaningful default value.\r\n String defaultFlowRules = \"[]\";\r\n\r\n ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new ApolloDataSource<>(namespaceName,\r\n flowRuleKey, defaultFlowRules, source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {\r\n }));\r\n FlowRuleManager.register2Property(flowRuleDataSource.getProperty());\r\n ClusterFlowRuleManager.setPropertySupplier(namespace ->flowRuleDataSource.getProperty());\r\n \r\n\r\n\t\tif (ClusterStateManager.CLUSTER_SERVER == type) \r\n\t\t{\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_SERVER);\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tClusterStateManager.applyState(ClusterStateManager.CLUSTER_CLIENT);\r\n\t\t\tinitClientConfigProperty(namespaceName);\r\n\t\t\tinitClientServerAssignProperty(namespaceName);\r\n\t\t}\r\n \r\n \r\n \r\n \r\n }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "public EnumRule getRule() { return rule; }", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public ArrayList<String> getRules() {\n return rules;\n }", "@Override\r\npublic void initRules(){\r\n\t\r\n}", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "public interface KubernetesSecretRule extends ExtensionPoint {\n\n /**\n * Check if the secret should be excluded.\n * @param secret secret will be checked.\n * @return true, if the secret should be excluded.\n */\n boolean exclude(V1Secret secret);\n\n static ExtensionList<KubernetesSecretRule> all() {\n return ExtensionList.lookup(KubernetesSecretRule.class);\n }\n\n static boolean shouldExclude(V1Secret secret) {\n ExtensionList<KubernetesSecretRule> filters = all();\n\n return filters.stream().anyMatch(e -> e.exclude(secret));\n }\n\n}", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "com.google.protobuf.ByteString\n getRuleBytes();", "@PUT(\"pushrules/global/{kind}/{ruleId}\")\n Call<Void> addRule(@Path(\"kind\") String kind, @Path(\"ruleId\") String ruleId, @Body JsonElement rule);", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "private void actOnRules() {\r\n\r\n\t\tfor(String key: myRuleBook.keySet())\r\n\t\t{\r\n\r\n\t\t\tRule rule = myRuleBook.get(key);\r\n\t\t\tSpriteGroup[] obedients = myRuleMap.get(rule);\r\n\r\n\t\t\tif(rule.isSatisfied(obedients))\r\n\t\t\t{\r\n\t\t\t\trule.enforce(obedients);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public TypeCheckerProofRule getRule ( ) ;", "@GET(\"pushrules/\")\n Call<PushRulesResponse> getAllRules();", "public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}", "IRuleset add(IRuleset rule);", "public void setRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.set(index, value);\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void addRules(int index, ContextRule value) {\n value.getClass();\n ensureRulesIsMutable();\n this.rules_.add(index, value);\n }", "ConstRule createConstRule();", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "public int getNumberOfRules() {\n\t\treturn this.patternActionRules.size();\n\t}", "public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "FirewallRuleService firewallrule();", "FlowRule build();", "public void setRules(final ArrayList<NetworkSecurityRule> rulesValue) {\n this.rules = rulesValue;\n }", "public interface EntityOrAssetRule extends Rule {\n /**\n * Return the component id of the Entity or Asset that this rule should\n * belong to.\n * @return The component id.\n */\n public String getComponentId();\n \n /**\n * Given a mission objective and a system, find the corresponding component\n * to this rule, and add this rule to that component.\n * @param objective The mission objective.\n * @param system The system containing the component for this rule.\n */\n public void addToComponent(String objective, OpSystem system);\n}", "public int numberOfBrokenRules()\n {\n return mBrokenRules.size();\n }", "CmdRule createCmdRule();", "ControlBlockRule createControlBlockRule();", "@Test\n public void ruleNameTest() {\n // TODO: test ruleName\n }", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "E8Rule createE8Rule();", "@Override\n public List<Rule> getPriceRules() {\n return List.of(getMatchTravelCardHolderRule());\n }", "public HashMap<String,Rule> get_rules_to_action() throws Exception;", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public void setRule(java.lang.String rule) {\n this.rule = rule;\n }", "E9Rule createE9Rule();", "void checkRule(String rule) throws IOException;", "public void setRule(final String rule) {\r\n this.rule = rule;\r\n }", "public abstract void setRules (CellProfile rules);", "public interface Rule {\n\n /**\n * Process this security event and detects whether this represents a security breach from the perspective of this rule\n * \n * @param event\n * event to process\n * @return security breach - either a breach or not (could be delayed)\n */\n SecurityBreach isSecurityBreach(SecurityEvent event);\n\n /**\n * Detects whether this rule is applicable in the in-passed security mode. Each rule guarantees to return the very same value of this method at\n * runtime. E.g. if this method returns true for an instance, it is guaranteed it will always return true within the lifecycle of this object\n * \n * @param securityMode\n * security mode to test applicability of this rule against\n * @return true if so, false otherwise\n */\n boolean isApplicable(SecurityMode securityMode);\n\n /**\n * Detects whether this rule is enabled or not\n * \n * @return true if so, false otherwise\n */\n boolean isEnabled();\n\n /**\n * Get human readable description of this rule. It should be a unique string compared to all other rules\n * \n * @return unique description of this rule\n */\n String getDescription();\n\n /**\n * Gets Unique ID of this Rule\n * \n * @return integer identification of this rule\n */\n int getId();\n\n /**\n * Update this rule based on the in-passed rule detail (e.g. whether it is enabled, etc)\n * \n * @param ruleDetail\n * rule detail to use to update this rule\n */\n void updateFrom(RuleDetail ruleDetail);\n}", "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "public ValidationRule getRule()\r\n {\r\n return rule;\r\n }", "public interface FlowRule extends PiTranslatable {\n\n IndexTableId DEFAULT_TABLE = IndexTableId.of(0);\n int MAX_TIMEOUT = 60;\n int MIN_PRIORITY = 0;\n int MAX_PRIORITY = 65535;\n\n /**\n * Reason for flow parameter received from switches.\n * Used to check reason parameter in flows.\n */\n enum FlowRemoveReason {\n IDLE_TIMEOUT,\n HARD_TIMEOUT,\n DELETE,\n GROUP_DELETE,\n METER_DELETE,\n EVICTION,\n NO_REASON;\n\n /**\n * Covert short to enum.\n * @return reason in enum\n * @param reason remove reason in integer\n */\n public static FlowRemoveReason parseShort(short reason) {\n switch (reason) {\n case -1 :\n return NO_REASON;\n case 0:\n return IDLE_TIMEOUT;\n case 1:\n return HARD_TIMEOUT;\n case 2 :\n return DELETE;\n case 3:\n return GROUP_DELETE;\n case 4:\n return METER_DELETE;\n case 5:\n return EVICTION;\n default :\n return NO_REASON;\n }\n }\n }\n\n /**\n * Returns the ID of this flow.\n *\n * @return the flow ID\n */\n FlowId id();\n\n /**\n * Returns the application id of this flow.\n *\n * @return an applicationId\n */\n short appId();\n\n /**\n * Returns the group id of this flow.\n *\n * @return an groupId\n */\n GroupId groupId();\n\n /**\n * Returns the flow rule priority given in natural order; higher numbers\n * mean higher priorities.\n *\n * @return flow rule priority\n */\n int priority();\n\n /**\n * Returns the identity of the device where this rule applies.\n *\n * @return device identifier\n */\n DeviceId deviceId();\n\n /**\n * Returns the traffic selector that identifies what traffic this rule\n * should apply to.\n *\n * @return traffic selector\n */\n TrafficSelector selector();\n\n /**\n * Returns the traffic treatment that applies to selected traffic.\n *\n * @return traffic treatment\n */\n TrafficTreatment treatment();\n\n /**\n * Returns the timeout for this flow requested by an application.\n *\n * @return integer value of the timeout\n */\n int timeout();\n\n /**\n * Returns the hard timeout for this flow requested by an application.\n * This parameter configure switch's flow hard timeout.\n * In case of controller-switch connection lost, this variable can be useful.\n * @return integer value of the hard Timeout\n */\n int hardTimeout();\n\n /**\n * Returns the reason for the flow received from switches.\n *\n * @return FlowRemoveReason value of reason\n */\n FlowRemoveReason reason();\n\n /**\n * Returns whether the flow is permanent i.e. does not time out.\n *\n * @return true if the flow is permanent, otherwise false\n */\n boolean isPermanent();\n\n /**\n * Returns the table id for this rule.\n *\n * @return an integer.\n * @deprecated in Loon release (version 1.11.0). Use {@link #table()} instead.\n */\n @Deprecated\n int tableId();\n\n /**\n * Returns the table identifier for this rule.\n *\n * @return a table identifier.\n */\n TableId table();\n\n /**\n * {@inheritDoc}\n *\n * Equality for flow rules only considers 'match equality'. This means that\n * two flow rules with the same match conditions will be equal, regardless\n * of the treatment or other characteristics of the flow.\n *\n * @param obj the reference object with which to compare.\n * @return {@code true} if this object is the same as the obj\n * argument; {@code false} otherwise.\n */\n boolean equals(Object obj);\n\n /**\n * Returns whether this flow rule is an exact match to the flow rule given\n * in the argument.\n * <p>\n * Exact match means that deviceId, priority, selector,\n * tableId, flowId and treatment are equal. Note that this differs from\n * the notion of object equality for flow rules, which does not consider the\n * flowId or treatment when testing equality.\n * </p>\n *\n * @param rule other rule to match against\n * @return true if the rules are an exact match, otherwise false\n */\n boolean exactMatch(FlowRule rule);\n\n /**\n * A flowrule builder.\n */\n interface Builder {\n\n /**\n * Assigns a cookie value to this flowrule. Mutually exclusive with the\n * fromApp method. This method is intended to take a cookie value from\n * the dataplane and not from the application.\n *\n * @param cookie a long value\n * @return this\n */\n Builder withCookie(long cookie);\n\n /**\n * Assigns the application that built this flow rule to this object.\n * The short value of the appId will be used as a basis for the\n * cookie value computation. It is expected that application use this\n * call to set their application id.\n *\n * @param appId an application id\n * @return this\n */\n Builder fromApp(ApplicationId appId);\n\n /**\n * Sets the priority for this flow rule.\n *\n * @param priority an integer\n * @return this\n */\n Builder withPriority(int priority);\n\n /**\n * Sets the deviceId for this flow rule.\n *\n * @param deviceId a device id\n * @return this\n */\n Builder forDevice(DeviceId deviceId);\n\n /**\n * Sets the table id for this flow rule, when the identifier is of type {@link TableId.Type#INDEX}. Default\n * value is 0.\n * <p>\n * <em>Important:</em> This method is left here for backward compatibility with applications that specifies\n * table identifiers using integers, e.g. as in OpenFlow. Currently there is no plan to deprecate this method,\n * however, new applications should favor using {@link #forTable(TableId)}.\n *\n * @param tableId an integer\n * @return this\n */\n Builder forTable(int tableId);\n\n /**\n * Sets the table identifier for this flow rule.\n * Default identifier is of type {@link TableId.Type#INDEX} and value 0.\n *\n * @param tableId table identifier\n * @return this\n */\n Builder forTable(TableId tableId);\n\n /**\n * Sets the selector (or match field) for this flow rule.\n *\n * @param selector a traffic selector\n * @return this\n */\n Builder withSelector(TrafficSelector selector);\n\n /**\n * Sets the traffic treatment for this flow rule.\n *\n * @param treatment a traffic treatment\n * @return this\n */\n Builder withTreatment(TrafficTreatment treatment);\n\n /**\n * Makes this rule permanent on the dataplane.\n *\n * @return this\n */\n Builder makePermanent();\n\n /**\n * Makes this rule temporary and timeout after the specified amount\n * of time.\n *\n * @param timeout an integer\n * @return this\n */\n Builder makeTemporary(int timeout);\n\n /**\n * Sets the idle timeout parameter in flow table.\n *\n * Will automatically make it permanent or temporary if the timeout is 0 or not, respectively.\n * @param timeout an integer\n * @return this\n */\n default Builder withIdleTimeout(int timeout) {\n if (timeout == 0) {\n return makePermanent();\n } else {\n return makeTemporary(timeout);\n }\n }\n\n /**\n * Sets hard timeout parameter in flow table.\n * @param timeout an integer\n * @return this\n */\n Builder withHardTimeout(int timeout);\n\n /**\n * Sets reason parameter received from switches .\n * @param reason a short\n * @return this\n */\n Builder withReason(FlowRemoveReason reason);\n\n /**\n * Builds a flow rule object.\n *\n * @return a flow rule.\n */\n FlowRule build();\n\n }\n}", "public Builder setRuleBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n rule_ = value;\n onChanged();\n return this;\n }" ]
[ "0.6758241", "0.66073847", "0.6324158", "0.5882989", "0.58308566", "0.58160627", "0.56775767", "0.5629937", "0.5585979", "0.558538", "0.5547636", "0.5541968", "0.553581", "0.5533254", "0.55036545", "0.55036545", "0.55036545", "0.5481315", "0.54485416", "0.5419642", "0.53476197", "0.5337188", "0.53014475", "0.53004724", "0.52729964", "0.52644557", "0.526205", "0.52599156", "0.52554446", "0.52106124", "0.51971495", "0.5167773", "0.5162868", "0.5143033", "0.51352286", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.513514", "0.51316065", "0.51162964", "0.51018506", "0.5070313", "0.50133187", "0.501097", "0.5006078", "0.5005819", "0.499506", "0.49879688", "0.4986693", "0.49839061", "0.49765792", "0.49757215", "0.49669006", "0.49591646", "0.4949548", "0.49479246", "0.48998997", "0.4894581", "0.48887685", "0.48873442", "0.48845914", "0.4870449", "0.4862182", "0.4850548", "0.4848361", "0.48347676", "0.48257735", "0.48255107", "0.48247758", "0.48231375", "0.48219362", "0.48191807", "0.48171392", "0.4809339", "0.48059994", "0.48044145", "0.48017424", "0.4799419", "0.4795082", "0.47944537", "0.4792266", "0.47912973", "0.47909856", "0.47841352", "0.47763908", "0.47743317", "0.47739196", "0.47724056", "0.47707915" ]
0.6288047
3
System.out.println("The fruit has grown!");
private void grow(){ berries.replaceAll((p, v) -> v + 1); apples.replaceAll((p, v) -> v + 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eat(){\r\n System.out.println(\"Life Isn't Precious\");}", "public static void hello() {\n System.out.println(\"The coffee machine has:\\n\" +\n waterStock + \" of water\\n\" +\n milkStock + \" of milk\\n\" +\n coffeeBeansStock + \" of coffee beans\\n\" +\n disposableCup + \" of disposable cups\\n\" +\n moneyStock + \" of money\\n\");\n }", "public void eat()\n {\n System.out.println(\"You have eaten now and you are not hungry any more\");\n }", "private void eat3(){\n System.out.println(\"Fried Chicken\");\r\n }", "public void eat(){\n System.out.println(\"Bat Eatz\");\n }", "public static void goodBye() {\n System.out.println(\"\\nThe coffee machine has:\\n\" +\n waterStock + \" of water\\n\" +\n milkStock + \" of milk\\n\" +\n coffeeBeansStock + \" of coffee beans\\n\" +\n disposableCup + \" of disposable cups\\n\" +\n moneyStock + \" of money\\n\");\n }", "public void fly() {\r\n\t\tSystem.out.print(\"This Goose flies\");\r\n\t}", "public void show() {\n System.out.println(\"I am the best\");\n }", "public void eat() {\r\n System.out.println(\"ORANGES\");\r\n }", "public void speak(){\n System.out.println(\"Smile and wave boys. Smile and wave.\");\n }", "private void oops(){\n\t\tSystem.out.println(\"Oops! \" +getCandyName() +\" is delicious! I ate that one.\");\n\t}", "void println(String message);", "void programming() {\n\t\tSystem.out.println(\"Programming is amazing\");\n\t}", "public void displayTextToConsole();", "public void juice()\n\t{\n\t\tSystem.out.println(\"Pepsi juice\");\n\t}", "public static void bark(){\n System.out.println(\"I am barking\");\n }", "public void println();", "@Override\n\tpublic String eat() {\n\t\treturn \"The dog eats meat\";\n\t}", "@Override\n\tpublic void eatfood() {\n\t\tSystem.out.println(\"==pig : 잡식 ==\");\n\t}", "public void speak(){\n System.out.println(\"Shark bait oooh ha haa!\");\n }", "public void talking(){\n System.out.println(\"PetOwner : *says something*\");\n }", "public void speak() {\r\n\t\tSystem.out.print(\"This Goose speaks\");\r\n\t}", "public static void main (String [] args){\n System.out.println(\"Hello, Word\");\n }", "public void sentence(){\n \n System.out.println(\"Your first boyfriend's name was \" + getName() + \".\\n\");\n }", "private void mian()\r\n {\n System.out.println(\"Hello World222222221111\");\n System.out.println(\"12345\");\n }", "public static void main(String[] args) throws Exception {\nSystem.out.println(\"i love nayanthara\");\nSystem.out.println(\"i love trisha\");\nSystem.out.println(\"i love keerthisuresh\");\n\n \n \n\t }", "public void ruff() {\n System.out.println(\"The dog says ruff.\");\n }", "public void eat () {\n System.out.println(\"He's eating everything\" );\n }", "@Override\r\n\tpublic void alimentar() {\n\t\tSystem.out.print(\" como carne, yummy, yummy\");\r\n\t}", "public void breathe(){\n\n System.out.println(\"Through big nostrills\");\n }", "public void eat() {\n\t\tSystem.out.println(\"They eat...\");\n\t}", "void bark(){\r\n\t\tSystem.out.println(\"barking...\");\r\n\t}", "public void display(){\n System.out.println(\"I am a mallard duck\");\n }", "public void t(){\n System.out.println( \"Some text \"); \n }", "public void barking()\r\n {\r\n \tSystem.out.println (\"Woof Woof\");\r\n }", "public void bad(){\n\t\tSystem.out.println(\"you mom's a beautiful woman\");\r\n\t}", "static void sayHello() {\n\t\tSystem.out.println(\"Hello!\");\n\t}", "public static void better() {\n System.out.println(\"I am 'efficient'\");\n }", "public void speak() {\r\n\t\tSystem.out.print(\"This animal speaks\");\r\n\t}", "void bark(){\n\n System.out.println(\"=== baking !!! =====\");\n }", "public static void sayHello() {\r\n System.out.println(\"Hello\");\r\n }", "void eat() {\n\t\tSystem.out.println(\"eating...\");\n\t}", "private void sysout() {\nSystem.out.println(\"pandiya\");\n}", "public void cowSound() {\n System.out.println(\"The cow sounds : meeee\");\n }", "@Override\n public void eatMeat()\n {\n setEatText(\"nomnomnom oink thx\");\n System.out.println(getEatText());\n }", "public void speak()\n\t {\n\t \tSystem.out.printf(\"%s chants: Four legs good, Two legs BETTER\\n\", this.getName());\n\t }", "public static void sayHello() {\n System.out.println(\"Hello!\");\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"猫吃鱼\");\n\t}", "public void speak(){\n System.out.println(\"Hi my name is \" + name + \".\\n\" +\n \"I am \" + age + \"years old and \" + height + \" feet tall.\");\n }", "static void sayHello() {\r\n System.out.println(\"Hello World\");\r\n }", "public void Practice1(){\n System.out.println(\"Hello\");\n }", "public void car(){\n\t\t\tSystem.out.println(\"My car is BMW\");\n\t\t}", "@Override\n\tpublic void compete() {\n\t\tSystem.out.println(\"Pawan is competing as a swimming Athlete \");\n\t\t\n\t}", "public void bark() {\n System.out.println(\"bark!\");\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"狗吃肉\");\n\t}", "void eat() {\n\t\tname = \"jack\";\n\t\tSystem.out.println(name + \"eating bread...\");\n\t}", "@Override\n\tpublic void cry() {\n\t\tSystem.out.println(\"黄种人-哭\");\n\t}", "String print() {\n\t\treturn \"Hi\";\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"hello\");\r\nSystem.out.println(\"world\");\r\nSystem.out.println(\"haaai\");\r\nSystem.out.println(\"hell\");\r\n\t}", "public static void main(String [] args)\n {\n System.out.println(\"Programming is great fun!\");\n }", "void printSeasonalFruit() { System.out.println( name() + \" : Mango\" ); }", "public void monsterSound(){\n System.out.println(\"\\n\\nYou hear gutteral moans and the shambling of a creature nearby.\\n\\n\");\n }", "public void haha(){\n System.out.println(\"thavasi\");\n }", "@Override\n public void food(){\n System.out.println(\"They are Herbivorous in nature.\");\n }", "public static void main(String[] args) {\n System.out.println(\"Hi Everyone\");\n //it is needed to be able to work with the team remotely\n System.out.println(\"I am happy to learn something new\");\n //i need to focus on practicing\n }", "public static void main (String [] args)\n\t{\n\t\tString line = \"I think it's cool to be a programmer\";\n\t\tSystem.out.println(line); \n\t}", "@Override\r\n\tpublic void program() {\n\t\tSystem.out.println(\"我是一名Java工程师\");\r\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"Diligence Is Our Problem As the Youth of Today\");\n\t}", "public void fly() {\n\t\tSystem.out.println(\"我是比赛用排球, 我可以飞!\");\n\t}", "@Override\n\tpublic void call() {\n\t\tSystem.out.println(\"dog say: gau gau!\");\n\t}", "public void speak() {\r\n\t\tSystem.out.print(\"This Tiger speaks\");\r\n\t}", "private void printGoodbye()\n {\n System.out.println(\"Nice talking to you. Bye...\");\n }", "static void print (){\n \t\tSystem.out.println();\r\n \t}", "@Override\r\n\tpublic void getFruit() {\n\t\tSystem.out.println(\"我是苹果\");\r\n\t\t\r\n\t}", "@Override\n\tpublic void happyWithMan() {\n\t\tSystem.out.println(\"ÕýÄÇɶĨ¡£¡£¡£\");\n\t}", "@Override\r\n\tpublic String eat() {\n\t\treturn \"eats rats\";\r\n\t}", "void greet(String name) {\n\t\tSystem.out.println(\"Hello \"+name);\n\t}", "public void swim(){// this class only for fish class\n System.out.println(name+\" swimming\");\n }", "public static void main(String args[]){\n\tSystem.out.println(\"hi hello hi.\");\n}", "static void it(String s) {\n System.out.println(\" ======> \" + s);\n }", "public static void main(String[] args){\n System.out.println(\" -----------\");\n System.out.println(\" | WELCOME |\");\n System.out.println(\" -----------\");\n System.out.println(\" ^ ^ ^ ^ ^ ^\");\n System.out.println(\" / \\\\/ \\\\/ \\\\/ \\\\/ \\\\/ \\\\\"); //Use double backslashes to only\n System.out.println(\"|-G--J--J--2--1--5-|\"); //print one of them.\n System.out.println(\" \\\\ /\\\\ /\\\\ /\\\\ /\\\\ /\\\\ /\");\n System.out.println(\" v v v v v v\");\n //Print out short autobioographic statement\n System.out.println(\"I've gone hiking in the Austrian Alps and I plan\");\n System.out.println(\"to go back to backpack Europe for a summer\");\n \n }", "public void cars_of_my_father(){\n System.out.println(\"Royal Rayce, Maruti Suzuki, Mazda\");\n }", "public void gears(){\n\t\t System.out.println(\"bike has 4 gears ....\");\r\n\t\t//system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"Hello World!\"); // Display the string\n }", "public static void hi (String stuff){\n\t\tSystem.out.println(stuff);\n\t}", "@Override\r\n\t\t \t public void eat(String item) {\n\t\t \t\t System.out.println(\"Penguin eats fish\");\r\n\t\t \t\t\r\n\t\t }", "private static void print(String message)\n {\n System.out.println(message);\n }", "@Override\r\n\tpublic void simpleOperation() {\n\t\tSystem.out.println(\"I'm building house\");\r\n\r\n\t}", "@Override\n public void speak() {\n System.out.println(\"I'm an Aardvark, I make grunting sounds most of the time.\");\n }", "public void eat() {\n\t\tSystem.out.println(\"Ape eating\");\n\t}", "public static void say(String string){\n System.out.println(string);\n return;\n }", "public static void main(String[] args) {\nSystem.out.println(\"xin chào linh\");\n\n\n}", "static void salutare(String nume) {\n System.out.println(\"Hello \" + nume + \"!\");\n }", "@Override\n\tpublic void smile() {\n\t\tSystem.out.println(\"黄种人-笑\");\n\t}", "public void println()\n\t{\n\t\tSystem.out.println();\n\t}", "private void printGoodbye() {\n System.out.println();\n System.out.println(\"Thank you for playing. Good bye.\");\n }", "public void doSayGoodBye(){\n try {\n UtilityMethods.print(\"Hope you have enjoyed the day...\");\n } catch (Exception e) {\n UtilityMethods.print(e.getMessage());\n }\n }", "public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\n }", "public void display2(){\n System.out.println(\"codegym\");\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"사료를 먹다\");\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"I'm a yellow duck\");\n\t}" ]
[ "0.74794567", "0.7289995", "0.7145635", "0.7130762", "0.7112249", "0.7046853", "0.7033056", "0.70148575", "0.7006731", "0.69436455", "0.6899001", "0.68963724", "0.6873571", "0.68690366", "0.68643004", "0.6855284", "0.6854645", "0.68394834", "0.68291503", "0.682691", "0.6824375", "0.68115395", "0.67849624", "0.6780372", "0.67737556", "0.6753111", "0.6741698", "0.6735006", "0.6734555", "0.67326975", "0.6727927", "0.670605", "0.66985446", "0.66975784", "0.66873723", "0.66683054", "0.66619086", "0.6649689", "0.66488653", "0.6642223", "0.66304237", "0.66262907", "0.6621761", "0.66191506", "0.66020584", "0.6599386", "0.6596789", "0.65923077", "0.6586769", "0.65740114", "0.65668935", "0.6564436", "0.65632665", "0.65616727", "0.6555273", "0.6531645", "0.6521341", "0.6513153", "0.6510283", "0.6504372", "0.6495333", "0.64931947", "0.6490521", "0.64904976", "0.6473871", "0.64678335", "0.6467265", "0.6465573", "0.646165", "0.6459607", "0.64535356", "0.64532995", "0.6446451", "0.64446247", "0.6444554", "0.6442989", "0.6440017", "0.6438494", "0.64315575", "0.64300317", "0.6424806", "0.641904", "0.64166397", "0.64103454", "0.6405035", "0.6404602", "0.639374", "0.63895583", "0.637671", "0.6374709", "0.63739914", "0.6368457", "0.636795", "0.63606954", "0.63603294", "0.63596684", "0.63464344", "0.6339034", "0.6330138", "0.6329527", "0.63202494" ]
0.0
-1
If a snake is within SNAKE_ATTACK_RANGE tiles of truman, it will hunt him down.
private boolean shouldSnakeSeekTruman(Point snake, int trux, int truy){ return (Math.abs(snake.x - trux) < SNAKE_ATTACK_RANGE && Math.abs(snake.y - truy) < SNAKE_ATTACK_RANGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean tryAttack(Tile fromTile) {\r\n\t\tint size = getBoard().getTiles().length;\r\n\r\n\t\t// if attacker is on power-up tile\r\n\t\tif (fromTile.getTileType().equals(\"PowerUp\")) {\r\n\t\t\tif (fromTile.getPiece().getLEAGUE() == League.SHARK && fromTile.getTer().territoryName().equals(\"Shark\")) {\r\n\t\t\t\tfromTile.getPiece().setPower(fromTile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (fromTile.getPiece().getLEAGUE() == League.EAGLE && fromTile.getTer().territoryName().equals(\"Eagle\")) {\r\n\t\t\t\tfromTile.getPiece().setPower(fromTile.getPiece().getPower() + 1);\r\n\t\t\t} else if (fromTile.getTer().territoryName().equals(\"Neutral\")) {\r\n\t\t\t\tfromTile.getPiece().setPower(fromTile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if the defender is on power-up tile\r\n\t\tif (tile.getTileType().equals(\"PowerUp\")) {\r\n\t\t\tif (tile.getPiece().getLEAGUE() == League.SHARK && tile.getTer().territoryName().equals(\"Shark\")) {\r\n\t\t\t\ttile.getPiece().setPower(tile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (tile.getPiece().getLEAGUE() == League.EAGLE && tile.getTer().territoryName().equals(\"Eagle\")) {\r\n\t\t\t\ttile.getPiece().setPower(tile.getPiece().getPower() + 1);\r\n\t\t\t} else if (tile.getTer().territoryName().equals(\"Neutral\")) {\r\n\t\t\t\ttile.getPiece().setPower(tile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (fromTile.getPiece().getPower() >= tile.getPiece().getPower()) {\r\n\t\t\tif (tile.getPiece().getTYPE() == PieceType.FLAG) {\r\n\t\t\t\tfromTile.getPiece().setHasEnemyFlag(true);\r\n\t\t\t\tUtilities.infoAlert(\"Enemy Flag Captured!\", \"Get that piece with the flag back to your territory quickly!\");\r\n\t\t\t} else {\r\n\t\t\t\tif (tile.getPiece().getHasEnemyFlag() == true) {\r\n\t\t\t\t\tUtilities.infoAlert(\"Flag Recaptured!\", \"Enemy piece carrying your flag has been killed.\\nYour flag has respawned in your territory.\");\r\n\r\n\t\t\t\t\t// generate the dropped flag at its original position\r\n\t\t\t\t\t// or generate the dropped flag on first available tile on first or last row\r\n\t\t\t\t\t// if the default position has a piece on it\r\n\t\t\t\t\tif (tile.getPiece().getLEAGUE() == League.EAGLE) {\r\n\t\t\t\t\t\tif (getBoard().getTiles()[size - 1][(size / 2) - 1].getPiece() == null) {\r\n\t\t\t\t\t\t\tgetBoard().getTiles()[size - 1][(size / 2) - 1].setPiece(new SharkFlag());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tfor (int sharkCol = 0; sharkCol < getBoard().getTiles().length; sharkCol++) {\r\n\t\t\t\t\t\t\t\tif (getBoard().getTiles()[size - 1][sharkCol].getPiece() == null) {\r\n\t\t\t\t\t\t\t\t\tgetBoard().getTiles()[size - 1][sharkCol].setPiece(new SharkFlag());\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (getBoard().getTiles()[0][size / 2].getPiece() == null) {\r\n\t\t\t\t\t\t\tgetBoard().getTiles()[0][size / 2].setPiece(new EagleFlag());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tfor (int eagleCol = 0; eagleCol < getBoard().getTiles().length; eagleCol++) {\r\n\t\t\t\t\t\t\t\tif (getBoard().getTiles()[0][eagleCol].getPiece() == null) {\r\n\t\t\t\t\t\t\t\t\tgetBoard().getTiles()[0][eagleCol].setPiece(new EagleFlag());\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn movePiece(fromTile);\r\n\t\t} else {\r\n\t\t\tUtilities.infoAlert(\"Invalid action\", \"Enemy power level higher at level \" + tile.getPiece().getPower()\r\n\t\t\t\t\t+ \". \" + \"\\nYour current piece is not able to defeat it and has cowered back in fear.\");\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }", "public Location attack() {\n resetBoard();\n\n if (getHits().isEmpty()) {\n// System.out.println(\"Hunting\");\n\n for (final int[] r : board) {\n for (int c = 0; c < r.length; c++) {\n if (getIntegers().contains(5) && (c < (r.length - 4)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3]) && (-1 != r[c + 4])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n ++r[c + 4];\n }\n\n if (getIntegers().contains(4) && (c < (r.length - 3)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n }\n if (getIntegers().contains(3) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(2) && (c < (r.length - 1)))\n if ((-1 != r[c]) && (-1 != r[c + 1])) {\n ++r[c];\n ++r[c + 1];\n }\n }\n }\n\n for (int c = 0; c < board[0].length; c++) {\n for (int r = 0; r < board.length; r++) {\n if (getIntegers().contains(5) && (r < (board.length - 4)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n\n if (getIntegers().contains(4) && (r < (board.length - 3)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n if (getIntegers().contains(3) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(2) && (r < (board.length - 1)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n }\n }\n } else {\n// System.out.println(\"Hitting\");\n\n for (final Location hit : getHits()) {\n final int r = hit.getRow();\n final int c = hit.getCol();\n\n if (getIntegers().contains(2)) {\n if ((0 <= (c - 1)) && (-1 != board[r][c]) && (-1 != board[r][c - 1])) {\n ++board[r][c];\n ++board[r][c - 1];\n }\n\n\n if (((c + 1) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1])) {\n ++board[r][c];\n ++board[r][c + 1];\n }\n\n if ((0 <= (r - 1)) && (-1 != board[r][c]) && (-1 != board[r - 1][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n }\n\n if (((r + 1) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n\n\n }\n if (getIntegers().contains(3)) {\n final int inc = Collections.frequency(getIntegers(), 3);\n\n if ((0 <= (c - 2)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2])) {\n board[r][c] += inc;\n board[r][c - 1] += inc;\n board[r][c - 2] += inc;\n }\n if (((c + 2) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2])) {\n board[r][c] += inc;\n board[r][c + 1] += inc;\n board[r][c + 2] += inc;\n }\n if ((0 <= (r - 2)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c])) {\n board[r][c] += inc;\n board[r - 1][c] += inc;\n board[r - 2][c] += inc;\n }\n if (((r + 2) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n board[r][c] += inc;\n board[r + 1][c] += inc;\n board[r + 2][c] += inc;\n }\n\n\n }\n if (getIntegers().contains(4)) {\n if ((0 <= (c - 3)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n }\n if (((c + 3) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n }\n if ((0 <= (r - 3)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n }\n if (((r + 3) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n\n\n }\n if (getIntegers().contains(5)) {\n if ((0 <= (c - 4)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3]) && (-1 != board[r][c - 4])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n ++board[r][c - 4];\n }\n if (((c + 4) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3]) && (-1 != board[r][c + 4])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n ++board[r][c + 4];\n }\n if ((0 <= (r - 4)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c]) && (-1 != board[r - 4][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n ++board[r - 4][c];\n }\n if (((r + 4) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n }\n }\n\n for (final Location hit : getHits()) {\n board[hit.getRow()][hit.getCol()] = 0;\n }\n }\n\n// for (int[] i : board)\n// System.out.println(Arrays.toString(i));\n return findLargest();\n }", "private void action() {\r\n moveSnake();\r\n if (hasEatenPowerUp() == false) checkForCollisionWithSelf();\r\n if (hasHitBoundry() == false) redraw();\r\n }", "private void checkCollision() {\n\n for(int b = 1; b < snakeLength; b++){\n if(xLength[b] == xLength[0] && yLength[b] == yLength[0]) {\n right = false;\n left = false;\n down = false;\n up = false;\n gameOver = true;\n }\n }\n\n if(right){\n if(xLength[0] >= 825) {\n gameOver = true;\n }\n }\n if(left){\n if(xLength[0] <= 50) {\n gameOver = true;\n }\n }\n if(down){\n if(yLength[0] >= 600) {\n gameOver = true;\n }\n }\n if(up){\n if(yLength[0] <= 100) {\n gameOver = true;\n }\n }\n }", "private void checkForCollisionWithSelf() {\r\n if (isInSnake(snake[0].row,snake[0].column,true)) {\r\n gameOver();\r\n }\r\n }", "public void checkShipsSunk() {\n int sunkships = 0;\n int pos = 0; \n Ship ship;\n for(int i =0; i<5; i++) {\n ship = ships.get(i); \n if(ship.getSunk() == true) {\n sunkships++;\n pos = pos + ship.getLength(); \n }\n else{\n ship.setSunk(isSunk(ship.getLength(), pos));\n pos = pos + ship.getLength(); \n if(ship.getSunk() == true) {\n sunkships++;\n }\n }\n }\n shipsRemaining = 5 - sunkships; \n }", "public Answer shoot(){\n if (this.isOccuped()){\n this.ship.hit();\n if (this.ship.hasBeenSunk()){\n\tthis.hasBeenShot = true;\n return Answer.SUNK;\n }\n else{\n\tthis.hasBeenShot = true;\n return Answer.HIT;\n }\n }\n else{\n this.hasBeenShot = true;\n return Answer.MISSED;\n }\n }", "private boolean attemptSkaneAttack(Room room, Element e) {\n Skane ska = room.getSkane();\n if (ska.isBury())\n return false;\n\n if (e.attack(room, ska))\n return true;\n for (SkaneBody sb : ska.getBody()) {\n if (e.attack(room, sb))\n return true;\n }\n\n return false;\n }", "public void dropItLikeItsHot(){\n\t\tint score_increment = 0;\n\t\tPoint test_location = new Point(pieceOrigin);\n\t\twhile(true){\n\t\t\ttest_location.y += 1;\n\t\t\tif(!collides(test_location, currentPiece)){\n\t\t\t\tpieceOrigin.y += 1;\n\t\t\t\tscore_increment += 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tscore += score_increment*100;\n\t\tgossipGirl();\n\t\trepaint();\n\t}", "public void NPSShot()\n\t{\n\t\t//can only occur if a friendly missile and \n\t\t//a NPS are spawned\n\t\tif(gameObj[2].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint nps = new Random().nextInt(gameObj[2].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[2].remove(nps);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 500;\n\t\t\tSystem.out.println(\"A player misile has struck a NPS! +500 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An NPS and a friendly missile are not spawned\");\n\t}", "@Override\r\n\tpublic void tick(){\n\t\tif(!alert){\r\n\t\t\tif(hostileToPlayer&&closeEnoughToAlert(World.player))\r\n\t\t\t\t{alert=true;target=World.player;}\r\n\t\t}\r\n\t\t\r\n\t\tif(alert&&null!=target){\r\n\t\t\t//For now, advance towards the player\r\n\t\t\tPathfinder.moveTowards(this, target);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//If within attacking range but not yet attacking, and not stunned, do so.\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public void snakeUp(){\r\n\t\tspeedUp();\r\n\t\tpoints += 100;\r\n\t}", "public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void findEnemySnake() {\n // Cheap fix to GameState spawning a food on a person's HeadPiece\n if (this.gb.heads.size() == 1) {\n if (print) System.out.println(\" ONLY 1 HEAD FOUND IN GAME BOARD!\");\n HeadPiece h1 = this.gb.heads.get(0);\n if ((h1.getX() == this.us_head_x) && (h1.getY() == this.us_head_y)) {\n // fucking panic i guess\n if (print) System.out.println(\" CANNOT FIND ENEMY HEAD?????\");\n this.enemy_head_x = 0;\n this.enemy_head_y = 0;\n } else {\n // Correctly found enemy head\n this.enemy_head_x = h1.getX();\n this.enemy_head_y = h1.getY();\n }\n return;\n }\n\n // Find the enemy snake head and update member variables\n HeadPiece h1 = this.gb.heads.get(0);\n HeadPiece h2 = this.gb.heads.get(1);\n HeadPiece enemyHead;\n if ((h1.getX() == this.us_head_x) && (h1.getY() == this.us_head_y)) {\n enemyHead = h2;\n } else {\n enemyHead = h1;\n }\n this.enemy_head_x = enemyHead.getX();\n this.enemy_head_y = enemyHead.getY();\n }", "@Override\n\tpublic void takeHit(int attack) {\n\n\t}", "public ShotResult checkForHit(Admiral admiral, int playerShot) {\r\n\t\tAdmiral opponentAdmiral = returnOpponent(admiral);\r\n\t\tint[] mapGrid = opponentAdmiral.getMapGrid();\r\n\t\tadmiral.setCountOfPlayerShots((admiral.getCountOfPlayerShots()) + 1);\r\n\t\tShotResult result = ShotResult.Miss;\r\n\t\tIterator<Unit> iteratorForShips = opponentAdmiral.getFleet().iterator();\r\n\t\twhile (iteratorForShips.hasNext()) {\r\n\t\t\tUnit ship = iteratorForShips.next();\r\n\t\t\tArrayList<Integer> location = ship.getLocationCells();\r\n\t\t\tIterator<Integer> iteratorFofCells = location.iterator();\r\n\t\t\twhile (iteratorFofCells.hasNext()) {\r\n\t\t\t\tInteger cell = iteratorFofCells.next();\r\n\t\t\t\tif (cell == playerShot) {\r\n\t\t\t\t\tmapGrid[cell] = 2;\r\n\t\t\t\t\titeratorFofCells.remove();\r\n\t\t\t\t\tint countOfHits = ship.getHitsToSunk();\r\n\t\t\t\t\tship.setHitsToSunk(--countOfHits);\r\n\t\t\t\t\tif (ship.getHitsToSunk() == 0) {\r\n\t\t\t\t\t\tresult = ShotResult.Sunk;\t\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.println(\"Sunk \" + ship.getTypeOfShip() + \" \"+ ship.getName());\r\n\t\t\t\t\t\titeratorForShips.remove();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tresult = ShotResult.Hit;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (result.equals(ShotResult.Miss)) {\r\n\t\t\tmapGrid[playerShot] = -1;\r\n\t\t}\r\n\t\tif (returnOpponent(admiral).getFleet().isEmpty()) {\r\n\t\t\tgameWin = true;\r\n\t\t\twinner = admiral;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void eat(){\n if (threshold<=0 && !lapar) revLapar();\n if (lapar && Common.gamemap.get(getX()).get(getY()).showSymbol()=='@'){\n Common.gamemap.get(getX()).get(getY()).ungrowGrass();\n revLapar();\n threshold = 12;\n }\n }", "public void tick() {\n if (ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL) {\n --this.attackTime;\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n ShulkerEntity.this.getLookController().setLookPositionWithEntity(livingentity, 180.0F, 180.0F);\n double d0 = ShulkerEntity.this.getDistanceSq(livingentity);\n if (d0 < 400.0D) {\n if (this.attackTime <= 0) {\n this.attackTime = 20 + ShulkerEntity.this.rand.nextInt(10) * 20 / 2;\n ShulkerEntity.this.world.addEntity(new ShulkerBulletEntity(ShulkerEntity.this.world, ShulkerEntity.this, livingentity, ShulkerEntity.this.getAttachmentFacing().getAxis()));\n ShulkerEntity.this.playSound(SoundEvents.ENTITY_SHULKER_SHOOT, 2.0F, (ShulkerEntity.this.rand.nextFloat() - ShulkerEntity.this.rand.nextFloat()) * 0.2F + 1.0F);\n }\n } else {\n ShulkerEntity.this.setAttackTarget((LivingEntity)null);\n }\n\n super.tick();\n }\n }", "public void attack(Creature target) {\r\n\t\t//Check if attacker is within 1 tile\r\n\t\tint destx = (int) (target.getXlocation()/Tile.TILEWIDTH);\r\n\t\tint desty = (int) (target.getYlocation()/Tile.TILEHEIGHT);\r\n\t\tVector2i start = new Vector2i((int) (creature.getXlocation() / Tile.TILEWIDTH), (int) (creature.getYlocation()/ Tile.TILEHEIGHT));\r\n\t\t//FIND SHORTEST DISTANCE\r\n\t\tVector2i destination = null; \t\t\r\n\t\tdouble shortest = 100000; \t\t\t\t\t\t\t\t\t\t //Set huge\r\n\t\tbyte Direction = 2;\t\t\t\t\t\t\t\t\t\t\t\t //default Look DOWN\r\n\t\tdouble temp = getDistance(start, new Vector2i(destx+1, desty)); //Check first\r\n\t\tif (shortest > temp && !handler.getWorld().getTile(destx+1, desty).isSolid() && !checkCollision(destx+1, desty)) {\r\n\t\t\tshortest = temp;\r\n\t\t\tdestination = new Vector2i(destx+1, desty);\r\n\t\t\tDirection = 1;\t\t\t\t\t\t\t\t\t\t\t\t //Look LEFT\r\n\t\t}\r\n\t\ttemp = getDistance(start, new Vector2i(destx-1, desty)); \t\t //Check second\r\n\t\tif (shortest > temp && !handler.getWorld().getTile(destx-1, desty).isSolid() && !checkCollision(destx-1, desty)) {\r\n\t\t\tshortest = temp;\r\n\t\t\tdestination = new Vector2i(destx-1, desty);\r\n\t\t\tDirection = 3;\t\t\t\t\t\t\t\t\t\t\t\t //Look RIGHT\r\n\t\t}\r\n\t\ttemp = getDistance(start, new Vector2i(destx, desty+1)); \t\t //Check third\r\n\t\tif (shortest > temp && !handler.getWorld().getTile(destx, desty+1).isSolid() && !checkCollision(destx, desty+1)) {\r\n\t\t\tshortest = temp;\r\n\t\t\tdestination = new Vector2i(destx, desty+1);\r\n\t\t\tDirection = 0;\t\t\t\t\t\t\t\t\t\t\t\t //Look UP\r\n\t\t}\r\n\t\ttemp = getDistance(start, new Vector2i(destx, desty-1)); \t\t //Check fourth\r\n\t\tif (shortest > temp && !handler.getWorld().getTile(destx, desty-1).isSolid() && !checkCollision(destx, desty-1)) {\r\n\t\t\tshortest = temp;\r\n\t\t\tdestination = new Vector2i(destx, desty-1);\r\n\t\t\tDirection = 2;\t\t\t\t\t\t\t\t\t\t\t\t //Look DOWN\r\n\t\t}\r\n\t\t//SET PATH FOR SHORTEST DISTANCE\r\n\t\tList<Node> path = pf.findPath(start, destination);\r\n\t\t//FOLLOW SHORTEST DISTANCE PATH\r\n\t\tfollowPath(path);\r\n\t\t//IF ATTACKER HAS ARRIVED\r\n\t\tif (creature.getxMove() == 0 && creature.getyMove() == 0) {\r\n\t\t\t//face target -> \r\n\t\t\tcreature.setLastDirection(Direction);\r\n\t\t\t//attack\r\n\t\t\tcreature.setAttacking(true);\r\n\t\t} else {\r\n\t\t\tcreature.setAttacking(false);\r\n\t\t}\r\n\t}", "@Override\n\tpublic String attack(Game game) {\n\t\tString text = \"\";\n\t\tremoved_laketile = new ArrayList<LakeTile>();\n\t\tremoved_position = new ArrayList<Position>();\n\t\tLakeTile[][] board = game.getPlayArea().getLakeTilesOnBoard();\n\t\tRandom r = new Random();\n\t\tint number_laketile_onboard = countLakeTileOnBoard(board);\n\t\tif (number_laketile_onboard == 0) {\n\t\t\treturn \"Passing Power Boat attacking but there is nothing on the board\";\n\t\t} else {\n\t\t\tint number_remove_laketile = r.nextInt(number_laketile_onboard) + 1;\n\t\t\tfor (int i = 0; i < number_remove_laketile; i++) {\n\t\t\t\tremoveALakeTile(game);\n\t\t\t}\n\t\t\ttext += showText();\n\t\t\treturn \"Passing Power Boat attacking on position ::\\n\" + text + \"\\n\";\n\t\t}\n\t}", "public void playerHasSword() {\n\t\tthis.state = canBeKilled;\n\t}", "public void PSShot()\n\t{\n\t\t//collision can only occur if an enemy missile and a PlayerShip are spawned\n\t\tif(gameObj[1].size() > 0 && gameObj[3].size() > 0)\n\t\t{\n\t\t\tint mis = new Random().nextInt(gameObj[3].size());\n\t\t\tgameObj[1].remove(0);\n\t\t\tgameObj[3].remove(mis);\n\t\t\tlives--;\n\t\t\tSystem.out.println(\"An enemy missile has struck a PS -1 life\");\n\t\t\tif(lives >0) \n\t\t\t\tSystem.out.println(\"you have \" + lives + \" left\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Game over\");\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship and an enemy missile are not spawned\");\t\t\n\t}", "public void asteroidShot()\n\t{\n\t\t//collision can only occur if at least 1 asteroid\n\t\t//and one missile are currently spawned\n\t\tif(gameObj[0].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 100;\n\t\t\tSystem.out.println(\"A friendly missile has struck an asteroid! +100 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An asteroid and a friendly missile are not spawned\");\n\t}", "private void huntMode() {\n if (!alreadyHit(hitLocationX+1, hitLocationY)){ // tests to see if they're already shot at\n if (hitLocationX < 9) { // doesn't add if they're on a border\n huntList.add(new Point(hitLocationX + 1, hitLocationY));\n huntCount++;\n huntModeActive++;\n }\n }\n if (!alreadyHit(hitLocationX, hitLocationY+1)){\n if (hitLocationY < 9) {\n huntList.add(new Point(hitLocationX, hitLocationY + 1));\n huntCount++;\n huntModeActive++;\n }\n }\n if (!alreadyHit(hitLocationX-1, hitLocationY)){\n if (hitLocationX > 0) {\n huntList.add(new Point(hitLocationX - 1, hitLocationY));\n huntCount++;\n huntModeActive++;\n }\n }\n if (!alreadyHit(hitLocationX, hitLocationY-1)){\n if (hitLocationY > 0) {\n huntList.add(new Point(hitLocationX, hitLocationY - 1));\n huntCount++;\n huntModeActive++;\n }\n }\n }", "public void checkCollisions() {\n\t\t List<Missile> missiles = player.getMissiles();\n\t\t for(Missile n : missiles) {\n\t\t\t Rectangle r1 = n.getBounds();\n\t\t\t for(Mushroom mush : mushrooms) {\n\t\t\t\t Rectangle r2 = mush.getBounds();\n\t\t\t\t r2.x += 8;\n\t\t\t\t if(r1.intersects(r2)) {\n\t\t\t\t\t mush.hitCnt += 1;\n\t\t\t\t\t if(mush.hitCnt == 3) {\n\t\t\t\t\t\t score += 5;\n\t\t\t\t\t\t n.setVisible(false);\n\t\t\t\t\t\t mush.setVisible(false);\n\t\t\t\t\t } else {\n\t\t\t\t\t\t score += 1;\n\t\t\t\t\t\t n.setVisible(false);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if Missile hits Centipede\n\t\t //missiles = player.getMissiles();\n\t\t for(Missile m: missiles) {\n\t\t\t Rectangle rm = m.getBounds();\n\t\t\t for(int i = 0; i < centipede.size(); i++) {\n\t\t\t\t Segment s = centipede.get(i);\n\t\t\t\t Rectangle rs = s.getBounds();\n\t\t\t\t if(rs.intersects(rm)) {\n\t\t\t\t\ts.hit();\n\t\t\t\t\tscore = (s.hitCnt < 2 ? score +2 : score + 0);\n\t\t\t\t\tif(s.hitCnt == 2){\n\t\t\t\t\t\t//split centipede\n\t\t\t\t\t\tscore += 5;\n\t\t\t\t\t\tm.setVisible(false);\n\t\t\t\t\t\tcentipede.remove(i);\n\t\t\t\t\t\t//mushrooms.add(new Mushroom(s.getX(), s.getY()));\n\t\t\t\t\t}else {\n\t\t\t\t\t\tm.setVisible(false);\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if missile hits spider\n\t\t missiles = player.getMissiles();\n\t\t for(Missile m : missiles) {\n\t\t\t Rectangle mBound = m.getBounds();\n\t\t\t Rectangle spiderBound = spider.getBounds();\n\t\t\t if(mBound.intersects(spiderBound)) {\n\t\t\t\t spiderHitCnt += 1;\n\t\t\t\t if(spiderHitCnt == 2) {\n\t\t\t\t\t m.setVisible(false);\n\t\t\t\t\t spider.setVisible(false);\n\t\t\t\t\t score += 600;\n\t\t\t\t } else {\n\t\t\t\t\t score += 100;\n\t\t\t\t\t m.setVisible(false);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if centipede hits mushroom\n\t\t for(Segment c : centipede) {\n\t\t\t Rectangle cB = c.getBounds();\n\t\t\t for(Mushroom m: mushrooms) {\n\t\t\t\t Rectangle mB = new Rectangle(m.getX(), m.getY() + 5, m.getWidth(), m.getHeight() - 10);\n\t\t\t\t mB.y += 3;\n\t\t\t\t if(cB.intersects(mB)) {\n\t\t\t\t\t//makes each segment to go downs\n\t\t\t\t\tc.y += 16;\n\t\t\t\t\tc.dx = -c.dx;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if Centipede hits Player\n\t\t Rectangle playerBounds = player.getBounds();\n\t\t for(Segment s : centipede) {\n\t\t\t Rectangle sB = s.getBounds();\n\t\t\t if(playerBounds.intersects(sB)) {\n\t\t\t\t playerLives -= 1;\n\t\t\t\t playerHitCnt += 1;\n\t\t\t\t if(playerHitCnt > MAX_HIT_COUNT) {\n\t\t\t\t\t// System.out.println(playerLives+\" \"+ x);\n\t\t\t\t\t player.setVisible(false);\n\t\t\t\t\t inGame = false;\n\t\t\t\t }else {\n\t\t\t\t\t\tplayer.x = 707;\n\t\t\t\t\t\tplayer.y = 708;\n\t\t\t\t\t\tPoint location = getLocationOnScreen();\n\t\t\t\t\t\trobot.mouseMove(location.x + 250, location.y + 425);\n\t\t\t\t\t\tplayer = new Player(300, 400);\n\t\t\t\t\t\tregenMushrooms();\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\n\t\t //check if Spider hits Player\n\t\t playerBounds = player.getBounds();\n\t\t Rectangle spiderBounds = spider.getBounds();\n\t\t if(spiderBounds.intersects(playerBounds)) {\n\t\t\tplayerLives -= 1;\n\t\t\tplayerHitCnt += 1;\n\t\t\tif(playerLives > MAX_HIT_COUNT) {\n\t\t\t\t//System.out.println(playerLives+\" \"+ y);\n\t\t\t\tplayer.setVisible(false);\n\t\t\t\tspider.setVisible(false);\n\t\t\t}else {\n\t\t\t\tregenMushrooms();\n\t\t\t\tcentipede.clear();\n\t\t\t\tcreateCentipede();\n\t\t\t\tplayer.x = 707;\n\t\t\t\tplayer.y = 708;\n\t\t\t\tPoint location = getLocationOnScreen();\n\t\t\t\trobot.mouseMove(location.x + 250, location.y + 425);\n\t\t\t\tplayer = new Player(300, 400);\n\t\t\t}\n\t\t}\n\t }", "private void checkCollision() {\n for (int i = snakeSize; i > 0; i--) {\n if (i>4 && x[0] == x[i] && y[0] == y[i]){\n isInGame=false;\n }\n }\n\n if (x[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (x[0] < 0) {\n isInGame=false;\n }\n\n if (y[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (y[0] < 0) {\n isInGame=false;\n }\n\n\n }", "private boolean isMyWormInShootingRange(Direction d) {\n MyWorm currentWorm = getCurrentWorm(gameState);\n // direction N(0, -1), NE(1, -1), E(1, 0), SE(1, 1), S(0, 1), SW(-1, 1), W(-1,0), NW(-1, -1)\n Worm[] myWorms = player.worms;\n int i = 0;\n boolean found = false;\n while ((i < myWorms.length) && (!found)) {\n int weaponRange = currentWorm.weapon.range;\n if(myWorms[i].id != currentWorm.id && myWorms[i].health > 0){\n if ((d.name().equals(\"N\")) && (between(myWorms[i].position.y, currentWorm.position.y - weaponRange, currentWorm.position.y) && currentWorm.position.x == myWorms[i].position.x)) {\n found = true;\n }\n else if ((d.name().equals(\"E\")) && (between(myWorms[i].position.x, currentWorm.position.x + weaponRange, currentWorm.position.x) && currentWorm.position.y == myWorms[i].position.y)) {\n found = true;\n }\n else if ((d.name().equals(\"S\")) && (between(myWorms[i].position.y, currentWorm.position.y + weaponRange, currentWorm.position.y) && currentWorm.position.x == myWorms[i].position.x)) {\n found = true;\n }\n else if ((d.name().equals(\"W\")) && (between(myWorms[i].position.x, currentWorm.position.x - weaponRange, currentWorm.position.x) && currentWorm.position.y == myWorms[i].position.y)) {\n found = true;\n }\n else if ((d.name().equals(\"NE\")) && (between(myWorms[i].position.x, currentWorm.position.x + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n else if ((d.name().equals(\"SE\")) && (between(myWorms[i].position.x, currentWorm.position.x + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n else if ((d.name().equals(\"SW\")) && (between(myWorms[i].position.x, currentWorm.position.x - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n else if ((d.name().equals(\"NW\")) && (between(myWorms[i].position.x, currentWorm.position.x - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n\n }\n i++;\n }\n return found;\n }", "void collide() {\n for (Target t : this.helicopterpieces) {\n if (!t.isHelicopter && ((t.x == this.player.x && t.y == this.player.y)\n || (t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected--;\n t.isCollected = true;\n }\n if (t.isHelicopter && this.collected == 1\n && ((t.x == this.player.x && t.y == this.player.y) || (t.isHelicopter\n && this.collected == 1 && t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected = 0;\n this.helicopter.isCollected = true;\n }\n }\n }", "private void shoot() {\n\t\tif (playerList.size() > 0) {\n\t\t\tif (!someoneLose) {\n\t\t\t\tPlayer target = null;\n\t\t\t\tint remainingShips = SHIP_COUNT + 1;\n\t\t\t\tfor (Player player : playerList) {\n\t\t\t\t\tif (player.getRemainingShips() < remainingShips) {\n\t\t\t\t\t\ttarget = player;\n\t\t\t\t\t\tremainingShips = player.getRemainingShips();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSector targetSector = target.findFreeSector();\n\t\t\t\tlastTarget = targetSector.getMiddle();\n\t\t\t\tShootingThread st = new ShootingThread(chordImpl, targetSector.getMiddle());\n\t\t\t\tst.start();\n\t\t\t}\n\t\t}\n\t}", "private boolean hasHitBoundry() {\r\n if (snake[HEAD].row < 0 || \r\n snake[HEAD].row >= maxRows ||\r\n snake[HEAD].column < 0 ||\r\n snake[HEAD].column >= maxColumns) {\r\n gameOver();\r\n return true;\r\n }\r\n return false;\r\n }", "@Test\n public void bestowEnchantmentWillNotBeTapped() {\n addCard(Zone.BATTLEFIELD, playerA, \"Forest\", 6);\n addCard(Zone.BATTLEFIELD, playerA, \"Silent Artisan\");\n\n addCard(Zone.HAND, playerA, \"Boon Satyr\");\n\n // Enchantment {1}{W}\n // Creatures your opponents control enter the battlefield tapped.\n addCard(Zone.BATTLEFIELD, playerB, \"Imposing Sovereign\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Boon Satyr using bestow\", \"Silent Artisan\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n // because Boon Satyr is no creature on the battlefield, evolve may not trigger\n assertPermanentCount(playerA, \"Silent Artisan\", 1);\n assertPowerToughness(playerA, \"Silent Artisan\", 7, 7);\n // because cast with bestow, Boon Satyr may not be tapped\n assertTapped(\"Boon Satyr\", false);\n\n }", "public void enemyAttack() {\n Log.i(\"enemyAttack\", \"Begins\");\n AIisAttacking = true;\n setHit(false);\n\n // Loop until A.I. selects a cell it has not chosen before.\n int counter = 0;\n int myRow = 0, myCol = 0;\n boolean selectionFound = false;\n String aiSelectedHit = \"Empty\";\n Random newRow, newCol;\n\n while (selectionFound || counter < aiAttacks.size()) {\n selectionFound = false;\n // Select random row and col\n newRow = new Random();\n myRow = newRow.nextInt(maxN);\n newCol = new Random();\n myCol = newCol.nextInt(maxN);\n\n aiSelectedHit = myRow + \", \" + myCol;\n\n while (counter < aiAttacks.size()) {\n // Check if grid has been selected before\n if (aiAttacks.get(counter).equals(aiSelectedHit)) {\n selectionFound = true;\n counter = 0;\n break;\n }\n counter++;\n }\n }\n aiAttacks.add(aiSelectedHit);\n\n checkIfOccupied(myRow, myCol);\n\n if (getHit()) {\n ivCell[myRow][myCol].setImageResource(R.drawable.mushroom);\n Log.i(\"AI getHit\", \"\" + getHit() + \", (\" + myRow + \", \" + myCol + \")\");\n } else {\n ivCell[myRow][myCol].setImageResource(R.drawable.crater);\n Log.i(\"AI getHit\", \"\" + getHit() + \", (\" + myRow + \", \" + myCol + \")\");\n }\n AIisAttacking = false;\n Log.i(\"enemyAttack\", \"Ends\");\n }", "private static void attack(RobotInfo target) throws GameActionException {\n if (SOLDIER_DEBUG) {\n System.out.println(\"attacking\");\n }\n BulletInfo[] bullets = rc.senseNearbyBullets(EvasiveSoldier.BULLET_DETECT_RADIUS);\n RobotInfo[] robots = rc.senseNearbyRobots(EvasiveSoldier.ENEMY_DETECT_RADIUS);\n MapLocation targetLocation = target.getLocation();\n move(bullets, robots, targetLocation);\n //RobotUtils.tryMoveDestination(targetLocation);\n if (TargetingUtils.clearShot(here, target) || (rc.getType() == RobotType.GARDENER && rc.getOpponentVictoryPoints() > 10)) {\n if (SOLDIER_DEBUG) {\n System.out.println(\"clearShot to target\");\n }\n Direction towardsEnemy = here.directionTo(targetLocation);\n float distanceEnemy = here.distanceTo(targetLocation);\n if (distanceEnemy <= 3.5 && rc.canFirePentadShot() && rc.getTeamBullets() > 200) {\n rc.firePentadShot(towardsEnemy);\n }\n else {\n if (rc.canFireTriadShot() && rc.getTeamBullets() > 50) {\n rc.fireTriadShot(towardsEnemy);\n }\n else if (rc.canFireSingleShot()) {\n rc.fireSingleShot(towardsEnemy);\n }\n }\n }\n }", "public static void checkTurnEnd(){\n\t\tboolean end = true;\n\t\tfor (int i = 0; i < heroList.length && end; i++) {\n\t\t\t\n\t\t\tif (heroList[i].isAlive()){\n\t\t\t\tif (heroList[i].getOtherAction()){\n\t\t\t\t\tend = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (checkVictory()) {\n\t\t\tinBattle = false;\n\t\t\t//screenNumber = ID_POST_BATTLE_CUTSCENE;\n\t\t\t//gui.setScreenID(screenNumber);\n\t\t\tscreenNumber = ID_POST_BATTLE_CUTSCENE;\n\t\t\tCutscene.loadCutscene(player.getCurLevel(), false);\n\t\t\tgui.setScreenID(screenNumber);\n\t\t\tgui.initializeCutscene();\n\t\t\tplayer.setCurLevel(player.getCurLevel()+1);\n\t\t}\n\t\t\n\t\tif (end) {\n\t\t\tai.play();\n\t\t\tgui.setEnemyPath(ai.getMoveCommands());\n\t\t\t\n\t\t\ttotalEnemyAttacks = 0;\n\t\t\tcurEnemyAttacker = -1;\n\t\t\t\n\t\t\tfor (int i = 0; i < enemyList.length; i++){\n\t\t\t\t\n\t\t\t\tif (ai.getAttackCommands(i) != null){\n\t\t\t\t\ttotalEnemyAttacks++;\n\t\t\t\t\t\n\t\t\t\t\tif (curEnemyAttacker == -1){\n\t\t\t\t\t\tcurEnemyAttacker = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (totalEnemyAttacks > 0){\n\t\t\t\tgui.setEnemyHasAttackCommand(true);\n\t\t\t\tscreenNumber = ID_POST_BATTLE_CUTSCENE;\n\t\t\t\tisEnemyAttacking = true;\n\t\t\t\t//gui.setScreenID(screenNumber);\n\t\t\t\tString message = ((Enemy)enemyList[curEnemyAttacker]).getEnemyType() + \" did \" + ai.getAttackCommandsDamage(curEnemyAttacker) + \" damage to \" + ((Hero)ai.getAttackCommands(curEnemyAttacker)).getName() + \"!\";\n\t\t\t\tCutscene.loadAttackCutscene(((Enemy)enemyList[curEnemyAttacker]).getEnemyID() * -1 - 1, ai.getAttackCommands(curEnemyAttacker).getUnitID(), message, map.getTileNumber(enemyList[curEnemyAttacker].getCoordinate()));\n\t\t\t\t\n\t\t\t\tcurEnemyAttack = 1;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tplayer.resetAllHeroes();\n\t\t\t}\n\n\t\t}\n\t}", "public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public void move() {\n\t\tsetHealth(getHealth() - 1);\n\t\t//status();\n\t\tint row = getPosition().getRow() ;\n\t\tint column = getPosition().getColumn();\n\t\tint randomInt = (int)((Math.random()*2) - 1);\n\t\t\n\t\tif(hunter == false && row < 33) {\n\t\t\tif(row == 32) {\n\t\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(row == 0) {\n\t\t\t\tgetPosition().setCoordinates(row + 1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 99) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column - 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 0) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column + 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t}\n\t\tif(hunter == false && row > 32) {\n\t\t\t//setHealth(100);\n\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\tsetPosition(getPosition()) ;\n\t\t}\n\t\telse {\n\t\t\tif(row < 65 && hunter == true) {\n\t\t\t\tgetPosition().setCoordinates(row + 1, column);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgetPosition().setCoordinates(65, column);\n\t\t\t\tsetPosition(getPosition());\n\t\t\t\t//Check if there is a gazelle\n\t\t\t\tPair [][] range = {{Drawer.pairs[row+1][column-1],Drawer.pairs[row+1][column],\n\t\t\t\t\t\t\t Drawer.pairs[row+1][column+1]}, {\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column-1],\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column],Drawer.pairs[row+2][column+1]}};\n\t\t\t\t\n\t\t\t\tfor(Pair [] line: range) {\n\t\t\t\t\tfor(Pair prey: line) {\n\t\t\t\t\t\tif(prey.getAnimal() instanceof Gazelle ) {\n\t\t\t\t\t\t\tattack();\n\t\t\t\t\t\t\tprey.getAnimal().die();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void hit(int atk) {\n hp = hp - atk;\n }", "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 }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tfor (Damage damage : actionAttack.damages) {\r\n\t\t\t\t\t\t\t\tBattlerSprite attacked = damage.target.getTag();\r\n\t\t\t\t\t\t\t\tattacked.takeHit(damage.damage);\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "public void gameAttack(){\n int counter = 0;\n while (currentPlayer.wantToAttack(this)){\n counter++;\n if (counter > 100) break;\n /*In rare cases, AI players will repeatedly select the same attackers and defenders\n while also not wanting to dice fight. That will infinitely loop here and this counter will prevent it\n Under normal circumstances, no reasonable player will ever try to do more than 100 separate attacks in the same turn\n */\n\n String[] attackerDefender = {\"\",\"\"};\n //AttackStarterSelection\n attackerDefender[0] = currentPlayer.chooseAttackStarter(this);\n\n //AttackDefenderSelection\n attackerDefender[1] = currentPlayer.chooseAttackDefender(this, attackerDefender[0]);\n\n //DiceFightOrQuit\n int attackerDice, defenderDice;\n while (currentPlayer.wantToDiceFight(this, attackerDefender[0]+ \",\" + attackerDefender[1])){\n //DiceFightAttackerChoice\n attackerDice = currentPlayer.getAttackerDice(this, getTerritory(attackerDefender[0]));\n\n //DiceFightDefenderChoice\n Player defender = this.getPlayerFromList(this.getTerritory(attackerDefender[1]).getOwner());\n defenderDice = defender.getDefenderDice(this, this.getTerritory(attackerDefender[1]));\n\n\n //DiceFight results\n displayMessage(this.diceFight(attackerDefender, attackerDice,defenderDice));\n\n //Possible elimination and announcement of winner\n //Current diceFight ends if attacker has 1 troop left, or territory is conquered\n if (endDiceFight(attackerDefender, attackerDice)) break;\n\n }//End diceFightOrQuit\n\n\n }//End wantToAttack\n //Proceed to fortify stage of turn\n }", "public void checkForHits(){\n\t\tfor(Missile missile : this.missiles){\n\t\t\tif(missile != null && !missile.isDestroyed()){\n\t\t\t\t// Check buildings\n\t\t\t\tfor (int i = 0; i < this.buildings.length; i++) {\n\t\t\t\t\tif(!this.buildings[i].isDestroyed()){\n\t\t\t\t\t\tif (this.buildings[i].getHitBox().intersects(missile.getHitBox())) {\n\t\t\t\t\t\t\tthis.buildings[i].destroy();\n\t\t\t\t\t\t\tmissile.setDestroyed(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}\n\t\t\t\t// Check turrets\n\t\t\t\tfor (int i = 0; i < this.turrets.length; i++ ) {\n\t\t\t\t\tif(!this.turrets[i].isDestroyed()){\n\t\t\t\t\t\tif (!missile.isFriendly() && this.turrets[i].getHitBox().intersects(missile.getHitBox())) {\n\t\t\t\t\t\t\tthis.turrets[i].destroy();\n\t\t\t\t\t\t\tmissile.setDestroyed(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}\n\t\t\t\t\n\t\t\t\t// Checks Missile vs. Friendly Missile collisions\n\t\t\t\tfor (Missile fMissile : this.friendlyMissiles){\n\t\t\t\t\tif(!fMissile.isDestroyed() && fMissile != null){\n\t\t\t\t\t\tif (missile.getHitBox().intersects(fMissile.getHitBox())) {\n\t\t\t\t\t\t\tfMissile.setDestroyed(true);\n\t\t\t\t\t\t\tmissile.setDestroyed(true);\n\t\t\t\t\t\t\tthis.incrementScore(this.SCORE_INCREASE);\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}\n\t\t}\n\t}", "public void attack(Player opponent) {\n\t\t\n\t\tboolean ok = false;\n\t\tString coord = \"\";\n\t\t\n\n\t\twhile(!ok) {\n\t\t\tcoord = CoordCheck.getRandomCoordinate();\n\t\t\tif (!this.shots.contains(coord)) {\n\t\t\t\tok = true;\n\t\t\t\tthis.shots.add(coord);\n\t\t\t}\n\n\t\t}\n\t\ttry {\n\t\t\tthis.gameBoard.shot(opponent.getGameBoard(), coord);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public boolean check(double xDelt,double yDelt) {\r\n \tBounds pBound= player1.player.getBoundsInParent();\r\n \t\r\n \tfor( Node object: enemy1.hostileG.getChildren()) {\r\n \t\t\r\n \t\tif(object.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())){\r\n \t\t\teHealth -= inventory.getpDamage();\r\n \t\t\tpHealth -= 1;\r\n\r\n \t\t\tSystem.out.println(\"eHealth \"+ eHealth);\r\n \t\t\tSystem.out.println(\"pHealth \"+ pHealth);\r\n \t\t\t\r\n \t\t\t//\"Deaths of the sprites\"\r\n \t\t\tif(pHealth <=0) {\r\n \t\t\t\tlayout.getChildren().remove(player1.player);\r\n \t\t\t\tSystem.out.println(\"You died!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(eHealth <=0) {\r\n \t\t\t\tlayout.getChildren().remove(enemy1.enemy);\r\n \t\t\t\tenemy1.enemy.setLayoutX(-10000);\r\n \t\t\t\tenemy1.enemy.setLayoutY(-10000);\r\n \t\t\t}\r\n \t\treturn false;\r\n \t\t}\r\n }\r\n \t\r\n \tfor( Node object: map1.walls.getChildren()) {\r\n \t\tif(object.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())) return false;\r\n \t}\r\n \t\r\n \tfor( Node chest: map1.chests.getChildren()) {\r\n \tif(chest.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())){\r\n \t\tmap1.chests.getChildren().remove(chest);\r\n \t chestchose=inventory.getchestchose();\r\n \t \r\n \t if(chestchose==1) {\r\n \t \tinventory.sworda.setVisible(true);\r\n \t \tinventory.setpDamage(3);\r\n \t }\r\n \t if(chestchose==2) {\r\n \t \tinventory.healthbag.setVisible(true);\r\n \t }\r\n \t \r\n \t return false;\r\n \t} \r\n }\t\r\n \t\r\n return true;\r\n }", "public void attack(Entity defender) {\n\t\tboolean canAttack = true;\n\n\t\tif ((abilities[3] == false && abilities[2] == false)\n\t\t\t\t&& (Math.abs(defender.getPosX() - xCoordinate) > 1 || Math.abs(defender.getPosY() - yCoordinate) > 1))\n\t\t\treturn; // if not in range, don't attack (also cant attack self)\n\n\t\tfor (int i = xCoordinate - 1; i <= xCoordinate + 1; i++) {\n\t\t\tfor (int j = yCoordinate - 1; j <= yCoordinate + 1; j++) {\n\t\t\t\tif (Game.game.getEntityAt(i, j) != null && Game.game.getEntityAt(i, j) != this\n\t\t\t\t\t\t&& Game.game.getEntityAt(i, j).hasAbility(0)) {\n\t\t\t\t\tcanAttack = false; // checks to see if there is any provoke\n\t\t\t\t\t\t\t\t\t\t// troops adjacent to attacker\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (canAttack == false) // if something had provoke...\n\t\t{\n\t\t\tif (Math.abs(defender.getPosX() - xCoordinate) <= 1 && Math.abs(defender.getPosY() - yCoordinate) <= 1\n\t\t\t\t\t&& defender.hasAbility(0)) { // if the defender is in range,\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and has provoke. attack\n\t\t\t\t\t\t\t\t\t\t\t\t\t// it\n\t\t\t\tif (abilities[2]) // but if it has blast, also attack everything\n\t\t\t\t\t\t\t\t\t// else in row/col up until void troop\n\t\t\t\t{\n\t\t\t\t\tblastAttack(defender);\n\t\t\t\t} else if (abilities[0] || abilities[1] || abilities[3] || abilities[4]) {\n\t\t\t\t\tdealDamage(defender);\n\t\t\t\t}\n\t\t\t}\n\t\t} else // if there is nothing with provoke, you can just attack\n\t\t{\n\t\t\tif (abilities[2]) // if it has blast attack everything else in\n\t\t\t\t\t\t\t\t// row/col up until void troop\n\t\t\t{\n\t\t\t\tblastAttack(defender);\n\t\t\t} else if (abilities[0] || abilities[1] || abilities[3] || abilities[4]) {\n\t\t\t\tdealDamage(defender);\n\t\t\t}\n\t\t}\n\t}", "private void gameMove() {\n for (int x = 0; x < list.size() - 2; x++) {\n // check if snake is touch coin\n if (Snake().isTouching(list.get(x))) {\n Snake().collected();\n list.get(x).collected();\n }\n }\n Snake().move();\n }", "public void attack() {\n //Grab an attacker.\n Territory attacker = potentialAttackers.remove(0);\n \n //Find the weakest adjacent territory\n int victimStrength = Integer.MAX_VALUE;\n Territory victim = null;\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(attacker);\n for(Territory adj : adjs){\n \n //Verify that our odds are good enough for this attack to consider it.\n int aTroops = attacker.getNumTroops() - 1;\n int dTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(aTroops, dTroops);\n boolean yes = Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we have a chance of winning this fight and its the weakest opponent.\n if(yes && adj.getNumTroops() < victimStrength && !adj.getOwner().equals(this)){\n victim = adj;\n victimStrength = adj.getNumTroops();\n }\n }\n \n //Resolve the Attack by building forces and settle the winner in Victim's land\n Force atkForce = attacker.buildForce(attacker.getNumTroops() - 1);\n Force defForce = victim.buildForce(victimStrength); //Guaranteed not null\n Force winner = atkForce.attack(defForce);\n victim.settleForce(winner);\n }", "public boolean isWin_DragonKingOfArms(){\r\n // player got LordSelachii card\r\n /*Player playerHoldCard = null;\r\n for (Player player : discWorld.getPlayer_HASH().values()) {\r\n if (player.getPersonalityCardID() == 5) {\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }*/\r\n int count = 0;\r\n for(TroubleMarker troubleMarker : discWorld.getTroubleMarker_HASH().values()){\r\n if(troubleMarker.getAreaNumber() != ConstantField.DEFAULT_PIECE_AREA_NUMBER){\r\n count++;\r\n }\r\n }\r\n \r\n if(count >= 8){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n \r\n }", "public void shoot(int offset) throws InvalidPositionException {\n\n if (offset < 0 || offset >= this.getSize()) throw new InvalidPositionException(\"Invalid offset: \" + offset);\n\n this.statuses[offset] = ShipStatus.HIT;\n\n for (ShipStatus s: this.statuses) {\n\n if (s == ShipStatus.INTACT) return;\n\n }\n\n Arrays.fill(this.statuses, ShipStatus.SUNK);\n\n }", "public Answer shot (){\n if (this.is_shot()){\n return Answer.MISSED;\n }\n this.shot=true;\n if (this.is_Empty()){\n return Answer.MISSED;\n }\n this.ship.hitted();\n if (this.ship.isSunk()){\n return Answer.SUNK;\n }\n else {\n return Answer.HIT;\n }\n }", "public boolean hitDealer() {\r\n while (getHandValue() <= 16) {\r\n hit();\r\n }\r\n return getHandValue() <= 21;\r\n }", "public boolean checkSight() {\r\n\t\tint x = (int) (creature.getXlocation()/Tile.TILEWIDTH);\r\n\t\tint y = (int) (creature.getYlocation()/Tile.TILEHEIGHT);\r\n\t\t//Facing Left\r\n\t\tif (creature.getLastDirection() == 1) {\r\n\t\t\tif (checkSeesPlayer(x-1, y+1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x-1, y+1)) {\r\n\t\t\t\tif (checkSeesPlayer(x-2, y+1)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else if (checkSeesPlayer(x-2, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x-1, y)) {\r\n\t\t\t\treturn true; \r\n\t\t\t}else if (!checkCollision(x-1, y)) {\r\n\t\t\t\tif (checkSeesPlayer(x-2, y)) {\r\n\t\t\t\t\treturn true; \r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x-1, y-1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x-1, y-1)) {\r\n\t\t\t\tif (checkSeesPlayer(x-2, y-1)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else if (checkSeesPlayer(x-2, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t//Facing Right\r\n\t\t}else if (creature.getLastDirection() == 3) {\r\n\t\t\tif (checkSeesPlayer(x+1, y+1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x+1, y+1)) {\r\n\t\t\t\tif (checkSeesPlayer(x+2, y+1)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tif (checkSeesPlayer(x+2, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x+1, y)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x+1, y)) {\r\n\t\t\t\tif (checkSeesPlayer(x+2, y)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x+1, y-1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x+1, y-1)) {\r\n\t\t\t\tif (checkSeesPlayer(x+2, y-1)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tif (checkSeesPlayer(x+2, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t//Facing Up\r\n\t\t}else if (creature.getLastDirection() == 0) {\r\n\t\t\tif (checkSeesPlayer(x-1, y-1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x-1, y-1)) {\r\n\t\t\t\tif (checkSeesPlayer(x-1, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else if (checkSeesPlayer(x-2, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x, y-1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x, y-1)) {\r\n\t\t\t\tif (checkSeesPlayer(x, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x+1, y-1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x+1, y-1)) {\r\n\t\t\t\tif (checkSeesPlayer(x+1, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else if (checkSeesPlayer(x+2, y-2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t//Facing Down\r\n\t\t}else if (creature.getLastDirection() == 2) {\r\n\t\t\tif (checkSeesPlayer(x-1, y+1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x-1, y+1)) {\r\n\t\t\t\tif (checkSeesPlayer(x-1, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else if (checkSeesPlayer(x-2, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x, y+1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x, y+1)) {\r\n\t\t\t\tif (checkSeesPlayer(x, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else if (checkSeesPlayer(x+1, y+1)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else if (!checkCollision(x+1, y+1)) {\r\n\t\t\t\tif (checkSeesPlayer(x+1, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else if (checkSeesPlayer(x+2, y+2)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n\tpublic void testTAlive6() {\n\t\ttank.damage(proj);\n\t\tassertEquals(false, tank.isDeceased());\n\t}", "@Test\n\tpublic void testTAlive5() {\n\t\ttank.damage(proj);\n\t\ttank.damage(proj);\n\t\tassertEquals(false, tank.isDeceased());\n\t}", "private static void turretCode() throws GameActionException {\n\t\t//Attack Enemy\n\t\tRobotInfo[] visibleEnemyArray = rc.senseHostileRobots(rc.getLocation(), 1000000);\n\t\tSignal[] incomingSignals = rc.emptySignalQueue();\n\t\tSignal[] signals;\n\t\tif (incomingSignals.length>125) {\n\t\t\tsignals = new Signal[125];\n\t\t\tfor(int i=0; i<125; i++) {\n\t\t\t\tsignals[i]=incomingSignals[i];\n\t\t\t}\n\t\t} else {\n\t\t\tsignals = incomingSignals;\n\t\t}\n\t\tboolean unit = false;\n\t\tfor(Signal s:signals){\n\t\t\tint[] message = s.getMessage();\n\t\t\tif(s.getTeam()==rc.getTeam()){\n\t\t\t\tif(message!=null){\n\t\t\t\t\tif(message[0]%10==0){\n\t\t\t\t\t\tcenter = s.getLocation();\n\t\t\t\t\t\tint r = message[0]/10;\n\t\t\t\t\t\tradius=r;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tunit=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (visibleEnemyArray.length > 0 || unit) {\n\t\t\tif (rc.isWeaponReady()) {\n\t\t\t\trc.attackLocation(Utility.toAttack(visibleEnemyArray, incomingSignals));\n\t\t\t}\n\t\t}else{\n\t\t\tMapLocation travel=turretFind();\n\t\t\tif(travel!=rc.getLocation()){\n\t\t\t\tgoal = travel;\n\t\t\t\trc.pack();\n\t\t\t}\n\t\t}\t\t\t\n\t}", "@EventHandler\r\n\tpublic void run(PlayerInteractEvent e) {\n\t\tPlayer p = e.getPlayer();\r\n\t\t\tif (e.getAction()==Action.LEFT_CLICK_AIR && p.getInventory().getItemInMainHand().getType()==Material.WOOD_SWORD) {\r\n\t\t\t\tnew BukkitRunnable() {\r\n\t\t\t\tLocation loc = p.getLocation();\r\n\t\t\t\tLocation loc2 = p.getLocation();\r\n\t\t\t\tdouble t = 0.0;\r\n\t\t\t\t\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tint size = 5;\r\n\t\t\t\t\tfor(int i = 0; i < 360;i++) {\r\n\t\t\t\t\t\tdouble angle = (i*Math.PI/180);\r\n\t\t\t\t\t\tt+=0.25;\r\n\t\t\t\t\t\tif (t==1) {\r\n\t\t\t\t\t\t\tp.playSound(loc, Sound.ENTITY_PLAYER_ATTACK_SWEEP, 1, 0);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tdouble x =(size*Math.cos(angle));\r\n\t\t\t\t\t\tdouble y = 0.1;\r\n\t\t\t\t\t\tdouble z =(size*Math.sin(angle));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tint n = ran.nextInt(100);\r\n\t\t\t\t\t\tloc.add(x,y,z);\r\n\t\t\t\t\t\tif (t%1000==0)\r\n\t\t\t\t\t\t\tp.playSound(loc, Sound.ENTITY_IRONGOLEM_HURT, 1, 0);\r\n\t\t\t\t\t\tif(n>95) {\r\n\t\t\t\t\t\t\tParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc, Color.YELLOW);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tfor (Entity en : loc.getChunk().getEntities()){\r\n\t\t\t\t\t\t\t\tif (en.getLocation().distance(loc2) < size){\r\n\t\t\t \tif(en != p) {\r\n\t\t\t\t if(en.getType().isAlive()) { \r\n\t\t\t\t\t Damageable d = (Damageable) en;\r\n\t\t\t\t\t d.damage(5.0, p);\r\n\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t \t}\r\n\t\t\t }\r\n\t\t\t\t\t\t\r\n\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\tloc.subtract(x,y,z);\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\tif(t>5000.0) {\r\n\t\t\t\t\t\tthis.cancel();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.runTaskTimer(plugin, 0, 1);\r\n\t\t}\t\t\r\n\t}", "public int checkChasingPlayer()\n {\n if(stunCountdown > 0)\n {\n chasingPlayer = false;\n return stunCountdown;\n }\n if(Game.getInstance().getPlayer().getCurrentRoom().isControlRoom())\n {\n chasingPlayer = false;\n return(-1);\n }\n else\n {\n List<Exit> neighbors = getCurrentRoom().getCollectionOfExits();\n for(Exit neighbor : neighbors)\n {\n if(getCurrentRoom().getExit(neighbor).equals(Game.getInstance().getPlayer().getCurrentRoom()) && neighbor.isOperating())\n {\n chasingPlayer = true;\n return(5 + (int) Math.floor(Math.random() * 6));\n }\n }\n chasingPlayer = false;\n return(-1);\n }\n }", "public void sharkAttack() {\n if (fins>0) \n fins--;\n }", "private void swellMountains(Square[][]Squares, int rows, int columns, int[][] terrainLoc)\n {\n int swellRand = (int) Math.sqrt(grid);\n int swellRand2 = (int) Math.sqrt(grid);\n int swellTolerance;\n \n // make sure that the mountains are swelled in proportion to the grid shape\n if(columns>rows)\n {\n swellTolerance = rows/25+1;\n }\n else\n {\n swellTolerance = columns/25+1;\n }\n \n // creating new mountains around the seeds\n \n // going through every second row \n for (int a = 1; a < rows-2 ; a=a+2)\n {\n // going through every column\n for (int b = 1 ; b < columns-2 ; b++)\n { \n if (terrainLoc[a][b] == 1)\n {\n // if a mountain seed is found, start making a bigger mountain on it by creating\n // three differently shaped rectangles out of mountain tiles\n int scRand;\n \n // loop for going through each rectangle\n for(int c=0;c<3;c++)\n {\n // loop for randoming mountain tiles 20 times around the seed\n for(int d = 0;d<20;d++)\n {\n // create a vertical rectangle\n if(c==0)\n {\n swellRand = (int) ((Math.random() * Math.sqrt(grid))/20)+1;\n swellRand2 = (int) ((Math.random() * Math.sqrt(grid))/40)+1;\n }\n // create a horizontal rectangle\n if (c == 1)\n {\n swellRand = (int) ((Math.random() * Math.sqrt(grid))/40)+1;\n swellRand2 = (int) ((Math.random() * Math.sqrt(grid))/20)+1;\n }\n // create a square\n if (c==2)\n {\n swellRand = (int) ((Math.random() * Math.sqrt(grid))/30)+1;\n swellRand2 = (int) ((Math.random() * Math.sqrt(grid))/30)+1;\n }\n \n // randoming the actual place for a tile and making sure it does not go over the array\n scRand = (int) (Math.random() * 8) + 1;\n \n switch (scRand)\n {\n case 1:\n if(a+swellRand < rows && b+swellRand2 < columns)\n Squares[a+swellRand][b+swellRand2].setTerrain(1);\n \n case 2:\n if(a-swellRand >= 0 && b-swellRand2 >=0)\n Squares[a-swellRand][b-swellRand2].setTerrain(1);\n \n case 3: \n if(a+swellRand < rows && b-swellRand2 >=0)\n Squares[a+swellRand][b-swellRand2].setTerrain(1);\n \n case 4:\n if(a-swellRand > 0 && b+swellRand2 < columns)\n Squares[a-swellRand][b+swellRand2].setTerrain(1);\n \n case 5:\n if(a<rows && a>=0 && b+swellRand < columns)\n Squares[a][b+swellRand].setTerrain(1);\n \n case 6:\n if(a<rows && a>=0 && b-swellRand >= 0)\n Squares[a][b-swellRand].setTerrain(1);\n\n case 7:\n if(a+swellRand < rows && b>=0 && b<columns)\n Squares[a+swellRand][b].setTerrain(1);\n\n case 8:\n if(a-swellRand >= 0 && b>=0 && b<columns)\n Squares[a-swellRand][b].setTerrain(1);\n }\n }\n }\n }\n }\n }\n }", "public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }", "public void attack(int fromRow, int fromCol, int toRow, int toCol){\n this.numAttacked++;\n this.speak();\n System.out.println(\"Attack with lasers – other piece removed from game.\");\n }", "@Test\n public void testDiesByDamage() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 1);\n addCard(Zone.HAND, playerA, \"Lightning Bolt\");\n addCard(Zone.BATTLEFIELD, playerB, \"Dryad Militant\");\n\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Lightning Bolt\", \"Dryad Militant\");\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n \n assertLife(playerB, 20);\n \n assertExileCount(\"Lightning Bolt\", 1);\n }", "private void snack() {\n\t\t\tsynchronized (left) {\n\t\t\t\tsynchronized (right) {\n\t\t\t\t\tSystem.out.println(this.name + \" start to snack\");\n\t\t\t\t\tUtils.pause(1_000);\n\t\t\t\t\t// System.out.println(this.name + \" finished to snack\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(this.name + \" is not hungry\");\n\t\t}", "public void performAttack(){\r\n // For every zombie\r\n for (int i = 0 ; i < allZombies.getZombies().size(); i++) {\r\n // Variables used to prevent long getter lines\r\n int zombieX = allZombies.getZombies().get(i).getCurrX();\r\n int zombieY = allZombies.getZombies().get(i).getCurrY();\r\n Zombie zombie = allZombies.getZombies().get(i);\r\n // If the zombie is in range and alive:\r\n if(isInRange(zombieX,zombieY) && zombie.isAlive()) {\r\n // kill the zombie and increase score by 1.\r\n allZombies.getZombies().get(i).setAlive(false);\r\n increaseScore();\r\n }\r\n }\r\n }", "boolean attack(int sq, int s) {\n\tlong attackSq = (1L << sq);\n\tif (s == LIGHT) {\n\tlong moves = ((pawnBits[LIGHT] & 0x00fefefefefefefeL) >> 9)\n\t& attackSq;\n\tif (moves != 0)\n\treturn true;\n\tmoves = ((pawnBits[LIGHT] & 0x007f7f7f7f7f7f7fL) >> 7) & attackSq;\n\tif (moves != 0)\n\treturn true;\n\t} else {\n\tlong moves = ((pawnBits[DARK] & 0x00fefefefefefefeL) << 7)\n\t& attackSq;\n\tif (moves != 0)\n\treturn true;\n\tmoves = ((pawnBits[DARK] & 0x007f7f7f7f7f7f7fL) << 9) & attackSq;\n\tif (moves != 0)\n\treturn true;\n\t}\n\tlong pieces = pieceBits[s] ^ pawnBits[s];\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 (n == sq)\n\treturn true;\n\tif (color[n] != EMPTY)\n\tbreak;\n\tif (!slide[p])\n\tbreak;\n\t}\n\tpieces &= (pieces - 1);\n\t}\n\treturn false;\n\t}", "public boolean isSunk(){\n if(places.isEmpty()){\n //ship cant be sunk if empty\n return false;\n }\n\n //Checks each place in list for hit\n for(Place place : places){\n if(!place.isHit()){\n return false;\n }\n }\n return true;\n }", "public void check() {\n Ellipse2D.Double head = snakeParts.get(0);\n Food food = gameGround.getFood();\n\n // Ate itself\n for (int i = 1; i < snakeParts.size(); i++) {\n if (head.getMinX() == snakeParts.get(i).getMinX() && head.getMinY() == snakeParts.get(i).getMinY()) {\n over = true;\n return;\n }\n }\n\n // Ate food\n if (head.getMinX() == food.getShape().getMinX() && head.getMinY() == food.getShape().getMinY()) {\n scoreBoard.addPoints(1);\n food.next(this);\n snakeParts.add(ass);\n }\n }", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "public boolean isValidMove(int value){\n if (value == HIT || value == MISS) {\n System.out.println(\"Already shot here\");\n return false;\n }\n return true;\n }", "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "public boolean shouldExecute() {\n return ShulkerEntity.this.getAttackTarget() == null && ShulkerEntity.this.rand.nextInt(40) == 0;\n }", "@Override\n public void hitEvent(Block beingHit, Ball hitter) {\n //checking if we hit the death block\n //creating the upper left point of the death block\n Point upLeftDeathBlock = new Point(0.0, 600.0);\n if (beingHit.getCollisionRectangle().getUpperLeft().equals(upLeftDeathBlock)) {\n hitter.removeFromGame(this.gameLevel);\n this.remainingBalls.decrease(1);\n return;\n }\n //in regular cases\n return;\n\n }", "public void runaway(ScannedRobotEvent e){\r\n if(didenemyshoot(e)){\r\n //moves away from the enemy\r\n setTurnRight(5 * turndir);\r\n setAhead(e.getVelocity() * movedir);\r\n //tell where it is heading\r\n movedir *= -1;\r\n }\r\n }", "void hitCreep(int range, boolean isCashan)\r\n\t{\r\n\t\tIterator<Tickable> listIterator=Game.getBoard().getTimer().getTickables().descendingIterator();\r\n\t\twhile (listIterator.hasNext())\r\n\t\t{\r\n\t\t\tTickable tickable=listIterator.next();\r\n\t\t\tif (tickable instanceof Creep &&\r\n\t\t\t tickable.getLocation().distance(getLocation())<=range*Math.sqrt(2))\r\n\t\t\t{\r\n\t\t\t\t((Creep)tickable).impact(this);\r\n\t\t\t\tif (!isCashan)\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void test_chooseBadTargetOnSacrifice_WithoutTargets_AI() {\n addCard(Zone.HAND, playerA, \"Redcap Melee\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Atarka Monument\", 1); // {T}: Add {R} or {G}.\n //\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\", 1);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Redcap Melee\", \"Silvercoat Lion\");\n //addTarget(playerA, \"Mountain\"); no lands to sacrifice\n\n //setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertGraveyardCount(playerA, \"Redcap Melee\", 1);\n assertGraveyardCount(playerB, \"Silvercoat Lion\", 1);\n }", "private void recheckTileCollisions() {\n\t\tint len = regTiles.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tRegTile tile = regTiles.get(i);\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(OverlapTester.overlapRectangles(player.bounds, tile.bounds)) {\n\t\t\t\t\t//check-x cols and fix\n\t\t\t\t\tif(player.position.x > tile.position.x - tile.bounds.width/2 && player.position.x < tile.position.x + tile.bounds.width/2 && player.position.y < tile.position.y + tile.bounds.height/2 && player.position.y > tile.position.y - tile.bounds.height/2) {\n\t\t\t\t\t\tif(player.position.x < tile.position.x) {\n\t\t\t\t\t\t\tplayer.position.x = tile.position.x - 1;\n\t\t\t\t\t\t} else if(player.position.x > tile.position.x) {\n\t\t\t\t\t\t\tplayer.position.x = tile.position.x + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}", "private boolean hasEatenPowerUp() {\r\n if (snake[HEAD].row == powerUp.row && \r\n snake[HEAD].column == powerUp.column) { \r\n growSnake();\r\n newPowerUp();\r\n MainClass.totalPoints++;\r\n return true;\r\n }\r\n return false;\r\n }", "private static void rangedTank(Player player) {\n\t\tbankInventoryAndEquipment(player);\n\t\tspawnInventory(player, RangedTank.inventory);\n\t\tspawnEquipment(player, RangedTank.equipmentSet(player));\n\t\tupdateEquipment(player);\n\t\theal(player, true, true);\n\t\tsetCombatSkills(player, \"RANGED TANK\", false, null);\n\t\tsetPrayerAndMagicBook(player, \"LUNAR\");\n\t\tPresets.isPresetFlagged(player, player.bankIsFullWhileUsingPreset);\n\t}", "@Override\n public void chooseAction(){\n healthDecay = getHealth() - 5;\n //now scan for Nazguls\n\n if(healthDecay == 0){\n death(this);\n }\n int scan_result = scan();\n\n if(scan_result == 1){\n move();\n }\n\n if(scan_result == 0 && healthDecay < 75){\n stay();\n }\n\n if(scan_result == 0 && hobbitCounter == 15){\n replicate();\n hobbitCounter = 0;\n }\n\n else{\n move();\n \n }\n hobbitCounter = hobbitCounter + 1;\n }", "@Override\n public boolean attack(final Player enemy, Location loc) {\n final Ship ship = enemy.getShip(loc = board.attack());\n\n// System.out.println(loc);\n\n if (ship != null) {\n getGuessBoard()[loc.getRow()][loc.getCol()] = 1;\n ship.takeHit(loc);\n\n board.getHits().add(loc);\n\n if (ship.isSunk()) {\n\n board.getIntegers().remove(Integer.valueOf(ship.getLocations().size()));\n board.getMisses().addAll(board.getHits());\n board.getHits().clear();\n\n return true;\n }\n\n } else {\n getGuessBoard()[loc.getRow()][loc.getCol()] = -1;\n board.getMisses().add(loc);\n }\n\n return false;\n }", "public void playerHasNoSword() {\n\t\tthis.state = cannotBeKilled;\n\t}", "public void checkDeath()\n {\n if (player.getY() >= 549)\n {\n gameOver();\n }\n }", "static boolean settleDown() throws GameActionException {\n\t\treturn !rc.isCircleOccupiedExceptByThisRobot(rc.getLocation(), SETTLERADIUS);\n\t}", "public boolean attack(int row, int col)\n {\n \n \tif(inBounds(row,col) == false)\n \t\treturn false;\n \telse if(grid[row][col]==EMPTY){\n \t\tgrid[row][col] = MISS;\n \t\treturn false;\n \t}\n \telse if(grid[row][col] == HIT)\n \t\treturn false;\n \telse if(grid[row][col]==SHIP){\n \t\tgrid[row][col] = HIT;\n \t\treturn true;\n \t}\n \t\n \t\n \t\n return true;\n }", "public void attemptAttack() {\r\n\t\tattackAttempts += 100;\r\n\t}", "public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}", "public void hit(int melee_dmg,int range_dmg) {\n melee_dmg=this.current_atk-30;\n range_dmg=this.current_atk-60;\n }", "public ArrayList<Player> performShortAttack(String name) {\n\t\tArrayList<Player> killed \t= new ArrayList<Player>();\n\t\tPoint check\t\t\t\t\t= new Point();\n\t\tPoint p\t\t\t\t\t\t= new Point();\n\t\tPlayer player \t\t\t\t= findPlayer(name);\n\t\t\n\t\tp.x\t\t\t\t\t\t\t= player.getX();\n\t\tp.y\t\t\t\t\t\t\t= player.getY();\n\t\tcheck.x\t\t\t\t\t\t= player.getX();\n\t\tcheck.y\t\t\t\t\t\t= player.getY();\n\t\t\n\t\tfor(int y = -1; y <= 1; y++) {\n\t\t\tcheck.y += y;\n\t\t\tfor(int x = -1; x <= 1; x++) {\n\t\t\t\tcheck.x += x;\n\t\t\t\tfor(Player pl : playerList) {\n\t\t\t\t\tif(pl.getX() == check.x && pl.getY() == check.y)\n\t\t\t\t\t\tif(pl.getType() == PlayerType.Robot) {\n\t\t\t\t\t\t\tkilled.add(pl);\n\t\t\t\t\t\t\tplayerKilledRobot(player);\n\t\t\t\t\t\t\tremovePlayer(pl.getName()); \t\t// kill robot\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//restore values\n\t\t\t\tcheck.x\t= p.x;\n\t\t\t}\n\t\t\t//restore values\n\t\t\tcheck.y = p.y;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//send the new score to the player\n\t\tif(killed.size() > 0) { // if the player killed at least one robot \n\t\t\tserver.sendMessageToClient(name, \"@126@\" + highscore.get(player.getName()) + \"@\");\n\t\t\t\n\t\t\trewardPlayer(player);\n\t\t}\n\t\t\n\t\treturn killed;\n\t}", "public boolean hit() {\r\n add(deck.deal());\r\n return getHandValue() <= 21;\r\n }", "@Override\n public void attack(Entity e) {\n e.hit(atk);\n }", "public boolean isHit(int value){\n return (value == SHIP);\n }", "private void handleCollisions() {\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tcheckInvaderDeath(a);\n\t\t\t\tcheckPlayerDeath(a);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Shot s : enemyShotList) {\n\t\t\t\n\t\t\tif (s.detectDownwardCollision(player.getX(), player.getY())) {\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcollectPowerUp(armorPiercing);\n\t\tcollectPowerUp(explosive);\n\t}", "private static boolean runAway(Critter foo){\n\t\tif(foo.moved) {\n\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\tif (foo.getEnergy() <= 0) {\n\t\t\t\tfoo.isAlive=false;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tint dir = getRandomInt(8);\n\t\t\tif(canMove(foo, dir)) {\n\t\t\t\tfoo.walk(dir);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void test_chooseBadTargetOnSacrifice_WithoutTargets_User() {\n addCard(Zone.HAND, playerA, \"Redcap Melee\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Atarka Monument\", 1); // {T}: Add {R} or {G}.\n //\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\", 1);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Redcap Melee\", \"Silvercoat Lion\");\n //addTarget(playerA, \"Mountain\"); no lands to sacrifice\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertGraveyardCount(playerA, \"Redcap Melee\", 1);\n assertGraveyardCount(playerB, \"Silvercoat Lion\", 1);\n }", "public boolean inRange(){\n //System.out.println(\"inRange\");\n return Math.abs(GameView.instance.player.position.x - creationPoint.x) < GameView.instance.cameraSize * attackRange;\n }", "public void fireScourge() {\n\t\t// Has player waited cooldown before trying to fire again?\t\tCHANGED to 10000\n\t\tif (System.currentTimeMillis() - this.lastFired > Config.WEAPON_COOLDOWN_TIME * 10000) {\n\t\t\tSystem.out.println(player.getDisplayName() + \" is attempting to launch napalm\");\n\t\t\t// Can this airship drop scourge?\n\t\t\tif (this.properties.FIRES_SCOURGE) {\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_NAPALM)) {\n\t\t\t\t\t\tboolean missingMaterial = false;\n\t\t\t\t\t\tfor (int id : Config.MATERIALS_NEEDED_FOR_SCOURGE) {\n\t\t\t\t\t\t\tif (!cannonHasItem(cannons[i], id, 1))\n\t\t\t\t\t\t\t\tmissingMaterial = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!missingMaterial && 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_SCOURGE);\n\t\t\t\t\t\t\tfor (int id : Config.MATERIALS_NEEDED_FOR_SCOURGE) {\n\t\t\t\t\t\t\t\twithdrawItem(cannons[i], id, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Fire some scourge TODO: maybe add sound effects for scourge dropping? :P\n\t\t\t\t\t\t\tnew Scourge(cannons[i]);\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\t//player.sendMessage(ChatColor.AQUA + \"Some purifiers did not fire. Max cannon limit is \" + ChatColor.GOLD + this.properties.MAX_NUMBER_OF_CANNONS);\n\t\t\t\t\t\t\tplayer.sendMessage(ChatColor.AQUA + \"Some purifiers did not fire. item check = \" + ChatColor.GOLD + missingMaterial);\n\t\t\t\t\t\t\tplayer.sendMessage(ChatColor.AQUA + \"numFiredCannons = \" + ChatColor.GOLD + numfiredcannons);\n\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 NAPALM\");\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 attackMonster(World world){\n\t\tif ((UnitManager.unitNearPlayer(world.getPlayer(),this,PLAYER_RANGE) == true \n\t\t\t\t\t&& RPG.isAttacking()) && world.getPlayer().isAttack()) {\n\t\t\tthis.getUnitStats().reduceHP(world.getPlayer().damageAmount());\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t}\n\t}", "public void playerAttack() {\n if (playerTurn==true) {\n myMonster.enemHealth=myMonster.enemHealth-battlePlayer.str;\n }\n playerTurn=false;\n enemyMove();\n }", "public void attack() {\n if (st instanceof RedAlienState.Attacking) {\n \tRedAlienState.Attacking att = (RedAlienState.Attacking)st;\n \ttry{\n \t\tDelta d = att.path.remove();\n \t\tthis.x += d.xd;\n \t\tthis.y += d.yd;\n \t\tif(Math.random() > .99){\n \t\t\tthis.fire();\n \t\t}\n \t}catch(NoSuchElementException e){\n \t\tthis.x = this.column;\n \t\tthis.y = this.row;\n \t\tst = new RedAlienState.Normal();\n \t\tthis.isAttacking = false;\n \t}\n }\n }" ]
[ "0.64716566", "0.6229715", "0.61977965", "0.6124987", "0.6123417", "0.61195", "0.60738456", "0.6067385", "0.6058956", "0.60506517", "0.60373944", "0.59920955", "0.5984228", "0.59727776", "0.59462583", "0.59460056", "0.59346056", "0.5874751", "0.587433", "0.5872102", "0.585495", "0.5832213", "0.58154047", "0.5802066", "0.5795319", "0.5794007", "0.5793262", "0.57863253", "0.57807195", "0.5777262", "0.5771623", "0.57699466", "0.5767174", "0.5763899", "0.57586277", "0.5748786", "0.57454383", "0.5740046", "0.5729461", "0.5726374", "0.5719106", "0.57059777", "0.57033813", "0.56991774", "0.56988084", "0.5686443", "0.5682435", "0.5674432", "0.5673603", "0.5671147", "0.5669565", "0.56685394", "0.5662937", "0.56335163", "0.56274056", "0.56222826", "0.56154495", "0.560623", "0.56021714", "0.560031", "0.55981934", "0.55929667", "0.55901885", "0.55848986", "0.55814904", "0.5575693", "0.55712306", "0.5563766", "0.5560354", "0.555884", "0.55566823", "0.5554703", "0.5552747", "0.55514014", "0.5550444", "0.5541046", "0.5539683", "0.5522201", "0.5517526", "0.5517519", "0.55148417", "0.5507437", "0.5506862", "0.5502351", "0.55016583", "0.55007994", "0.55004597", "0.55001146", "0.54995215", "0.5496959", "0.5496574", "0.54939324", "0.5490824", "0.5485913", "0.5480081", "0.54793", "0.5478249", "0.5476929", "0.5476704", "0.54751575" ]
0.6558092
0
Binary content data coding. The default value is (&x60;0&x60;) for GSM7. Example: (&x60;8&x60;) for Unicode data.
public Integer getDataCoding() { return dataCoding; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getEncoding() {\r\n return \"B\";\r\n }", "private void storeHeaderDataToByte() {\n\t\tString byteNumStr = String.format(\"%24s\",\n\t\t\t\tInteger.toBinaryString(encodedByte.length)).replace(' ',\n\t\t\t\t'0');\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(byteNumStr\n\t\t\t\t.substring(0, 8));\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(byteNumStr\n\t\t\t\t.substring(8, 16));\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(byteNumStr\n\t\t\t\t.substring(16, 24));\n\n\t\t\n\t\tString widthStr = String.format(\"%16s\",\n\t\t\t\tInteger.toBinaryString(width)).replace(' ', '0');\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(widthStr\n\t\t\t\t.substring(0, 8));\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(widthStr\n\t\t\t\t.substring(8, 16));\n\n\t\t\n\t\tString heightStr = String.format(\"%16s\",\n\t\t\t\tInteger.toBinaryString(height)).replace(' ', '0');\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(heightStr\n\t\t\t\t.substring(0, 8));\n\t\tencodedByte[encodingIndex++] = convert8BitsStrToByte(heightStr\n\t\t\t\t.substring(8, 16));\n\n\t\tencodedByte[encodingIndex++] = (byte) numOfTableValue;\n\t\tencodedByte[encodingIndex++] = (byte) byteSizeForCode;\n\t\tencodedByte[encodingIndex++] = (byte) extraBits;\n\t}", "public DsByteString getContentCoding() {\n return m_strCoding;\n }", "byte[] getData();", "byte[] getData();", "byte[] getData();", "byte[] getData();", "public byte[] getData()\r\n/* 18: */ {\r\n/* 19:59 */ byte[] data = new byte[4];\r\n/* 20: */ \r\n/* 21:61 */ IntegerHelper.getTwoBytes(this.xfIndex, data, 0); int \r\n/* 22: */ \r\n/* 23: */ \r\n/* 24:64 */ tmp15_14 = 1; byte[] tmp15_13 = data;tmp15_13[tmp15_14] = ((byte)(tmp15_13[tmp15_14] | 0x80));\r\n/* 25: */ \r\n/* 26:66 */ data[2] = ((byte)this.styleNumber);\r\n/* 27: */ \r\n/* 28: */ \r\n/* 29:69 */ data[3] = -1;\r\n/* 30: */ \r\n/* 31:71 */ return data;\r\n/* 32: */ }", "@AutoEscape\n\tpublic String getDataCode();", "public byte[] getFormulaData()\r\n/* 161: */ {\r\n/* 162:293 */ byte[] data = new byte[this.formulaBytes.length + 16];\r\n/* 163:294 */ System.arraycopy(this.formulaBytes, 0, data, 16, this.formulaBytes.length);\r\n/* 164: */ \r\n/* 165:296 */ data[6] = 16;\r\n/* 166:297 */ data[7] = 64;\r\n/* 167:298 */ data[12] = -32;\r\n/* 168:299 */ data[13] = -4; byte[] \r\n/* 169: */ \r\n/* 170:301 */ tmp54_51 = data;tmp54_51[8] = ((byte)(tmp54_51[8] | 0x2));\r\n/* 171: */ \r\n/* 172: */ \r\n/* 173:304 */ IntegerHelper.getTwoBytes(this.formulaBytes.length, data, 14);\r\n/* 174: */ \r\n/* 175:306 */ return data;\r\n/* 176: */ }", "public byte[] getData();", "public java.lang.String getBFSDATA() {\n return BFSDATA;\n }", "private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }", "private byte m1655h() {\n char charAt;\n int i = this.f2519d;\n while (true) {\n int i2 = this.f2519d;\n if (i2 <= 0) {\n break;\n }\n CharSequence charSequence = this.f2516a;\n int i3 = i2 - 1;\n this.f2519d = i3;\n char charAt2 = charSequence.charAt(i3);\n this.f2520e = charAt2;\n if (charAt2 == '<') {\n return 12;\n }\n if (charAt2 == '>') {\n break;\n } else if (charAt2 == '\\\"' || charAt2 == '\\'') {\n do {\n int i4 = this.f2519d;\n if (i4 <= 0) {\n break;\n }\n CharSequence charSequence2 = this.f2516a;\n int i5 = i4 - 1;\n this.f2519d = i5;\n charAt = charSequence2.charAt(i5);\n this.f2520e = charAt;\n } while (charAt != charAt2);\n }\n }\n this.f2519d = i;\n this.f2520e = '>';\n return 13;\n }", "private byte[] encode(byte[] data) {\n int lc = (data==null ? 0 : data.length);\n int L = 0;\n\n // decide whether short or extended encoding is to be used\n boolean useShort = (lc<256)&&(le<256);\n\n // compute total length of body\n L += lc; // length due to data bytes\n\n if (lc>0) // need to code Lc\n L = (useShort ? L+1 : L+3); // coding Lc as 1 or 3 bytes\n\n if (le>=0) // need to code Le\n L = (useShort ? L+1 : L+2); // coding Le as 1 or 2 bytes\n\n if (L==0) \n return null;\n\n // perform encoding\n byte[] body = new byte[L];\n int l=0;\n\n if (lc>0) { // need to code Lc\n\n if (useShort) // Lc fits in a single byte\n body[l++]=(byte)(lc&0xFF);\n else { // Lc requires 3 bytes\n body[l] =(byte)0x00; // marker indicating extended encoding\n body[l+1]=(byte)((lc>>8)&0xFF);\n body[l+2]=(byte)(lc&0xFF);\n l+=3;\n }\n\n // code data\n System.arraycopy(data, 0, body, l, lc);\n l += lc;\n } // if (lc > 0)\n\n if (le>=0) { // need to code Le\n\n if (useShort) // Le fits in a single byte\n body[l++]=(byte) (le&0xFF); // handle coding of 256\n else { // Le fits in two bytes\n body[l] =(byte)((le>>8)&0xFF);\n body[l+1]=(byte)(le&0xFF);\n }\n\n } // if (le >= 0)\n return body;\n }", "byte mo30283c();", "public static String encode(byte[] binaryData) {\n \n if (binaryData == null)\n return null;\n \n int lengthDataBits = binaryData.length*EIGHTBIT;\n if (lengthDataBits == 0) {\n return \"\";\n }\n \n int fewerThan24bits = lengthDataBits%TWENTYFOURBITGROUP;\n int numberTriplets = lengthDataBits/TWENTYFOURBITGROUP;\n int numberQuartet = fewerThan24bits != 0 ? numberTriplets+1 : numberTriplets;\n int numberLines = (numberQuartet-1)/19+1;\n char encodedData[] = null;\n \n encodedData = new char[numberQuartet*4+numberLines];\n \n byte k=0, l=0, b1=0,b2=0,b3=0;\n \n int encodedIndex = 0;\n int dataIndex = 0;\n int i = 0;\n if (fDebug) {\n System.out.println(\"number of triplets = \" + numberTriplets );\n }\n \n for (int line = 0; line < numberLines-1; line++) {\n for (int quartet = 0; quartet < 19; quartet++) {\n b1 = binaryData[dataIndex++];\n b2 = binaryData[dataIndex++];\n b3 = binaryData[dataIndex++];\n \n if (fDebug) {\n System.out.println( \"b1= \" + b1 +\", b2= \" + b2 + \", b3= \" + b3 );\n }\n \n l = (byte)(b2 & 0x0f);\n k = (byte)(b1 & 0x03);\n \n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n \n byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);\n byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);\n \n if (fDebug) {\n System.out.println( \"val2 = \" + val2 );\n System.out.println( \"k4 = \" + (k<<4));\n System.out.println( \"vak = \" + (val2 | (k<<4)));\n }\n \n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ (l <<2 ) | val3 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ b3 & 0x3f ];\n \n i++;\n }\n encodedData[encodedIndex++] = 0xa;\n }\n \n for (; i<numberTriplets; i++) {\n b1 = binaryData[dataIndex++];\n b2 = binaryData[dataIndex++];\n b3 = binaryData[dataIndex++];\n \n if (fDebug) {\n System.out.println( \"b1= \" + b1 +\", b2= \" + b2 + \", b3= \" + b3 );\n }\n \n l = (byte)(b2 & 0x0f);\n k = (byte)(b1 & 0x03);\n \n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n \n byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);\n byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);\n \n if (fDebug) {\n System.out.println( \"val2 = \" + val2 );\n System.out.println( \"k4 = \" + (k<<4));\n System.out.println( \"vak = \" + (val2 | (k<<4)));\n }\n \n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ (l <<2 ) | val3 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ b3 & 0x3f ];\n }\n \n // form integral number of 6-bit groups\n if (fewerThan24bits == EIGHTBIT) {\n b1 = binaryData[dataIndex];\n k = (byte) ( b1 &0x03 );\n if (fDebug) {\n System.out.println(\"b1=\" + b1);\n System.out.println(\"b1<<2 = \" + (b1>>2) );\n }\n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ k<<4 ];\n encodedData[encodedIndex++] = PAD;\n encodedData[encodedIndex++] = PAD;\n } else if (fewerThan24bits == SIXTEENBIT) {\n b1 = binaryData[dataIndex];\n b2 = binaryData[dataIndex +1 ];\n l = ( byte ) ( b2 &0x0f );\n k = ( byte ) ( b1 &0x03 );\n \n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);\n \n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ l<<2 ];\n encodedData[encodedIndex++] = PAD;\n }\n \n //encodedData[encodedIndex] = 0xa;\n \n return new String(encodedData);\n }", "public static String decodeMessage(ArrayList<Boolean> data) {\n // get each group of 8 bits and assemble into a byte\n StringBuilder text = new StringBuilder();\n int counter = 0;\n for (int j=0; j<data.size()-11; j=j+9) {\n byte ascii = 0;\n for (int i = 0; i < 10; i++) {\n // DEBUG System.out.print(data.get(i+j) ? \"1\" : \"0\");\n if (data.get(i+j)) {\n ascii = set(ascii, i);\n }\n }\n\n if (!checkParity((int)ascii) == parityChecker.get(counter)) {\n text.append(\"[PARITY ERROR]\");\n } else {\n text.append(Character.toString((char) ascii));\n }\n\n\n // DEBUG System.out.println(\" \" + ascii + \" = \" + text);\n\n counter++;\n }\n return text.toString();\n }", "public byte getData() {\n return data;\n }", "com.google.protobuf.ByteString\n getField1110Bytes();", "public String getDatakbn() {\r\n return datakbn;\r\n }", "public byte[] code();", "public void setCode(byte[] code);", "private byte[] getImageEncodingParameter() {\n final byte[] encodingData = new byte[] {\n (byte)0x95, // ID\n 0x02, // Length\n encoding,\n (byte)(encoding == COMPID_JPEG ? 0xFE : 0x01), // RECID\n };\n return encodingData;\n }", "public byte[] getData() {\n/* 91 */ return (this.pbData == null) ? null : this.pbData.getByteArray(0L, this.cbData);\n/* */ }", "private String encodeCode11() {\n if (!checkNumericOnly(getRawData().replace(\"-\", \"\"))) {\n error(\"EC11-1: Numeric data and '-' Only\");\n }\n\n //calculate the checksums\n int weight = 1;\n int CTotal = 0;\n String dataToEncodeWithChecksums = getRawData();\n\n //figure the C checksum\n for (int i = getRawData().length() - 1; i >= 0; i--) {\n //C checksum weights go 1-10\n if (weight == 10) {\n weight = 1;\n }\n\n if (getRawData().charAt(i) != '-') {\n CTotal += Integer.parseInt(String.valueOf(getRawData().charAt(i))) * weight++;\n } else {\n CTotal += 10 * weight++;\n }\n }\n\n int checksumC = CTotal % 11;\n\n dataToEncodeWithChecksums += String.valueOf(checksumC);\n\n //K checksums are recommended on any message length greater than or equal to 10\n if (getRawData().length() >= 10) {\n weight = 1;\n int KTotal = 0;\n\n //calculate K checksum\n for (int i = dataToEncodeWithChecksums.length() - 1; i >= 0; i--) {\n //K checksum weights go 1-9\n if (weight == 9) {\n weight = 1;\n }\n\n if (dataToEncodeWithChecksums.charAt(i) != '-') {\n KTotal += Integer.parseInt(String.valueOf(dataToEncodeWithChecksums.charAt(i))) * weight++;\n } else {\n KTotal += 10 * weight++;\n }\n }\n\n int checksumK = KTotal % 9;\n dataToEncodeWithChecksums += checksumK;\n }\n\n //encode data\n String space = \"0\";\n StringBuilder builder = new StringBuilder();\n builder.append(C11_Code[11]);//start-stop char\n builder.append(space); //interchar space\n\n for (char c : dataToEncodeWithChecksums.toCharArray()) {\n int index = (c == '-' ? 10 : Integer.parseInt(String.valueOf(c)));\n builder.append(C11_Code[index]);\n\n //inter-character space\n builder.append(space);\n }//foreach\n\n //stop bars\n builder.append(C11_Code[11]);\n\n return builder.toString();\n }", "private byte m1656i() {\n char charAt;\n int i = this.f2519d;\n while (true) {\n int i2 = this.f2519d;\n if (i2 < this.f2518c) {\n CharSequence charSequence = this.f2516a;\n this.f2519d = i2 + 1;\n char charAt2 = charSequence.charAt(i2);\n this.f2520e = charAt2;\n if (charAt2 == '>') {\n return 12;\n }\n if (charAt2 == '\\\"' || charAt2 == '\\'') {\n do {\n int i3 = this.f2519d;\n if (i3 >= this.f2518c) {\n break;\n }\n CharSequence charSequence2 = this.f2516a;\n this.f2519d = i3 + 1;\n charAt = charSequence2.charAt(i3);\n this.f2520e = charAt;\n } while (charAt != charAt2);\n }\n } else {\n this.f2519d = i;\n this.f2520e = '<';\n return 13;\n }\n }\n }", "com.google.protobuf.ByteString\n getField1180Bytes();", "public void setData(byte data) {\n this.data = data;\n }", "public final void mBINARY() throws RecognitionException {\n try {\n int _type = BINARY;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2940:2: ( '0x' ( ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) )+ )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2940:4: '0x' ( ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) )+\n {\n match(\"0x\"); if (state.failed) return ;\n\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2940:8: ( ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) )+\n int cnt8=0;\n loop8:\n do {\n int alt8=2;\n int LA8_0 = input.LA(1);\n\n if ( ((LA8_0>='0' && LA8_0<='9')||(LA8_0>='A' && LA8_0<='F')||(LA8_0>='a' && LA8_0<='f')) ) {\n alt8=1;\n }\n\n\n switch (alt8) {\n \tcase 1 :\n \t // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2940:9: ( DIGIT | 'a' .. 'f' | 'A' .. 'F' ) ( DIGIT | 'a' .. 'f' | 'A' .. 'F' )\n \t {\n \t if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='F')||(input.LA(1)>='a' && input.LA(1)<='f') ) {\n \t input.consume();\n \t state.failed=false;\n \t }\n \t else {\n \t if (state.backtracking>0) {state.failed=true; return ;}\n \t MismatchedSetException mse = new MismatchedSetException(null,input);\n \t recover(mse);\n \t throw mse;}\n\n \t if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='F')||(input.LA(1)>='a' && input.LA(1)<='f') ) {\n \t input.consume();\n \t state.failed=false;\n \t }\n \t else {\n \t if (state.backtracking>0) {state.failed=true; return ;}\n \t MismatchedSetException mse = new MismatchedSetException(null,input);\n \t recover(mse);\n \t throw mse;}\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt8 >= 1 ) break loop8;\n \t if (state.backtracking>0) {state.failed=true; return ;}\n EarlyExitException eee =\n new EarlyExitException(8, input);\n throw eee;\n }\n cnt8++;\n } while (true);\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "static public byte[] encode( byte[] binaryData ) {\n if (binaryData == null)\n return null;\n int lengthData = binaryData.length;\n int lengthEncode = lengthData * 2;\n byte[] encodedData = new byte[lengthEncode];\n for( int i = 0; i<lengthData; i++ ){\n encodedData[i*2] = lookUpHexAlphabet[ binaryData[i] >> 4];\n encodedData[i*2+1] = lookUpHexAlphabet[ binaryData[i] & 0xf];\n }\n return encodedData;\n }", "private static byte[] getLsfileaeMessage100() throws HeaderPartException, HostMessageFormatException {\r\n Map < String, Object > map = new HashMap < String, Object >();\r\n map.put(Constants.CICS_PROGRAM_NAME_KEY, \"LSFILEAE\");\r\n map.put(Constants.CICS_LENGTH_KEY, \"79\");\r\n map.put(Constants.CICS_DATALEN_KEY, \"6\");\r\n \r\n LegStarMessage legstarMessage = new LegStarMessage();\r\n legstarMessage.setHeaderPart(new LegStarHeaderPart(map, 0));\r\n legstarMessage.addDataPart(new CommareaPart(\r\n HostData.toByteArray(LsfileaeCases.getHostBytesHexRequest100())));\r\n return legstarMessage.toByteArray();\r\n\r\n }", "public byte[] getData()\r\n/* 38: */ {\r\n/* 39: 98 */ byte[] data = new byte[18];\r\n/* 40: */ \r\n/* 41:100 */ int options = 0;\r\n/* 42:102 */ if (this.promptBoxVisible) {\r\n/* 43:104 */ options |= PROMPT_BOX_VISIBLE_MASK;\r\n/* 44: */ }\r\n/* 45:107 */ if (this.promptBoxAtCell) {\r\n/* 46:109 */ options |= PROMPT_BOX_AT_CELL_MASK;\r\n/* 47: */ }\r\n/* 48:112 */ if (this.validityDataCached) {\r\n/* 49:114 */ options |= VALIDITY_DATA_CACHED_MASK;\r\n/* 50: */ }\r\n/* 51:117 */ IntegerHelper.getTwoBytes(options, data, 0);\r\n/* 52: */ \r\n/* 53:119 */ IntegerHelper.getFourBytes(this.objectId, data, 10);\r\n/* 54: */ \r\n/* 55:121 */ IntegerHelper.getFourBytes(this.numDVRecords, data, 14);\r\n/* 56: */ \r\n/* 57:123 */ return data;\r\n/* 58: */ }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "public void setBinmode() {\n }", "public byte[] getData()\r\n/* 140: */ {\r\n/* 141:254 */ byte[] celldata = super.getData();\r\n/* 142:255 */ byte[] formulaData = getFormulaData();\r\n/* 143:256 */ byte[] data = new byte[formulaData.length + celldata.length];\r\n/* 144:257 */ System.arraycopy(celldata, 0, data, 0, celldata.length);\r\n/* 145:258 */ System.arraycopy(formulaData, 0, data, celldata.length, \r\n/* 146:259 */ formulaData.length);\r\n/* 147:260 */ return data;\r\n/* 148: */ }", "@Test\n void testQuickBasics() throws Exception {\n HMEFMessage msg;\n try (InputStream is = _samples.openResourceAsStream(\"quick-winmail.dat\")) {\n msg = new HMEFMessage(is);\n }\n\n MAPIAttribute rtfAttr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);\n assertNotNull(rtfAttr);\n assertTrue(rtfAttr instanceof MAPIRtfAttribute);\n\n // Check the start of the compressed version\n byte[] data = ((MAPIRtfAttribute) rtfAttr).getRawData();\n assertEquals(5907, data.length);\n\n // First 16 bytes is header stuff\n // Check it has the length + compressed marker\n assertEquals(5907 - 4, LittleEndian.getShort(data));\n assertEquals(\n \"LZFu\",\n StringUtil.getFromCompressedUnicode(data, 8, 4)\n );\n\n\n // Now Look at the code\n byte[] exp = {\n (byte) 0x07, // Flag: cccUUUUU\n (byte) 0x00, // c1a: offset 0 / 0x000\n (byte) 0x06, // c1b: length 6+2 -> {\\rtf1\\a\n (byte) 0x01, // c2a: offset 16 / 0x010\n (byte) 0x01, // c2b: length 1+2 -> def\n (byte) 0x0b, // c3a: offset 182 / 0xb6\n (byte) 0x60, // c3b: length 0+2 -> la\n (byte) 0x6e, // n\n (byte) 0x67, // g\n (byte) 0x31, // 1\n (byte) 0x30, // 0\n (byte) 0x32, // 2\n\n (byte) 0x66, // Flag: UccUUccU\n (byte) 0x35, // 5\n (byte) 0x00, // c2a: offset 6 / 0x006\n (byte) 0x64, // c2b: length 4+2 -> \\ansi\\a\n (byte) 0x00, // c3a: offset 7 / 0x007\n (byte) 0x72, // c3b: length 2+2 -> nsi\n (byte) 0x63, // c\n (byte) 0x70, // p\n (byte) 0x0d, // c6a: offset 221 / 0x0dd\n (byte) 0xd0, // c6b: length 0+2 -> g1\n (byte) 0x0e, // c7a: offset 224 / 0x0e0\n (byte) 0x00, // c7b: length 0+2 -> 25\n (byte) 0x32, // 2\n };\n\n assertArrayEquals(exp, Arrays.copyOfRange(data, 16, 16+25));\n }", "SQLBinary()\n\t{\n\t}", "public Int8Msg(byte[] data, int base_offset) {\n super(data, base_offset);\n amTypeSet(AM_TYPE);\n }", "com.google.protobuf.ByteString\n getField1100Bytes();", "public Int8Msg(byte[] data) {\n super(data);\n amTypeSet(AM_TYPE);\n }", "public byte getData() {\n return this.data;\n }", "public abstract byte[] getEncoded();", "public byte getCode();", "public String getPayloadCharEncoding() {\n return payloadCharEncoding;\n }", "public byte[] getByteCode() {\n return byteCode;\n }", "com.google.protobuf.ByteString getByteCode();", "com.google.protobuf.ByteString\n getField1188Bytes();", "byte[] getContent();", "public String getBinaryMnemonic(){\n\t\tswitch(this) {\n\t\tcase STOP -> \t{return \t\"00000000\";}\n\t\tcase RETTR -> \t{return \t\"00000001\";}\n\t\tcase MOVSPA -> \t{return \t\"00000010\";}\n\t\tcase MOVFLGA -> {return \t\"00000011\";}\n\t\t\n\t\tcase BR -> \t\t{return \t\"0000010\";}\n\t\tcase BRLE -> \t{return \t\"0000011\";}\n\t\tcase BRLT -> \t{return \t\"0000100\";}\n\t\tcase BREQ -> \t{return \t\"0000101\";}\n\t\tcase BRNE -> \t{return \t\"0000110\";}\n\t\tcase BRGE -> \t{return \t\"0000111\";}\n\t\tcase BRGT -> \t{return \t\"0001000\";}\n\t\tcase BRV -> \t{return \t\"0001001\";}\n\t\tcase BRC -> \t{return \t\"0001010\";}\n\t\tcase CALL -> \t{return \t\"0001011\";}\n\t\t\n\t\tcase NOTA -> \t{return \t\"00011000\";}\n\t\tcase NOTX -> \t{return \t\"00011001\";}\n\t\tcase NEGA -> \t{return \t\"00011010\";}\n\t\tcase NEGX -> \t{return \t\"00011011\";}\n\t\tcase ASLA -> \t{return \t\"00011100\";}\n\t\tcase ASLX -> \t{return \t\"00011101\";}\n\t\tcase ASRA -> \t{return \t\"00011110\";}\n\t\tcase ASRX -> \t{return \t\"00011111\";}\n\t\tcase ROLA -> \t{return \t\"00100000\";}\n\t\tcase ROLX -> \t{return \t\"00100001\";}\n\t\tcase RORA -> \t{return \t\"00100010\";}\n\t\tcase RORX -> \t{return \t\"00100011\";}\n\t\t\n\t\tcase NOP -> \t{return \t\"00101\";}\n\t\tcase DECI -> \t{return \t\"00110\";}\n\t\tcase DECO -> \t{return \t\"00111\";}\n\t\tcase STRO -> \t{return \t\"01000\";}\n\t\tcase CHARI -> \t{return \t\"01001\";}\n\t\tcase CHARO -> \t{return \t\"01010\";}\n\t\t\n//\t\tcase RETn\n\t\t\n\t\tcase ADDSP -> \t{return \t\"01100\";}\n\t\tcase SUBSP -> \t{return \t\"01101\";}\n\t\t\n\t\tcase ADDA -> \t{return \t\"0111\";}\n\t\tcase SUBA -> \t{return \t\"1000\";}\n\t\tcase ANDA -> \t{return \t\"1001\";}\n\t\tcase ORA -> \t{return \t\"1010\";}\n\t\tcase CPA -> \t{return \t\"1011\";}\n\t\tcase LDA -> \t{return \t\"1100\";}\n\t\tcase LDBYTEA -> {return \t\"1101\";}\n\t\tcase STA -> \t{return \t\"1110\";}\n\t\tcase STBYTEA -> {return \t\"1111\";}\n\t\t\n\t\tcase i -> \t{return \t\"000\";}\n\t\tcase d -> \t{return \t\"001\";}\n\t\tcase n -> \t{return \t\"010\";}\n\t\tcase s -> \t{return \t\"011\";}\n\t\tcase sf -> \t{return \t\"100\";}\n\t\tcase x -> \t{return \t\"101\";}\n\t\tcase sx -> \t{return \t\"110\";}\n\t\tcase sfx -> {return \t\"111\";}\n\t\t\n\t\tcase A -> {return \"0\";}\n\t\tcase X -> {return \"1\";}\n\t\t\n\t\tcase ADDRSS -> \t{return \"\";}\n\t\tcase ASCII -> \t{return \"\";}\n\t\tcase BLOCK -> \t{return \"\";}\n\t\tcase BURN -> \t{return \"\";}\n\t\tcase BYTE -> \t{return \"\";}\n\t\tcase END -> \t{return \"\";}\n\t\tcase EQUATE -> {return \"\";}\n\t\tcase WORD -> \t{return \"\";}\n\t\t\n\t\tdefault -> throw new IllegalArgumentException(\"This is an illegal mnemonic. \\nPlease double check your code.\");\n\t\t\n\t\t}\n\t\t\n\t}", "public Header getContentEncoding() {\n/* 89 */ return this.contentEncoding;\n/* */ }", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "public char flags_GET()\n { return (char)((char) get_bytes(data, 0, 1)); }", "@Override\n public void setData(byte[] data) {\n\tsuper.setData(data);\n\tsetLC(data.length);\n }", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "com.google.protobuf.ByteString getData();", "public abstract byte[] mo32305a(String str);", "com.google.protobuf.ByteString\n getField1148Bytes();", "public byte[] getByteData() { return bytedata; }", "byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }", "com.google.protobuf.ByteString\n getField1275Bytes();", "public char message_type_GET()\n { return (char)((char) get_bytes(data, 0, 2)); }", "com.google.protobuf.ByteString\n getField1196Bytes();", "public void setDatakbn(String datakbn) {\r\n this.datakbn = datakbn;\r\n }", "private static void writeDATA(int data) {\n writeByte(true,data);\n }", "public Builder setField1197Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1197_ = value;\n onChanged();\n return this;\n }", "public Builder setField1180Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1180_ = value;\n onChanged();\n return this;\n }", "public void setDataCode(String dataCode);", "ByteArray(String s) {\n\tdata = StringConverter.hexToByte(s);\n }", "public void encodeBinary(Buf out)\n {\n out.u2(val.length()+1);\n for (int i=0; i<val.length(); ++i)\n out.u1(val.charAt(i));\n out.u1(0);\n }", "private byte[] get_VARCHAR_FOR_BIT_DATA(int column) {\n byte[] bytes;\n int columnLength =\n (maxFieldSize_ == 0) ? columnDataComputedLength_[column - 1] - 2 :\n Math.min(maxFieldSize_, columnDataComputedLength_[column - 1] - 2);\n bytes = new byte[columnLength];\n// System.arraycopy(dataBuffer_, columnDataPosition_[column - 1] + 2, bytes, 0, bytes.length);\n dataBuffer_.getBytes(columnDataPosition_[column - 1] + 2, bytes);\n return bytes;\n }", "public abstract int encodeUtf8(CharSequence charSequence, byte[] bArr, int i, int i2);", "com.google.protobuf.ByteString\n getField1252Bytes();", "public interface FirmataProtocol {\n\t// Message types\n\tpublic static final byte I2C_REQUEST\t\t\t= (byte) 0x76;\n\tpublic static final byte I2C_REPLY\t\t\t\t= (byte) 0x77;\n\tpublic static final byte I2C_CONFIG\t\t\t\t= (byte) 0x78;\n\tpublic static final byte DIGITAL_IO_START\t\t= (byte) 0x90;\n\tpublic static final byte DIGITAL_IO_END\t\t\t= (byte) 0x9F;\n\tpublic static final byte ANALOG_IO_START\t\t= (byte) 0xE0;\n\tpublic static final byte ANALOG_IO_END\t\t\t= (byte) 0xEF;\n\tpublic static final byte REPORT_ANALOG_PIN\t\t= (byte) 0xC0;\n\tpublic static final byte REPORT_DIGITAL_PORT\t= (byte) 0xD0;\n\tpublic static final byte START_SYSEX\t\t\t= (byte) 0xF0;\n\tpublic static final byte SET_PIN_MODE\t\t\t= (byte) 0xF4;\n\tpublic static final byte SET_DIGITAL_PIN_VALUE\t= (byte) 0xF5;\n\tpublic static final byte END_SYSEX\t\t\t\t= (byte) 0xF7;\n\tpublic static final byte PROTOCOL_VERSION\t\t= (byte) 0xF9;\n\tpublic static final byte SYSTEM_RESET\t\t\t= (byte) 0xFF;\n\t\n\t// SysEx commands\n\tpublic static final byte EXTENDED_ID\t\t\t\t= 0x00;\t// A value of 0x00 indicates the next 2 bytes define the extended ID\n\t// IDs 0x01 - 0x0F are reserved for user defined commands\n\tpublic static final byte ANALOG_MAPPING_QUERY\t\t= 0x69;\t// ask for mapping of analog to pin numbers\n\tpublic static final byte ANALOG_MAPPING_RESPONSE\t= 0x6A;\t// reply with mapping info\n\tpublic static final byte CAPABILITY_QUERY\t\t\t= 0x6B;\t// ask for supported modes and resolution of all pins\n\tpublic static final byte CAPABILITY_RESPONSE\t\t= 0x6C;\t// reply with supported modes and resolution\n\tpublic static final byte PIN_STATE_QUERY\t\t\t= 0x6D;\t// ask for a pin's current mode and state (different than value)\n\tpublic static final byte PIN_STATE_RESPONSE\t\t\t= 0x6E;\t// reply with a pin's current mode and state (different than value)\n\tpublic static final byte EXTENDED_ANALOG\t\t\t= 0x6F;\t// analog write (PWM, Servo, etc) to any pin\n\tpublic static final byte STRING_DATA\t\t\t\t= 0x71;\t// a string message with 14-bits per char\n\tpublic static final byte REPORT_FIRMWARE\t\t\t= 0x79;\t// report name and version of the firmware\n\tpublic static final byte SAMPLING_INTERVAL\t\t\t= 0x7A;\t// the interval at which analog input is sampled (default = 19ms)\n\tpublic static final byte SYSEX_NON_REALTIME\t\t\t= 0x7E;\t// MIDI Reserved for non-realtime messages\n\tpublic static final byte SYSEX_REALTIME\t\t\t\t= 0X7F;\t// MIDI Reserved for realtime messages\n\t\n\tpublic static enum PinMode {\n\t\tDIGITAL_INPUT,\t// 0x00\n\t\tDIGITAL_OUTPUT,\t// 0x01\n\t\tANALOG_INPUT,\t// 0x02\n\t\tPWM,\t\t\t// 0x03\n\t\tSERVO,\t\t\t// 0x04\n\t\tSHIFT,\t\t\t// 0x05\n\t\tI2C,\t\t\t// 0x06\n\t\tONEWIRE,\t\t// 0x07\n\t\tSTEPPER,\t\t// 0x08\n\t\tENCODER,\t\t// 0x09\n\t\tSERIAL,\t\t\t// 0x0A\n\t\tINPUT_PULLUP,\t// 0x0B\n\t\tUNKNOWN;\n\n\t\tprivate static PinMode[] MODES = values();\n\t\t\n\t\tpublic static PinMode valueOf(int mode) {\n\t\t\tif (mode < 0 || mode >= MODES.length) {\n\t\t\t\treturn UNKNOWN;\n\t\t\t}\n\t\t\t\n\t\t\treturn MODES[mode];\n\t\t}\n\n\t\tpublic boolean isOutput() {\n\t\t\treturn this == DIGITAL_OUTPUT || this == PWM || this == SERVO;\n\t\t}\n\t}\n\t\n\tpublic static class PinCapability {\n\t\tprivate PinMode mode;\n\t\tprivate int resolution;\n\t\tprivate int max;\n\t\t\n\t\tpublic PinCapability(PinMode mode, int resolution) {\n\t\t\tthis.mode = mode;\n\t\t\tthis.resolution = resolution;\n\t\t\tthis.max = (int) Math.pow(2, resolution) - 1;\n\t\t}\n\n\t\tpublic PinMode getMode() {\n\t\t\treturn mode;\n\t\t}\n\n\t\tpublic int getResolution() {\n\t\t\treturn resolution;\n\t\t}\n\t\t\n\t\tpublic int getMax() {\n\t\t\treturn max;\n\t\t}\n\n\t\t@Override\n\t\tpublic String toString() {\n\t\t\treturn \"PinCapability [mode=\" + mode + \", resolution=\" + resolution + \"]\";\n\t\t}\n\t}\n}", "public Builder setField1188Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1188_ = value;\n onChanged();\n return this;\n }", "public Int8Msg(byte[] data, int base_offset, int data_length) {\n super(data, base_offset, data_length);\n amTypeSet(AM_TYPE);\n }", "String getContentEncoding();", "public void setBFSDATA(java.lang.String BFSDATA) {\n this.BFSDATA = BFSDATA;\n }", "public static String encode(byte[] binaryData) {\n if (CommonUtil.isNull(binaryData)) {\n return null;\n }\n\n int lengthDataBits = binaryData.length * EIGHTBIT;\n if (lengthDataBits == 0) {\n return \"\";\n }\n\n int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;\n int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;\n int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;\n char[] encodedData = new char[numberQuartet * 4];\n\n byte k1 = 0;\n byte l1 = 0;\n byte b1 = 0;\n byte b2 = 0;\n byte b3 = 0;\n\n int encodedIndex = 0;\n int dataIndex = 0;\n byte val1 = 0;\n byte val2 = 0;\n byte val3 = 0;\n for (int i = 0; i < numberTriplets; i++) {\n b1 = binaryData[dataIndex++];\n b2 = binaryData[dataIndex++];\n b3 = binaryData[dataIndex++];\n\n l1 = (byte) (b2 & 0x0f);\n k1 = (byte) (b1 & 0x03);\n\n val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);\n val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);\n val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);\n\n encodedData[encodedIndex++] = LOOK_UP_BASE64_ALPHABET[val1];\n encodedData[encodedIndex++] = LOOK_UP_BASE64_ALPHABET[val2 | (k1 << 4)];\n encodedData[encodedIndex++] = LOOK_UP_BASE64_ALPHABET[(l1 << 2) | val3];\n encodedData[encodedIndex++] = LOOK_UP_BASE64_ALPHABET[b3 & 0x3f];\n }\n\n // form integral number of 6-bit groups\n assembleInteger(binaryData, fewerThan24bits, encodedData, encodedIndex, dataIndex);\n\n return new String(encodedData);\n }", "public byte[] getByteArray(){\r\n\r\n byte[] b = new byte[0x54];\r\n\r\n System.arraycopy(PID_pointer, 0, b, 0, 4);\r\n System.arraycopy(MPID_pointer, 0, b, 4, 4);\r\n System.arraycopy(Null_pointer, 0, b, 8, 4);\r\n System.arraycopy(Portrait_pointer, 0, b, 12, 4);\r\n System.arraycopy(Class_pointer, 0, b, 16, 4);\r\n System.arraycopy(Affiliation_pointer, 0, b, 20, 4);\r\n System.arraycopy(Weaponlevel_pointer, 0, b, 24, 4);\r\n System.arraycopy(Skill1_pointer, 0, b, 28, 4);\r\n System.arraycopy(Skill2_pointer, 0, b, 32, 4);\r\n System.arraycopy(Skill3_pointer, 0, b, 36, 4);\r\n System.arraycopy(Animation1_pointer, 0, b, 40, 4);\r\n System.arraycopy(Animation2_pointer, 0, b, 44, 4);\r\n b[48] = unknownbyte1;\r\n b[49] = unknownbyte2;\r\n b[50] = unknownbyte3;\r\n b[51] = unknownbyte4;\r\n b[52] = unknownbyte5;\r\n b[53] = unknownbyte6;\r\n b[54] = level;\r\n b[55] = build;\r\n b[56] = weight;\r\n System.arraycopy(bases, 0, b, 57, 8);\r\n System.arraycopy(growths, 0, b, 65, 8);\r\n System.arraycopy(supportgrowth, 0, b, 73, 8);\r\n b[81] = unknownbyte9;\r\n b[82] = unknownbyte10;\r\n b[83] = unknownbyte11;\r\n\r\n return b;\r\n }", "public Builder setField1190Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1190_ = value;\n onChanged();\n return this;\n }", "com.google.protobuf.ByteString\n getField1197Bytes();", "public static void stringToBcdPlmn(final String plmn, byte[] data, int offset) {\n char digit6 = (plmn.length() > 5) ? plmn.charAt(5) : 'F';\n data[offset] = (byte) (charToByte(plmn.charAt(1)) << 4 | charToByte(plmn.charAt(0)));\n data[offset + 1] = (byte) (charToByte(digit6) << 4 | charToByte(plmn.charAt(2)));\n data[offset + 2] = (byte) (charToByte(plmn.charAt(4)) << 4 | charToByte(plmn.charAt(3)));\n }", "com.google.protobuf.ByteString\n getField1190Bytes();", "public String getString_data() { \n char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,60)];\n int i;\n for (i = 0; i < carr.length; i++) {\n if ((char)getElement_data(i) == (char)0) break;\n carr[i] = (char)getElement_data(i);\n }\n return new String(carr,0,i);\n }", "com.google.protobuf.ByteString\n getField1189Bytes();", "public Integer doEbcdicToAscii(CommBufferLogic commBuffer, Integer Data) {\n // Euro -- IBM has new codepages 1140..1149 using 0x9F except for\n // Scandinavian 0x5A. Scandinavian translates 0x5A to 0x9F.\n // Thus CP500 (0x9F) to ASCII (CP858 0xD5) to ANSI (CP1252 0x80)\n // will work.\n Integer temp = Data;\n\n if (commBuffer.getConnectionData().getCodePage() != 37) { // Default US\n \t// Display EBCDIC to ASCII uses CP037\n Integer idx, size;\n switch (commBuffer.getConnectionData().getCodePage()) {\n case 273: // Austria, Germany\n size = CP273_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP273_CP500[idx]) {\n temp = CP273_CP500[idx + size];\n break;\n }\n }\n break;\n case 277: // Denmark, Norway\n size = CP277_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP277_CP500[idx]) {\n temp = CP277_CP500[idx + size];\n break;\n }\n }\n break;\n case 278: // Finland, Sweden\n size = CP278_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP278_CP500[idx]) {\n temp = CP278_CP500[idx + size];\n break;\n }\n }\n break;\n case 280: // Italy\n size = CP280_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP280_CP500[idx]) {\n temp = CP280_CP500[idx + size];\n break;\n }\n }\n break;\n case 284: // Spain, Latin America\n size = CP284_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP284_CP500[idx]) {\n temp = CP284_CP500[idx + size];\n break;\n }\n }\n break;\n case 285: // United Kingdom\n size = CP285_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP285_CP500[idx]) {\n temp = CP285_CP500[idx + size];\n break;\n }\n }\n break;\n case 297: // France\n size = CP297_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP297_CP500[idx]) {\n temp = CP297_CP500[idx + size];\n break;\n }\n }\n break;\n case 871: // Iceland\n size = CP871_CP500.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP871_CP500[idx]) {\n temp = CP871_CP500[idx + size];\n break;\n }\n }\n break;\n }\n size = CP500_CP037.length / 2;\n for (idx = 0; idx < size; idx++) {\n if (temp == CP500_CP037[idx]) {\n temp = CP500_CP037[idx + size];\n break;\n }\n }\n }\n\n Integer result = 0;\n if(temp < EBCDICTOASCII.length) {\n \tresult = EBCDICTOASCII[temp];\n }\n else {\n\t\t\tresult = 0;\n\t\t}\n \n return result;\n\t}", "public byte[] getContent();", "com.google.protobuf.ByteString\n getField1182Bytes();" ]
[ "0.5862878", "0.5805442", "0.573985", "0.5736735", "0.5736735", "0.5736735", "0.5736735", "0.57291955", "0.5601688", "0.54967755", "0.5482488", "0.5457795", "0.54381704", "0.5430763", "0.5388963", "0.53576136", "0.5331874", "0.53302455", "0.5329283", "0.53191245", "0.5314022", "0.53125274", "0.53063774", "0.5302106", "0.52913535", "0.52912843", "0.52822405", "0.52816075", "0.52736443", "0.5263684", "0.5246622", "0.52236485", "0.5221515", "0.52118987", "0.5199942", "0.51962954", "0.51882094", "0.5183855", "0.51827663", "0.5182359", "0.51787883", "0.5172543", "0.5169551", "0.516718", "0.5163148", "0.5161045", "0.51504034", "0.5133673", "0.51250863", "0.5121858", "0.51212054", "0.5118377", "0.51071787", "0.51069504", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5106061", "0.5094418", "0.50917315", "0.5091426", "0.50809693", "0.50760704", "0.5072392", "0.50673074", "0.5063189", "0.50535417", "0.5043261", "0.5035156", "0.50279677", "0.5027268", "0.50189555", "0.5018365", "0.5009149", "0.49993894", "0.4996593", "0.49900708", "0.49816304", "0.49805486", "0.4975357", "0.49738628", "0.4971334", "0.4968444", "0.49637264", "0.49613124", "0.49553233", "0.49493098", "0.4948598", "0.49479812", "0.49463338", "0.49410367" ]
0.53224444
19
Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: &x60;0f c2 4a bf 34 13 ba&x60;).
public String getHex() { return hex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString() {\n return Util.bytesToHex(getByteArray());\n }", "private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }", "public static String hex(final byte[] data) {\n return hex(data, 0, data.length);\n }", "private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }", "private void outHex(){\n\t\tSystem.out.println(binary);\n\t\tpw.println(binary);\n\t\t\n\t}", "private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }", "public String toHexString() {\n\treturn ByteUtils.toHexString(toByteArray());\n }", "public static String prettyHex(final byte[] data) {\n return prettyHex(data, 0, data.length);\n }", "private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}", "@Override\n public String toString() {\n\treturn ByteUtils.toHexString(toByteArray(), true);\n }", "public static String toHex(byte[] data) {\n\t\tStringBuilder builder = new StringBuilder(data.length * 3);\n\t\tfor (byte b : data) {\n\t\t\tint v = b & 0xFF;\n\t\t\t// Get the first then second character\n\t\t\tbuilder.append(HEX_ARRAY[v >>> 4]);\n\t\t\tbuilder.append(HEX_ARRAY[v & 0x0F]);\n\t\t\tbuilder.append(' ');\n\t\t}\n\t\treturn builder.toString().trim();\n\t}", "public static String hex(final byte[] data, final int offset, final int length) {\n Validate.notInBounds(data, offset, length);\n if (length == 0) {\n return \"\";\n }\n int endIndex = offset + length;\n char[] buf = new char[length << 1];\n\n int srcIdx = offset;\n int dstIdx = 0;\n for (; srcIdx < endIndex; srcIdx++, dstIdx += 2) {\n System.arraycopy(Hexs.HEXDUMP_TABLE, (data[srcIdx] & 0xFF) << 1, buf, dstIdx, 2);\n }\n return new String(buf);\n }", "private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\n }", "public String toString() {\n if (this.data.isEmpty()) {\n return super.toString();\n }\n return BytesUtil.bytes2HexString(toBinary());\n }", "public static String binToHexString(byte[] data) {\r\n return binToHexString(data, data.length);\r\n }", "private String makeHex(byte[] buffer) {\n byte current;\n int length = buffer.length;\n String blank = \"\"; // it's easier to change\n StringBuffer ret = new StringBuffer(2*length);\n\n // do for each half byte\n for(int i=0;i<(2*length);i++)\n {\n\t// mask half byte and move it to the right\n\tcurrent = i%2==1 ? (byte) (buffer[(i/2)] & 0x0F)\n\t : (byte) ((buffer[(i/2)] >> 4) & 0x0F);\n\t\n\t// convert half byte to ASCII char\t\t \n\tret.append((char) (current < 0x0A ? current+0x30 : current+0x37) + (i%2==1 ? blank : \"\"));\n }\n return ret.toString();\n }", "public String memoryDisplayHex()\n {\n int pos = startingPos;\n String ret = \"\";\n while(pos <= endingPos)\n {\n String instruction = mem.getFourBytes(pos);\n ret += \"0x\"+Integer.toHexString(pos) + \": \" + instruction.substring(0,4) + \" \" + instruction.substring(4,8)+\"\\n\";\n pos += 4;\n }\n return ret;\n }", "public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}", "private static String hex(String binStr) {\n\n\n\t\tString newStr = new String();\n\n\t\ttry {\n\t\t\tString hexStr = \"0123456789ABCDEF\";\n\t\t\tbyte[] p = binStr.getBytes();\n\t\t\tfor (int k = 0; k < p.length; k++) {\n\t\t\t\tint j = (p[k] >> 4) & 0xF;\n\t\t\t\tnewStr = newStr + hexStr.charAt(j);\n\t\t\t\tj = p[k] & 0xF;\n\t\t\t\tnewStr = newStr + hexStr.charAt(j) + \" \";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"Failed to convert into hex values: \" + e);\n\t\t}\n\t\treturn newStr;\n\t}", "public String getHexa() {\n\t\treturn String.format(\"#%02x%02x%02x\", getRed(), getGreen(), getBlue());\t\t\t\t\n\t}", "private String toHex(byte[] bytes) {\n StringBuilder s = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n s.append(String.format(\"%02x\", b));\n }\n return s.toString();\n }", "private void toHex(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tStringBuilder tempsb = new StringBuilder(binary);\n\t\t\n\t\t\tfor (int i = 0;i<binary.length();i+=4){//maps each nibble to its binary value\n\t\t\t\tif (tempsb.substring(i,i+4).equals(\"0000\")) \n\t\t\t\t\tsb.append('0');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0001\"))\n\t\t\t\t\tsb.append('1');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0010\"))\n\t\t\t\t\tsb.append('2');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0011\"))\n\t\t\t\t\tsb.append('3');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0100\"))\n\t\t\t\t\tsb.append('4');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0101\"))\n\t\t\t\t\tsb.append('5');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0110\"))\n\t\t\t\t\tsb.append('6');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0111\"))\n\t\t\t\t\tsb.append('7');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1000\"))\n\t\t\t\t\tsb.append('8');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1001\"))\n\t\t\t\t\tsb.append('9');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1010\"))\n\t\t\t\t\tsb.append('A');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1011\"))\n\t\t\t\t\tsb.append('B');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1100\"))\n\t\t\t\t\tsb.append('C');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1101\"))\n\t\t\t\t\tsb.append('D');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1110\"))\n\t\t\t\t\tsb.append('E');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1111\"))\n\t\t\t\t\tsb.append('F');\n\t\t\t}\n\t\t\tsb.insert(0,\"0x\");\n\t\t\tbinary = sb.toString();\n\t}", "public String toString() {\n StringBuffer ret = new StringBuffer(\"APDU_Buffer = \");\n ret.append(makeHex(getBytes()));\n ret.append(\" (hex) | lc = \");\n ret.append(lc);\n ret.append(\" | le = \");\n ret.append(le);\n\n // make hex representation of byte array\n return ret.toString();\n }", "public String hex() {\r\n return this.hex;\r\n }", "public static String toHexString(BigInteger data) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(data.toString(16));\n return sb.toString();\n }", "private static String getHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(\n HEXES.charAt((b & 0x0F)));\n }\n return hex.toString();\n }", "public static String toHex(byte[] bytes){\r\n\t\treturn hexEncode(bytes);\r\n\t}", "public static String hexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tint size = b.length;\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\tif ((i+1)%16 == 0)\r\n\t\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\"\\n\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn buf.toString();\r\n\t}", "public static String toHexadecimal(final byte[] bytes) {\n\t\treturn new String(toHexadecimalChars(bytes));\n\t}", "public static String prettyHex(final byte[] data, final int offset, final int length) {\n Validate.notInBounds(data, offset, length);\n StringBuilder result = new StringBuilder();\n StringBuilder builder = new StringBuilder();\n int pos = offset;\n int max = length;\n int lineNumber = 0;\n builder.append(Hexs.HEXDUMP_PRETTY_HEADER);\n while (pos < max) {\n builder.append(String.format(\"%08d | \", lineNumber++));\n int lineMax = Math.min(max - pos, 16);\n for (int i = 0; i < lineMax; i++) {\n int index = (data[pos + i] & 0xFF) << 1;\n builder.append(\n new String(new char[] {Hexs.HEXDUMP_TABLE[index], Hexs.HEXDUMP_TABLE[++index]}));\n builder.append(\" \");\n }\n builder.append(\"| \");\n for (int i = 0; i < lineMax; i++) {\n char c = (char) data[pos + i];\n if (c < 32 || c > 127) {\n c = '.';\n }\n builder.append(c);\n }\n builder.append(\"\\n\");\n result.append(builder);\n builder.setLength(0);\n pos += 16;\n }\n result.append(Hexs.HEXDUMP_PRETTY_FOOTER);\n return result.toString();\n }", "private static String toHex(byte buffer[]) {\n\t\tStringBuffer sb = new StringBuffer(buffer.length * 2);\n\t\tfor (int i = 0; i < buffer.length; i++) {\n\t\t\tsb.append(Character.forDigit((buffer[i] & 0xf0) >> 4, 16));\n\t\t\tsb.append(Character.forDigit(buffer[i] & 0x0f, 16));\n\t\t}\n\t\treturn sb.toString();\n\t}", "@Override\n public String toString() {\n if (data == null) {\n return ZeroString;\n }\n StringBuffer uuid = new StringBuffer(36);\n for (int i = 0; i < 16; ++i) {\n byte value = data[i];\n uuid.append(String.format(\"%02x\", value & 0xFF));\n if (i == 3 || i == 5 || i == 7 || i == 9) {\n uuid.append(\"-\");\n }\n }\n return uuid.toString();\n }", "public static String rawHexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tint size = b.length;\r\n\t\tif (size == 0)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t}\r\n\t\tbuf.delete(buf.length()-1,buf.length());\r\n\t\treturn buf.toString();\r\n\t}", "private static String toHex(byte[] hash) {\n StringBuilder hashedInput = new StringBuilder(\"\");\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(0xff & hash[i]);\n if (hex.length() == 1) {\n hashedInput.append('0');\n }\n hashedInput.append(hex);\n }\n return hashedInput.toString();\n }", "public static String prettyHex(final byte value) {\n return prettyHex(new byte[] {value});\n }", "static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }", "public static String getHexString (byte[] bytes) {\r\n\t \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\r\n\t for (int i = 0; i < bytes.length; i++) {\r\n\t sb.append(String.format(\"%02x\", bytes[i]).toUpperCase());\r\n\t if (i < (bytes.length - 1))\r\n\t \tsb.append(\"-\");\r\n\t }\r\n\r\n\t return sb.toString();\r\n\t}", "static String binToHex(String binaryStr) {\n\t\tint bin = Integer.parseInt(binaryStr, 2);\n\t\tString hexStr = Integer.toString(bin, 16);\n\n\t\treturn hexStr;\n\t}", "public String getHexValue() {\n return hexValue;\n }", "public static String toHexStringWithSpace(byte[] bytes) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tfor (byte b : bytes) {\n\t\t\tstringBuilder.append(HEX_ALPHABET[0xF & (b>>4)]);\n\t\t\tstringBuilder.append(HEX_ALPHABET[0xF & b]);\n\t\t\tstringBuilder.append(' ');\n\t\t}\n\t\treturn stringBuilder.toString();\n\t}", "private static String binToHex(String bin) {\n\t\tString hex = \"\";\n\t\twhile (bin.length() % 4 != 0) { // comprueba si la cadena tiene longitud multiplo de 4\n\t\t\tbin = \"0\" + bin; // si no, le aņado un cero y vuelvo a comprobar si es multiplo de 4\n\t\t}\n\t\t// este while va cogiendo cachitos de 4, los pasa a hexadecimal y acumula en la variable hex\n\t\twhile (bin.length() != 0) { // el while continua hasta que la cadena tenga longitud cero\n\t\t\tString four = bin.substring(bin.length()-4); // cojo los 4 ultimos\n\t\t\thex = byteToHex(four) + hex; // paso 4 bits a hexadecimal y acumulo en hex\n\t\t\tbin = bin.substring(0, bin.length() - 4); // al string original le quito los cuatro bits que ya he procesado\n\t\t}\n\t\treturn hex; // cuando ha terminado el while, en hex tengo el hexadecimal completo\n\t\t\n\t}", "public static String formatByteAsHex(byte a)\n {\n char guarismos[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n int i = signedByte2unsignedInteger(a);\n byte nibbleH = (byte)(i >> 4), nibbleL = (byte)(i & 0x0F);\n\n return \"\" + guarismos[nibbleH] + guarismos[nibbleL];\n }", "private static String pasarAHexadecimal(byte[] digest){\n String hash = \"\";\n for(byte aux : digest) {\n int b = aux & 0xff;\n if (Integer.toHexString(b).length() == 1) hash += \"0\";\n hash += Integer.toHexString(b);\n }\n return hash;\n }", "public String memoryDisplayBin()\n {\n int pos = startingPos;\n String ret = \"\";\n while(pos <= endingPos)\n {\n String instruction = mem.getFourBytes(pos);\n String bin = BinaryFormater.format(Integer.toBinaryString(Integer.parseInt(instruction, 16)),32);\n ret += \"0x\"+Integer.toHexString(pos) + \": \" + bin.substring(0,16) + \" \" + bin.substring(16,32)+\"\\n\";\n pos += 4;\n }\n return ret;\n }", "private String convertToHex(byte[] raw) {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < raw.length; i++) {\n sb.append(Integer.toString((raw[i] & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }", "public static String formatHexBytes(byte[] raw) {\n StringBuffer buffer;\n final char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n int i;\n int value;\n buffer = new StringBuffer(raw.length * 2);\n for (i = 0; i < raw.length; i++) {\n value = raw[i];\n buffer.append(hexDigits[(value >> 4) & 0x0F]);\n buffer.append(hexDigits[value & 0x0F]);\n }\n return (buffer.toString());\n }", "static private String hexEncode(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (int i = 0; i < bytes.length; i++) {\n byte b = bytes[i];\n result.append(DIGITS[(b & 0xf0) >> 4]);\n result.append(DIGITS[b & 0x0f]);\n }\n return result.toString();\n }", "private static String bytesToHex(byte[] bytes) {\n StringBuilder result = new StringBuilder();\n\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n\n return result.toString();\n }", "public String toHex(String arg) throws UnsupportedEncodingException {\n\t return String.format(\"%064x\", new BigInteger(1, arg.getBytes(\"UTF8\")));\n\t}", "private String toHexString(byte[] bytes) {\n StringBuilder hexString = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n String hex = Integer.toHexString(0xFF & bytes[i]);\n if (hex.length() == 1) {\n hexString.append('0');\n }\n hexString.append(hex);\n }\n\n return hexString.toString().toUpperCase();\n }", "public static String asHex(byte[] buf) {\n \t char[] HEX_CHARS = \"0123456789abcdef\".toCharArray();\n \t char[] chars = new char[2 * buf.length];\n \t for (int i = 0; i < buf.length; ++i) {\n \t chars[2 * i] = HEX_CHARS[(buf[i] & 0xF0) >>> 4];\n \t chars[2 * i + 1] = HEX_CHARS[buf[i] & 0x0F];\n \t }\n \t return new String(chars);\n \t}", "public static final String toHex(byte hash[]) {\r\n StringBuffer buf = new StringBuffer(hash.length * 2);\r\n int i;\r\n\r\n for (i = 0; i < hash.length; i++) {\r\n if (((int) hash[i] & 0xff) < 0x10) {\r\n buf.append(\"0\");\r\n }\r\n buf.append(Long.toString((int) hash[i] & 0xff, 16));\r\n }\r\n return buf.toString();\r\n }", "public String getHash() {\n byte[] bArr = new byte[21];\n bArr[0] = (byte) getCTxDestinationType().getValue();\n System.arraycopy(this.mData, 0, bArr, 1, 20);\n return StringToolkit.bytesToString(bArr);\n }", "@Override\n\tpublic String toString()\n\t{\n\t\treturn new String(bytes);\n\t}", "private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "private static String bytesToHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }", "public static String toHexString(byte[] bytes) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tfor (byte b : bytes) {\n\t\t\tstringBuilder.append(HEX_ALPHABET[b>>4]);\n\t\t\tstringBuilder.append(HEX_ALPHABET[b]);\n\t\t}\n\t\treturn stringBuilder.toString();\n\t}", "private String toHex(byte[] array)\n {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if(paddingLength > 0) \n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }", "public static String hex(final byte value) {\n char[] buf = new char[2];\n System.arraycopy(Hexs.HEXDUMP_TABLE, (value & 0xFF) << 1, buf, 0, 2);\n return new String(buf);\n }", "public static String byteArrayToHexStr(byte[] data)\r\n {\r\n\tString output = new String();\r\n\tString tempStr = new String();\r\n\tint tempInt = 0;\r\n\r\n\tfor(int a = 0; a < data.length; a++)\r\n\t {\r\n\t\ttempInt = data[a]&0xFF;\r\n\t\ttempStr = Integer.toHexString(tempInt);\r\n\r\n\t\tif(tempStr.length() == 1)\r\n\t\t tempStr = \"0\" + tempStr;\r\n\r\n\t\toutput += tempStr;\r\n\t }\r\n\treturn output;\r\n }", "public boolean isHexBinary() {\n return false;\n }", "public String binarioToHexa(String binario) {\n\t\tSystem.out.print(\"Convirtiendo binario (\" + binario + \") a hexadecimal >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(binario, 2);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + binario + \" no es binario\");\n\t\t}\n\t\treturn Integer.toHexString(numero);\n\t}", "private String blobToHex (Blob blobData) throws SQLException {\n\n String returnData = \"\";\n\n if (blobData != null) {\n try {\n byte[] bytes = blobData.getBytes(1, (int) blobData.length());\n returnData = Hex.encodeHexString(bytes).toUpperCase();\n } finally {\n // The most important thing here is free the BLOB to avoid memory Leaks\n blobData.free();\n }\n }\n return returnData;\n }", "@Override\n\tpublic String toString()\n\t{\n\t\treturn String.format(\"0x%08x\", ib);\n\t}", "private static String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'\n\t\t};\n\t\tchar[] array = {hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f]};\n\t\treturn new String(array);\n\t}", "private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }", "public String binToHex(String input) {\r\n int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn Integer.toString(decimal,16);\t\r\n\t}", "public static String toHex(byte[] bytes)\n {\n\n if (bytes == null)\n {\n return null;\n }\n\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < bytes.length; i++)\n {\n int value = (int) bytes[i];\n\n builder.append(HEX_CHARS.charAt((value >> 4) & 0x0F));\n builder.append(HEX_CHARS.charAt(value & 0x0F));\n }\n\n return builder.toString();\n }", "public static String hexaToString(byte[] digest ){\n\t StringBuffer hexString = new StringBuffer();\n\t for (int i = 0; i < digest.length; i++) {\n\t if ((0xff & digest[i]) < 0x10) {\n\t hexString.append(\"0\" + Integer.toHexString((0xFF & digest[i])));\n\t } else {\n\t hexString.append(Integer.toHexString(0xFF & digest[i]));\n\t }\n\t } \n\t return hexString.toString(); \n\t }", "static String hexSha256Msg(String text) {\n String str=null;\n byte[] data = text.getBytes();\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n md.update(data);\n byte[] bytes = md.digest();\n str = byteToHex(bytes);\n }catch (NoSuchAlgorithmException e){\n e.printStackTrace();\n }\n System.out.println(str);\n return str ;\n }", "private static String bytesToHex(byte[] bytes) {\n final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }", "private StringBuilder byteToStringBuilder(byte[] data) {\n\t\tStringBuilder sbLog = new StringBuilder();\n\t\tfor (byte b : data) {\n\t\t\tsbLog.append(String.format(\"%02x\", new Object[] { b }));\n\t\t}\n\t\t//System.out.println(\" data packet : \"+ sbLog);\n\t\treturn sbLog;\n\t}", "public static String hexToString(byte[] bytes) {\n StringBuffer buff = new StringBuffer();\n for (int i=0; i<bytes.length; i++) {\n int val = bytes[i];\n val = val & 0xff; // remove higher bits, sign\n if (val<16) buff.append('0'); // leading 0\n buff.append(Integer.toString(val, 16));\n }\n return buff.toString();\n }", "private String formatHex(int decimal) {\n char[] bin = Integer.toBinaryString(decimal).toCharArray();\n //System.out.println(\"bin is \"+String.valueOf(bin) +\" length:\"+bin.length);\n while(bin.length< 4) {\n for(int i =4-bin.length; i<4;i++){\n bin = (\"0\"+ String.valueOf(bin)).toCharArray();\n }\n }\n //System.out.println(\"bin is \"+String.valueOf(bin));\n int len = bin.length -1;\n char[] temp = {bin[len-3], bin[len-2], bin[len-1], bin[len] };\n return formatHex(Integer.toHexString(Integer.parseInt(String.valueOf(temp), 2 )));\n }", "private static String toHex(byte[] array) {\r\n BigInteger bi = new BigInteger(1, array);\r\n String hex = bi.toString(16);\r\n int paddingLength = (array.length * 2) - hex.length();\r\n if (paddingLength > 0) {\r\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n } else {\r\n return hex;\r\n }\r\n }", "static public String encode(byte[] binaryData) {\n if (binaryData == null)\n return null;\n int lengthData = binaryData.length;\n int lengthEncode = lengthData * 2;\n char[] encodedData = new char[lengthEncode];\n int temp;\n for (int i = 0; i < lengthData; i++) {\n temp = binaryData[i];\n if (temp < 0)\n temp += 256;\n encodedData[i*2] = lookUpHexAlphabet[temp >> 4];\n encodedData[i*2+1] = lookUpHexAlphabet[temp & 0xf];\n }\n return new String(encodedData);\n }", "private static String byteArrayToHexString(byte[] byteArray) {\n\t\t\n\t\t//Initialize the string buffer\n\t\tStringBuffer stringBuffer = new StringBuffer(byteArray.length * 2);\n\t\t\n\t\t//Start constructing the byte array\n\t\tstringBuffer.append(\"[ \");\n\t\t\n\t\t//For all the bytes in the array\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\t\n\t\t\t//Convert the byte to an integer\n\t\t\tint v = byteArray[i] & 0xff;\n\t\t\t\n\t\t\t//Left shift\n\t\t\tif (v < 16) {\n\t\t\t\tstringBuffer.append('0');\n\t\t\t}\n\t\t\t\n\t\t\t//Add the hex string representation of the byte \n\t\t\tstringBuffer.append(\"0x\" + Integer.toHexString(v).toUpperCase() + \" \");\n\t\t}\n\t\t\n\t\t//Close the byte array string\n\t\tstringBuffer.append(\"]\");\n\t\t\n\t\t//Convert the string buffer to a string a return it\n\t\treturn stringBuffer.toString();\n\t}", "public String encodeHex(String hexa) {\n if (!hexa.matches(\"^[0-9a-fA-F]+$\")) {\n return \"\";\n }\n\n final List<Long> matched = new ArrayList<Long>();\n final Matcher matcher = WORD_PATTERN.matcher(hexa);\n\n while (matcher.find()) {\n matched.add(Long.parseLong('1' + matcher.group(), 16));\n }\n\n // conversion\n final long[] result = new long[matched.size()];\n for (int i = 0; i < matched.size(); i++) {\n result[i] = matched.get(i);\n }\n\n return this.encode(result);\n }", "private static String toHex(byte[] array) {\r\n\t\tBigInteger bi = new BigInteger(1, array);\r\n\t\tString hex = bi.toString(16);\r\n\t\tint paddingLength = (array.length * 2) - hex.length();\r\n\t\tif (paddingLength > 0)\r\n\t\t\treturn String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n\t\telse\r\n\t\t\treturn hex;\r\n\t}", "public static String toHexString(byte[] array) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(DatatypeConverter.printHexBinary(array));\n return sb.toString();\n }", "public final String toString()\n\t{\n\t\tif (dataValue == null)\n\t\t{\n\t\t\tif ((stream == null) && (_blobValue == null) )\n\t\t\t{\n\t\t\t\treturn \"NULL\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (SanityManager.DEBUG)\n\t\t\t\t\tSanityManager.THROWASSERT(\n\t\t\t\t\t\t\"value is null, stream or blob is not null\");\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn org.apache.derby.iapi.util.StringUtil.toHexString(dataValue, 0, dataValue.length);\n\t\t}\n\t}", "private static String hexlify() throws Exception {\n byte[] data = new byte[4 + SCRIPT.length() + (16 - (4 + SCRIPT.length()) % 16)];\n data[0] = 77;\n data[1] = 80;\n data[2] = (byte) (SCRIPT.length() & 0xff);\n data[3] = (byte) ((SCRIPT.length() >> 8) & 0xff);\n for (int i = 0; i < SCRIPT.length(); ++i) {\n data[4 + i] = (byte) SCRIPT.charAt(i);\n }\n\n if (data.length > MAX_SIZE) {\n throw new Exception(\"Script is too long\");\n }\n int addr = 0x3e000;\n byte[] chunk = new byte[5 + 16];\n\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\":020000040003F7\")\n .append(\"\\n\");\n for (int i = 0; i < data.length; i += 16) {\n chunk[0] = 16;\n chunk[1] = (byte) ((addr >> 8) & 0xff);\n chunk[2] = (byte) (addr & 0xff);\n chunk[3] = 0;\n for (int j = 0; j < 16; j++) {\n chunk[4 + j] = data[i + j];\n }\n byte checksum = 0;\n for (int j = 0; j < 4 + 16; j++) {\n checksum += chunk[j];\n }\n chunk[4 + 16] = (byte) ((-checksum) & 0xff);\n stringBuilder.append(':')\n .append(hexlify(chunk).toUpperCase())\n .append(\"\\n\");\n addr += 16;\n }\n return stringBuilder.toString();\n }", "public String getHexCode() {\r\n return this.hexCode;\r\n }", "public static byte[] toBytes(String strhex ){\r\n\t\t \r\n\t\t String hexString = strhex.trim();\t\t \r\n\t int length = hexString.length();\r\n\t if ( length % 2 != 0 ) {\r\n\t \thexString = \"0\" ;\r\n\t \thexString += strhex.trim();\r\n\t }\r\n\t length = hexString.length();\r\n\t byte[] data = new byte[ length / 2 ];\r\n\t char highChar, lowChar;\r\n\t byte highNibble, lowNibble;\r\n\t for (int i = 0, offset = 0; i < length; i += 2, offset ++ )\r\n\t {\r\n\t highChar = hexString.charAt( i );\r\n\t if ( highChar >= '0' && highChar <= '9')\r\n\t {\r\n\t highNibble = (byte)(highChar - '0');\r\n\t }\r\n\t else if (highChar >= 'A' && highChar <= 'F')\r\n\t {\r\n\t highNibble = (byte)(10 + highChar - 'A');\r\n\t }\r\n\t else if (highChar >= 'a' && highChar <= 'f')\r\n\t {\r\n\t highNibble = (byte)(10 + highChar - 'a');\r\n\t }\r\n\t else\r\n\t {\r\n\t throw new NumberFormatException( \"Invalid hex char: \" + highChar );\r\n\t }\r\n\r\n\t lowChar = hexString.charAt( i + 1 );\r\n\t if ( lowChar >= '0' && lowChar <= '9')\r\n\t {\r\n\t lowNibble = (byte)(lowChar - '0');\r\n\t }\r\n\t else if (lowChar >= 'A' && lowChar <= 'F')\r\n\t {\r\n\t lowNibble = (byte)(10 + lowChar - 'A');\r\n\t }\r\n\t else if (lowChar >= 'a' && lowChar <= 'f')\r\n\t {\r\n\t lowNibble = (byte)(10 + lowChar - 'a');\r\n\t }\r\n\t else\r\n\t {\r\n\t throw new NumberFormatException( \"Invalid hex char: \" + lowChar );\r\n\t }\r\n //System.out.println(\"len = \" + length +\", offset = \" + offset);\r\n\t data[ offset ] = (byte)(highNibble << 4 | lowNibble);\r\n\t }\r\n\t return data;\r\n\t}", "public static String bytesToHex(byte[] txtInByte) {\n\t\t StringBuilder sb = new StringBuilder(txtInByte.length * 2);\n\t\t for(byte b: txtInByte)\n\t\t sb.append(String.format(\"%02x\", b & 0xff));\n\t\t return sb.toString();\n\t\t}", "@Override\n public String getHexMessage() {\n return ModbusUtil.toHex(this);\n }", "private static String getFormattedText(byte[] bytes) {\n\t\tint len = bytes.length;\n\t\tStringBuilder buf = new StringBuilder(len * 2);\n\t\t// 把密文转换成十六进制的字符串形式\n\t\tfor (int j = 0; j < len; j++) {\n\t\t\tbuf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);\n\t\t\tbuf.append(HEX_DIGITS[bytes[j] & 0x0f]);\n\t\t}\n\t\treturn buf.toString();\n\t}", "private static String getFormattedText(byte[] bytes) {\n\t\tint len = bytes.length;\n\t\tStringBuilder buf = new StringBuilder(len * 2);\n\t\t// 把密文转换成十六进制的字符串形式\n\t\tfor (int j = 0; j < len; j++) {\n\t\t\tbuf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);\n\t\t\tbuf.append(HEX_DIGITS[bytes[j] & 0x0f]);\n\t\t}\n\t\treturn buf.toString();\n\t}", "public static final String hash(final byte[] bytes) {\n\t\treturn Hex.fromByteArray(digest(bytes));\n\t}", "public static String byteToHex(final byte[] hash) {\n if (Objects.isNull(hash)) {\n return null;\n }\n\n Formatter formatter = new Formatter();\n for (byte b : hash) {\n formatter.format(\"%02x\", b);\n }\n String result = formatter.toString();\n formatter.close();\n return result;\n }", "private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }", "public static String bytesToHex(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n return result.toString();\n }", "static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'\n\t\t};\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}", "private static String toHex(byte[] digest) {\n\t\tchar[] result = new char[digest.length * 2];\n\t\tint pos = 0;\n\t\tfor (int i = 0; i < digest.length; i++) {\n\t\t\tresult[pos++] = hexChar((digest[i] & 0xf0) >> 4);\n\t\t\tresult[pos++] = hexChar(digest[i] & 0x0f);\n\t\t}\n\t\treturn new String(result);\n\t}", "public static void dumpData(String text, byte[] data, int offset, int length) {\n StringBuilder outString = new StringBuilder(512);\n outString.append(text);\n outString.append(\"\\n\");\n for (int i=0; i<length; i++) {\n if (i%32 == 0)\n outString.append(String.format(\" %14X \", i));\n else if (i%4 == 0)\n outString.append(\" \");\n outString.append(String.format(\"%02X\", data[offset+i]));\n if (i%32 == 31)\n outString.append(\"\\n\");\n }\n if (length%32 != 0)\n outString.append(\"\\n\");\n log.info(outString.toString());\n }", "public static String toHex(byte[] b) {\r\n\tStringBuffer buf;\r\n\tint i;\r\n\r\n\tbuf = new StringBuffer(b.length * 2);\r\n\r\n\tfor (i = 0; i < b.length; i++) {\r\n\t buf.append(HEX.charAt((b[i] >> 4) & 15));\r\n\t buf.append(HEX.charAt(b[i] & 15));\r\n\t}\r\n\treturn buf.toString();\r\n }", "public static String toString(String hexStr) {\n\t\treturn new String(toBytes(hexStr));\n\t}", "public static String bytesToHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(Character.forDigit((b & 0xF0) >> 4, 16))\n .append(Character.forDigit((b & 0x0F), 16));\n }\n return hex.toString();\n }", "static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',\n\t\t\t\t'B', 'C', 'D', 'E', 'F' };\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}", "public String convertToAssemblyHex(String hex)\n {\n if(hex.equals(\"69400100\"))\n {\n return \"MOVEZ X0 data\";\n } else if(hex.equals(\"7c200001\"))\n {\n return \"LDUR X1, X0, #0\";\n } else if(hex.equals(\"5a000202\"))\n {\n return \"CBZ X2, #32\";\n } else if(hex.equals(\"00a0000c\"))\n {\n return \"B #12\";\n } else if(hex.equals(\"04881422\"))\n {\n return \"ADDI X2, X2, #20\";\n }else if(hex.equals(\"06581022\"))\n {\n return \"SUB X2, X1, X2\";\n }else if(hex.equals(\"02220002\"))\n {\n return \"PUSH X2\";\n }else if(hex.equals(\"00000000\"))\n {\n return \"NOP\";\n }else if(hex.equals(\"03330003\"))\n {\n return \"POP X3\";\n }else if(hex.equals(\"7c000003\"))\n {\n return \"STUR X3, X0, #0\";\n }else if(hex.equals(\"06502033\"))\n {\n return \"EOR X3, X2, X3\";\n }else if(hex.equals(\"5a000043\"))\n {\n return \"CBZ X3, #4\";\n }else if(hex.equals(\"11111111\"))\n {\n return \"HALT\";\n } else if(hex.equals(\"00000def\"))\n {\n return \"STACK VALUE: \" + Integer.parseInt(\"def\", 16);\n } else if(hex.equals(\"00abab00\") || hex.equals(\"0000ab00\"))\n {\n return \"DATA VALUE: \" + Integer.parseInt(\"ab\", 16);\n }\n return \"\";\n }" ]
[ "0.67399853", "0.6658015", "0.6637555", "0.6591403", "0.654938", "0.6547397", "0.6538596", "0.65359914", "0.64754957", "0.6447616", "0.6371127", "0.63298565", "0.6286104", "0.62561166", "0.62071806", "0.6199627", "0.6189633", "0.6161902", "0.6153057", "0.61526644", "0.61496574", "0.6148678", "0.6108557", "0.6094062", "0.6044426", "0.6043991", "0.60069454", "0.600588", "0.5993946", "0.59881794", "0.5984633", "0.59606534", "0.5953396", "0.5915349", "0.59139127", "0.59041405", "0.5897316", "0.58940184", "0.5892722", "0.58858335", "0.5879894", "0.5867539", "0.58675045", "0.58646655", "0.5862193", "0.5842962", "0.5839414", "0.58365035", "0.5836288", "0.58230644", "0.5804116", "0.5804096", "0.5802291", "0.5800288", "0.57900393", "0.5786422", "0.57780254", "0.5766383", "0.57654464", "0.57556236", "0.57466626", "0.5745189", "0.5739171", "0.5730194", "0.5725566", "0.5716419", "0.5700626", "0.570031", "0.5697494", "0.56883943", "0.5687412", "0.5685379", "0.5679438", "0.5677753", "0.56728107", "0.5668855", "0.5668468", "0.56638986", "0.56621355", "0.5653881", "0.56492007", "0.56396896", "0.56385994", "0.5608596", "0.5607973", "0.5607732", "0.5598552", "0.5598552", "0.5590011", "0.55592066", "0.555741", "0.5553633", "0.5541675", "0.55272716", "0.5526612", "0.5526587", "0.5525335", "0.55246395", "0.55200344", "0.55181843" ]
0.6289131
12
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }" ]
[ "0.7884939", "0.7549351", "0.74972624" ]
0.0
-1
fungsi untuk mengubah board ke string
public String convertBoardToString(){ String tmp= ""; for (int i=0; i<30; i++){ for (int j=0; j<80; j++){ if (board.getCharacter(j,i)==0){ tmp += '-'; } else { tmp += board.getCharacter(j,i); } } } return tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getBoardString();", "String drawBoard();", "String getBoard();", "String displayMyBoard();", "public void drawBoard() {\n String[][] strBoard= new String[4][4];\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n strBoard[x][y]= \".\";\n }\n else {\n // set color\n if(board[x][y]%3==2) {\n }\n strBoard[x][y]= \"\"+board[x][y];\n }\n }\n }\n \n String line= \"---------------------------------\";\n System.out.println(line);\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n System.out.print(\"|\"+strBoard[x][y]+\"\\t\");\n }\n System.out.println(\"|\");\n }\n System.out.println(line);\n }", "private String boardToString(char[] board) {\n String boardString = \"\";\n for (char aBoard : board) boardString += aBoard;\n return boardString.replaceAll(\" \", \"_\");\n }", "public void displayBoard() {\n newLine();\n for (int row = _board[0].length - 1; row >= 0; row -= 1) {\n String pair = new String();\n for (int col = 0; col < _board.length; col += 1) {\n pair += \"|\";\n pair += _board[col][row].abbrev();\n }\n System.out.println(pair + \"|\");\n newLine();\n }\n }", "public static void setBoard(char[][] board) {\n\t\tBoard.board = board;\n\t}", "private static void printBoard(char [][] board){\n for (int i = 0; i < 6; i++){\n for(int j = 0; j < 7; j++){\n System.out.print(\"|\"+board[i][j]);\n }\n System.out.println(\"|\");\n }\n System.out.println();\n }", "void displayBoard();", "String[][] getBoard();", "public static void printBoard(String b) {\r\n\t\tchar[] c = b.toCharArray();\r\n\t\tSystem.out.println(c[0] + \"|\" + c[1] + \"|\" + c[2]);\r\n\t\tSystem.out.println(c[3] + \"|\" + c[4] + \"|\" + c[5]);\r\n\t\tSystem.out.println(c[6] + \"|\" + c[7] + \"|\" + c[8]);\r\n\t}", "void draw_board(int x, int y, char[][] _display, char[][] _board) {\n for (int i = 0; i < 65; i++) {\n for (int j = 0; j < 33; j++) {\n if (i%8 == 0 && j%4 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '+');\n } else if (j%4 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '-');\n } else if (i%8 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '|');\n } else {\n draw_char(x + i + 1, y + j + 1, _display, ' ');\n }\n }\n }\n char label_row = '1';\n char label_column = 'A';\n for (int i = 0; i < 8; i++) {\n draw_char(x, \t\t\t\t\t\t\t4 * i + 3 + y, _display, label_row);\n draw_char(x + 66, \t\t\t\t4 * i + 3 + y, _display, label_row);\n draw_char(8 * i + 5 + x, \ty,\t\t\t\t\t\t _display, label_column);\n draw_char(8 * i + 5 + x, \ty + 34,\t\t\t\t _display, label_column);\n label_row ++;\n label_column ++;\n }\n draw_pieces(x, y, _display, _board);\n }", "public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n\t\t// 체스판 크기 입력\r\n\t\tString boardSize = br.readLine();\r\n\t\tint sizeX = Integer.parseInt(boardSize.split(\" \")[0]);\r\n\t\tint sizeY = Integer.parseInt(boardSize.split(\" \")[1]);\r\n\r\n\t\t// 체스판 색 정보 2차원 배열 삽입\r\n\t\tCharacter[][] boardArray = new Character[sizeX][sizeY];\r\n\t\tfor (int i = 0; i < sizeX; i++) {\r\n\t\t\tString tmpLineString = br.readLine();\r\n\t\t\tfor (int j = 0; j < sizeY; j++) {\r\n\t\t\t\tboardArray[i][j] = tmpLineString.charAt(j);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// 맨 왼쪽 위 색에 따른 경우의 수 변수 선언\r\n\t\tList<Integer> blackList = new ArrayList<>();\r\n\t\tList<Integer> whiteList = new ArrayList<>();\r\n\t\t\r\n\t\tint black = 0;\r\n\t\tint white = 0;\r\n\r\n\t\t// 기준색에 따른 재 색칠 경우의 수 확인\r\n\t\tfor(int x = 0; x < sizeX-7; x++) {\r\n\t\t\tfor(int y = 0; y < sizeY-7; y++) {\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0+x; i < 8+x; i++) {\r\n\t\t\t\t\tfor (int j = 0+y; j < 8+y; j++) {\r\n\r\n\t\t\t\t\t\tif ((i + j) % 2 == 0 && boardArray[i][j] == 'B') {\r\n\t\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t\t} else if ((i + j) % 2 == 1 && boardArray[i][j] == 'W') {\r\n\t\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t\t} else if ((i + j) % 2 == 0 && boardArray[i][j] == 'W') {\r\n\t\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t\t} else if ((i + j) % 2 == 1 && boardArray[i][j] == 'B') {\r\n\t\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tblackList.add(black);\r\n\t\t\t\twhiteList.add(white);\r\n\t\t\t\tblack = 0;\r\n\t\t\t\twhite = 0;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// 각 리스트 중에서 최소값 출력\r\n\t\tSystem.out.println(Collections.min(blackList) >= Collections.min(whiteList) ? Collections.min(whiteList) : Collections.min(blackList));\t\t\r\n\r\n\t}", "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 }", "public void Display_Boards(){\r\n\t\tfor(int i=0; i<13; i++){\r\n\t\t\tdisplay.putStaticLine(myBoard.Display(i)+\" \"+hisBoard.Display(i));\r\n\t\t}\r\n\t}", "public static void displayboard(String board[][]){\n\t\tint rowindicator[]=new int[boardwidth+1];\n\t\tint rowcount=1;\n\t\tfor(int i=1;i<=boardwidth;i++){\n\t\t\trowindicator[i]=rowcount;\n\t\t\trowcount++;\n\t\t}\n\t\tint columnindicator[]=new int[boardlength+1];\n\t\tint columncount=1;\n\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\tcolumnindicator[i]=columncount;\n\t\t\tcolumncount++;\n\t\t}\n\t\tSystem.out.print(\"\\n \");\n\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t//displays column indicator\n\t\t\tSystem.out.print(\" \"+columnindicator[i]);\n\t\t}\n\t\t//displays board\n\t\tSystem.out.println(\"\");\n\t\tfor(int x=1;x<=boardwidth;x++){\n\t\t\t//displays row indicator\n\t\t\tSystem.out.print(\" \"+rowindicator[x]);\n\t\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t\tSystem.out.print(\" \"+board[x][i]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void showBoard() {\n System.out.println(\"The board is\");\n System.out.println(\"| 1 | 2 | 3 |\\n| 4 | 5 | 6 | \\n| 7 | 8 | 9 |\");\n }", "public static void printBoard(String[][] board) {\n String row0 = board[0][0] +\"|\"+ board[0][1] +\"|\"+ board[0][2];\n String row1 = board[1][0] +\"|\"+ board[1][1] +\"|\"+ board[1][2];\n String row2 = board[2][0] +\"|\"+ board[2][1] +\"|\"+ board[2][2];\n\n System.out.println(row0);\n System.out.println(\"-----\");\n System.out.println(row1);\n System.out.println(\"-----\");\n System.out.println(row2);\n }", "public void displayBoard()\n {\n System.out.println(\"\");\n System.out.println(\" Game Board \");\n System.out.println(\" ---------------------------------\");\n for (int i = 0; i < ROW; i++)\n {\n System.out.print(i+1 + \" | \");\n for (int j = 0; j < COL; j++)\n {\n //board[i][j] = \"A\";\n System.out.print(board[i][j].getPieceName() + \" | \");\n }\n System.out.println();\n }\n System.out.println(\" ---------------------------------\");\n\n System.out.println(\" a b c d e f g h \");\n }", "public String boardCellToString() {\n String str;\n Integer convertX, convertY;\n //adjusting the co'ordinates because the board starts at 1 not 0\n convertX=this.xCor + 1;\n convertY= this.yCor + 1;\n str = \"(\" + convertX.toString() + \",\" + convertY.toString() + \")\";\n return str;\n }", "private String encodedBoard() {\r\n char[] result = new char[Square.SQUARE_LIST.size() + 1];\r\n result[0] = turn().toString().charAt(0);\r\n for (Square sq : SQUARE_LIST) {\r\n result[sq.index() + 1] = get(sq).toString().charAt(0);\r\n }\r\n return new String(result);\r\n }", "public static void displayBoard(String[][] board) {\r\n for (int r = 0; r < board.length; r++) {\r\n for (int c = 0; c < board[0].length; c++) {\r\n System.out.print(board[r][c]);\r\n }\r\n System.out.println();\r\n }\r\n }", "public void displayBoard(){\r\n System.out.println(board.toString());\r\n }", "protected static char[][] update_Board(){\n return null;\n }", "public String toString() {\n // show marbles on board with indexes\n String s = \"\";\n for (int i = 0; i < DIMENSION; i++) {\n if ((i > 4) && (i != 10)) {\n s += \" \".repeat(i - 2);\n // char index bottom board\n s += \"\\u001b[32m\" + String.valueOf((char) ((char) i + 'A' - 1)) + \"\\u001b[0m \";\n } else {\n s += \" \".repeat(i);\n }\n for (int j = 0; j < DIMENSION; j++) {\n if (i + j == 4) {\n if (i == 0) {\n s += \" \";\n } else {\n // char index top board\n s += \"\\u001b[32m\" + String.valueOf((char) ((char) i + 'A' - 1)) + \"\\u001b[0m\";\n }\n } else if ((i + j < 4) || i + j > 15) {\n s += \"\\u001b[32m\";\n if ((i == 7 && j == 9)) {\n s += \"9\";\n } else if ((i == 8 && j == 8)) {\n s += \"8\";\n } else if ((i == 9 && j == 7)) {\n s += \"7\";\n } else if ((i == 10 && j == 6)) {\n s += \"6\";\n } else {\n s += \" \";\n }\n s += \"\\u001b[0m\";\n } else if (isOutOfBoard(fields[i][j])) {\n \n s += fields[i][j].getMarbleColor().toString().charAt(0);\n } else {\n // show marbles with color\n switch (fields[i][j].getMarbleColor()) {\n case BLACK:\n s += \"\\u001b[30mo\";\n break;\n case WHITE:\n s += \"\\u001b[37mo\";\n break;\n case RED:\n s += \"\\u001b[31mo\";\n break;\n case BLUE:\n s += \"\\u001b[34mo\";\n break;\n case NONE:\n s += \" \";\n break;\n }\n }\n s += \"\\u001b[0m \";\n }\n \n s += \"\\n\";\n }\n \n s += \" \".repeat(13) + \"\\u001b[32m1 2 3 4 5\\u001b[0m\";\n return s;\n\n\n }", "private static void printBoard() {\n\n\t//\tJOptionPane.showMessageDialog(null, \"Heyoo\", \".-*Board*-.\", -1);\n\t\t//String name = JOptionPane.showInputDialog(\"Vat is dain name?\");\n\t\t//JOptionPane.showMessageDialog(null, \"Aiight you good, \" + name);\n\t\t\n\t\t\n\t\tString[] options = {\"Sten\", \"Sax\", \"Påse\"};\n\t\tString Val = (String)JOptionPane.showInputDialog(null, \"Sten, Sax eller Påse?\",\n \"Game nr\", JOptionPane.QUESTION_MESSAGE, null, options, options[2]);\n\t\t\n\t\t\n\t\t\n\t}", "public void initBoard(){\n System.out.print(\" \");\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++){\n board[i][j] = 'O';\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "private void drawStrings(Canvas canvas)\n\t{\n\t\tPaint dark = new Paint();\n\t\tdark.setARGB(255, 15, 74, 0);\n\t\tdark.setTextAlign(Paint.Align.CENTER);\n\t\tfloat cellWidth = (Math.min(getMeasuredHeight(), getMeasuredWidth()) - PADDING);\n\t\tcellWidth = cellWidth/(float)_height;\n\t\tdark.setTextSize(cellWidth / 4 * 3);\n\n\t\tTypeface font = Typeface.createFromAsset(getContext().getAssets(), \n\t\t\t\t\"fonts/Roboto.ttf\");\n\t\tdark.setTypeface(font);\n\t\tfor ( int i = 0; i < _board.getSize(); ++i ) \n\t\t{\n\t\t\tString letter = _board.getElementAt(i);\n\t\t\tint x = i % _height;\n\t\t\tint y = i / _height;\n\t\t\tcanvas.drawText(letter, x * (cellWidth) + cellWidth / 2, y * (cellWidth) + cellWidth / 4 * 3, dark);\n\t\t}\n\t}", "public void showBoard(){\n }", "private void init() {\r\n\t\tint linePos = this.playBoard.length / 2;\r\n\t\tint columnPos = this.playBoard[0].length / 2;\r\n\t\tfor (int i = 0; i < playBoard.length; i++) {\r\n\t\t\tfor (int j = 0; j < playBoard[0].length; j++) {\r\n\t\t\t\tplayBoard[i][j] = '-';\r\n\t\t\t}\r\n\t\t}\r\n\t\tplayBoard[linePos - 1][columnPos - 1] = 'W';\r\n\t\tplayBoard[linePos - 1][columnPos] = 'B';\r\n\t\tplayBoard[linePos][columnPos] = 'W';\r\n\t\tplayBoard[linePos][columnPos - 1] = 'B';\r\n\t}", "boolean updateBoard(String currentPlayerTurn, String newBoard);", "public static void printBoard(char[][] board) {\n\t\tfor(int i=0; i<3; i++) {\n\t\t\tfor(int j=0; j<3; j++) {\n\t\t\t\tboard[i][j] = '-';\n\t\t\t\tSystem.out.print(board[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void printBoard() {\n int separatorLen = 67;\n StringBuilder boardString = new StringBuilder();\n boardString.append(new String(new char [separatorLen]).replace(\"\\0\",\"*\"));\n boardString.append(\"\\n\");\n for(int y = Y_UPPER_BOUND - 1; y >= 0; y--)\n {\n boardString.append(y + 1).append(\" \");\n boardString.append(\"*\");\n for (int x = 0; x < X_UPPER_BOUND; x++)\n {\n Piece p = Board.board[x + y * X_UPPER_BOUND];\n if(p != null)\n {\n boardString.append(\" \").append(p).append(p.getColor()? \"-B\":\"-W\").append(\" \").append((p.toString().length() == 1? \" \":\"\"));\n }\n else\n {\n boardString.append(\" \");\n }\n boardString.append(\"*\");\n }\n boardString.append(\"\\n\").append((new String(new char [separatorLen]).replace(\"\\0\",\"*\"))).append(\"\\n\");\n }\n boardString.append(\" \");\n for(char c = 'A'; c <= 'H';c++ )\n {\n boardString.append(\"* \").append(c).append(\" \");\n }\n boardString.append(\"*\\n\");\n System.out.println(boardString);\n }", "private void generateBoard(){\n\t}", "public String toString(){\n\t\tString board = \"\";\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tif(theGrid[i][j]){ //iterate through, if cell is alive, mark with *\n\t\t\t\t\tboard += \"*\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tboard += \" \"; //else, [space]\n\t\t\t\t}\n\t\t\t}\n\t\t\tboard += \"\\n\";//create a new line, to create the board\n\t\t}\n\t\treturn board; //return the board\n\t}", "public static void drawBoard(){\n\t\tSystem.out.println(\"\\n\\t A B C\");\r\n\t\tSystem.out.println(\"\\t .-----------.\");\r\n\t\tSystem.out.println(\"\\t1 |_\"+TicTac.place[0]+\"_|_\"+TicTac.place[1]+\"_|_\"+TicTac.place[2]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t2 |_\"+TicTac.place[3]+\"_|_\"+TicTac.place[4]+\"_|_\"+TicTac.place[5]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t3 |_\"+TicTac.place[6]+\"_|_\"+TicTac.place[7]+\"_|_\"+TicTac.place[8]+\"_|\");\r\n\t\tSystem.out.println(\"\\t '-----------'\");\r\n\t}", "private boolean addToBoardVer(int col,int row,int all, ArrayList<String> test, Board board){\n int rowToStart = row;\n String onBoard = test.get(all).toUpperCase();\n int newIndex = 0;\n if (row-1>=0 && board.getPiece(row-1, col)!= null){\n int index = row-1;\n while (index >=0 && board.getPiece(index, col)!= null){\n index--;\n }\n index++;\n \n while (index<row){\n if (newIndex<onBoard.length() && board.getPiece(index, col).theLetter() != onBoard.charAt(newIndex)){\n board.clearNonPinned();\n return false;\n }\n newIndex++;\n index++;\n }\n }\n int chars = newIndex;\n for (; chars < onBoard.length(); chars++) {\n char toFind = onBoard.charAt(chars);\n if (rowToStart == 15){\n board.clearNonPinned();\n return false;\n }\n \n if (chars == onBoard.length()-1 && rowToStart+1 < 15 && board.getPiece(rowToStart+1, col)!= null){\n board.clearNonPinned();\n return false;\n }\n \n Piece onB = board.getPiece(rowToStart, col);\n if(onB!= null && onB.theLetter()!=toFind){\n board.clearNonPinned();\n return false;\n }\n else if (onB== null){\n Piece toAddToBoard = null;\n for (int allPieces = 0; allPieces < this.playersPieces.size() && toAddToBoard==null; allPieces++) {\n if (this.playersPieces.get(allPieces).theLetter()==toFind){\n toAddToBoard = this.playersPieces.get(allPieces);\n }\n }\n if (toAddToBoard==null){\n board.clearNonPinned();\n return false;\n }\n else\n board.add(toAddToBoard, rowToStart, col);\n }\n rowToStart++;\n }\n return true;\n }", "private void boardInit() {\n for(int i = 0; i < this.boardHeight; i++)\n this.board[i][0] = ' ';\n for(int i = 0; i < this.boardWidth; i++)\n this.board[0][i] = ' ';\n \n for(int i = 1; i < this.boardHeight; i++) {\n for(int j = 1; j < this.boardWidth; j++) {\n this.board[i][j] = '*';\n }\n }\n }", "public String toString(){\n\t\tchar[][] boardRep = new char[yDim + 2][xDim + 2];\n\t\t\n\t\tfor(int i = 0; i < boardRep.length; i++){\n\t\t\tfor(int j = 0; j < boardRep[i].length; j++){\n\t\t\t\tboardRep[i][j] = ' ';\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < yDim + 2; i++){\n\t\t\tboardRep[i][0] = '.';\n\t\t\tboardRep[i][xDim + 1] = '.';\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < xDim + 2; i++){\n\t\t\tboardRep[0][i] = '.';\n\t\t\tboardRep[yDim + 1][i] = '.';\n\t\t}\n\t\t\n\t\tfor (Gadget g : gadgets){\n\t\t\tif(g instanceof SquareBumper){\n\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= '#';\n\t\t\t}else if(g instanceof TriangularBumper){\n\t\t\t\tif(((TriangularBumper) g).getOrientation() % 2 == 0)\t\n\t\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= '/';\n\t\t\t\tif(((TriangularBumper) g).getOrientation() % 2 == 1)\t\n\t\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= '\\\\';\n\t\t\t}else if(g instanceof CircularBumper){\n\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= 'O';\n\t\t\t}else if(g instanceof Absorber){\n\t\t\t\tfor(int i=g.getX(); i < g.getX() + g.getWidth(); i++){\n\t\t\t\t\tfor(int j=g.getY(); j < g.getY() + g.getHeight(); j++){\n\t\t\t\t\t\tboardRep[j + 1][i + 1] = '=';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(g instanceof Flipper){\n\t\t\t\tFlipper f = (Flipper) g;\n\t\t\t\tif (f.isLeft && f.orientation == 0){\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+1] = '|';\n\t\t\t\t\tboardRep[f.getY()+2][f.getX()+1] = '|';\n\t\t\t\t} else if(f.orientation == 0){\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+2] = '|';\n\t\t\t\t\tboardRep[f.getY()+2][f.getX()+2] = '|';\n\t\t\t\t} else{\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+1] = '-';\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+2] = '-';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(Ball b : balls){\n\t\t\tboardRep[(int) (b.getY() + 1)][(int) (b.getX() + 1)]= '*';\n\t\t}\n\t\t\n\t\tStringBuffer boardString = new StringBuffer();\n\t\tfor(char[] row : boardRep){\n\t\t\tfor(char c : row){\n\t\t\t\tboardString.append(c);\n\t\t\t}\n\t\t\tboardString.append('\\n');\n\t\t}\n\t\t\n\t\treturn boardString.toString();\n\t}", "public static void displayBoard(char[][] a){\r\n int rowNumber = a.length;\r\n int colNumber = a[0].length;\r\n for (int i = 0; i<rowNumber;i++){\r\n rowLine(colNumber);\r\n for (int j = 0; j<colNumber;j++){\r\n System.out.print('|');\r\n System.out.print(a[i][j]);\r\n }\r\n System.out.println('|');\r\n }\r\n rowLine(colNumber);\r\n }", "public static void initBoard()\r\n\t{\n\t\tfor ( int r=0; r<3; r++ )\r\n\t\t\tfor ( int c=0; c<3; c++ )\r\n\t\t\t\tboard[r][c] = ' ';\r\n\t}", "public void getBoard(int r, int c, String a){\n \n if (a == \"x\"){\n board[r-1][c-1] = 'X';\n }\n else if (a == \"o\"){\n board[r-1][c-1] = 'O';\n }\n \n int x = 1;\n System.out.println(\" 1 2 3 \");\n for (int i = 0; i < board.length; i++){\n System.out.println(\" | | \");\n for (int j = 0; j < board[i].length; j++){\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n System.out.println(x +\"------------------------\");\n x = x + 1;\n } \n checkWinner(); // Check if someone has won.\n \n }", "@Test\n\tpublic void testBoardMoveToString() {\n\t\t\tboard.initNewGame();\n\t\t\tbyte[] move = new byte[2];\n\t\t\tmove[0]=0;\n\t\t\tmove[1]=2;\n\t\t\tAssert.assertEquals(\"A1C1\",Board.moveToString(move));\n\t\t\t\n\t\t\t// reverse test\n\t\t\ttry {\n\t\t\t\tbyte[] reverse=Board.stringToMove(\"A1C1\");\n\t\t\t\t\n\t\t\t\tAssert.assertTrue(move[0]==reverse[0]);\n\t\t\t\tAssert.assertTrue(move[1]==reverse[1]);\n\t\t\t} catch (IllegalBoardException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tAssert.fail();\n\t\t\t}\n\t}", "public void displayBoard(char[][] grid) {\n System.out.println();\n System.out.println(\" 0 1 2 3 4 5 6\");\n System.out.println(\"---------------\");\n for (int row = 0; row < grid.length; row++) {\n System.out.print(\"|\");\n for (int col = 0; col < grid[0].length; col++) {\n System.out.print(grid[row][col]);\n System.out.print(\"|\");\n }\n System.out.println();\n System.out.println(\"---------------\");\n }\n System.out.println(\" 0 1 2 3 4 5 6\");\n System.out.println();\n }", "public void DisplayBoard(Board bord);", "@Test\n public void stringPortsTest()\n {\n Board b = new Board();\n\n Intersection incoming = Intersection.factory(INCOMING);\n Intersection outgoing = Intersection.factory(OUTGOING);\n b.addNode(incoming);\n b.addNode(outgoing);\n\n Intersection subboard = Intersection.subboardFactory(\"test\");\n b.addNode(subboard);\n\n b.addEdge(incoming, \"asdf\", subboard, \"bth\", new Chute(-1, \"\"));\n b.addEdge(subboard, \"34h\", outgoing, \"hkbf\", new Chute(-1, \"\"));\n\n b.finishConstruction();\n\n BoardLayout.layout(b);\n }", "private String[][] initBoard() {\n String[][] tmp=new String[this.SIZE][this.SIZE];\n for (String[] ae:\n tmp) {\n Arrays.fill(ae, \" \");\n }\n return tmp;\n }", "private void renderBoard() {\n Cell[][] cells = gameBoard.getCells();\n StringBuilder battleField = new StringBuilder(\"\\tA B C D E F G H I J \\n\");\n\n for (int i = 0; i < cells.length; i++) {\n battleField.append(i+1).append(\"\\t\");\n for (int j = 0; j < cells[i].length; j++) {\n if (cells[i][j].getContent().equals(Content.deck)) {\n battleField.append(\"O \");\n } else {\n battleField.append(\"~ \");\n }\n }\n battleField.append(\"\\n\");\n }\n\n System.out.println(battleField.toString());\n }", "public void printBoard(){\n\t\tfor(int row = 0; row <9; row++)\n\t\t{\n\t\t\tfor(int column = row; column<25-row; column++)\n\t\t\t{\n\t\t\t\tBoard[row][column]='O';\n\t\t\t}\n\t\t}\n\t\tfor(int iteration_i = 0;iteration_i<9;iteration_i++){\n\t\t\tfor(int iteration_j=0;iteration_j<25;iteration_j++)\n\t\t\t{\t\n\t\t\t\tif (Board[iteration_i][iteration_j]=='\\u0000')\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(Board[iteration_i][iteration_j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "public void displayBoard() {\n System.out.printf(\"%20s\",\"\"); // to add spacing\n for(int i = 0; i < space[0].length; i++) //Put labels for number axis\n {\n System.out.printf(\"%4d\",i+1);\n }\n System.out.println();\n for(int row = 0; row < this.space.length; row++) { //Put letter labels and appropriate coordinate values\n System.out.print(\" \"+ (char)(row+'A') + \"|\");\n for (String emblem: this.space[row]) //coordinate values\n System.out.print(emblem + \" \");\n System.out.println();\n }\n }", "private static void showBoard()\n {\n System.out.println(board[1] + \" | \" + board[2] + \" | \" + board[3]);\n System.out.println(\"----------\");\n System.out.println(board[4] + \" | \" + board[5] + \" | \" + board[6]);\n System.out.println(\"----------\");\n System.out.println(board[7] + \" | \" + board[8] + \" | \" + board[9]);\n }", "public static void printBoard(){\n \n System.out.println(board[0][0] + \" | \" + board[0][1] + \" | \" + board[0][2]);\n System.out.println(board[1][0] + \" | \" + board[1][1] + \" | \" + board[1][2]);\n System.out.println(board[2][0] + \" | \" + board[2][1] + \" | \" + board[2][2]);\n \n }", "static void printBoard() \r\n {\r\n \tSystem.out.println(\"/---|---|---\\\\\");\r\n \tSystem.out.println(\"| \" + board[0][0] + \" | \" + board[0][1] + \" | \" + \r\n \tboard[0][2] + \" |\");\r\n \tSystem.out.println(\"|-----------|\");\r\n \tSystem.out.println(\"| \" + board[1][0] + \" | \" + board[1][1] + \" | \" + \r\n \tboard[1][2] + \" |\");\r\n \tSystem.out.println(\"|-----------|\");\r\n \tSystem.out.println(\"| \" + board[2][0] + \" | \" + board[2][1] + \" | \" + \r\n \tboard[2][2] + \" |\");\r\n \tSystem.out.println(\"\\\\---|---|---/\");\r\n }", "public void showBoard() {\n for (int i = 0; i < booleanBoard.length; i++) {\n for (int j = 0; j < booleanBoard.length; j++) {\n if (strBoard[i][j].equals(\"possible move\") || strBoard[i][j].equals(\"castling\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.green);\n }\n if (strBoard[i][j].equals(\"possible kill\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.red);\n }\n if (booleanBoard[i][j]) {\n if (figBoard[i][j].getColor().equals(\"white\")) {\n gA.getBoard()[i][j].setRotation(180);\n } else {\n gA.getBoard()[i][j].setRotation(0);\n }\n gA.getBoard()[i][j].setImageResource(figBoard[i][j].getImageResource());\n } else {\n gA.getBoard()[i][j].setImageResource(0);\n }\n }\n }\n }", "private String gameBoardToString(){\n StringBuilder config = new StringBuilder();\n\n //length attribute gets the number of rows in a 2D array. length attribute on a row gets the number of columns in a\n // 2D array. We iterate through all the rows and columns and join all the characters in the array into a single\n // String config\n\n for (int i = 0; i < this.boardRows; i++){\n for (int j =0; j < this.boardColumns; j++){\n config.append(this.gameBoard[i][j]);\n }\n }\n\n // Returns String object representation of StringBuilder object\n return config.toString();\n\n }", "public void aiInitBoard(){\n for(int i = 0; i < boardSize; i++) {\n for (int j = 0; j < boardSize; j++) {\n board[i][j] = 'O';\n }\n }\n }", "@Override\n\tpublic String toString(){\n\t\t// return a string of the board representation following these rules:\n\t\t// - if printed, it shows the board in R rows and C cols\n\t\t// - every cell should be represented as a 5-character long right-aligned string\n\t\t// - there should be one space between columns\n\t\t// - use \"-\" for empty cells\n\t\t// - every row ends with a new line \"\\n\"\n\t\t\n\t\t\n\t\tStringBuilder sb = new StringBuilder(\"\");\n\t\tfor (int i=0; i<numRows; i++){\n\t\t\tfor (int j =0; j<numCols; j++){\n\t\t\t\tPosition pos = new Position(i,j);\n\t\t\t\t\n\t\t\t\t// use the hash table to get the symbol at Position(i,j)\n\t\t\t\tif (grid.contains(pos))\n\t\t\t\t\tsb.append(String.format(\"%5s \",this.get(pos)));\n\t\t\t\telse\n\t\t\t\t\tsb.append(String.format(\"%5s \",\"-\")); //empty cell\n\t\t\t}\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\n\t}", "public void displayBoard(Board board) { //Print the whole current board\n System.out.print(\"\\n \");\n System.out.print(\"A B C D E F G H\");\n System.out.println();\n for (int row = 0; row < BOARD_SIZE; row++) {\n System.out.print((row + 1) + \" \");\n for (int column = 0; column < BOARD_SIZE; column++) {\n System.out.print(board.board[row][column] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public static void initialBoard() {\n\t\tSystem.out.println(\"Welcome to TicTacToe ♡\");\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tboard[i][j] = '-';\n\t\t\t}\n\t\t}\n\t}", "private static void printBoard(char[][] board) {\n\n\t\t// header\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tSystem.out.print(\"- \");\n\t\t}\n\n\t\tSystem.out.println();\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board[0].length; j++) {\n\t\t\t\tSystem.out.print(board[i][j] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// footer\n\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\tSystem.out.print(\"- \");\n\t\t}\n\n\t\tSystem.out.println();\n\t}", "public void inputboard() {\n System.out.println(board[pos]+\"X\");\n showBoard();\n }", "public TicTacToe(){ \r\n\t\tboard = new char[3][3];\r\n\t}", "public static void createBoard() \n\t{\n\t\tfor (int i = 0; i < tictactoeBoard.length; i++) \n\t\t{\n\t\t\ttictactoeBoard[i] = '-';\n\t\t}\n\t}", "public void boardMain() {\n\n while(true) {\n\n try {\n\n System.out.println(\"메인 / 게시판 메인-------------------------------\\n\");\n System.out.println(\"1. 게시글 작성\\n2. 게시글 보기\\n3. 게시글 수정\\n4. 게시글 삭제\\n5. 뒤로가기\\n \");\n int inputMenu = Prompt.inputInt(\"입력>\");\n\n if (inputMenu == 1) { // 게시글 작성\n this.add();\n\n }else if (inputMenu == 2) { // 게시글 보기\n this.List();\n\n }else if (inputMenu == 3) { // 게시글 수정\n this.update();\n\n }else if (inputMenu == 4) { // 게시글 삭제\n this.delete();\n\n }else if (inputMenu == 5) {\n break;\n\n }else {\n System.out.println(\"잘못 입력하였습니다.1\");\n }\n } catch(Exception e) {\n System.out.println(\"잘못 입력하였습니다.2\");\n }\n }\n\n }", "public Board(char[][] board) {\n this.boardWidth = board.length;\n this.boardHeight = board[0].length;\n this.board = board;\n this.numShips = 0;\n boardInit();\n }", "void setPieces(String str, PieceColor nextMove) {\n if (nextMove == EMPTY || nextMove == null) {\n throw new IllegalArgumentException(\"bad player color\");\n }\n str = str.replaceAll(\"\\\\s\", \"\");\n if (!str.matches(\"[bw-]{25}\")) {\n throw new IllegalArgumentException(\"bad board description\");\n }\n\n for (int k = 0; k < str.length(); k += 1) {\n switch (str.charAt(k)) {\n case '-':\n set(k, EMPTY);\n break;\n case 'b': case 'B':\n set(k, BLACK);\n break;\n case 'w': case 'W':\n set(k, WHITE);\n break;\n default:\n break;\n }\n }\n\n _whoseMove = nextMove;\n setInitialDirection(MAX_INDEX);\n\n _history.clear();\n setChanged();\n notifyObservers();\n }", "void setBoard(Board board);", "public void initializeBoard() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tthis.board[i] = \"-\";\n\n\t\t}\n\n\t}", "public char[][] updateBoard(char[][] board, int[] click) {\n\t\tint i = click[0];\n\t\tint j = click[1];\n\t\tchar c = board[i][j];\n\t\tif (c == 'M') {\n\t\t\tboard[i][j] = 'X';\n\t\t\treturn board;\n\t\t} else if (c == 'E') {\n\t\t\tint count = 0;\n\t\t\tfor (int[] d : directions) {\n\t\t\t\tint a = i + d[0];\n\t\t\t\tint b = j + d[1];\n\t\t\t\tif (a >= 0 && b >= 0 && a < board.length && b < board[0].length) {\n\t\t\t\t\tif (board[a][b] == 'M') {\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == 0) {\n\t\t\t\tboard[i][j] = 'B';\n\t\t\t\tfor (int[] d : directions) {\n\t\t\t\t\tint a = i + d[0];\n\t\t\t\t\tint b = j + d[1];\n\t\t\t\t\tif (a >= 0 && b >= 0 && a < board.length && b < board[0].length) {\n\t\t\t\t\t\tif (board[a][b] == 'E') {\n\t\t\t\t\t\t\tboard = updateBoard(board, new int[] { a, b });\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\tboard[i][j] = (count+\"\").charAt(0);\n\t\t\t}\n\n\t\t} else if (c == 'B') {\n\t\t\treturn board;\n\t\t}\n\t\treturn board;\n\n\t}", "public Connect4() {\n gameMode = 0;\n board = new char[6][7];\n for (int r = 0; r < 6; r++) {\n for (int c = 0; c < 7; c++) {\n board[r][c] = ' ';\n }\n }\n\t}", "public void updateBoard() {\n for(SnakePart s : snakePartList) {\n board[s.getSnakePartRowsOld()][s.getSnakePartCollsOld()] = ' ';\n board[s.getSnakePartRowsNew()][s.getSnakePartCollsNew()] = 'S';\n }\n \n for (SnakeEnemyPart e : snakeEnemyPartList) {\n board[e.getSnakeEnemyPartRowsOld()][e.getSnakeEnemyPartCollsOld()] = ' ';\n board[e.getSnakeEnemyPartRowsNew()][e.getSnakeEnemyPartCollsNew()] = 'E';\n }\n }", "private void fillGameBoard() {\n for (int i = 0; i < row; i++) {\n String next = input.get(pointer);\n for (int j = 0; j < column; j++) {\n game[i][j] = String.valueOf(next.charAt(j)); //takes char from string next, this is where columns are filled\n }\n pointer++;\n }\n }", "public void createBoard() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j <colls; j++) {\n if(i==0 || j == 0 || i == rows-1|| j == colls-1){\n board[i][j] = '*';\n } else {\n board[i][j] = ' ';\n }\n }\n }\n }", "public void ShowBoard(){\n System.out.println(\" ___________{5}_____{4}_____{3}_____{2}_____{1}_____{0}____________\");\n System.out.println(\"| ____ ____ ____ ____ ____ ____ ____ ____ |\");\n System.out.printf(\"| | | [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] | | |\\n\",\n this.gameBoard[5], this.gameBoard[4], this.gameBoard[3],\n this.gameBoard[2], this.gameBoard[1], this.gameBoard[0]);\n System.out.println(\"| | | | | |\");\n System.out.printf(\"| | %2d | ____ ____ ____ ____ ____ ____ | %2d | |\\n\",\n this.gameBoard[6], this.gameBoard[13]);\n System.out.printf(\"| |____| [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] |____| |\\n\",\n this.gameBoard[7], this.gameBoard[8], this.gameBoard[9],\n this.gameBoard[10], this.gameBoard[11], this.gameBoard[12]);\n System.out.println(\"|_________________________________________________________________|\");\n }", "public static void printBoard(String[][] ticTacToeBoard) {\n\t\t\n\t\tString printElement1 = \"\", printElement2=\"\", printElement3=\"\";\n\n\t\tfor (int i = 0; i < 3; i++) {\n\n\t\t\tif (ticTacToeBoard[i][0] == \"\") {\n\t\t\t\tprintElement1 = \"-\";\n\t\t\t} else if (ticTacToeBoard[i][0] !=\"\") {\n\n\t\t\t\tprintElement1 = ticTacToeBoard[i][0];\n\t\t\t}\n\n\t\t\tif (ticTacToeBoard[i][1] == \"\") {\n\t\t\t\tprintElement2 = \"-\";\n\t\t\t} else if (ticTacToeBoard[i][1] != \"\") {\n\t\t\t\tprintElement2 = ticTacToeBoard[i][1];\n\t\t\t}\n\n\t\t\tif (ticTacToeBoard[i][2] == \"\") {\n\t\t\t\tprintElement3 = \"-\";\n\t\t\t} else if (ticTacToeBoard[i][2] != \"\") {\n\t\t\t\tprintElement3 = ticTacToeBoard[i][2];\n\t\t\t}\n\n\t\t\t System.out.println(printElement1 + \" |\" + printElement2 + \" |\"+\n\t\t\t printElement3);\n\n\t\t}\n\n\t}", "private boolean addToBoardHor(int col,int row,int all, ArrayList<String> test, Board board){\n int colToStart = col;\n String onBoard = test.get(all).toUpperCase();\n int newIndex = 0;\n if (col-1>=0 && board.getPiece(row, col-1)!= null){\n int index = col-1;\n while (index >=0 &&board.getPiece(row, index)!= null){\n index--;\n }\n index++;\n \n while (index<col){\n if (newIndex<onBoard.length() && board.getPiece(row, index).theLetter() != onBoard.charAt(newIndex)){\n board.clearNonPinned();\n return false;\n }\n newIndex++;\n index++;\n }\n }\n int chars = newIndex;\n for (; chars < onBoard.length(); chars++) {\n char toFind = onBoard.charAt(chars);\n if (colToStart == 15){\n board.clearNonPinned();\n return false;\n }\n \n if (chars == onBoard.length()-1 && colToStart+1 < 15 && board.getPiece(row, colToStart+1)!= null){\n board.clearNonPinned();\n return false;\n }\n \n Piece onB = board.getPiece(row, colToStart);\n if(onB!= null && onB.theLetter()!=toFind){\n board.clearNonPinned();\n return false;\n }\n else if (onB== null){\n Piece toAddToBoard = null;\n for (int allPieces = 0; allPieces < this.playersPieces.size() && toAddToBoard==null; allPieces++) {\n if (this.playersPieces.get(allPieces).theLetter()==toFind){\n toAddToBoard = this.playersPieces.get(allPieces);\n }\n }\n if (toAddToBoard==null){\n board.clearNonPinned();\n return false;\n }\n else\n board.add(toAddToBoard, row, colToStart);\n }\n colToStart++;\n }\n return true;\n }", "public void gameBoard()\t\n\t{\n\t\tSystem.out.println();\n\t\t\n\t\t// for loop to read through the board array\n\t\tfor( int i = 0; i < board.length; i++ )\n\t\t{\n\t\t\tboard[ i ] = \" \";\n\t\t\t\n\t\t} // end of for( int i = 0; i < board.length; i++ )\n\t\t\n\t\t// prints the top vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 1 ] + \" | \" + board[ 2 ] + \" | \" \n\t\t + board[ 3 ] );\n\t\t\n\t\t// prints top most horizontal line to create the board\n\t\tSystem.out.println( \"____________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 4 ] + \" | \" + board[ 5 ] + \" | \" \n + board[ 6 ] );\n\t\t\n\t\t// prints the second horizontal line to create the board\n\t\tSystem.out.println( \"____________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 7 ] + \" | \" + board[ 8 ] + \" | \" \n + board[ 9 ] );\n\t\t\n\t}", "public String drawBoard() {\n fillBoard();\n return \"\\n\" +\n \" \" + boardArray[0][0] + \" | \" + boardArray[0][1] + \" | \" + boardArray[0][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[1][0] + \" | \" + boardArray[1][1] + \" | \" + boardArray[1][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[2][0] + \" | \" + boardArray[2][1] + \" | \" + boardArray[2][2] + \" \\n\";\n }", "public interface ChessPieceLabel {\n //black pieces\n String BLACK_KING = \"\\u265A\";\n String BLACK_QUEEN = \"\\u265B\";\n String BLACK_ROOK = \"\\u265C\";\n String BLACK_BISHOP = \"\\u265D\";\n String BLACK_KNIGHT = \"\\u265E\";\n String BLACK_PAWN = \"\\u265F\";\n String BLACK_FERZ = \"\\u2660\";\n String BLACK_THREELEAPER = \"\\u2663\";\n\n //white pieces\n String WHITE_KING = \"\\u2654\";\n String WHITE_QUEEN = \"\\u2655\";\n String WHITE_ROOK = \"\\u2656\";\n String WHITE_BISHOP = \"\\u2657\";\n String WHITE_KNIGHT = \"\\u2658\";\n String WHITE_PAWN = \"\\u2659\";\n String WHITE_FERZ = \"\\u2664\";\n String WHITE_THREELEAPER = \"\\u2667\";\n}", "private void putOnBoard(int row, int col, boolean direction,String topWord, ArrayList<Piece> piecesOfTopWord,Board board){\n \t\t\n \t\tif (direction){\n \t\t\tfor (int i = 0; i < piecesOfTopWord.size(); i++) {\n \t\t\t\tif (piecesOfTopWord.get(i).isPinned()){\n \t\t\t\t\tpiecesOfTopWord.remove(piecesOfTopWord.get(i));\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tint index = 0;\n \t\t\tfor (int i = 0; index <piecesOfTopWord.size(); i++) {\n \t\t\t\t\n \t\t\t\tif (board.getPiece(row, col+i)==null){\n \t\t\t\t\t\n \t\t\t\t\tPiece toPlace = null;\n \t\t\t\t\tfor (int r = 0; r < playersPieces.size(); r++) {\n \t\t\t\t\t\tSystem.out.println(piecesOfTopWord.get(index).theLetter());\n \t\t\t\t\t\tif (playersPieces.get(r) != null && playersPieces.get(r).theLetter() == piecesOfTopWord.get(index).theLetter()){\n \t\t\t\t\t\t\ttoPlace = playersPieces.get(r);\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\n \t\t\t\t\tboard.insertPiece(toPlace, row, col + i);\n \t\t\t\t\ttoPlace.x = (col+i)*42 + 64;\n \t\t\t\t\ttoPlace.y = (row)*42 + 64;\n \t\t\t\t\tthis.removeAI(toPlace);\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\tfor (int i = 0; i < piecesOfTopWord.size(); i++) {\n \t\t\t\tif (piecesOfTopWord.get(i).isPinned()){\n \t\t\t\t\tpiecesOfTopWord.remove(piecesOfTopWord.get(i));\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tint index = 0;\n \t\t\tfor (int i = 0; index <piecesOfTopWord.size(); i++) {\n \t\t\t\tif (board.getPiece(row+i, col)==null){\n \t\t\t\t\t\n \t\t\t\t\tPiece toPlace = null;\n \t\t\t\t\tfor (int r = 0; r < playersPieces.size(); r++) {\n \t\t\t\t\t\tSystem.out.println(piecesOfTopWord.get(index).theLetter());\n \t\t\t\t\t\tif (playersPieces.get(r) != null && playersPieces.get(r).theLetter() == piecesOfTopWord.get(index).theLetter()){\n \t\t\t\t\t\t\ttoPlace = playersPieces.get(r);\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\n \t\t\t\t\tboard.insertPiece(toPlace, row+i, col);\n \t\t\t\t\ttoPlace.y = (row+i)*42 + 64;\n \t\t\t\t\ttoPlace.x = (col)*42 + 64;\n \t\t\t\t\tthis.removeAI(toPlace);\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t\t\t\n \t\t\t}\n \t\t}\n \t}", "public String toString() {\n\t\t// Variables\n\t\tString gameboard;\n\t\tchar[] firstLetter = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' };\n\n\t\t// Top\n\t\tgameboard = \" ===============================================================\\n\";\n\n\t\t// Middle\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\t// Beginning of the line\n\t\t\tgameboard += \" \" + firstLetter[i] + \" ||\";\n\n\t\t\t// Letters\n\t\t\tfor (int j = 0; j < 15; j++) {\n\t\t\t\tif (this.grid[i][j].getTile().getLetter() == Character.MIN_VALUE) {\n\t\t\t\t\tif (this.grid[i][j].getScoreMult() > 1)\n\t\t\t\t\t\tgameboard += \" * \";\n\t\t\t\t\telse\n\t\t\t\t\t\tgameboard += \" . \";\n\t\t\t\t} else {\n\t\t\t\t\tgameboard += \" \" + this.grid[i][j].getTile().getLetter() + \" \";\n\t\t\t\t}\n\t\t\t\tif (j != 14)\n\t\t\t\t\tgameboard += '|';\n\t\t\t}\n\n\t\t\t// End of the line\n\t\t\tgameboard += \"||\\n\";\n\t\t\tif (i != 14)\n\t\t\t\tgameboard += \" ||---|---|---|---|---|---|---|---|---|---|---|---|---|---|---||\\n\";\n\t\t}\n\n\t\t// Bottom\n\t\tgameboard += \" ===============================================================\\n\";\n\t\tgameboard += \" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\";\n\n\t\treturn gameboard;\n\t}", "void display(String w[][]){\r\n System.out.println(\"\\nGambaran dari area (world) yang di buat\\n\");\r\n for (int i = 1; i <= 4; i++) {\r\n System.out.println(\"\\n-----------------------------------------------------------------\");\r\n System.out.print(\"|\\t\");\r\n for (int j = 1; j <= 4; j++) {\r\n System.out.print(w[i][j]+ \"\\t|\\t\");\r\n }\r\n }\r\n\r\n System.out.println(\"\\n-----------------------------------------------------------------\");\r\n }", "public void stringImage(char ch1, char ch2, char ch3, char ch4, char ch5, char ch6){\r\n\t\t//GLabels are assigned values of the chArray and given coordinates\r\n\t\tstringImage1 = new GLabel(String.valueOf(ch1),250,300 );\r\n\t\tstringImage2 = new GLabel(String.valueOf(ch2),283,300 );\r\n\t\tstringImage3 = new GLabel(String.valueOf(ch3),315,300 );\r\n\t\tstringImage4 = new GLabel(String.valueOf(ch4),347,300 );\r\n\t\tstringImage5 = new GLabel(String.valueOf(ch5),379,300 );\r\n\t\tstringImage6 = new GLabel(String.valueOf(ch6),411,300 );\r\n\t\t//Assigns the colors to each GLabel, either green or red\r\n\t\tif(match1 == true){\r\n\t\t\tstringImage1.setColor(Color.green);\r\n\t\t}if(match1 == false){\r\n\t\t\tstringImage1.setColor(Color.red);\r\n\t\t}if(match2 == true){\r\n\t\t\tstringImage2.setColor(Color.green);\r\n\t\t}if(match2 == false){\r\n\t\t\tstringImage2.setColor(Color.red);\r\n\t\t}if(match3 == true){\r\n\t\t\tstringImage3.setColor(Color.green);\r\n\t\t}if(match3 == false){\r\n\t\t\tstringImage3.setColor(Color.red);\r\n\t\t}if(match4 == true){\r\n\t\t\tstringImage4.setColor(Color.green);\r\n\t\t}if(match4 == false){\r\n\t\t\tstringImage4.setColor(Color.red);\r\n\t\t}if(match5 == true){\r\n\t\t\tstringImage5.setColor(Color.green);\r\n\t\t}if(match5 == false){\r\n\t\t\tstringImage5.setColor(Color.red);\r\n\t\t}if(match6 == true){\r\n\t\t\tstringImage6.setColor(Color.green);\r\n\t\t}if(match6 == false){\r\n\t\t\tstringImage6.setColor(Color.red);\r\n\t\t}\r\n\t\t//All GLabels are set with the same font\r\n\t\tstringImage1.setFont(\"Arial-40\");\r\n\t\tstringImage2.setFont(\"Arial-40\");\r\n\t\tstringImage3.setFont(\"Arial-40\");\r\n\t\tstringImage4.setFont(\"Arial-40\");\r\n\t\tstringImage5.setFont(\"Arial-40\");\r\n\t\tstringImage6.setFont(\"Arial-40\");\r\n\t\t////All GLabels are added to the canvas\r\n\t\tcanvas.add(stringImage1);\r\n\t\tcanvas.add(stringImage2);\r\n\t\tcanvas.add(stringImage3);\r\n\t\tcanvas.add(stringImage4);\r\n\t\tcanvas.add(stringImage5);\r\n\t\tcanvas.add(stringImage6);\r\n\t}", "private void initialiseBoard() {\n boardStringArr = new ArrayList<>(16);\n for (int i = 0; i < 16; i++) {\n boardStringArr.add(\"\");\n }\n int randFirstIndex = rand.nextInt(16);\n int randSecondIndex = (randFirstIndex + 5 )% 16;\n boardStringArr.set(randFirstIndex, \"2\");\n boardStringArr.set(randSecondIndex, \"2\");\n\n TextView te = (TextView) gvBoard.getChildAt(randFirstIndex);// !! not a correct way of initialising a view\n TextView te2 = (TextView) gvBoard.getChildAt(randSecondIndex);// !! not a correct way of initialising a view\n te.setText(\"2\");\n te2.setText(\"2\");\n }", "private void Mostra() {\n mat = matriz.getMatriz();\n\n for (int lin = 0; lin < 9; lin++) {\n for (int col = 0; col < 9; col++) {\n array_texto[lin][col].setEditable(true);\n array_texto[lin][col].setText(mat[lin][col]);\n array_texto[lin][col].setBackground(Color.white);\n\n for (char letra : array_texto[lin][col].getText().toCharArray()) {\n if ((letra < 1 || letra > 9)) {\n array_texto[lin][col].setEditable(false);\n array_texto[lin][col].setBackground(Color.LIGHT_GRAY);\n }\n }\n }\n }\n }", "public void reveal(char[][] board,int row, int col,boolean[][] used)\n {\n if(row >= board.length || row < 0 || col >= board[0].length || col < 0 || used[row][col])\n return;\n used[row][col] = true;\n if(board[row][col] == 'M' || Character.isDigit(board[row][col])) return;\n int digit = checkDigits(board,row-1,col-1) + checkDigits(board,row,col-1) + checkDigits(board,row+1,col-1) + checkDigits(board,row-1,col) + checkDigits(board,row+1,col) + checkDigits(board,row-1,col+1) + checkDigits(board,row,col+1) + checkDigits(board,row+1,col+1);\n if(digit != 0){\n board[row][col] = (char)(digit + '0');\n }\n else {\n board[row][col] = 'B';\n reveal(board,row-1,col-1,used);\n reveal(board,row,col-1,used);\n reveal(board,row+1,col-1,used);\n reveal(board,row-1,col,used);\n reveal(board,row+1,col,used);\n reveal(board,row-1,col+1,used);\n reveal(board,row,col+1,used);\n reveal(board,row+1,col+1,used);\n }\n }", "@Test\n public void testQueenLabel() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(\"Q\", chessBoard.getPiece(0, 3).getLabel());\n assertEquals(\"Q\", chessBoard.getPiece(7, 3).getLabel());\n }", "public void printBoard() {\n \tfor(int i = 7; i >= 0; i--) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tSystem.out.print(\"\"+getPiece(j, i).getColor().toString().charAt(0)+getPiece(j, i).getName().charAt(0)+\"\\t\");\n \t\t}\n \t\tSystem.out.println();\n \t}\n }", "private void boardPrint(){\t\t\n\t\tfor (int i=0;i<size;i++) {\n\t for (int j=0;j<size;j++) {\n\t System.out.print(\" ---- \");\n\t }\n\t System.out.println();\n\t for (int j=0;j<size;j++) {\n\t \tint value = (i*size) + j + 1;\n\t \tif(board[i][j] == '\\u0000'){\n\t \t\tif(value < 10)\n\t \t\t\tSystem.out.print(\"| \"+ value + \" |\");\n\t \t\telse\n\t \t\t\tSystem.out.print(\"| \"+ value + \" |\");\n\t \t}\n\t \telse\n\t \t\tSystem.out.print(\"| \"+ board[i][j] + \" |\");\n\t }\n\t System.out.println();\n\t }\n\n\t for (int i=0;i<size;i++){\n\t \tSystem.out.print(\" ---- \");\n\t }\n\t System.out.println();\n\t}", "public static void main(String[] args) {\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tticTacToeBoard[i][j] = \"\";\n\t\t\t}\n\t\t}\n\n\t\tint position = 1;\n\n\t\tString[][] addedBoard = add(\"X\", position);\n\t\tprintBoard(addedBoard);\n\n\t}", "public void PrintBoard() {\n\tSystem.out.println(\"printing from class\");\n\t\tString[][] a = this.piece;\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 <- X axis\");\n\t\tSystem.out.println(\" +----------------+ \");\n\t\t\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tSystem.out.print(i + \" |\");\n\t\t\tfor (int j=0; j<8;j++) {\n\t\t\t\t\n\t\tSystem.out.print(\"\" + a[i] [j] + \" \");\n\t\t\t\t\t} \n\t\t\tSystem.out.println(\"|\");\n\t\t}\n\t\tSystem.out.println(\" +----------------+ \");\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 \");\n\t\n\t}", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "@Test\n public void testRookLabel() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(\"R\", chessBoard.getPiece(0, 0).getLabel());\n assertEquals(\"R\", chessBoard.getPiece(0, 7).getLabel());\n assertEquals(\"R\", chessBoard.getPiece(7, 0).getLabel());\n assertEquals(\"R\", chessBoard.getPiece(7, 7).getLabel());\n }", "public void updateBoard(JsonObject inputMsg) {\n\t\tboard[Integer.parseInt(format(inputMsg.get(\"Row\").toString()))][Integer\n\t\t\t\t.parseInt(format(inputMsg.get(\"Column\").toString()))]\n\t\t\t\t\t\t.setText(format(inputMsg.get(\"Letter\").toString()));\n\t}", "public void cbMohexShowRollout()\n {\n \tif (!m_white.wasSuccess()) \n \t return;\n \n \tString str = m_white.getResponse();\n Vector<Pair<String, String> > pairs = \n StringUtils.parseStringPairList(str);\n \n m_guiboard.clearMarks();\n m_guiboard.aboutToDirtyStones();\n \n HexPoint p = HexPoint.get(pairs.get(0).first);\n HexColor color = HexColor.get(pairs.get(0).second);\n m_guiboard.setColor(p, color);\n m_guiboard.setAlphaColor(p, Color.blue);\n \n for (int i=1; i<pairs.size(); i++) {\n \t HexPoint point = HexPoint.get(pairs.get(i).first);\n String value = pairs.get(i).second;\n if (value.equals(\"#\"))\n m_guiboard.setAlphaColor(point, Color.green);\n else\n m_guiboard.setAlphaColor(point, Color.red);\n \n m_guiboard.setText(point, Integer.toString(i));\n \n color = color.otherColor();\n m_guiboard.setColor(point, color);\n \t}\n \tm_guiboard.repaint();\n \n }", "public static void printBoard(char[][] board){\n for (char[] letter: board) {\n for (char element: letter) {\n System.out.print(element + \" \");\n }\n System.out.println();\n }\n }", "private void displayBoard(Board board)\n {\n for (int i = 0; i < size; i++)\n {\n System.out.print(\"|\");\n for (int j = 0; j < size; j++)\n \n System.out.print(board.array[i][j] + \"|\");\n System.out.println();\n }\n }", "public static void drawPlayerBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (playerBoardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + playerBoardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }" ]
[ "0.7321755", "0.67984915", "0.677307", "0.66825396", "0.64890915", "0.64670163", "0.63954437", "0.6357363", "0.6355943", "0.6337652", "0.631623", "0.6298542", "0.629096", "0.62777436", "0.6257378", "0.6251178", "0.62420046", "0.6238704", "0.62253994", "0.6205695", "0.61700034", "0.6135895", "0.61352223", "0.6114647", "0.61076146", "0.6106117", "0.60963833", "0.60866314", "0.60847765", "0.60615027", "0.6056762", "0.60549283", "0.6050822", "0.6041647", "0.6038013", "0.60365784", "0.60236365", "0.60171664", "0.60156214", "0.6014839", "0.60097665", "0.5997505", "0.59884346", "0.5972163", "0.59674734", "0.59625775", "0.59618217", "0.5951875", "0.59475046", "0.5927102", "0.5925738", "0.5919758", "0.59149855", "0.59127134", "0.5910815", "0.59094", "0.59006107", "0.58887833", "0.58867025", "0.58716613", "0.58651364", "0.5846742", "0.58457464", "0.58393717", "0.5838586", "0.5833346", "0.583", "0.5824881", "0.5809611", "0.58059657", "0.58038384", "0.58035034", "0.5798862", "0.57984066", "0.577816", "0.57760596", "0.5773902", "0.57696265", "0.5767023", "0.57655853", "0.5758545", "0.5758177", "0.5754973", "0.57469064", "0.5737552", "0.5721382", "0.57205534", "0.57173264", "0.5714349", "0.5712963", "0.5709198", "0.57083213", "0.57046956", "0.570249", "0.57009333", "0.5700237", "0.56903845", "0.5688359", "0.56860495", "0.568229" ]
0.6362809
7
prosedur untuk menampilkan board ke layar
public void displayToScreen(){ System.out.println(convertBoardToString()); delay(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showBoard() {\n for (int i = 0; i < booleanBoard.length; i++) {\n for (int j = 0; j < booleanBoard.length; j++) {\n if (strBoard[i][j].equals(\"possible move\") || strBoard[i][j].equals(\"castling\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.green);\n }\n if (strBoard[i][j].equals(\"possible kill\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.red);\n }\n if (booleanBoard[i][j]) {\n if (figBoard[i][j].getColor().equals(\"white\")) {\n gA.getBoard()[i][j].setRotation(180);\n } else {\n gA.getBoard()[i][j].setRotation(0);\n }\n gA.getBoard()[i][j].setImageResource(figBoard[i][j].getImageResource());\n } else {\n gA.getBoard()[i][j].setImageResource(0);\n }\n }\n }\n }", "public void boardMain() {\n\n while(true) {\n\n try {\n\n System.out.println(\"메인 / 게시판 메인-------------------------------\\n\");\n System.out.println(\"1. 게시글 작성\\n2. 게시글 보기\\n3. 게시글 수정\\n4. 게시글 삭제\\n5. 뒤로가기\\n \");\n int inputMenu = Prompt.inputInt(\"입력>\");\n\n if (inputMenu == 1) { // 게시글 작성\n this.add();\n\n }else if (inputMenu == 2) { // 게시글 보기\n this.List();\n\n }else if (inputMenu == 3) { // 게시글 수정\n this.update();\n\n }else if (inputMenu == 4) { // 게시글 삭제\n this.delete();\n\n }else if (inputMenu == 5) {\n break;\n\n }else {\n System.out.println(\"잘못 입력하였습니다.1\");\n }\n } catch(Exception e) {\n System.out.println(\"잘못 입력하였습니다.2\");\n }\n }\n\n }", "public void showBoard(){\n }", "public void Display_Boards(){\r\n\t\tfor(int i=0; i<13; i++){\r\n\t\t\tdisplay.putStaticLine(myBoard.Display(i)+\" \"+hisBoard.Display(i));\r\n\t\t}\r\n\t}", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "public void initializeDebugBoard() {\n\t\tboolean hasNotMoved = false;\n\t\tboolean hasMoved = true;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set empty rows\n\t\tfor (int row = 0; row < 8; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\tboard[5][4] = new Piece('k', white, hasMoved, 5, 4, PieceArray.E_kingId);\n//\t\tboard[1][4] = new Piece(\"rook\", white, hasMoved, 1, 4);\n\t\tboard[2][2] = new Piece('q', black, hasMoved, 2, 2, PieceArray.A_rookId);\n//\t\tboard[3][2] = new Piece('q', black, hasMoved, 3, 2, PieceArray.H_rookId);\n\t\t\n\n\t\tboard[0][0] = new Piece('k', black, hasMoved, 0, 0, PieceArray.E_kingId);\n//\t\tboard[7][7] = new Piece('r', black, hasNotMoved, 7, 7, PieceArray.A_rookId);\n//\t\tboard[6][7] = new Piece('p', black, hasNotMoved, 6, 7, PieceArray.A_pawnId);\n//\t\tboard[6][6] = new Piece('p', black, hasNotMoved, 6, 6, PieceArray.B_pawnId);\n//\t\tboard[6][5] = new Piece('p', black, hasNotMoved, 6, 5, PieceArray.C_pawnId);\n//\t\tboard[6][4] = new Piece('p', black, hasNotMoved, 6, 4, PieceArray.D_pawnId);\n\t\n//\t\tboard[6][6] = new Piece(\"pawn\", black, hasMoved, 6, 6);\n//\t\tboard[6][7] = new Piece(\"pawn\", black, hasMoved, 6, 7);\n//\t\tboard[6][4] = new Piece(\"pawn\", black, hasMoved, 6, 4);\n//\t\t\t\n//\t\t\n//\t\tboard[4][4] = new Piece(\"pawn\", black, hasMoved, 4,4);\n//\t\tboard[3][5] = new Piece(\"rook\", white,hasMoved,3,5);\n//\t\tboard[1][7] = new Piece(\"pawn\",black,hasMoved,1,7);\n\n\t}", "void displayBoard();", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "private void generateBoard(){\n\t}", "public void initBoard() {\n board = new Board();\n\n // initilaisation des groupes\n Group violet = new Group();\n Group bleu = new Group();\n Group orange = new Group();\n Group vert = new Group();\n Group rouge = new Group();\n Group jaune = new Group();\n Group rose = new Group();\n Group marine = new Group();\n Group gare = new Group();\n Group compagnie = new Group();\n\n // ajout des cases\n board.addCaseBoard(new StartCase());\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd Belleville\", 60, 2, 10,30, 90, 160,250, 30,violet, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de caumunauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue lecourbe\", 60, 4,20,60,180,320,450, 30,violet, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Taxes\"));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare Monparnasse\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Vaugirard\", 100, 6,30,90,270,400,550, 50, bleu, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Courcelles\", 100, 6,30,90,270,400,550, 50, bleu, 50));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de la Republique\", 120, 8,40,100,300,450,600, 60, bleu, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Prison\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd de la villette\", 140, 10,50,150,450,625,750, 70, orange, 100));\n board.addCaseBoard(new BuyableCaseImpl(\"Compagnie de distribution d'electricité\",150, 0, 75, compagnie));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Neuilly\", 140, 10,50,150,450,625,750, 70, orange, 100));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Paradis\", 160, 12,60,180,500,700,900, 80, orange, 100));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare de Lyon\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Mozart\", 180, 14,70,200,550,700,900, 90, vert, 100));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd Saint Michel\", 180, 14,70,200,550,700,900, 90, vert, 100));\n board.addCaseBoard(new BuildingCaseImpl(\"Place Pigalle\", 200, 16,80,220,600,800,950, 100, vert, 100));\n board.addCaseBoard(new CaseBoardImpl(\"Park Gratuit\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Matignon\", 220, 18,90,250,700,875,1050, 110, rouge, 150));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd MalesHerbes\", 220, 18,90,250,700,875,1050, 110, rouge, 150));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Henri-Martin\", 240, 20,100,300,750,925,1100, 120, rouge, 150));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare du Nord\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Fb Saint Honoré\", 260, 22,110,330,800,975,1150, 130, jaune, 150));\n board.addCaseBoard(new BuildingCaseImpl(\"Place de la Bourse\", 260, 22,110,330,800,975,1150, 130, jaune, 150));\n board.addCaseBoard(new BuyableCaseImpl(\"Compagnie de distribution des eaux\",150, 0, 75, compagnie));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue lafayette\", 280, 24,120,360,850,1025,1200, 140, jaune, 150));\n board.addCaseBoard(new CaseBoardImpl(\"Aller en Prison\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Breteuil\", 300, 26,130,390,900,1100,1275, 150, rose, 200));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Foch\", 300, 26,130,390,900,1100,1275, 150, rose, 200));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd des Capucines\", 320, 28,150,450,1000,1200,1400, 160, rose, 200));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare Saint-Lazarre\", 200, 2, 100,gare));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av des Champs Elysées\", 350, 35,175,500,1100,1300,1500, 175, marine, 200));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de la Paix\", 400, 50,200,600,1400,1700,2000, 200, marine, 200));\n }", "public void showBoard() {\n System.out.println(\"The board is\");\n System.out.println(\"| 1 | 2 | 3 |\\n| 4 | 5 | 6 | \\n| 7 | 8 | 9 |\");\n }", "public void boardSetUp(){\n\t}", "public void displayBoard() {\r\n\t\tboard = new JButton[6][7];\r\n\t\tfor (int row = 0; row < board.length; row++) {\r\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\r\n\t\t\t\tboard[row][col] = new JButton();\r\n\t\t\t\tboard[row][col].addActionListener(this);\r\n\t\t\t\tboard[row][col].setBorder(new EtchedBorder());\r\n\t\t\t\tboard[row][col].setEnabled(true);\r\n\t\t\t\tboardPanel.add(board[row][col]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void prepareBoard(){\n gameBoard.arrangeShips();\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 }", "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 }", "private void initializeBoard() {\n\t\t\n\t}", "public void inputboard() {\n System.out.println(board[pos]+\"X\");\n showBoard();\n }", "public void setBeginningBoard() {\n clearBooleanBoard();\n\n figBoard[0][0] = new Rook(\"white\", 00, white[0]);\n figBoard[0][1] = new Knight(\"white\", 01, white[1]);\n figBoard[0][2] = new Bishop(\"white\", 02, white[2]);\n figBoard[0][4] = new King(\"white\", 04, white[3]);\n figBoard[0][3] = new Queen(\"white\", 03, white[4]);\n figBoard[0][5] = new Bishop(\"white\", 05, white[2]);\n figBoard[0][6] = new Knight(\"white\", 06, white[1]);\n figBoard[0][7] = new Rook(\"white\", 07, white[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[0][i] = true;\n gA.getBoard()[0][i].setRotation(180);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[1][i] = true;\n gA.getBoard()[1][i].setRotation(180);\n figBoard[1][i] = new Pawn(\"white\", 10 + i, white[8]);\n }\n\n figBoard[7][0] = new Rook(\"black\", 70, black[0]);\n figBoard[7][1] = new Knight(\"black\", 71, black[1]);\n figBoard[7][2] = new Bishop(\"black\", 72, black[2]);\n figBoard[7][4] = new King(\"black\", 74, black[3]);\n figBoard[7][3] = new Queen(\"black\", 73, black[4]);\n figBoard[7][5] = new Bishop(\"black\", 75, black[2]);\n figBoard[7][6] = new Knight(\"black\", 76, black[1]);\n figBoard[7][7] = new Rook(\"black\", 77, black[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[7][i] = true;\n gA.getBoard()[7][i].setRotation(0);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[6][i] = true;\n gA.getBoard()[6][i].setRotation(0);\n figBoard[6][i] = new Pawn(\"black\", 60 + i, black[8]);\n }\n\n clearFallenFigures();\n clearBoardBackground();\n clearStringBoard();\n showBoard(); //shows the figures\n showScore();\n setBoardClickable();\n\n if (beginner % 2 == 0)\n this.turn = 0;\n else this.turn = 1;\n\n beginner++;\n\n numberOfBlackFallen = 0;\n numberOfWhiteFallen = 0;\n fallenFiguresWhite = new ArrayList<Figure>();\n fallenFiguresBlack = new ArrayList<Figure>();\n\n showCheck();\n showTurn();\n }", "public void initChessBoardManually() {\r\n\t\tstatus.setStatusEdit();\r\n\t\tclearBoard();\r\n\t\tthis.setBoardEnabled(true);\r\n\t\tfor (int i=0; i<8*8; i++) {\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setBorderPainted(false);\r\n\t\t}\r\n\t\tswitcher.setEnabled(true);\r\n\t\tconfirm.setEnabled(true);\r\n\t\tt.setText(\"<html>Please choose position to put the pieces.<br>Right click to set/cancel King flag</html>\");\r\n\t}", "private static void showBoard()\n {\n System.out.println(board[1] + \" | \" + board[2] + \" | \" + board[3]);\n System.out.println(\"----------\");\n System.out.println(board[4] + \" | \" + board[5] + \" | \" + board[6]);\n System.out.println(\"----------\");\n System.out.println(board[7] + \" | \" + board[8] + \" | \" + board[9]);\n }", "private void startNewGame(){\n if (selectedPiece!=null)\n selectedPiece.setBackground(getDefaultColor(selectedPiece));\n selectedPiece = null;\n setAllToDefaultColor();\n setDefulatMessage();\n board = new ChessBoard(1, false);\n for(int row = 0 ; row < ROWS; row++){\n for(int col = 0; col < COLS ; col++){\n setButtonIcon(row,col);\n }\n }\n }", "public static void main(String[] args) {\n\n Board myboard = new Board(8,8);\n System.out.println(myboard.drawBoard());\n myboard.boardToLetters();\n //System.out.println(myboard.drawBoard());\n // myboard.boardToFigures();\n // System.out.println(myboard.drawBoard());\n\n System.out.println(\"------------------- Movimientos Posibles\");\n //myboard.obtenerPiezasPorColor();\n\n Coordinate coordinate = new Coordinate(4,3);\n Piece pieza = myboard.obtenerPiezaCoordenadas(coordinate);\n Movimientos movimientos = new Movimientos(pieza, myboard);\n ArrayList<Coordinate> listaMovimientos = new ArrayList<>(movimientos.obtenerMovimientos());\n\n //System.out.println(piece.toString());\n for(Coordinate coordenadas : listaMovimientos)\n {\n System.out.println(coordenadas.toString());\n }\n\n if(listaMovimientos.isEmpty())\n {\n System.out.println(\"Esta vacia\");\n }\n }", "public void DisplayBoard(Board bord);", "public void displayPossibleMoves() {\n \tGame.permBoard.displayBoard();\n }", "public static void drawPlayerBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (playerBoardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + playerBoardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }", "public void initialize() {\r\n\r\n\t\t// Assign1, Add control button\r\n\t\tFlowLayout fl = new FlowLayout();\r\n\t\tfl.setAlignment(FlowLayout.LEFT);\r\n\t\tthis.setLayout(fl);\r\n\t\tswitcher = new JButton(\"Switch Player:black\");\r\n\t\tswitcher.setEnabled(false);\r\n\t\tswitcher.addActionListener(this);\r\n\t\tconfirm = new JButton(\"Confirm\");\r\n\t\tconfirm.setEnabled(false);\r\n\t\tconfirm.addActionListener(this);\r\n\t\tthis.add(switcher);\r\n\t\tthis.add(confirm);\r\n\t\tswitcher.setBounds(520, 200, 50, 20);\r\n\t\tconfirm.setBounds(520, 400, 50, 20);\r\n\r\n\t\t// Assign1, Add message upper from the board\r\n\t\tt = new JLabel();\r\n\t\tt.setVerticalAlignment(JLabel.TOP);\r\n\t\tthis.add(t);\r\n\t\tt.setVisible(true);\r\n\r\n\t\t// Assign1, Get layer object, which in order to enable layering of JFrame\r\n\t\tlp = this.getLayeredPane();\r\n\r\n\t\t// Define board by JPanel with a 8*8 GridLayout\r\n\t\t// Put red and white board\r\n\t\tboardBg = new JPanel();\r\n\t\tboardBg.setLayout(new GridLayout(8, 8));\r\n\t\tfor (int i = 0; i < 8 * 8; i++) {\r\n\t\t\t// Assign1, Put red board\r\n\t\t\tif ((i % 2 == 0 && (i / 8) % 2 == 1)\r\n\t\t\t\t\t|| (i % 2 == 1 && (i / 8) % 2 == 0)) {\r\n\t\t\t\tChessBoardBlock block = new ChessBoardBlock(\"red\", order[i]);\r\n\t\t\t\tblock.addActionListener(this);\r\n\t\t\t\tblock.addMouseListener(this);\r\n\t\t\t\tboard.put(order[i], block);\r\n\t\t\t\tblock.setEnabled(false);\r\n\t\t\t\tblock.setBorderPainted(false);\r\n\t\t\t\tboardBg.add(block);\r\n\t\t\t}\r\n\t\t\t// Assign1, Put white board\r\n\t\t\telse {\r\n\t\t\t\tChessBoardBlock block = new ChessBoardBlock(\"white\", order[i]);\r\n\t\t\t\tblock.addActionListener(this);\r\n\t\t\t\tblock.addMouseListener(this);\r\n\t\t\t\tboard.put(order[i], block);\r\n\t\t\t\tblock.setEnabled(false);\r\n\t\t\t\tblock.setBorderPainted(false);\r\n\t\t\t\tboardBg.add(block);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Assign1, Put pieces on the board, on another same JPanel with 8*8 GridLayout\r\n\t\tbody = new JPanel();\r\n\t\tbody.setLayout(new GridLayout(8, 8));\r\n\r\n\t\t// Assign1, Put board panel and piece panel in different layer by the Integer parameter\r\n\t\tlp.add(boardBg, new Integer(1));\r\n\t\tlp.add(body, new Integer(2));\r\n\t\tboardBg.setBounds(0, 70, 500, 500);\r\n\t\tboardBg.setVisible(true);\r\n\t\tbody.setBounds(0, 70, 500, 500);\r\n\t\tbody.setOpaque(false);// Assign1, Make the upper layer panel transparent so that lower layer can be seen\r\n\t\tbody.setVisible(true);\r\n\t\t\r\n\t\tstatus.setStatusInit();\r\n\r\n\t}", "public static void drawFullBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (boardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + boardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }", "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 initialiseBoard() {\n\t\tPlayer1Mancala = new MancalaPit(this.player1Name, 0, null);\n\t\tPit player1_Pit6 = new Pit(this.player1Name, 6, 1, Player1Mancala);\n\t\tPit player1_Pit5 = new Pit(this.player1Name, 5, 1, player1_Pit6);\n\t\tPit player1_Pit4 = new Pit(this.player1Name, 4, 1, player1_Pit5);\n\t\tPit player1_Pit3 = new Pit(this.player1Name, 3, 1, player1_Pit4);\n\t\tPit player1_Pit2 = new Pit(this.player1Name, 2, 1, player1_Pit3);\n\t\tPit player1_Pit1 = new Pit(this.player1Name, 1, 1, player1_Pit2);\n\n\t\t// Define Player2 Pits in descending order \n\t\tPlayer2Mancala = new MancalaPit(this.player2Name, 0, null);\n\t\tPit player2_Pit6 = new Pit(this.player2Name, 6, 1, Player2Mancala);\n\t\tPit player2_Pit5 = new Pit(this.player2Name, 5, 1, player2_Pit6);\n\t\tPit player2_Pit4 = new Pit(this.player2Name, 4, 1, player2_Pit5);\n\t\tPit player2_Pit3 = new Pit(this.player2Name, 3, 1, player2_Pit4);\n\t\tPit player2_Pit2 = new Pit(this.player2Name, 2, 1, player2_Pit3);\n\t\tPit player2_Pit1 = new Pit(this.player2Name, 1, 1, player2_Pit2);\n\n\t\t// Complete the board by connecting mancala with player pits\n\t\tPlayer1Mancala.setNextPit(player2_Pit1);\n\t\tPlayer2Mancala.setNextPit(player1_Pit1);\n\n\t\t//Initialize the Player1 board \n\t\tthis.Player1Pits[0] = player1_Pit1;\n\t\tthis.Player1Pits[1] = player1_Pit2;\n\t\tthis.Player1Pits[2] = player1_Pit3;\n\t\tthis.Player1Pits[3] = player1_Pit4;\n\t\tthis.Player1Pits[4] = player1_Pit5;\n\t\tthis.Player1Pits[5] = player1_Pit6;\n\n\t\t// Initialize the Player2 board \n\t\tthis.Player2Pits[0] = player2_Pit1;\n\t\tthis.Player2Pits[1] = player2_Pit2;\n\t\tthis.Player2Pits[2] = player2_Pit3;\n\t\tthis.Player2Pits[3] = player2_Pit4;\n\t\tthis.Player2Pits[4] = player2_Pit5;\n\t\tthis.Player2Pits[5] = player2_Pit6;\n\t}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "@Override\n public void mouseReleased(MouseEvent arg0) {\n yourBoardPanel[xx][yy].setBackground(updateYourBoardHelper(xx, yy));\n //potential problem here during initialization of ships?\n \n }", "private void setupChessBoard() {\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 add(settingsBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n }", "public void newGame() {\n\n\n inGame = true;\n mines_left = mines+ePirate+mPirate+hPirate;\n\n all_cells = rows * cols;\n field = new int[all_cells];\n\n for (int i = 0; i < all_cells; i++)\n field[i] = COVER_FOR_CELL;\n\n statusbar.setText(Integer.toString(mines_left));\n\n // draw the board -- pass to the undo array\n drawBoard(mines) ; // now rocks\n drawBoard(ePirate) ;\n drawBoard(mPirate) ;\n drawBoard(hPirate) ;\n\n }", "private void printBoard() {\n\n for (int j=Board.getSize()-1; j >= 0; j--) {\n for (int i=0; i < Board.getSize(); i++) {\n // make sure indexes get printed for my pieces\n if (board.layout[i][j] == player) {\n //System.out.print(\" \"+ getPieceIndex(i,j)+ \" \");\n } else {\n System.out.print(\" \"+ board.layout[i][j]+ \" \");\n }\n }\n System.out.print(\"\\n\");\n\n }\n }", "private void setupLeaderBoards() {\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(settingsBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n }", "public void updateBoard() {\n for(SnakePart s : snakePartList) {\n board[s.getSnakePartRowsOld()][s.getSnakePartCollsOld()] = ' ';\n board[s.getSnakePartRowsNew()][s.getSnakePartCollsNew()] = 'S';\n }\n \n for (SnakeEnemyPart e : snakeEnemyPartList) {\n board[e.getSnakeEnemyPartRowsOld()][e.getSnakeEnemyPartCollsOld()] = ' ';\n board[e.getSnakeEnemyPartRowsNew()][e.getSnakeEnemyPartCollsNew()] = 'E';\n }\n }", "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 static void showBoard(int[][] board) {\r\n\t\tgrid.showBoard(board);\r\n\t}", "public static void drawBoard(){\n\t\tSystem.out.println(\"\\n\\t A B C\");\r\n\t\tSystem.out.println(\"\\t .-----------.\");\r\n\t\tSystem.out.println(\"\\t1 |_\"+TicTac.place[0]+\"_|_\"+TicTac.place[1]+\"_|_\"+TicTac.place[2]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t2 |_\"+TicTac.place[3]+\"_|_\"+TicTac.place[4]+\"_|_\"+TicTac.place[5]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t3 |_\"+TicTac.place[6]+\"_|_\"+TicTac.place[7]+\"_|_\"+TicTac.place[8]+\"_|\");\r\n\t\tSystem.out.println(\"\\t '-----------'\");\r\n\t}", "void goToWhiteboardSelect(){\n CollaboardGUI.this.setSize(500,500);\n CardLayout layout = (CardLayout) panels.getLayout();\n layout.show(panels, \"whiteboard\");\n }", "public void displayBoard() {\n newLine();\n for (int row = _board[0].length - 1; row >= 0; row -= 1) {\n String pair = new String();\n for (int col = 0; col < _board.length; col += 1) {\n pair += \"|\";\n pair += _board[col][row].abbrev();\n }\n System.out.println(pair + \"|\");\n newLine();\n }\n }", "Board createLayout();", "public void showBoardState() {\n System.out.print(\" \");\n //top row X axis\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for (int i = 0; i < boardSize; i++) {\n //conversion 0-9 to char for display as Y axis\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++) {\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n\n }\n System.out.println();\n }", "private void displayBoard(Board board)\n {\n for (int i = 0; i < size; i++)\n {\n System.out.print(\"|\");\n for (int j = 0; j < size; j++)\n \n System.out.print(board.array[i][j] + \"|\");\n System.out.println();\n }\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 }", "private void buttonClicked(int c){\r\n boardRep[currentFilled[c]][c] = blackToPlay ? 1:-1; //adjust board rep\r\n if (blackToPlay){\r\n boardSquares[5-currentFilled[c]][c].setBackground(Color.BLACK);\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.RED);\r\n }\r\n int y = 5-currentFilled[c];\r\n \r\n \r\n for (int i = 0; i < 4; i++) { //check horizontal for black win\r\n if ((c-3 + i)>-1 && c-3+i<4){\r\n horizontal4s[y][c-3+i]++;\r\n if (horizontal4s[y][c-3+i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check vertical for black win\r\n if (y-3+i>-1 && y-3+i<3){\r\n vertical4s[y-3+i][c]++;\r\n if (vertical4s[y-3+i][c] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TLBR diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c-3+i>-1 && c-3+i<4){\r\n diagonalTLBR4s[y-3+i][c-3+i]++;\r\n if (diagonalTLBR4s[y-3+i][c-3+i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TRBL diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c+3-i>-1 && c+3-i < 4){\r\n diagonalTRBL4s[y-3+i][c+3-i]++;\r\n if (diagonalTRBL4s[y-3+i][c+3-i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n \r\n \r\n }\r\n else{\r\n boardSquares[5-currentFilled[c]][c].setBackground(Color.RED);\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.BLACK);\r\n }\r\n \r\n int y = 5-currentFilled[c];\r\n \r\n \r\n for (int i = 0; i < 4; i++) { //check horizontal for black win\r\n if ((c-3 + i)>-1 && c-3+i<4){\r\n horizontal4s[y][c-3+i]--;\r\n if (horizontal4s[y][c-3+i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check vertical for black win\r\n if (y-3+i>-1 && y-3+i<3){\r\n vertical4s[y-3+i][c]--;\r\n if (vertical4s[y-3+i][c] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TLBR diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c-3+i>-1 && c-3+i<4){\r\n diagonalTLBR4s[y-3+i][c-3+i]--;\r\n if (diagonalTLBR4s[y-3+i][c-3+i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TRBL diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c+3-i>-1 && c+3-i < 4){\r\n diagonalTRBL4s[y-3+i][c+3-i]--;\r\n if (diagonalTRBL4s[y-3+i][c+3-i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n \r\n }\r\n blackToPlay = !blackToPlay;\r\n currentFilled[c]++;\r\n if(currentFilled[c] == 6)\r\n moveSelect[c].setEnabled(false);\r\n }", "public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void newGame(){\n\t\tsetUp.buildBoard(8,8);\n\t\tfor(int i = 0; i < boardBoundsRow * boardBoundsColumn; i++){\n\t\t\tJPanel selectedTile = (JPanel) userInterface.boardButtons.getComponent(i);\n\t\t\tselectedTile.removeAll();\n\t\t\tselectedTile.revalidate();\n\t\t}\n\t\tuserInterface.addBlackPiece();\n\t\tuserInterface.addWhitePiece();\n\t\tuserInterface.check.setText(\"You are not in check\");\n\t\tking.blackKingCheck = false;\n\t\tking.whiteKingCheck = false;\n\t\tturn = \"white\";\n\t\tString playerTurn = \"Player turn: \";\n\t\tuserInterface.turn.setText(playerTurn.concat(turn));\n\t\tundoMoveClass.clearStacks();\n\t}", "public SetBoard(String newName){\n super(\"BattleShip Set\");\n\n //configuracoes basicas da janela\n\t\tsetSize(1100, 550);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n setContentPane(panel);\n container = getContentPane();\n container.setLayout(null);\n\n //cria a base do board do player e do computador\n gridPlayer.setBounds(3, 100, 497, 325);\n\t\tgridPlayer.setLayout(new GridLayout(10, 10, 2, 2));\n gridPc.setBounds(599, 100, 497, 325);\n\t\tgridPc.setLayout(new GridLayout(10, 10, 2, 2));\n\n //pega o name do player passado por parametro\n player.setName(newName);\n name = newName;\n\n //preenche ambos boards com uma imagem de ocean\n for(int line = 0; line < 10; line++){\n\t\t\tfor(int column = 0; column < 10; column++){\n\t\t\t\ttablePlayer[line][column] = new JButton(line+\"-\"+column, new ImageIcon(RandomBoard.class.getResource(\"/images/ocean.png\")));\n tablePlayer[line][column].setHorizontalTextPosition(SwingConstants.CENTER);\n tablePlayer[line][column].setMargin( new Insets(10, 10, 10, 10) );\n\t\t\t\ttablePlayer[line][column].addActionListener(this);\n tablePlayer[line][column].setForeground(Color.WHITE);\n\t\t\t\tgridPlayer.add(tablePlayer[line][column]);\n tablePc[line][column] = new JButton(line+\"-\"+column, new ImageIcon(RandomBoard.class.getResource(\"/images/ocean.png\")));\n tablePc[line][column].setHorizontalTextPosition(SwingConstants.CENTER);\n tablePc[line][column].setMargin( new Insets(10, 10, 10, 10) );\n\t\t\t\ttablePc[line][column].addActionListener(this);\n tablePc[line][column].setForeground(Color.WHITE);\n\t\t\t\tgridPc.add(tablePc[line][column]);\n\t\t\t}\n\t\t}\n\n //posiciona os elementos na janela\n exit.setBounds(7, 14, 120, 35);\n\t\texit.addActionListener(this);\n\n\t\tnewGame.setBounds(127, 14, 120, 35);\n\t\tnewGame.addActionListener(this);\n\n reset.setBounds(247, 14, 120, 35);\n\t\treset.addActionListener(this);\n\n hint.setBounds(367, 14, 120, 35);\n\t\thint.addActionListener(this);\n\n singleShot.setBounds(487, 14, 120, 35);\n\t\tsingleShot.addActionListener(this);\n\n commonShot.setBounds(607, 14, 120, 35);\n\t\tcommonShot.addActionListener(this);\n\n cascade.setBounds(727, 14, 120, 35);\n\t\tcascade.addActionListener(this);\n\n star.setBounds(847, 14, 120, 35);\n\t\tstar.addActionListener(this);\n\n playerLabel.setFont(new Font(\"Arial\", Font.BOLD, 15));\n\t\tplayerLabel.setBounds(12, 78, 120, 18);\n\n pc.setFont(new Font(\"Arial\", Font.BOLD, 15));\n\t\tpc.setBounds(607, 78, 120, 18);\n\n stopwatch.setFont(new Font(\"Arial\", Font.BOLD, 25));\n\t\tstopwatch.setBounds(1000, 10, 120, 50);\n\n aircraft.setBounds(7, 450, 120, 35);\n\t\taircraft.addActionListener(this);\n aircraft.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/aircraft.png\")));\n \n submarine.setBounds(127, 450, 120, 35);\n\t\tsubmarine.addActionListener(this);\n submarine.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/submarine.png\")));\n\n escortShip.setBounds(247, 450, 120, 35);\n\t\tescortShip.addActionListener(this);\n escortShip.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/escortShip.png\")));\n\n aircraftCarrier.setBounds(367, 450, 120, 35);\n\t\taircraftCarrier.addActionListener(this);\n aircraftCarrier.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/aircraftCarrier.png\")));\n\n play.setBounds(487, 450, 120, 35);\n play.addActionListener(this);\n\n container.add(gridPlayer);\n\t\tcontainer.add(gridPc);\n container.add(exit);\n container.add(newGame);\n container.add(reset);\n container.add(hint);\n container.add(singleShot);\n container.add(commonShot);\n container.add(cascade);\n container.add(star);\n container.add(playerLabel);\n container.add(pc);\n container.add(stopwatch);\n container.add(aircraft);\n container.add(submarine);\n container.add(escortShip);\n container.add(aircraftCarrier);\n container.add(play);\n\n //distribui os vehicles aleatoriamente no board do computador\n distVehPc.distribui(arrayPc, tablePc);\n\n //copia os valuees do arrayPc para outro array, ele sera usado caso o jogo seja reiniciado\n for(int line = 0; line < 10; line++){\n for(int column = 0; column < 10; column++){\n arrayPcAux[line][column] = arrayPc[line][column];\n }\n }\n\n //desabilita a maioria dos botoes, eles serao reativados quando o player montar seu campo e clicar em \"play\"\n hint.setEnabled(false);\n singleShot.setEnabled(false);\n commonShot.setEnabled(false);\n cascade.setEnabled(false);\n star.setEnabled(false);\n play.setEnabled(false);\n newGame.setEnabled(false);\n reset.setEnabled(false);\n }", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "static void showBoard() \n\t{\n\t\tSystem.out.println(\"|---|---|---|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[1] + \" | \" + tictactoeBoard[2] + \" | \" + tictactoeBoard[3] + \" |\");\n\t\tSystem.out.println(\"|-----------|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[4] + \" | \" + tictactoeBoard[5] + \" | \" + tictactoeBoard[6] + \" |\");\n\t\tSystem.out.println(\"|-----------|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[7] + \" | \" + tictactoeBoard[8] + \" | \" + tictactoeBoard[9] + \" |\");\n\t\tSystem.out.println(\"|---|---|---|\");\n\t}", "public void PrintBoard() {\n\tSystem.out.println(\"printing from class\");\n\t\tString[][] a = this.piece;\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 <- X axis\");\n\t\tSystem.out.println(\" +----------------+ \");\n\t\t\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tSystem.out.print(i + \" |\");\n\t\t\tfor (int j=0; j<8;j++) {\n\t\t\t\t\n\t\tSystem.out.print(\"\" + a[i] [j] + \" \");\n\t\t\t\t\t} \n\t\t\tSystem.out.println(\"|\");\n\t\t}\n\t\tSystem.out.println(\" +----------------+ \");\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 \");\n\t\n\t}", "public void onClick(View v){\n switch(v.getId())\n {\n case R.id.topLeft:\n if(boardStatus[0][0].equals(\"a\")){\n topLeft.setText(playerToggle);\n boardStatus[0][0] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.topMiddle:\n if(boardStatus[0][1].equals(\"b\")){\n topMiddle.setText(playerToggle);\n boardStatus[0][1] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.topRight:\n if(boardStatus[0][2].equals(\"c\")){\n topRight.setText(playerToggle);\n boardStatus[0][2] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.centerLeft:\n if(boardStatus[1][0].equals(\"d\")){\n centerLeft.setText(playerToggle);\n boardStatus[1][0] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.centerMiddle:\n if(boardStatus[1][1].equals(\"e\")){\n centerMiddle.setText(playerToggle);\n boardStatus[1][1] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.centerRight:\n if(boardStatus[1][2].equals(\"f\")){\n centerRight.setText(playerToggle);\n boardStatus[1][2] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.bottomLeft:\n if(boardStatus[2][0].equals(\"g\")) {\n bottomLeft.setText(playerToggle);\n boardStatus[2][0] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.bottomMiddle:\n if(boardStatus[2][1].equals(\"h\")){\n bottomMiddle.setText(playerToggle);\n boardStatus[2][1] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n case R.id.bottomRight:\n\n if(boardStatus[2][2].equals(\"i\")){\n bottomRight.setText(playerToggle);\n boardStatus[2][2] = playerToggle;\n checkBoard();\n switchPlayer();\n }\n break;\n }\n\n\n }", "private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}", "public void arrangeBoard(){\n for(int i=0;i<6;i++){\n for(int j=0;j<6;j++){\n if(i==2 && j==0){ //set the target ship.\n gbc.gridx = 0;\n gbc.gridy = 2;\n gbc.gridwidth = 2;\n targetShip = new JLabel();\n targetShip.setIcon(new ImageIcon(\"design\\\\ships\\\\targetShip.png\"));\n mainPanel.add(targetShip,gbc);\n }\n else if(i==2 && j==1){\n continue;\n }\n else{ //put free spaces in the other places.\n gbc.gridx = j;\n gbc.gridy = i;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n freeSpaceButton freeSpace = new freeSpaceButton(new Point(j,i));\n mainPanel.add(freeSpace,gbc);\n }\n }\n }\n }", "private static void printBoard() {\n\n\t//\tJOptionPane.showMessageDialog(null, \"Heyoo\", \".-*Board*-.\", -1);\n\t\t//String name = JOptionPane.showInputDialog(\"Vat is dain name?\");\n\t\t//JOptionPane.showMessageDialog(null, \"Aiight you good, \" + name);\n\t\t\n\t\t\n\t\tString[] options = {\"Sten\", \"Sax\", \"Påse\"};\n\t\tString Val = (String)JOptionPane.showInputDialog(null, \"Sten, Sax eller Påse?\",\n \"Game nr\", JOptionPane.QUESTION_MESSAGE, null, options, options[2]);\n\t\t\n\t\t\n\t\t\n\t}", "void prepareBoardBeforePlacement( Board board );", "private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }", "public void setBoard(Board board){this.board = board;}", "public void printBoard() {\n System.out.println(\"Updated board:\");\n for (int row = 0; row < size; row++) {\n for (int col = 0; col < size; col++) {\n\n System.out.print(grid[row][col] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "private void easyMove(Board board) {\n\t\t\r\n\t}", "public Gomoku() {\n initComponents();\n MenuAwal.setVisible(true);\n PilihRoom.setVisible(false);\n MasukRoom.setVisible(false);\n Gameplay.setVisible(false);\n GagalBuatRoom.setVisible(false);\n GagalBuatRoom1.setVisible(false);\n GagalMasukRoom.setVisible(false);\n GagalLogin1.setVisible(false);\n GagalLogin2.setVisible(false);\n GameplayCover.setVisible(false);\n ResultPanel.setVisible(false);\n for (int i = 0; i < 20; i++){\n for (int j = 0; j < 20; j++){\n Board[i][j] = 0;\n }\n }\n }", "public void displayBoard(Board board) { //Print the whole current board\n System.out.print(\"\\n \");\n System.out.print(\"A B C D E F G H\");\n System.out.println();\n for (int row = 0; row < BOARD_SIZE; row++) {\n System.out.print((row + 1) + \" \");\n for (int column = 0; column < BOARD_SIZE; column++) {\n System.out.print(board.board[row][column] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "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 }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\r\n\t\tString[][] level = generate(m.getWordListModel());\r\n\t\r\n\t\tfor(int x = 0; x < 6; x++){\r\n\t\t\tfor(int y = 0; y < 6; y++){\r\n\t\t\t\tif(level[x][y] == \"!\"){\r\n\t\t\t\t\tTile tile = m.getBoard().tiles[x][y];\r\n\t\t\t\t\ttile.setLetter(\"!\");\r\n\t\t\t\t\ttile.setEnabled(false);\r\n\t\t\t\t} else if(level[x][y] != \"_\"){\r\n\t\t\t\t\tTile tile = m.getBoard().tiles[x][y];\r\n\t\t\t\t\ttile.setLetter(level[x][y]);\r\n\t\t\t\t\ttile.setEnabled(true);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tm.getBoard().tiles[x][y].setLetter(\"_\");\r\n\t\t\t\t\tm.getBoard().tiles[x][y].setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tbuilder.refreshBoard();\r\n\t}", "public void displayBoard()\n {\n System.out.println(\"\");\n System.out.println(\" Game Board \");\n System.out.println(\" ---------------------------------\");\n for (int i = 0; i < ROW; i++)\n {\n System.out.print(i+1 + \" | \");\n for (int j = 0; j < COL; j++)\n {\n //board[i][j] = \"A\";\n System.out.print(board[i][j].getPieceName() + \" | \");\n }\n System.out.println();\n }\n System.out.println(\" ---------------------------------\");\n\n System.out.println(\" a b c d e f g h \");\n }", "public void showGameBoard() {\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n System.out\n .printf(\"%3d\", playingBoard[row][col].getMoveNumber());\n if (col == BOARD_SIZE - 1) {\n System.out.println();\n }\n }\n }\n }", "public void cleartbl(View view) {\n\n table.removeAllViews();\n buttons.clear();\n lauta = new int[9];\n moves = 0;\n turn = true;\n create_board();\n victory1 = false;\n victory2 = false;\n }", "public void initializeGameboard() {\r\n\t\t\r\n\t\t for (int row=0 ; row<gameBoard.length; row++)\r\n\t\t { \r\n\t\t \t \r\n\t\t \t for(int column=0;column<gameBoard[row].length;column++ )\t \r\n\t\t \t { \r\n\t\t \t\t if( row==0|| row ==1)\r\n\t\t \t\t { \r\n\t\t \t\t\t if (column==0) {gameBoard[row][column]=\"2\";}\r\n\t\t \t\t\t else if (column==1) {gameBoard[row][column]=\"3\";}\t \r\n\t\t \t\t\t else if (column==2) {gameBoard[row][column]=\"4\";} \r\n\t\t \t\t\t else if (column==3) {gameBoard[row][column]=\"5\";} \r\n\t\t \t\t\t else if (column==4) {gameBoard[row][column]=\"6\";} \r\n\t\t \t\t\t else if (column==5) {gameBoard[row][column]=\"7\";}\r\n\t\t \t\t\t else if (column==6) {gameBoard[row][column]=\"8\";} \r\n\t\t \t\t\t else if (column==7) {gameBoard[row][column]=\"9\";}\r\n\t\t \t\t\t else if (column==8) {gameBoard[row][column]=\"10\";} \r\n\t\t \t\t\t else if (column==9) {gameBoard[row][column]=\"11\";} \r\n\t\t \t\t\t else if (column==10) {gameBoard[row][column]=\"12\";} \r\n\t\t \t\t }\r\n\t\t \t\t \r\n\t\t\t \t else if(row ==2 || row==3) \r\n\t\t\t \t {\r\n\t\t\t \t\t if (column==0) {gameBoard[row][column]=\"12\";}\r\n\t\t \t\t\t else if (column==1) {gameBoard[row][column]=\"11\";}\t \r\n\t\t \t\t\t else if (column==2) {gameBoard[row][column]=\"10\";} \r\n\t\t \t\t\t else if (column==3) {gameBoard[row][column]=\"9\";} \r\n\t\t \t\t\t else if (column==4) {gameBoard[row][column]=\"8\";} \r\n\t\t \t\t\t else if (column==5) {gameBoard[row][column]=\"7\";}\r\n\t\t \t\t\t else if (column==6) {gameBoard[row][column]=\"6\";} \r\n\t\t \t\t\t else if (column==7) {gameBoard[row][column]=\"5\";}\r\n\t\t \t\t\t else if (column==8) {gameBoard[row][column]=\"4\";} \r\n\t\t \t\t\t else if (column==9) {gameBoard[row][column]=\"3\";} \r\n\t\t \t\t\t else if (column==10) {gameBoard[row][column]=\"2\";} \r\n\t\t\t \t }\r\n\t\t }\r\n\t\t }\r\n\t }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinitBoard();\r\n\t\t\t\trepaint();\r\n\t\t\t}", "public void refreshDisplay(){\r\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n switch (boardRep[i][j]) { //maybe not best style to have default red but whatever (change board\r\n case 0:\r\n boardSquares[i][j].setBackground(Color.WHITE);\r\n break;\r\n case 1:\r\n boardSquares[i][j].setBackground(Color.BLACK);\r\n break;\r\n default:\r\n boardSquares[i][j].setBackground(Color.RED);\r\n break;\r\n }\r\n }\r\n }\r\n \r\n if (blackToPlay){ //change to move squares\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.BLACK);\r\n }\r\n } else{\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.RED);\r\n }\r\n }\r\n \r\n \r\n }", "public void print_board(){\n\t\tfor(int i = 0; i < size*size; i++){\n\t\t\tif(i%this.size == 0) System.out.println(); //just for divider\n\t\t\tfor(int j = 0; j < size*size; j++){\n\t\t\t\tif(j%this.size == 0) System.out.print(\" \"); //just for divider\n\t\t\t\tSystem.out.print(board[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {\n\trefreshTableMhs();\n\tfungsi.loncatCard(jPanel1, \"mahasiswa\");\n }", "void setBoard(Board board);", "void drawBoard(Board board);", "@Override\n public void actionPerformed(ActionEvent e) {\n lblMove.setText(\"Jumlah Gerakan: \" + puzzlePanel.getMoveCount());\n if (puzzlePanel.getPuzzleModel().isSolved()) {\n puzzlePanel.showCompletePuzzle();\n isWin = true;\n int choice = JOptionPane.showConfirmDialog(null, \"Kamu menang! main lagi?\", \"Selamat!\",\n JOptionPane.YES_NO_OPTION);\n if (choice == JOptionPane.YES_OPTION) {\n initPanel();\n }\n }\n\n }", "public static void setupSouSuoBiaoDiGui(int status,int shenDu,int hang,Vector luJing)\n {\n \n \n \n for(int nextstatusXiaBiao=0;nextstatusXiaBiao<9;nextstatusXiaBiao++)\n {\n Vector[]newluJing=new Vector[9];\n newluJing[nextstatusXiaBiao]=(Vector)(luJing.clone());\n newluJing[nextstatusXiaBiao].add(String.valueOf(nextstatusXiaBiao));\n \n int[]nextStatusArray=(int[])(bianHuanTable.get(status));\n int nextstatus=nextStatusArray[nextstatusXiaBiao];\n //\n //===============================================\n \n if(souSuoBiao[hang][nextstatus].size()==0)\n {\n //souSuoBiao[hang][nextstatus].remove (0);\n souSuoBiao[hang][nextstatus].add(0,String.valueOf(shenDu));\n souSuoBiao[hang][nextstatus].add(1,newluJing[nextstatusXiaBiao]);\n \n \n souSuoBiaoFeiNullGeShu++;\n //MyPrintln.println(\"共计:\"+String.valueOf (souSuoBiaoFeiNullGeShu));\n \n }\n \n else \n {\n //按序放到正确位置\n \n //souSuoBiao[hang][nextstatus].add(String.valueOf(shenDu));\n //souSuoBiao[hang][nextstatus].add(newluJing[nextstatusXiaBiao]);\n ///=======\n int i1 ;\n for(i1=0;i1<souSuoBiao[hang][nextstatus].size();i1+=2)\n {\n String oldshenDu=(String)(souSuoBiao[hang][nextstatus].get(i1));\n if(shenDu<Integer.parseInt(oldshenDu))\n {\n break ;\n }\n }\n //--------\n souSuoBiao[hang][nextstatus].add(i1,String.valueOf(shenDu));\n souSuoBiao[hang][nextstatus].add(i1+1,newluJing[nextstatusXiaBiao]);\n \n //======\n \n \n //oldshenDu.\n }\n \n \n \n }\n //=======================================\n //将调用和条件改变位置到上面,则是深度优先\n //=====================================\n \n shenDu++;\n \n if((souSuoType.compareTo(\"shenDuControlGetAll\")==0&&shenDu<=shenDuControl)\n ||(souSuoType.compareTo(\"short\")==0&&souSuoBiaoHangFull(hang)!=1)\n )\n //if(souSuoBiaoHangFull(hang)!=1)//行满则返回\n //该条件是得到最短路径的方法。只得到一个。如果采用广度优先搜索,那么第一个结果就是需要的结果\n /// if(shenDu<=2)//该条件是得到所有3步内的方法,最短的自动放到最前面\n {\n //int[]nextStatusArray=bianHuanTable.get(status);\n for(int nextstatusXiaBiao=0;nextstatusXiaBiao<9;nextstatusXiaBiao++)\n {\n Vector[]newluJing=new Vector[9];\n newluJing[nextstatusXiaBiao]=(Vector)(luJing.clone());\n newluJing[nextstatusXiaBiao].add(String.valueOf(nextstatusXiaBiao));\n \n int[]nextStatusArray=(int[])(bianHuanTable.get(status));\n int nextstatus=nextStatusArray[nextstatusXiaBiao];\n //===============\n // souSuoBiao[status][nextstatus].add(String.valueOf(nextstatusXiaBiao));\n // souSuoBiao[status][nextstatus].add(String.valueOf(1));\n //---------------------\n // int[]lastStatusArray=bianHuanTable.get(nextstatus);\n // for(int laststatusXiaBiao=0;laststatusXiaBiao<9;laststatusXiaBiao++)\n // {\n // int laststatus=lastStatusArray[lastXiaBiao];\n //----------\n \n // souSuoBiao[status][laststatus].add(String.valueOf(nextstatusXiaBiao));\n // souSuoBiao[status][laststatus].add(String.valueOf(laststatusXiaBiao));\n // souSuoBiao[status][laststatus].add((2));\n \n //----------\n //}\n //\n // if(souSuoBiao[hang][nextstatus].size()==0)\n // {\n // souSuoBiao[hang][nextstatus].add(String.valueOf(nextstatusXiaBiao));\n // souSuoBiao[hang][nextstatus].add(String.valueOf(++shenDu));\n // souSuoBiaoFeiNullGeShu++;\n // MyPrintln.println(\"共计:\"+String.valueOf (souSuoBiaoFeiNullGeShu));\n // }\n //\n \n \n setupSouSuoBiaoDiGui(nextstatus,shenDu,hang,newluJing[nextstatusXiaBiao]);\n \n //=====================\n \n }\n }\n }", "public static void initialBoard() {\n\t\tSystem.out.println(\"Welcome to TicTacToe ♡\");\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tboard[i][j] = '-';\n\t\t\t}\n\t\t}\n\t}", "public static void printBoard() {\n\t\tSystem.out.println(\"Board:\");\r\n\t\tfor(int i=0; i<BoardSquare.numberOfSquare; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.print(String.format(\"%4s\", (i+1) + \":\"));\r\n\t\t\tif(BoardGame.board.get(i).isPlayerOne()) System.out.print(\" P1\"); \r\n\t\t\tif(BoardGame.board.get(i).isPlayerTwo()) System.out.print(\" P2\");\r\n\t\t\tif(BoardGame.board.get(i).isHasCard()) System.out.print(\" C\");\t\t\t\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t}", "public static void displayboard(String board[][]){\n\t\tint rowindicator[]=new int[boardwidth+1];\n\t\tint rowcount=1;\n\t\tfor(int i=1;i<=boardwidth;i++){\n\t\t\trowindicator[i]=rowcount;\n\t\t\trowcount++;\n\t\t}\n\t\tint columnindicator[]=new int[boardlength+1];\n\t\tint columncount=1;\n\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\tcolumnindicator[i]=columncount;\n\t\t\tcolumncount++;\n\t\t}\n\t\tSystem.out.print(\"\\n \");\n\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t//displays column indicator\n\t\t\tSystem.out.print(\" \"+columnindicator[i]);\n\t\t}\n\t\t//displays board\n\t\tSystem.out.println(\"\");\n\t\tfor(int x=1;x<=boardwidth;x++){\n\t\t\t//displays row indicator\n\t\t\tSystem.out.print(\" \"+rowindicator[x]);\n\t\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t\tSystem.out.print(\" \"+board[x][i]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printBoard() {\n\t\tSystem.out.print(\"\\r\\n\");\n\t\tSystem.out.println(\" A | B | C | D | E | F | G | H\");\n\t\tfor(int i = BOARD_SIZE ; i > 0 ; i--) {\n\t\t\tSystem.out.println(\" ___ ___ ___ ___ ___ ___ ___ ___\");\n\t\t\tfor(int j = 0; j < BOARD_SIZE ; j++) {\n\t\t\t\tif(j == 0) {\n\t\t\t\t\tSystem.out.print(i + \" |\");\n\t\t\t\t} \n\t\t\t\tif(this.tiles.get(i).get(j).getPiece() != null) {\n\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece().getColor() == PrimaryColor.BLACK) {\n\t\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece() instanceof Soldier)\n\t\t\t\t\t\t\tSystem.out.print(\" B |\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.print(\"B Q|\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece() instanceof Soldier)\n\t\t\t\t\t\t\tSystem.out.print(\" W |\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.print(\"W Q|\");\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" |\");\n\t\t\t\t}\n\n\t\t\t\tif(j==BOARD_SIZE-1) {\n\t\t\t\t\tSystem.out.print(\" \" + i); \n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tSystem.out.println(\" ___ ___ ___ ___ ___ ___ ___ ___\");\n\t\tSystem.out.println(\" A | B | C | D | E | F | G | H\\r\\n\");\n\n\t}", "public void ShowBoard(){\n System.out.println(\" ___________{5}_____{4}_____{3}_____{2}_____{1}_____{0}____________\");\n System.out.println(\"| ____ ____ ____ ____ ____ ____ ____ ____ |\");\n System.out.printf(\"| | | [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] | | |\\n\",\n this.gameBoard[5], this.gameBoard[4], this.gameBoard[3],\n this.gameBoard[2], this.gameBoard[1], this.gameBoard[0]);\n System.out.println(\"| | | | | |\");\n System.out.printf(\"| | %2d | ____ ____ ____ ____ ____ ____ | %2d | |\\n\",\n this.gameBoard[6], this.gameBoard[13]);\n System.out.printf(\"| |____| [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] |____| |\\n\",\n this.gameBoard[7], this.gameBoard[8], this.gameBoard[9],\n this.gameBoard[10], this.gameBoard[11], this.gameBoard[12]);\n System.out.println(\"|_________________________________________________________________|\");\n }", "public void setTestBoard() {\n\n /*game.setNode(new NodeImp(\"2,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"2,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"3,2\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,3\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,4\",\"P1\"));\n\n game.setNode(new NodeImp(\"3,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,4\",\"P2\"));\n\n game.setNode(new NodeImp(\"4,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"5,5\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,3\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,4\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,4\",\"P2\"));*/\n\n }", "private void boardInit() {\n for(int i = 0; i < this.boardHeight; i++)\n this.board[i][0] = ' ';\n for(int i = 0; i < this.boardWidth; i++)\n this.board[0][i] = ' ';\n \n for(int i = 1; i < this.boardHeight; i++) {\n for(int j = 1; j < this.boardWidth; j++) {\n this.board[i][j] = '*';\n }\n }\n }", "static void printBoard() \r\n {\r\n \tSystem.out.println(\"/---|---|---\\\\\");\r\n \tSystem.out.println(\"| \" + board[0][0] + \" | \" + board[0][1] + \" | \" + \r\n \tboard[0][2] + \" |\");\r\n \tSystem.out.println(\"|-----------|\");\r\n \tSystem.out.println(\"| \" + board[1][0] + \" | \" + board[1][1] + \" | \" + \r\n \tboard[1][2] + \" |\");\r\n \tSystem.out.println(\"|-----------|\");\r\n \tSystem.out.println(\"| \" + board[2][0] + \" | \" + board[2][1] + \" | \" + \r\n \tboard[2][2] + \" |\");\r\n \tSystem.out.println(\"\\\\---|---|---/\");\r\n }", "void drawCurrentToBoard () {\n board.clearTemp();\n for (int r = 0; r < currentPiece.height; ++r)\n for (int c = 0; c < currentPiece.width; ++c)\n if (currentPiece.blocks[r][c] == 1)\n board.addBlock(new Block(currentPiece.color), r + currentRow, c + currentColumn);\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 void printBoard() {\n printStream.println(\n \" \" + positions.get(0) + \"| \" + positions.get(1) + \" |\" + positions.get(2) + \"\\n\" +\n \"---------\\n\" +\n \" \" + positions.get(3) + \"| \" + positions.get(4) + \" |\" + positions.get(5) + \"\\n\" +\n \"---------\\n\" +\n \" \" + positions.get(6) + \"| \" + positions.get(7) + \" |\" + positions.get(8) + \"\\n\");\n }", "@Override\r\n\t/**\r\n\t * metodo para las acciones dentro del juego\r\n\t */\r\n\tpublic void actionPerformed(ActionEvent e)\r\n\t{\n\t\tticks++;\r\n\t\t//que pasa si el juego empieza\r\n\t\tif (started)\r\n\t\t{ \r\n\t\t\t//pinta las columnas\r\n\t\t\tfor (int i = 0; i < columns.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tRectangle column = columns.get(i);\r\n\t\t\t\t//aparicion de las columnas\r\n\t\t\t\tcolumn.x -= speed;\r\n\t\t\t}\r\n\t\t\t//control del salto\r\n\t\t\tif (ticks % 2 == 0 && yMotion < 15)\r\n\t\t\t{\r\n\t\t\t\tyMotion += 2;\r\n\t\t\t}\r\n\t\t\t//limpia las columnas que han pasado y crea de nuevas\r\n\t\t\tfor (int i = 0; i < columns.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tRectangle column = columns.get(i);\r\n\r\n\t\t\t\tif (column.x + column.width < 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcolumns.remove(column);\r\n\r\n\t\t\t\t\tif (column.y == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taddColumn(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//direccion en la que salta el pajaro\r\n\t\t\tif (Menu.dificultad == \"Invertido\") {\r\n\t\t\t\t//aqui al saltar baja\r\n\t\t\t\tbird.y -= yMotion;\r\n\t\t\t}else {\r\n\t\t\t\t//aqui al saltar sube\r\n\t\t\t\tbird.y += yMotion;\r\n\t\t\t}\r\n\r\n\t\t\t// Sirve para la puntuacion, por error de sumar 2\r\n\t\t\tint a;\r\n\t\t\tint b;\r\n\t\t\t\r\n\t\t\tfor (Rectangle column : columns)\r\n\t\t\t{\t\r\n\t\t\t\tif (Menu.dificultad == \"dificil\") {\r\n\t\t\t\t\ta = 5;\r\n\t\t\t\t\tb = 10;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ta = 10;\r\n\t\t\t\t\tb = 5;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (column.y == 0 && bird.x + bird.width / 2 > column.x + column.width / 2 - a && bird.x + bird.width / 2 < column.x + column.width / 2 + b)\r\n\t\t\t\t{\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treprocol.Play();\r\n\t\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Error: \" + e1.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscore++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//cuando toca columna\r\n\t\t\t\tif (column.intersects(bird))\r\n\t\t\t\t{\r\n\t\t\t\t\t//muere\r\n\t\t\t\t\tgameOver = true;\r\n\r\n\t\t\t\t\tif (bird.x <= column.x)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbird.x = column.x - bird.width;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t//para el sonido de las columnas\r\n\t\t\t\t\t\t\treprocol.Stop();\r\n\t\t\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (column.y != 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tbird.y = column.y - bird.height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (bird.y < column.height)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tbird.y = column.height;\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\r\n\r\n\t\t\tif (bird.y > HEIGHT - 120 || bird.y < 0)\r\n\t\t\t{\r\n\t\t\t\tgameOver = true;\r\n\t\t\t}\r\n\r\n\t\t\tif (bird.y + yMotion >= HEIGHT - 120)\r\n\t\t\t{\r\n\t\t\t\tbird.y = HEIGHT - 120 - bird.height;\r\n\t\t\t\tgameOver = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\trenderer.repaint();\r\n\t}", "public void changeToBoardView(){\n\t\tif (titlePage != null){\n\t\t\tgetContentPane().remove(titlePage); \t// remove the title page from the GUI\n\t\t\ttitlePage = null;\t\n\t\t}\n\t\tif (gameOverPage != null){\n\t\t\t// remove the page if it exists\n\t\t\tgetContentPane().remove(gameOverPage);\n\t\t\tgameOverPage = null;\t// set the page to null\n\t\t}\n\t\tscoreboard = new Scoreboard(this);\t\t// create a new scoreboard to track the game's score\n\t\tboard = new Board(this);\n\t\tvalidate(); \t// validate and repaint to reflect the removal of old panels\n\t\trepaint();\t\t// repaint the board\n\t\tthis.add(board, BorderLayout.EAST);\t\t// add board to the frame\n\t\tthis.add(scoreboard, BorderLayout.EAST);\t// add scoreboard to the frame\n\t}", "public Gomuku() {\n X = new ImageIcon(getURL(\"whitestone.jpg\"));\n O = new ImageIcon(getURL(\"blackstone.jpg\"));\n B = new ImageIcon(getURL(\"blank.jpg\"));\n \n // initialize board value to -1\n for ( int i=0; i<csize; i++ ) {\n for ( int k=0; k<csize; k++ ) {\n board[i][k] = -1;\n }\n }\n\n \t// create an array of 225 buttons\n for ( int i=0; i<gsize; i++) {\n jButton[i] = new JButton();\n }\n \n setLayout(new GridLayout(csize, csize));\n \n // setting default image as \"blank\"\n for ( int i=0; i<gsize; i++) {\n // starts top left\n \t jButton[i].setIcon(B);\n \n }\n\n for ( int i=0; i<gsize; i++) {\n final int j = i;\n jButton[j].addActionListener( new ActionListener() {\n // when a jButton is clicked, this method is called\n public void actionPerformed(ActionEvent evt) {\n if ( player == 0 ) { // Player O - blackstone\n if (jButton[j].getIcon().equals(B)) {\n jButton[j].setIcon(O); // value of current button read left to right and then top to bottom\n \n board[j/csize][j%csize] = 0;\n int win = 1;\n win = checkrow(board,j/csize,0);\n if ( win == 0 ) {\n win = checkcol(board,j%csize,0);\n }\n if ( win == 0 ) {\n win = checkdiag(board,0 , j/csize, j%csize);\n }\n player = 1; // switches player\n markers++;\n\n if ( win == 1 ) {\n exitAction(\"Blackstone wins!\\n\");\n }\n if ( markers == gsize ) { // if all blocks have been taken\n exitAction(\"Draw!\\n\");\n }\n } \n } else { // Player X - whitestone = 1\n if (jButton[j].getIcon().equals(B)) {\n jButton[j].setIcon(X);\n board[j/csize][j%csize] = 1;\n int win = 1;\n win = checkrow(board,j/csize,1);\n if ( win == 0 ) {\n win = checkcol(board,j%csize,1);\n }\n if ( win == 0 ) {\n win = checkdiag(board, 1, j/csize, j%csize );\n }\n player = 0;\n markers++;\n\n if ( win == 1 ) {\n exitAction(\"Whitestone wins!\\n\");\n }\n if ( markers == gsize ) {\n exitAction(\"Draw!\\n\");\n }\n } \n }\n }\n });\n } \n\n for ( int i=0; i<gsize; i++) {\n add(jButton[i]);\n }\n \n }", "String drawBoard();", "public void initChessBoardAutomaticly() {\r\n\t\tthis.initPieces();\r\n\t\tthis.clearBoard();\r\n\t\tfor (int i=0; i<board.size(); i++) {\r\n\t\t\tChessBoardBlock b = board.get(order[i]);\r\n\t\t\tb.setBorderPainted(false);\r\n\t\t}\r\n\t\tfor (int i = 0, w = 0, b = 0, s = 0; i < 8 * 8; i++) {\r\n\r\n\t\t\t// Assign1, Disable board clickable\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setEnabled(false);\r\n\r\n\t\t\t// Assign1, Put black pieces and record the position\r\n\t\t\tif (i % 2 != 1 && i >= 8 && i < 16) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t} else if (i % 2 != 0 && (i < 8 || (i > 16 && i < 24))) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Assign1, Put white pieces and record the position\r\n\t\t\telse if (i % 2 != 0 && i > 48 && i < 56) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t} else if (i % 2 != 1\r\n\t\t\t\t\t&& ((i >= 40 && i < 48) || (i >= 56 && i < 64))) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\t\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t}\r\n\r\n\t\t\t// Assign1, Put empty pieces on the board\r\n\t\t\t// Actually, empty pieces will not display on the board, they are\r\n\t\t\t// not existing\r\n\t\t\t// to chess players, just for calculation\r\n\t\t\telse {\r\n\t\t\t\tChessPiece spacePiece = spacePieces[s];\r\n\t\t\t\tspacePiece.position = order[i];\r\n\t\t\t\tbody.add(spacePiece);\r\n\t\t\t\tpiece.put(order[i], spacePiece);\r\n\t\t\t\tspacePiece.setVisible(false);\r\n\t\t\t\ts++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.setText(\"Chess Board has been initialized automatically\");\r\n\t\tthis.startGame();\r\n\t}", "public void initBoard(){\n System.out.print(\" \");\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++){\n board[i][j] = 'O';\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public static void initBoard()\r\n\t{\n\t\tfor ( int r=0; r<3; r++ )\r\n\t\t\tfor ( int c=0; c<3; c++ )\r\n\t\t\t\tboard[r][c] = ' ';\r\n\t}", "public void drawFromDeck(MapBoard board){\n\t\tdiscardUsedCards();\n\t\tint temp1=5-playerCards.size();\n\t\tfor (int i = 0; i < temp1; i++) {\n\t\t\tif(Helper.playerCardSet.size()>0)\n\t\t\t{\n\t\t\t\tPlayerCardActions temp=Helper.getRandomPlayerCard();\n\t\t\t\ttemp.p=this; \n\t\t\t\ttemp.board=board;\n\t\t\t\tplayerCards.add(temp);\n\t\t\t\tif (temp.playerCardName.equals(\"Gaspode\")||temp.playerCardName.equals(\"FreshStartClub\")||temp.playerCardName.equals(\"Wallace Sonky\")) {\n\t\t\t\t\tinterruptCollection.add(temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void displayBoard(){\r\n System.out.println(board.toString());\r\n }", "private void initBoardPanel()\r\n {\r\n for(int i = 0; i < 3; i++)\r\n {\r\n for(int j = 0; j < 3; j++)\r\n {\r\n buttons[i][j] = new JButton(\" \");\r\n buttons[i][j].addActionListener(bh);\r\n buttons[i][j].setEnabled(false);\r\n boardpanel.add(buttons[i][j]);\r\n }\r\n }\r\n }", "public void printBoard() {\n \tfor(int i = 7; i >= 0; i--) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tSystem.out.print(\"\"+getPiece(j, i).getColor().toString().charAt(0)+getPiece(j, i).getName().charAt(0)+\"\\t\");\n \t\t}\n \t\tSystem.out.println();\n \t}\n }", "private void initializeBoard(){\r\n checks =new int[][]{{0,2,0,2,0,2,0,2},\r\n {2,0,2,0,2,0,2,0},\r\n {0,2,0,2,0,2,0,2},\r\n {0,0,0,0,0,0,0,0},\r\n {0,0,0,0,0,0,0,0},\r\n {1,0,1,0,1,0,1,0},\r\n {0,1,0,1,0,1,0,1},\r\n {1,0,1,0,1,0,1,0}};\r\n }" ]
[ "0.72060794", "0.7087646", "0.6987039", "0.6886608", "0.68652135", "0.6816263", "0.6811079", "0.6746709", "0.6643165", "0.6611248", "0.65996975", "0.6598536", "0.65755093", "0.65742624", "0.65522", "0.6532221", "0.64692664", "0.6461921", "0.64498705", "0.6444937", "0.64328325", "0.64307207", "0.6417206", "0.64056844", "0.638397", "0.6376528", "0.63708615", "0.6369337", "0.63656676", "0.6356645", "0.6341021", "0.6339082", "0.6337462", "0.633615", "0.63306874", "0.6327899", "0.63258713", "0.6311537", "0.63114667", "0.63084733", "0.62921387", "0.6282348", "0.62788224", "0.6274196", "0.62697417", "0.62642443", "0.626322", "0.62621087", "0.6259886", "0.6254108", "0.6251929", "0.623565", "0.6221056", "0.622024", "0.62009126", "0.619684", "0.6188495", "0.6187753", "0.61828756", "0.61781114", "0.61734235", "0.61726815", "0.61706454", "0.61698896", "0.616512", "0.616061", "0.61602545", "0.6152813", "0.6149534", "0.6148964", "0.61479783", "0.6146995", "0.61408377", "0.6135363", "0.6126227", "0.6119173", "0.611661", "0.61158556", "0.6110312", "0.6109276", "0.6107649", "0.6107277", "0.6105902", "0.61022156", "0.60971385", "0.60920227", "0.6087107", "0.608524", "0.6080769", "0.6079692", "0.6078925", "0.6078531", "0.6074255", "0.6066218", "0.6065117", "0.6064891", "0.6062006", "0.6060762", "0.60571384", "0.605477", "0.60528284" ]
0.0
-1
prosedur untuk menyimpan display ke file
public void displayToFile(){ String data = ""; try{ FileWriter fstream = new FileWriter("output.txt", true); BufferedWriter out = new BufferedWriter(fstream); for (int i=0 ; i<40; i++) { for (int j=0; j<146 ;j++ ){ if (board.getCharacter(j,i) == '0') { data += '-'; } else { data += board.getCharacter(j,i); } } out.write(data); data = ""; } out.close(); } catch (Exception e){ System.err.println("Error: " + e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadShow(File f) {\n \n }", "private void viewFileChooser() {\n try {\n JFileChooser chooser = new JFileChooser();\n chooser.showOpenDialog(null);\n f = chooser.getSelectedFile();\n// this.attachmentName = f.getName();\n// this.attachmentPath = f.getAbsolutePath();//dan mokdda karanna ona// meke file ek \n// txtAttachment.setText(attachmentPath);\n System.out.println(f.getName());\n System.out.println(f.getAbsolutePath());\n \n// Icon icon = new ImageIcon(getClass().getResource(\"/image/file.png\"));\n lblPath.setText(f.getName());\n// lblPath.setIcon(icon);\n lblPath.setVisible(true);\n \n \n } catch (NullPointerException e) {\n \n } \n }", "private static void showFiles(File f) {\n\t\n}", "void doShowFiles()\n\t{\n\t\ttry\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tIterator itr = m_fileInfo.getAllFiles();\n\n\t\t\twhile(itr.hasNext())\n\t\t\t{\n\t\t\t\tSourceFile m = (SourceFile) ((Map.Entry)itr.next()).getValue();\n\n\t\t\t\tString name = m.getName();\n\t\t\t\tint id = m.getId();\n\t\t\t\tString path = m.getFullPath();\n\n\t\t\t\tsb.append(id);\n\t\t\t\tsb.append(' ');\n\t\t\t\tsb.append(path);\n\t\t\t\tsb.append(\", \"); //$NON-NLS-1$\n\t\t\t\tsb.append(name);\n\t\t\t\tsb.append(m_newline);\n\t\t\t}\n\t\t\tout( sb.toString() );\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noSourceFilesFound\")); //$NON-NLS-1$\n\t\t}\n\t}", "public FileViewer()\n {\n // initialise instance variables\n super(\"File Viewer 1.0\");\n setSize(300,400);\n getContentPane().add(txtIsiFile);\n try{\n txtIsiFile.setText(fl1.bacaFile(\"data.txt\"));\n }catch(Exception e){e.printStackTrace();}\n setVisible(true);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tint re = jfc.showOpenDialog(f);\n\t\t\t\tfile = jfc.getSelectedFile();\n\t\t\t\tif (re == 0) {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tFileReader fr = new FileReader(file);\n\t\t\t\t\t\tint ch;\n\t\t\t\t\t\tString str = \"\";\n\n\t\t\t\t\t\twhile ((ch = fr.read()) != -1) {\n\t\t\t\t\t\t\tstr += (char) ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tta.setText(str);\n\t\t\t\t\t\tfr.close();\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\tSystem.out.println(ex.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void dialogEcritureFichier(File file) {\n\t\tJOptionPane.showMessageDialog(null, \"le fichier \" + file.getName() +\" a été écrit\", \"Info\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "private void openFile() {\n\t\t\n\t\n\t\t\t\n\t\tFile file = jfc.getSelectedFile();\n\t\tint a = -1;\n\t\tif(file==null&&!jta.getText().equals(\"\"))\n\t\t{\n\t\t\ta = JOptionPane.showConfirmDialog(this, \"저장?\");\n\t\t\n\t\t}\n\t\tswitch (a){\n\t\tcase 0:\n\t\t\ttry {\n\t\t\t\tint c = -1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tc = jfc.showSaveDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || c ==0)\n\t\t\t\t{\t\n\t\t\t\t\tFileWriter fw = new FileWriter(jfc.getSelectedFile());\n\t\t\t\t\tfw.write(jta.getText());\n\t\t\t\t\tfw.close();\n\t\t\t\t\tSystem.out.println(\"파일을 저장하였습니다\");\n\t\t\t\t}\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\ttry {\n\t\t\t\tint j=-1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tj = jfc.showOpenDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || j == 1)\n\t\t\t\t{\t\n\t\t\t\t\tFileReader fr = new FileReader(file);\n\n\t\t\t\t\tString str=\"\";\n\t\t\t\t\twhile((j=fr.read())!=-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr = str+(char)j;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tjta.setText(str);\n\t\t\t\t\t\n\t\t\t\t\tsetTitle(file.getName());\n\t\t\t\t\t\n\t\t\t\t\tfr.close();\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tcatch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tint d= jfc.showOpenDialog(this);\n\t\t\n\t\tif(d==0)\n\t\t\ttry {\n\t\t\t\tFileReader fr = new FileReader(jfc.getSelectedFile());\n\t\t\t\tint l;\n\t\t\t\tString str=\"\";\n\t\t\t\twhile((l=fr.read())!=-1)\n\t\t\t\t{\n\t\t\t\t\tstr = str+(char)l;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tjta.setText(str);\n\t\t\t\t\n\t\t\t\tfr.close();\n\t\n\t\t\t\t\t\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t}", "public void actionPerformed(ActionEvent e) {\n\t \tJFileChooser fileChooser = new JFileChooser(lastChoosenDir);\n\t int returnValue = fileChooser.showOpenDialog(null);\n\t if (returnValue == JFileChooser.APPROVE_OPTION) {\n\t selectedFile = fileChooser.getSelectedFile();\n\t lastChoosenDir = selectedFile.getParentFile();\n\t System.out.println(selectedFile.getName());\n\t // lblSlika=new JLabel(\"aa\");\n\t displayChosen();\n\t \n\t // content.add(lblSlika);\n\t \n\t }\n\t }", "private static void printFileOperationMenu() {\n System.out.println(\"-------------------------------------\");\n System.out.println(\"File operation menu\");\n System.out.println(\"1. Retrieve file names from directory\");\n System.out.println(\"2. Add a file.\");\n System.out.println(\"3. Delete a file.\");\n System.out.println(\"4. Search a file.\");\n System.out.println(\"5. Change directory.\");\n System.out.println(\"6. Exit to main menu.\");\n\n }", "public void showFile() throws FileNotFoundException, IOException{\r\n ArrayList<String> arxiu = new ArrayList<>();\r\n \r\n BufferedReader br = new BufferedReader(new FileReader(fitxerUsuaris));\r\n \r\n String usuari;\r\n \r\n while((usuari = br.readLine()) != null){\r\n arxiu.add(usuari);\r\n }\r\n \r\n for (int i = 0; i < arxiu.size(); i++) {\r\n System.out.println(arxiu.get(i));\r\n }\r\n }", "@FXML\n public void openFile(Event e) {\n String inputData = \"\";\n File file = chooser.showOpenDialog(open.getScene().getWindow());\n\n try {\n inputData = new String(Files.readAllBytes(file.toPath()));\n } catch (IOException error) {\n error.getSuppressed();\n }\n\n input.setFont(Font.font(\"monospaced\"));\n input.setText(inputData);\n\n Stage primary = (Stage) open.getScene().getWindow();\n primary.setTitle(file.getName());\n }", "public void openFile() {\n\t\tJFileChooser choose = new JFileChooser();\n\t\t if(choose.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n\t\t\t\ttry {\n\t\t\t\t\tFile selectedFile = choose.getSelectedFile();\n\t\t\t\t\tdir=choose.getCurrentDirectory().toString();\n\t\t\t\t\tScanner readFile = new Scanner(selectedFile);\n\t\t\t\t\tif(!frame.textArea.getText().isEmpty()) {\n\t\t\t\t\t\tframe.textArea.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t\twhile(readFile.hasNext()) {\n\t\t\t\t\t\tString currentLine = readFile.nextLine();\n\t\t\t\t\t\tframe.textArea.append(currentLine+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\tframe.setTitle(selectedFile.getName()+\"-Text Editor\");\n\t\t\t\t\tframe.originalText=frame.textArea.getText();\n\t\t\t\t\treadFile.close();\n\t\t\t\t} catch (FileNotFoundException ex) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"File Not Found\");\n\t\t\t\t}\n\n\t\t }\n\t}", "private void helperDisplayProjectFiles ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tString[] fileNameList = DataController.scenarioGetFileNames();\r\n\r\n\t\t\tmainFormLink.getComponentPanelLeft().getComponentComboboxFileName().removeAllItems();\r\n\r\n\t\t\tfor (int i = 0; i < fileNameList.length; i++)\r\n\t\t\t{\r\n\t\t\t\tmainFormLink.getComponentPanelLeft().getComponentComboboxFileName().addItem(fileNameList[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "void load_from_file(){\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a file\", FileDialog.LOAD);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"load path: \" + file_withpath);\t\n\t\t\n\t\t\t \n\t\t\t /**\n\t\t\t * read object from file \n\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(file_withpath));\n\n\t\t\t\t\tKey_Lists = Key_Lists.copy((key_lists) in.readObject());\n\n\t\t\t\t\tkeys_area.setText(Key_Lists.arraylist_tostring());\t\t\n\t\t\t\t\t\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tinfo_label.setForeground(green);\n\t\t\t\t\tinfo_label.setText(\"file loaded :D\");\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tinfo_label.setForeground(white);\n\t\t\t\t\tinfo_label.setText(\"wrong file format\");\n\t\t\t\t\tSystem.out.println(\"io exception\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (ClassNotFoundException 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\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tFile file = new File(FILE_NAME);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFileInputStream fis = openFileInput(FILE_NAME);\n\t\t\t\t\tInputStreamReader isr = new InputStreamReader(fis);\n\t\t\t\t\t\n\t\t\t\t\tchar[] data = new char[fis.available()];\n\t\t\t\t\tisr.read(data);\n\t\t\t\t\t\n\t\t\t\t\tString buf = new String(data);\n\t\t\t\t\ttext.setText(buf);\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\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\t\t\n\t\t\t}", "private static void info ( File f ) {\n\tString nume = f . getName () ;\n\tif( f.isFile () )\n\tSystem.out.println ( \" Fisier : \" + nume ) ;\n\telse\n\tif( f.isDirectory () )\n\tSystem.out.println ( \" Director : \" + nume ) ;\n\tSystem.out.println (\n\t\" Cale absoluta : \" + f.getAbsolutePath () +\n\t\" \\n Poate citi : \" + f.canRead () +\n\t\" \\n Poate scrie : \" + f.canWrite () +\n\t\" \\n Parinte : \" + f.getParent () +\n\t\" \\n Cale : \" + f.getPath () +\n\t\" \\n Lungime : \" + f.length () +\n\t\" \\n Data ultimei modificari : \" +\n\tnew Date ( f.lastModified () ) ) ;\n\tSystem.out.println ( \" --------------\" ) ;\n\t}", "void selectFile(){\n JLabel lblFileName = new JLabel();\n fc.setCurrentDirectory(new java.io.File(\"saved\" + File.separator));\n fc.setDialogTitle(\"FILE CHOOSER\");\n FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(\n \"json files (*.json)\", \"json\");\n fc.setFileFilter(xmlfilter);\n int response = fc.showOpenDialog(this);\n if (response == JFileChooser.APPROVE_OPTION) {\n lblFileName.setText(fc.getSelectedFile().toString());\n }else {\n lblFileName.setText(\"the file operation was cancelled\");\n }\n System.out.println(fc.getSelectedFile().getAbsolutePath());\n }", "private void displayContents(String file)throws CoeusException, MalformedURLException{\r\n int selectedRow = subAwardBudget.tblSubAwardBudget.getSelectedRow();\r\n if(selectedRow == -1) {\r\n CoeusOptionPane.showInfoDialog(\"Select a Row\");\r\n return ;\r\n }\r\n BudgetSubAwardBean budgetSubAwardBean= (BudgetSubAwardBean)this.data.get(selectedRow);\r\n if(file.equals(BudgetSubAwardConstants.PDF) && budgetSubAwardBean.getPdfAcType() != null) {\r\n //PDF Updated. open file from local filesystem\r\n File fileObj = new File(budgetSubAwardBean.getPdfFileName());\r\n URL url = fileObj.toURL();\r\n URLOpener.openUrl(url);\r\n }else {\r\n displayContents(file, budgetSubAwardBean);\r\n }\r\n }", "public void showSelectedFiles() {\n\t\tCIVLTable tbl_fileTable = (CIVLTable) getComponentByName(\"tbl_fileTable\");\n\t\tDefaultTableModel fileModel = (DefaultTableModel) tbl_fileTable\n\t\t\t\t.getModel();\n\t\tif (fileModel.getRowCount() != 0) {\n\t\t\tfileModel.setRowCount(0);\n\t\t\ttbl_fileTable.clearSelection();\n\t\t}\n\n\t\tArrayList<File> files = currConfig.getSelectedFiles();\n\t\tfor (int i = 0; i < files.size(); i++) {\n\t\t\tFile f = files.get(i);\n\t\t\tfileModel\n\t\t\t\t\t.addRow(new Object[] { f.getName(), f.getPath(), \"Delete\" });\n\t\t}\n\t}", "public void loadFile() {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tString filename = JOptionPane.showInputDialog(null,\"Enter the filename.\");\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\n\t\t\tMinLFile nminl = new MinLFile(filename);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\n\t\t\t\t\n\t\t\t\tnminl.CodeArea.setText(\"\");\n\t\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tDocument doc = nminl.CodeArea.getDocument();\n\t\t\t\t\ttry {\n\t\t\t\t\tdoc.insertString(doc.getLength(), str, null);\n\t\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\n\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t\t\t\n\t\t\tJComponent panel = nminl;\n\t\t\t\n\t\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\t\tfilename);\t\t\n\t\t\ttabbedPane.setMnemonicAt(0, 0);\n\t\t}\t\n\t}", "public Menu createFileMenu();", "public void displayText(String filename) {\r\n\t\tSystem.out.println(\"UNIMPLEMENTED: display text from file \" + filename);\r\n\t\t// TODO implement text display\r\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n int returnVal = fc.showOpenDialog(panel);\n if(returnVal == JFileChooser.APPROVE_OPTION){\n file = fc.getSelectedFile();\n System.out.println(file);\n \n try {\n Scanner scanner = new Scanner(file);\n String appendString = \"\";\n \n while(scanner.hasNext()){\n String oneString = scanner.nextLine();\n txtArea.append(oneString + \"\\n\");\n }\n \n try {\n read_characters(file.toString());\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n resultArea.append(resultString);\n resultPane.setText(resultString);\n } catch (FileNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n //Print ID table\n Map<String,Integer> map = new TreeMap<String,Integer>(userDefinedWords);\n identifierTableArea.append(\"Number of Occurences \" + \"\\t\" +\n \t\t\t\t\t\t\t\"Symbol\" + \"\\n\\n\");\n Iterator iter = \n \t\tmap.entrySet().iterator();\n while(iter.hasNext()){\n \t Map.Entry pair = \n \t\t\t (Map.Entry)iter.next();\n \t identifierTableArea.append(\n \t\t\t pair.getValue() + \"\\t\\t\" + pair.getKey() + \"\\n\");\n }\n \n }\n }", "public void getFile(JPanel panel) {\n listOfFile= new ArrayList();\n for(int x=0; x<listOfFiles.length;x++) {\n listOfFile.add(listOfFiles[x]);\n }\n if(FileManaging.isMac()) {\n if(listOfFile.contains(Mac_DS_Store))\n listOfFile.remove(Mac_DS_Store);\n if(listOfFile.contains(Mac_Option))\n listOfFile.remove(Mac_Option);\n //if(listOfFile.contains(Mac_Log))\n // listOfFile.remove(Mac_Log);\n }\n if(panel!=null)\n for(int x=0; x<listOfFile.size();x++) {\n buttons.put(x, new JButton(listOfFile.get(x).getName()));\n buttons.get(x).setVisible(true);\n buttons.get(x).setActionCommand(x+\"\");\n buttons.get(x).addActionListener(this);\n buttons.get(x).setBackground(Color.green);\n panel.add(buttons.get(x));\n }\n }", "public void Open(){\n\tJFileChooser j = new JFileChooser(\"\"); \n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"txt\", \"TXT\");\n j.setFileFilter(filter); \n\n\t// Invoke the showsOpenDialog function to show the save dialog \n int r = j.showOpenDialog(null); \n\n\t// If the user selects a file \n\tif (r == JFileChooser.APPROVE_OPTION) { \n // Set the label to the path of the selected directory \n File fi = new File(j.getSelectedFile().getAbsolutePath()); \n\n try { \n\t\t// String \n\t\tString s1 = \"\", sl = \"\"; \n\n\t\t// File reader \n\t\tFileReader fr = new FileReader(fi); \n\n\t\t// Buffered reader \n\t\tBufferedReader br = new BufferedReader(fr); \n\n\t\t// Initilize sl \n\t\tsl = br.readLine(); \n\n\t\t// Take the input from the file \n\t\twhile ((s1 = br.readLine()) != null) { \n \t\tsl = sl + \"\\n\" + s1; \n\t\t} \n\n\t\t// Set the text \n\t\tt.setText(sl); \n } \n catch (Exception evt) { \n\t\tJOptionPane.showMessageDialog(f, evt.getMessage()); \n } \n\t} \n\t// If the user cancelled the operation \n\telse\n JOptionPane.showMessageDialog(f, \"the user cancelled the operation\"); \n\t\t\n }", "public static void main(String[] args) \r\n\t{\n\t\tfinal JFrame f = new JFrame(\"显示文件夹下的内容\"); \r\n\t\tf.setSize(400, 300); f.setLocation(200, 200); \r\n\t\tf.setLayout(null); \r\n\t\tJTabbedPane tp = new JTabbedPane(); \r\n\t\tf.setContentPane(tp); \r\n\t\tf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); \r\n\t\tf.setVisible(true); \r\n\t\tFile file = new File(\"C:/filetest/file/test/flielist/\"); \r\n\t\tFile[] listFiles = file.listFiles(); \r\n\t\tfor(int i=0;i<listFiles.length;i++){ \r\n\t\t\tfinal JPanel p1 = new JPanel(); \r\n\t\t\tDefaultEditorKit kit = new DefaultEditorKit(); \r\n\t\t\tfinal JTextArea textarea = new JTextArea(25, 80); \r\n\t\t\ttry { \r\n\t\t\t\tFileReader in = new FileReader(listFiles[i]); \r\n\t\t\t\ttextarea.setText(\"\"); \r\n\t\t\t\tkit.read(in,textarea.getDocument(),0); \r\n\t\t\t\t} catch (IOException | BadLocationException e) { // TODO Auto-generated catch block \r\n\t\t\t\t\te.printStackTrace(); \r\n\t\t\t\t} \r\n\t\t\ttextarea.setLineWrap(true); \r\n\t\t\ttextarea.setWrapStyleWord(true); \r\n\t\t\tp1.add(textarea); \r\n\t\t\ttp.add(listFiles[i].getName(), p1); \r\n\t\t\t} \r\n\t\t}", "public void seleccionarFichero(){\n JFileChooser fileChooser = new JFileChooser();\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"xml\", \"xml\");\n fileChooser.setFileFilter(filter);\n fileChooser.setCurrentDirectory(new java.io.File(\"./ficheros\"));\n int seleccion = fileChooser.showOpenDialog(vista_principal);\n if (seleccion == JFileChooser.APPROVE_OPTION){\n fichero = fileChooser.getSelectedFile();\n vista_principal.getTxtfield_nombre_fichero().\n setText(fichero.getName().substring(0, fichero.getName().length()-4));\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t\t int returnVal = fc.showOpenDialog(GenerateWindow.this);\n\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File goodsoundfile = fc.getSelectedFile();\n\t\t goodSoundTF.setText(\"sounds/\"+goodsoundfile.getName());\n\t\t }}", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\n\n JFileChooser chooser = new JFileChooser(); ////apabila merah -> ALT+ENTER -> j file chooser -> TOP\n chooser.showOpenDialog(null);\n File f = chooser.getSelectedFile();\n String filename = f.getAbsolutePath();\n vpath.setText(filename);\n }", "private void openItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openItemActionPerformed\n if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\n File file = fileChooser.getSelectedFile();\n String t = \"\";\n if (file.isFile()) {\n if ((file.getName().toLowerCase().endsWith(\".jpg\")\n || file.getName().toLowerCase().endsWith(\".png\"))) {\n files.add(file.getAbsolutePath());\n flist.add(file);\n } else if (file.getName().toLowerCase().endsWith(\".pdf\")) {\n parsePDF(file.getAbsolutePath());\n flist.add(file);\n }\n t += file.getAbsolutePath() + \"\\n\";\n } else {\n for (File f : file.listFiles()) {\n if (f.isFile() && (f.getName().toLowerCase().endsWith(\".jpg\")\n || f.getName().toLowerCase().endsWith(\".png\"))) {\n files.add(f.getAbsolutePath());\n flist.add(f);\n t += f.getAbsolutePath() + \"\\n\";\n } else if (f.isFile() && f.getName().toLowerCase().endsWith(\".pdf\")) {\n parsePDF(f.getAbsolutePath());\n flist.add(f);\n t += f.getAbsolutePath() + \"\\n\";\n }\n }\n }\n textArea.setText(t);\n } else {\n System.out.println(\"File access cancelled.\");\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Excel Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"xls\"); // 파일 필터로 사용되는 확장자. *.xml 만 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tString readFilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을 알아온다.\t\t\t\t\r\n\t\t\t\tShowPatientInfo_K showPatientInfo = new ShowPatientInfo_K(readFilePath);\r\n\t\t\t}", "void showFileManagerDialog();", "public void subir_file()\n {\n FileChooser fc = new FileChooser();\n\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"PDF Files\",\"*.pdf\")\n , new FileChooser.ExtensionFilter(\"Jpg Images\",\"*.jpg\",\"*.JPEG\",\"*.JPG\",\"*.jpeg\",\"*.PNG\",\"*.png\"));\n\n File fileSelected = fc.showOpenDialog(null);\n\n if (fileSelected!= null){\n txt_ruta.setText(fileSelected.getPath());\n\n if(txt_ruta.getText().contains(\".pdf\"))\n {\n System.out.println(\"si es pdf\");\n Image image = new Image(\"/sample/Clases/pdf.png\");\n image_esquema.setImage(image);\n\n }\n else\n {\n File file = new File(txt_ruta.getText());\n javafx.scene.image.Image image = new Image(file.toURI().toString());\n image_esquema.setImage(image);\n }\n\n }\n else{\n System.out.println(\"no se seleccinoó\");\n }\n }", "public void projectPropertiesDisplay()\n\t{\n\t\ttree.setModel(null);\n\t\tredoProjectProperties();\n\t\tFileTree model = new FileTree(currentProject.toString()); //Create a new FileTree using the Selected File\n tree.setModel(model); //Set the model as the FileTree class model\n /***************************************************************************************\n * Title: FileSelectorModel \n * Author: S�bastien Le Callonnec\n * Date: September 18, 2019\n * Code version: version 1.0\n * Availability: https://www.weblogism.com/item/300/use-jtree-to-display-files-in-filesystem-ii\n * Modified slightly by the team to work with our project\n ***************************************************************************************/\n JLabel status = new JLabel(currentProject.toString());\n tree.addTreeSelectionListener(new TreeSelectionListener() \n {\n public void valueChanged(TreeSelectionEvent e) \n {\n folderNameGetter selectedNode = (folderNameGetter) tree.getLastSelectedPathComponent();\n if(selectedNode != null)\n {\n \tstatus.setText(selectedNode.getAbsolutePath());\n if (selectedNode.isFile()) \n {\n try \n {\n \tcurrentFile.setLength(0);\n \tcurrentFile.append(selectedNode);\n \tresetFileTitle();\n BufferedReader br = new BufferedReader(new FileReader(selectedNode.getAbsolutePath()));\n String line = \"\";\n String l = \"\";\n while ((line = br.readLine()) != null) \n {\n \tl += line + \"\\n\" ;\n }\n displayText(l);\n br.close();\n } \n catch (Exception exc) \n {\n exc.printStackTrace();\n }\n }\n }\n }\n });\n//*********************************************************************************************************************************************************************************************************************************\n spectralFilesScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); //Show scroll bars when necessary\n projectProperties.add(spectralFilesScrollPane); //Add to projectProperties JPanel\n redoProjectProperties();\n\t}", "@FXML\n\tpublic void openFile() {\n\t\tFileChooser openFileChooser = new FileChooser();\n\t\topenFileChooser.setInitialDirectory(userWorkspace);\n\t\topenFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\tfile = openFileChooser.showOpenDialog(ap.getScene().getWindow());\n\n\t\tuserText.clear();\n\n\t\tif (file != null) {\n\t\t\tif (file.getName().endsWith(\".txt\")) {\n\t\t\t\tfilePath = file.getAbsolutePath();\n\t\t\t\tStage primStage = (Stage) ap.getScene().getWindow();\n\t\t\t\tprimStage.setTitle(filePath);\n\t\t\t\tTab tab = tabPane.getSelectionModel().getSelectedItem();\n\t\t\t\ttab.setId(filePath);\n\t\t\t\ttab.setText(file.getName());\n\n\t\t\t\twriteToUserText();\n\t\t\t}\n\t\t}\n\t}", "@objid (\"116a5759-3df1-4c8b-bd9e-e521507f07e6\")\r\n public String searchFile() {\r\n String nomFichier = this.dialog.open();\r\n if ((nomFichier != null) && (nomFichier.length() != 0)) {\r\n this.currentFile = new File(nomFichier);\r\n this.text.setText(nomFichier);\r\n }\r\n return this.text.getText();\r\n }", "static void viewFiles()\r\n\t {\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n System.out.println(\"List of files and directories in the specified directory:\");\r\n\t for(File file : filesList) \r\n\t {\r\n\t System.out.println(\"File name: \"+file.getName());\r\n\t System.out.println(\"File path: \"+file.getAbsolutePath());\r\n\t System.out.println(\"Size :\"+file.getTotalSpace());\r\n\t System.out.println(\"last time file is modified :\"+new Date(file.lastModified()));\r\n System.out.println(\" \");\r\n\t }\r\n }", "public void KvtTartListFrissit( String sKonyvtar)\r\n {\n File cAktKvt = null ;\r\n Object aKvtTartalma[] = null ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit( \" + sKonyvtar + \")\") ;\r\n\r\n// cAktKvt = new File( \".\") ;\r\n// cAktKvt = new File( \"/home/tamas/java/Polar/hrmfiles\") ;\r\n cAktKvt = new File( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit cAktKvt = new File() utan\") ;\r\n\r\n // Az aktualis konyvtar teljes utvonalanak beirasa\r\n// Itt nyeli le a vegerol a \\-t vagy /-t :\r\n// m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) ; // getAbsolutePath()\r\n m_jKonyvtarTxtFld.setText( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) utan\") ;\r\n if ( cAktKvt != null && cAktKvt.isDirectory() == true )\r\n {\r\n aKvtTartalma = HRMFileSzuro( cAktKvt) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : HRMFileSzuro() utan\") ;\r\n\r\n if ( aKvtTartalma != null )\r\n {\r\n/*\r\nfor ( int i=0 ; i < aKvtTartalma.length ; i++ )\r\n{\r\nSystem.out.println( \"JFileValasztDlg.KvtTartListFrissit() : cKvtrkFileok[\" + i + \"]=\" + aKvtTartalma[i].toString()) ;\r\n}\r\n*/\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : .setListData() utan\") ;\r\n\r\n // Itt mar valoszinu, hogy a ListBox a konyvtar file-jait tartalmazza +++\r\n SetAktKonyvtar( sKonyvtar) ;\r\n\r\n m_jKvtTartList.setSelectedIndex( 0) ;\r\n \r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : SetAktKonyvtar() utan\") ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : setListData\") ;\r\n/*\r\n for ( nIdx = 0 ; nIdx < aKvtTartalma.length ; nIdx++ )\r\n {\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n }\r\n*/\r\n }\r\n }\r\n }", "@Override\n\t public void actionPerformed(ActionEvent arg0) {\n\t\t JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); \n\t\t\n\t\t // invoke the showsOpenDialog function to show the save dialog \n\t\t int r = j.showOpenDialog(null); \n\t\t\n\t\t // if the user selects a file \n\t\t if (r == JFileChooser.APPROVE_OPTION) \n\t\t\n\t\t { \n\t\t // set the label to the path of the selected file \n\t\t textfield.setText(j.getSelectedFile().getAbsolutePath()); \n\t\t\n\t\t } \n\t\t // if the user cancelled the operation \n\t\t \n\t\t //\n\t\t \n\t\t }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJFileChooser jfc=new JFileChooser();\n\t\t\n\t\t//显示文件和目录\n\t\tjfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES );\n\t\tjfc.showDialog(new JLabel(), \"选择\");\n\t\tFile file=jfc.getSelectedFile();\n\t\t\n\t\t//file.getAbsolutePath()获取到的绝对路径。\n\t\tif(file.isDirectory()){\n\t\t\tSystem.out.println(\"文件夹:\"+file.getAbsolutePath());\n\t\t}else if(file.isFile()){\n\t\t\tSystem.out.println(\"文件:\"+file.getAbsolutePath());\n\t\t}\n\t\t\n\t\t//jfc.getSelectedFile().getName() 获取到文件的名称、文件名。\n\t\tSystem.out.println(jfc.getSelectedFile().getName());\n\t\t\n\t}", "@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t\tFileDialog dialog = new FileDialog(shlFaststone,SWT.OPEN); \n\t\t\t\tdialog.setFilterPath(System.getProperty(\"user_home\"));//设置初始路径\n\t\t\t\tdialog.setFilterNames(new String[] {\"文本文档(*txt)\",\"所有文档\"}); \n\t\t\t\tdialog.setFilterExtensions(new String[]{\"*.exe\",\"*.xls\",\"*.*\"});\n\t\t\t\tString path=dialog.open();\n\t\t\t\tString s=null;\n\t\t\t\tFile f=null;\n\t\t\t\tif(path==null||\"\".equals(path)) {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\ttry{\n\t\t\t f=new File(path);\n\t\t\t\tbyte[] bs=Fileutil.readFile(f);\n\t\t\t s=new String(bs,\"UTF-8\");\n\t\t\t\t}catch (Exception e1) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tMessageDialog.openError(shlFaststone, \"出错了\", \"打开\"+path+\"出错了\");\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t \n\t\t\t\ttext = new Text(composite_4, SWT.BORDER | SWT.WRAP\n\t\t\t\t\t\t| SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL\n\t\t\t\t\t\t| SWT.MULTI);\n\t\t\t\ttext.setText(s);\n\t\t\t\tcomposite_1.layout();\n\t\t\t\tshlFaststone.setText(shlFaststone.getText()+\"\\t\"+f.getName());\n\t\t\t\t\t\n\t\t\t\tFile f1=new File(path);\n\t\t\t\tImageData imageData;\n\t\t\t\ttry {\n\t\t\t\t\timageData = new ImageData( new FileInputStream( f1));\n\t\t\t\t\tImage image=new Image(shlFaststone.getDisplay(),imageData);\n\t\t\t\t\tlblNewLabel_3.setImage(image);\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n File selectedFile;\n JFileChooser fileChooser = new JFileChooser();\n int reply = fileChooser.showOpenDialog(null);\n if (reply == JFileChooser.APPROVE_OPTION) {\n selectedFile = fileChooser.getSelectedFile();\n geefBestandTextField1.setText(selectedFile.getAbsolutePath());\n }\n\n }", "void openFile() {\n\t\tJFileChooser fileChooser = new JFileChooser(desktopPath);\n\t\tint returnVal = fileChooser.showOpenDialog(null);\n if(returnVal == JFileChooser.APPROVE_OPTION) {\n \tString filePath = fileChooser.getSelectedFile().getPath();\n File file = new File(filePath);\n textEditor.setText(\"\");\n try {\n \tScanner in = new Scanner(file);\n \twhile(in.hasNextLine()) {\n \t\ttextEditor.append(in.nextLine()+'\\n');\n \t}\n \tin.close();\n \ttextAreaChanged = false;\n \tsavedFilePath = filePath;\n } catch (Exception ex) {\n \terrorTextArea.setForeground(Color.RED);\n\t\t\t\terrorTextArea.setText(\"Error loding file\");\n\t\t\t}\n }\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString cmd = e.getActionCommand();\n\t\tFile file;\n\t\tfile = jfc.getSelectedFile();\n\t\tswitch (cmd) {\n\t\tcase \"저장\":\n\t\t\tsaveFile();\n\t\t\tbreak;\n\t\tcase \"열기\":\n\t\t\t\n\t\t\topenFile();\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"새파일\":\n\t\t\tjta.setText(\"\");\n\t\t\tbreak;\n\t\tcase \"종료\":\n\t\t\tSystem.exit(0);\n\t\t\tbreak;\n\t\t}\n\t\t/*if(cmd.equals(\"저장\"))\n\t\t{\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(\"c:/output/notepad.txt\");\n\t\t\tfw.write(jta.getText());\n\t\t\tfw.close();\n\t\t\tSystem.out.println(\"파일을 생성하였습니다\");\n\t\t} catch (Exception e2) {\n\t\t\t// TODO: handle exception\n\t\t\tSystem.out.println(e2.getMessage());\n\t\t}\n\t\t}\n\t\t*/\n\t}", "private void choosefileBtnActionPerformed(ActionEvent evt) {\r\n JFileChooser filechooser = new JFileChooser();\r\n int returnValue = filechooser.showOpenDialog(panel);\r\n if(returnValue == JFileChooser.APPROVE_OPTION) {\r\n filename = filechooser.getSelectedFile().toString();\r\n fileTxtField.setText(filename);\r\n codeFile = filechooser.getSelectedFile();\r\n assemblyreader = new mipstoc.read.CodeReader(codeFile);\r\n inputTxtArea.setText(assemblyreader.getString());\r\n }\r\n \r\n }", "public void actionPerformed(ActionEvent e) {\n\tif (\"open\".equals(e.getActionCommand())) {\n\t\tfd.show(); \n\t\t if (fd.getFile() == null) \n\t\t { \n\t\t Label1.setText(\"You have not select\"); \n\t\t } else \n\t\t { \n\t\t in = new File [30];\n\t\t\tin = fd.getFiles ();\t\n\t\t\tLabel1.setText(\"You have selected \" + in.length + \" images\"); \n\t\t }\n\t}\n\tif (\"apply\".equals(e.getActionCommand())) {\n\t\tif (in == null) Label1.setText(\"You have not select\"); \n\t\telse {\n\t\t\tif (in.length < 30) Label1.setText(\"Chưa đủ 30 ảnh. Đã có \" + in.length + \"/30 ảnh\"); \n\t\t\telse {\n\t\tString S = nameImage.getText();\n\t\tif (S.equals(\"\")) Label1.setText(\"Không được để trống tên\");\n\t\telse {\n\t\tFile file = new File(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\"+ S);\n\t\t if (!file.exists()) {\n\t\t if (file.mkdir()) {\n\t\t System.out.println(\"Directory is created!\");\n\t\t } else {\n\t\t System.out.println(\"Failed to create directory!\");\n\t\t }\n\t\t }\n\t\t InputStream inStream= null;\n\t\t OutputStream outStream = null;\n\t\t \n\t\t //for(int i = 0; i <= in.length - 1; i ++) System.out.println(\"i = \" + i +\" name: \" + in[i].toString());\n\t\t \n\t\t try {\n\t\t\t //File [] getFiles () \n\t\t\t for(int i = 0; i <= in.length - 1; i ++) {\n\t\t\t if (i == 30) {\n\t\t\t\t //Label1.setText(\"Thừa ảnh. Bỏ từ ảnh \"+ in[i].getName()); \n JOptionPane.showMessageDialog(fr, \"Thừa ảnh. Bỏ từ ảnh \"+ in[i].getName());\n\t\t\t break;\n\t\t\t }\n\t\t inStream = new FileInputStream(in[i]);\n\t\t outStream = new FileOutputStream(new File(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\"+ S+\"\\\\icon\"+(i+1)+\".jpg\"));\n\n\t\t int length;\n\t\t byte[] buffer = new byte[2097152];\n\n\t\t // copy the file content in bytes\n\t\t while ((length = inStream.read(buffer)) > 0) {\n\t\t outStream.write(buffer, 0, length);\n\t\t }\n\t\t\t }\n\t\t System.out.println(\"File is copied successful!\");\n\t\t \n\t\t } catch (IOException ex) {\n\t\t ex.printStackTrace();\n\t\t }\t\t \n\t\t fr.setVisible(false);\n\t\t}}}\n\t}\n\tif (\"replace\".equals(e.getActionCommand())) {\n\t\tif (in == null) Label1.setText(\"You have not select\"); \n\t\telse {\n\t\t\tif (in.length > 30) Label1.setText(\"Thừa ảnh\"); \n\t\t\telse {\n\t\t\tfd.setDirectory(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\");\n\t\t\tfd.show(); \n\t\t\tFile[] in2;\n\t\t\t in2 = new File [30];\n\t\t\t\tin2 = fd.getFiles ();\n\t\t File tmp = new File(in2[0].getParent());\n\t\t String tv = tmp.getName();\n\t\t int kq = 0;\n\t\t File folder = new File(\"D:\\\\java\\\\PROJECT_I\\\\src\");\n\t\t\t //&& s != \"HighScore\" && s !=\"icon\" && s != \"icon\" && s != \"sound\"\n\t\t\t for (final File fileEntry : folder.listFiles()) {\n\t\t\t if (fileEntry.isDirectory()) {\n\t\t\t \tString s = fileEntry.getName();\n\t\t if (!s.equals(\"Game_lat_hinh\") && !s.equals(\"HighScore\") && !s.equals(\"icon\") && !s.equals(\"img\") && !s.equals(\"sound\")) {\n\t\t \tif (s.equals(tv)) kq = 1; \t\n\t\t }\n\t\t\t }\n\t\t\t }\n\t\t if (kq == 0) Label1.setText(\"File đã chọn không trong thư viện\" );\n\t\t else {\n if (in2.length != in.length ) Label1.setText(\"Số lượng chọn sai . Đã chọn\" + in2.length + \"/\" + in.length + \" ảnh\"); \n else {\n\t\t InputStream inStream= null;\n\t\t OutputStream outStream = null;\n\t\t \n\t\t //for(int i = 0; i <= in.length - 1; i ++) System.out.println(\"i = \" + i +\" name: \" + in[i].toString());\n\t\t \n\t\t try {\n\t\t\t //File [] getFiles () \n\t\t\t for(int i = 0; i <= in2.length - 1; i ++) {\t\t\n\t\t inStream = new FileInputStream(in[i]);\n\t\t outStream = new FileOutputStream(new File(in2[i].getAbsolutePath()));\n\t\t\t in2[i].delete();\n\t\t int length;\n\t\t byte[] buffer = new byte[2097152];\n\n\t\t // copy the file content in bytes\n\t\t while ((length = inStream.read(buffer)) > 0) {\n\t\t outStream.write(buffer, 0, length);\n\t\t }\n\t\t\t }\n\t\t System.out.println(\"File is copied successful!\");\n\t\t \n\t\t } catch (IOException ex) {\n\t\t ex.printStackTrace();\n\t\t }\t\t \n\t\t fr.setVisible(false);\n }}}}\n}\n}", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t int returnVal = fc.showOpenDialog(GenerateWindow.this);\n\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File badsoundfile = fc.getSelectedFile();\n\t\t badSoundTF.setText(\"sounds/\"+badsoundfile.getName());\n\t\t }}", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n JFileChooser fileChooser = new JFileChooser();\r\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"*.Images\", \"jpg\", \"gif\", \"png\");\r\n fileChooser.addChoosableFileFilter(filter);\r\n int result1 = fileChooser.showOpenDialog(null);\r\n if(result1 == JFileChooser.APPROVE_OPTION) {\r\n \tselectedFile = fileChooser.getSelectedFile();\r\n \treview.setText(selectedFile.getAbsolutePath());\r\n }\r\n }", "private JMenu createFileMenu() {\n\t\tJMenu menu = new JMenu(\"File\"); \n\t\tmenu.add(createDetectiveNotes());\n\t\tmenu.add(createFileExitItem());\n\t\treturn menu;\n\t}", "public void openFile(ActionEvent e) {\r\n JFileChooser chooser = new JFileChooser();\r\n\r\n int returnVal = chooser.showOpenDialog(null);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) {\r\n this.is_alg_started = false;\r\n this.is_already_renumbered = false;\r\n if (e.getActionCommand().equals(\"nodelist\")) {\r\n this.nodefileText.setText(chooser.getSelectedFile().getAbsolutePath());\r\n }\r\n if (e.getActionCommand().equals(\"edgelist\")) {\r\n this.edgeFileText.setText(chooser.getSelectedFile().getAbsolutePath());\r\n }\r\n }\r\n }", "@FXML\n void loadButtonClicked(ActionEvent event) throws FileNotFoundException\n {\n FileChooser file = new FileChooser();\n\n file.setTitle(\"Load file (.txt)\");\n\n file.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n\n File selectedFile = file.showOpenDialog(listView.getScene().getWindow());\n\n // Create new file with all info on file, do this in a method\n loadFile(selectedFile);\n\n // Send all this info to the list in order to create new one\n for(int i=0; i<Item.getToDoList().size(); i++)\n {\n // Display items\n display();\n\n }\n }", "private JMenu getMnuFile() {\r\n\t\tif (mnuFile == null) {\r\n\t\t\tmnuFile = new JMenu();\r\n\t\t\tmnuFile.setText(\"File\");\r\n\t\t\tmnuFile.add(getMniOpen());\r\n\t\t\tmnuFile.add(getSepFile1());\r\n\t\t\tmnuFile.add(getMniExit());\r\n\t\t}\r\n\t\treturn mnuFile;\r\n\t}", "private void showInformationAboutWrongFile(Shell shell) {\n\t\tMessageDialog\n \t.openInformation(\n \t\t shell, \n \t\t \"Info\",\n \t\t \"Please select a *.\" + TestCasePersister.FILE_EXTENSION + \" file\");\n\t}", "private void popAbout() {\n try {\n //File file=new File(filepath);\n Desktop.getDesktop().open(new java.io.File(\"about.pdf\"));\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(rootPane,\"File not found or supported\");\n }\n }", "private void abrirFichero() {\r\n\t\tJFileChooser abrir = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tabrir.setFileFilter(filtro);\r\n\t\tif(abrir.showOpenDialog(abrir) == JFileChooser.APPROVE_OPTION){\r\n\t\t\ttry {\r\n\t\t\t\tGestion.liga = (Liga) Gestion.abrir(abrir.getSelectedFile());\r\n\t\t\t\tGestion.setAbierto(true);\r\n\t\t\t\tGestion.setFichero(abrir.getSelectedFile());\r\n\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t} catch (ClassNotFoundException | IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"No se ha podido abrir el fichero\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void itemFileButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Raffle Items File\");\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n itemFile = chooser.getSelectedFile();\n itemFileLabel.setText(getFileName(itemFile));\n pcs.firePropertyChange(\"ITEM\" , null, itemFile);\n }\n }", "private String displayPDFFileDialog() {\r\n String fileName = null;\r\n if(fileChooser == null) {\r\n // COEUSQA-1925: Narrative upload recall the last folder from which an upload Can't be done - Start\r\n// fileChooser = new JFileChooser();\r\n fileChooser = new CoeusFileChooser(CoeusGuiConstants.getMDIForm());\r\n if(budgetSubAwardFileFilter == null) {\r\n budgetSubAwardFileFilter = new BudgetSubAwardFileFilter();\r\n }\r\n fileChooser.setFileFilter(budgetSubAwardFileFilter);\r\n fileChooser.setAcceptAllFileFilterUsed(false);\r\n }\r\n// int selection = fileChooser.showOpenDialog(subAwardBudget);\r\n fileChooser.showFileChooser();\r\n if(fileChooser.isFileSelected()){\r\n // if(selection == JFileChooser.APPROVE_OPTION) {\r\n// File file = fileChooser.getSelectedFile();\r\n File file = fileChooser.getFileName();\r\n // COEUSQA-1925: Narrative upload recall the last folder from which an upload Can't be done - End\r\n fileName = file.getAbsolutePath();\r\n }\r\n return fileName;\r\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString s=e.getActionCommand();\r\n\t\r\n\t\tif(s.equalsIgnoreCase(\"open\"))\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\r\n\t\t{\r\n\t\t\tstr=\"\";msg=\"\";\r\n\t\t\tFileDialog fd=new FileDialog(this,\"openfile\",FileDialog.LOAD);\r\n\t\t//to be added\r\n\t\t\tfd.setVisible(true);\r\n\t\t\tdir=fd.getDirectory();\r\n\t\t\t//path is got by directory\r\n\t\t\tfname=fd.getFile();\r\n\t\t\t//fname will get the name of the file so together we get teh full location\r\n\t\t\tFileInputStream fis=new FileInputStream(dir+fname);\r\n\t\t\t//file inputstream reader class obj is fis \r\n\t\t\tDataInputStream dis=new DataInputStream(fis);\r\n\t\t\t//here input it to datastream reader it is must\r\n\t\t\tstr=dis.readLine();\r\n\t\t\twhile(str!=null)\r\n\t\t\t{\r\n\t\t\t\tmsg=msg+str+\"\\n\";\r\n\t\t\t\tstr=dis.readLine();\r\n\t\t\t}\r\n\t\t\tta1.setText(msg);\r\n\t\t\tdis.close();\r\n\t\t\tfis.close();\r\n\t\t}\r\n\t\tcatch(Exception a)\r\n\t\t{\r\n\t\t\ta.printStackTrace();\r\n\t\t}\r\n\t\r\n\t\t}\r\n\t\tif(s.equalsIgnoreCase(\"save\"))\r\n\t\t{\ttry\r\n\t\t{\r\n\t\t\tFileDialog fd=new FileDialog(this,\"savefile\",FileDialog.SAVE);\r\n\t\t//to be added\r\n\t\t\tfd.setVisible(true);\r\n\t\t\ttxt=ta1.getText();\r\n\t\t\tdir=fd.getDirectory();\r\n\t\t\t//path is got by directory\r\n\t\t\tfname=fd.getFile();\r\n\t\t\t//fname will get the name of the file so together we get teh full location\r\n\t\t\tFileOutputStream fis=new FileOutputStream(dir+fname);\r\n\t\t\t//file inputstream reader class obj is fis \r\n\t\t\tDataOutputStream dis=new DataOutputStream(fis);\r\n\t\t\t//here input it to datastream reader it is must\r\n\t\t\t//str=dis.readLine();\r\n\t\t\t/*while(str!=null)\r\n\t\t\t{\r\n\t\t\t\tmsg=msg+str+\"\\n\";\r\n\t\t\t\tstr=dis.readLine();\r\n\t\t\t}\r\n\t\t\tta1.setText(msg);*/\r\n\t\t\tdis.writeBytes(txt);\r\n\t\t\tdis.close();\r\n\t\t\tfis.close();\r\n\t\t}\r\n\t\tcatch(Exception a)\r\n\t\t{\r\n\t\t\ta.printStackTrace();\r\n\t\t}\r\n\t\r\n\r\n\t\t}\r\n\t\r\n\tif (s.equalsIgnoreCase(\"cut\"))\r\n\t{\r\n\t\tmsg=ta1.getSelectedText();\r\n\t\tif(msg==null)\r\n\t\t\tJOptionPane.showMessageDialog(this,\"select text\");\r\n\t\telse\r\n\t\t\tta1.replaceRange(\"\", ta1.getSelectionStart(), ta1.getSelectionEnd());\r\n\t\t\t\t\r\n\t}\r\n\r\n\tif (s.equalsIgnoreCase(\"copy\"))\r\n\t{\r\n\t\tmsg=ta1.getSelectedText();\r\n\t\tif(msg==null)\r\n\t\t\tJOptionPane.showMessageDialog(this,\"select text\");\r\n\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t}\r\n\t\r\n\tif (s.equalsIgnoreCase(\"paste\"))\r\n\t{\r\n\t\t\r\n\t\tta1.replaceRange(msg, ta1.getSelectionStart(), ta1.getSelectionEnd());\r\n\t\t\t\r\n\t\t\t\t\r\n\t}\r\n\t\r\n\t\r\n}", "public static void open() {\n JFileChooser fileChooser;\n String fileContent;\n String path = FileLoader.loadFile(\"path.txt\");\n if (path != null) {\n fileChooser = new JFileChooser(path);\n } else {\n fileChooser = new JFileChooser((FileSystemView.getFileSystemView().getHomeDirectory()));\n }\n\n fileChooser.setDialogTitle(\"Select text file\");\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\",\"mytxt\");\n fileChooser.addChoosableFileFilter(filter);\n fileChooser.setAcceptAllFileFilterUsed(true);\n\n if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n path = fileChooser.getSelectedFile().getParent();\n FileLoader.saveFile(\"path.txt\", path, false);\n fileContent = FileLoader.loadFile(fileChooser.getSelectedFile().getAbsolutePath());\n TextEditor.setFileName(fileChooser.getSelectedFile().getAbsolutePath());\n TextEditor.getTextArea().setText(fileContent);\n }\n }", "@FXML\n private void displayFilesFromDisc() {\n ReadOnlyObjectProperty<String> userModel = activeUsers.getSelectionModel().selectedItemProperty();\n String user = userModel.getValue();\n if (user == null) {\n return;\n }\n ObservableList<String> files = observableArrayList();\n files.addAll(Tools.GetAllFilesInDirectory(basePath + activeDisc + \"\\\\\" + user + \"\\\\\"));\n userFiles.setItems(files);\n System.out.println(basePath + activeDisc + \"\\\\\" + user + \"\\\\\");\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t\tif (e.getSource() == this.openFile) {\r\n\t\t\tJFileChooser open = new JFileChooser();\r\n\t\t\tint option = open.showOpenDialog(this); // optiuni posibile selectate: approve sau cancel\r\n\t\t\t\r\n\t\t\tif (option == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\tthis.textArea.setText(\"\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tScanner scan = new Scanner(new FileReader(open.getSelectedFile().getPath()));\r\n\t\t\t\t\twhile (scan.hasNext()) {\r\n\t\t\t\t\t\tthis.textArea.append(scan.nextLine() + \"\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscan.close();\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse if (e.getSource() == this.saveFile) {\r\n\t\t\tJFileChooser save = new JFileChooser();\r\n\t\t\tint option = save.showSaveDialog(this); // atentie, e showSAVEdialog, nu ca sus, cu OPEN\r\n\t\t\t\r\n\t\t\tif (option == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(save.getSelectedFile().getPath()));\r\n\t\t\t\t\tout.write(this.textArea.getText());\r\n\t\t\t\t\tout.close();\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse if (e.getSource() == this.exit) {\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\telse if (e.getSource() == this.about) {\r\n\t\t\tJOptionPane.showMessageDialog(this, \"Dragos' Notepad v0.2\\nPerju Dragoș-Ștefan\");\r\n\t\t}\r\n\t}", "void open() {\n \tJFileChooser fileopen = new JFileChooser();\n int ret = fileopen.showDialog(null, \"Open file\");\n\n if (ret == JFileChooser.APPROVE_OPTION) {\n document.setFile(fileopen.getSelectedFile());\n textArea.setText(document.getContent());\n }\n }", "public static void showfiles()\n\t{\n File curDir = new File(\".\");\n String[] fileNames = curDir.list();\n ArrayList<String> data = new ArrayList<String>();\n\n //Find files which may have data. (aka, are in the .dat format)\n for(String s:fileNames)\n if(s.endsWith(\".dat\"))\n data.add(s);\n\n\t\tdata.trimToSize();\n\t\t\n\t\tclearScreen();\n\n\t\tSystem.out.println(\"\\t\\t\\tTHE BOOK SEARCH PROGRAM\");\n\n\t\t\n\t\tfor(int i = 0; i < 80; i++)\n\t\tSystem.out.print(\"-\");\n\t\n\n\t\tSystem.out.println(\"\\nWhat file is your book data stored in?\\n\");\n\t\n\t\tSystem.out.println(\"Here are the .dat file(s) in the current directory:\\n\");\n\n\t \tfor(int i = 0; i < data.size(); i++)\n\t\tSystem.out.print(\"[ \" + data.get(i) + \" ]\\t\");\n\t\tSystem.out.println(\"\\n\");\n\n\n\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n JFileChooser fileChooser = new JFileChooser();\r\n fileChooser.setDialogTitle(\"Upload Files\");\r\n int result = fileChooser.showOpenDialog(null);\r\n if (result == JFileChooser.APPROVE_OPTION) { \r\n selectedFile = fileChooser.getSelectedFile();\r\n review.setText(selectedFile.getAbsolutePath());\r\n } \r\n }", "public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); \n String str = FileChooserDemo.selectFile();\n if (str == null){\n \t\n }else{\n \ttext_field.setText(str);\n }\n }", "public void afficherFile() {\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Voici la File (tete a gauche, queue a droite): \");\r\n\t\tSystem.out.println(\"----------------------------------------------\");\r\n\r\n\t\tif (this.estVide() == true) {\r\n\r\n\t\t\tSystem.out.println();\r\n\t\t} else {\r\n\r\n\t\t\tCellule<T> ref = this.tete;\r\n\r\n\t\t\tfor (int i = 1; i <= this.getLongueurFile(); i++) {\r\n\r\n\t\t\t\tSystem.out.print(ref.getValeur() + \" \");\r\n\r\n\t\t\t\tif (ref.getSuivant() != null) {\r\n\r\n\t\t\t\t\tref = ref.getSuivant();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t}", "public ifrm_historial() {\n initComponents();\n this.setTitle(\"Historial bitacoraCalculadora.txt\");\n File archivo;\n try{\n final BufferedReader lector = new BufferedReader(new FileReader(\"bitacoraCalculadora.txt\"));\n String line = \"\";\n while ((line = lector.readLine()) != null){\n //txt_mostrar.setText(line);\n txt_mostrar.append(line +\"\\n\");\n }lector.close();\n }catch(FileNotFoundException e){\n e.printStackTrace();\n } catch(IOException e){\n e.printStackTrace();\n }\n }", "private void jFileChooser1PropertyChange(java.beans.PropertyChangeEvent evt) {\n System.out.println(\"----------------------------------------------------\");\r\n path = \"\"+ jFileChooser1.getSelectedFile();\r\n pathTextField.setText(path);\r\n pathTextField.setToolTipText(path);\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t int returnVal = fc.showOpenDialog(GenerateWindow.this);\n\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File imagefile = fc.getSelectedFile();\n\t\t imageSelect.setText(\"images/\"+imagefile.getName());\n\t\t }}", "public void showMetadata() {\n String title;\n String description;\n if (fileHandler.metaTitle.equals(\"\")) {\n title = \"No title\";\n } else {\n title = fileHandler.metaTitle;\n }\n if (fileHandler.metaData.equals(\"\")) {\n description = \"No description available. Try loading an RLE-file!\";\n } else {\n description = fileHandler.metaData;\n }\n PopUpAlerts.metaData(title, description);\n }", "void save_to_file() {\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a save directory\", FileDialog.SAVE);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"save path: \" + file_withpath);\n\t\t\t \n\t\ttry {\n\t\t\tObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file_withpath));\n\n\t\t\tout.writeObject(Key_Lists);\n\t\t\t\n\t\t\tout.close();\n\t\t\t\n\t\t\tinfo_label.setForeground(green);\n\t\t\tinfo_label.setText(\"file saved :D\");\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\t\n\t}", "public void actionPerformed(ActionEvent evt) {\n\t int result = chooser.showOpenDialog(frame);\n\n\t // Get the selected file\n\t if ( result == JFileChooser.APPROVE_OPTION){\n\t \ttextField.setText(chooser.getSelectedFile().getAbsolutePath());\n\t }\n\t }", "@FXML\r\n\tprivate void choisirFichier()\r\n\t{\r\n\t\tFileChooser fileChooser = new FileChooser();\r\n\r\n\t\tfileChooser\r\n\t\t\t\t.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\r\n\t\tFile fichier = fileChooser.showOpenDialog(new Stage());\r\n\r\n\t\tif (fichier != null)\r\n\t\t{\r\n\t\t\ttextFieldFichier.setText(fichier.getPath());\r\n\t\t}\r\n\t}", "private void dialogFichierInexistant(File file){\n\t\tJOptionPane.showMessageDialog(null, \"le fichier \" + file.getName() +\"\\n'existe pas\", \"Erreur\", JOptionPane.ERROR_MESSAGE);\n\t}", "private void entryFileButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Entries File\");\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n entryFile = chooser.getSelectedFile();\n entryFileLabel.setText(getFileName(entryFile));\n pcs.firePropertyChange(\"ENTRY\", null, entryFile);\n }\n }", "public void updateRecentPaneFilesMenu()\r\n {\r\n recentPaneFilesMenu.removeAll(); // clear previous menu items\r\n recentPaneFilesMenu.setFont(GlobalValues.uifont);\r\n clearRecentFilesJMenuItem = new JMenuItem(\"Clear the list of recent files\");\r\n clearRecentFilesJMenuItem.setFont(GlobalValues.uifont);\r\n clearRecentFilesJMenuItem.addActionListener(new ActionListener() {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n recentPaneFiles.clear();\r\n recentPaneFilesMenu.removeAll();\r\n }\r\n });\r\n\r\n recentPaneFilesMenu.add(clearRecentFilesJMenuItem);\r\n \r\n int numberRecentFiles = recentPaneFiles.size();\r\n for (int k=numberRecentFiles-1; k>=0; k--) { // reverse order for displaying the most recently loaded first\r\n final String recentFileName = (String)recentPaneFiles.elementAt(k); // take the recent filename\r\n recentFileMenuItem = new JMenuItem(recentFileName);\r\n recentFileMenuItem.setFont(GlobalValues.uifont);\r\n recentFileMenuItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n jShellLabEdit(recentFileName); // reload the recent file in editor\r\n \r\n // update the workingDir\r\n String pathOfLoadFileName = recentFileName.substring(0, recentFileName.lastIndexOf(File.separatorChar));\r\n GlobalValues.workingDir = pathOfLoadFileName;\r\n }\r\n });\r\n recentPaneFilesMenu.add(recentFileMenuItem); // add the menu item corresponding to the recent file\r\n } // for all the recently accessed files \r\n\r\n recentPaneFilesMenu.setToolTipText(\"Tracks \\\"Saved As\\\" Files\");\r\n mainJMenuBar.add(recentPaneFilesMenu); // finally add the recent files menu to the main menu bar\r\n \r\n }", "public void showMenuforUser(String path, Storage s) {\n\t\tint cnt;\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb=new StringBuilder();\n\t\t\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\tsb.append(\"**********Trenutna lokacija:\" + path+\"**********\\n\");\n\t\tif(privileges.contains(\"add_user\")) {\n\t\t\tcnt=1;\n\t\t\t\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog korisnika\");\n\t\t\t\n\t\t}\n\t\tif(privileges.contains(\"add_directory\")) {\n\t\t\tcnt=2;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog foldera\");\n\t\t}\n\t\tif(privileges.contains(\"add_file\")) {\n\t\t\tcnt=3;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog fajla\");\n\t\t}\n\t\tif(privileges.contains(\"download\")) {\n\t\t\tcnt=4;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za preuzimanje fajla\");\n\t\t}\n\t\tif(privileges.contains(\"upload\")) {\n\t\t\tcnt=5;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+ \" za upload fajla\");\n\t\t}\n\t\tif(privileges.contains(\"search_repository\")) {\n\t\t\tcnt=6;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za pretragu repozitorijuma\");\n\t\t}\n\t\tif(privileges.contains(\"delete_file\")) {\n\t\t\tcnt=7;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za brisanje fajla\");\n\t\t}\n\t\tif(privileges.contains(\"add_user\")) {\n\t\t\tcnt=8;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje zabranjenih ekstenzija\");\n\t\t}\n\t\tif(privileges.contains(\"download\") && s.getType().equals(\"local\")) {\n\t\t\tcnt=9;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za zipovnje fajlova\");\n\t\t}\n\t\tif(privileges.contains(\"upload\") && s.getType().equals(\"local\")) {\n\t\t\tcnt=10;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za anzipovanje fajlova\");\n\t\t}\n\t\t\n\t\tsb.append(\"\\n\");\n\t\tsb.append(\"Izaberite 'ls' za prikaz sadrzine trenutnog foldera\");\n\t\tsb.append(\"\\n\");\n\t\tsb.append(\"Izaberite 'cd' <folder name> ili <..> za kretanje po fajlu\");\n\t\t//sb.append(\"\\n\"+path+\" >\");\n\t\tSystem.out.print(sb.toString());\n\t\t\n\t}", "private void saveFile(File file){\r\n\t\ttry {\r\n\t\t\tlocal.saveFile(file);\r\n\t\t\topenFile = file;\r\n\t\t\tpopulateRecentMenu();\r\n\t\t\tframe.setTitle(openFile.getName());\r\n\t\t\tedit = false;\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void setUpFileMenu() {\n add(fileMenu);\n fileMenu.add(new OpenAction(parent));\n fileMenu.add(new SaveAction(parent));\n fileMenu.add(new SaveAsAction(parent));\n fileMenu.addSeparator();\n fileMenu.add(new ShowWorldPrefsAction(parent.getWorldPanel()));\n fileMenu.add(new CloseAction(parent.getWorkspaceComponent()));\n }", "public void showUpload(){\n\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n String src;\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n int result = fileChooser.showOpenDialog(getParent());\n if (result == JFileChooser.APPROVE_OPTION) {\n File selectedFile = fileChooser.getSelectedFile();\n textSalida.append(\"\\nAutómata seleccionado \" + selectedFile.getAbsolutePath() );\n automa = null;\n automataready = false;\n compilar.setEnabled(false);\n try {\n src = selectedFile.getAbsolutePath();\n automa = new AFDVault(src);\n automataready = automa.allready();\n if (automataready){\n compilar.setEnabled(true);\n textSalida.append(\"\\nAutomata cargado\");\n //automa.PrintAFD();\n }else{\n compilar.setEnabled(false);\n textSalida.append(\"\\nAutomata no cargado verifique el archivo\");\n }\n }catch (IOException|ParserException ex){\n textSalida.append(ex.getMessage()+\"\\n\");\n }\n }\n }", "private void schFileChanged()\r\n\t{\r\n\t\tString filename = fscSchFile.getComponentText();\r\n\t\tjbtnDisplaySchematics.setEnabled(!filename.isEmpty());\r\n\t}", "private void loadButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadButtonMouseClicked\n // open file dialog\n FileDialog dialog = new FileDialog(this, \"Choisir le fichier dictionnaire\", FileDialog.LOAD);\n dialog.setFile(\"*.txt\");\n dialog.setVisible(true);\n \n String filename = dialog.getFile();\n if(filename != null) // if user selected a file\n {\n filename = dialog.getDirectory() + filename;\n lexiNodeTrees = DictioFileOperations.loadListFromFile(filename);\n \n if(lexiNodeTrees != null) // if list was successfully retrieved\n {\n loadedDictionaryFilename = filename;\n refreshAllWordsList();\n \n // clear text area and search suggestion\n searchSuggestionList.setModel(new DefaultListModel());\n definitionTextArea.setText(\"\");\n searchField.setText(\"\");\n }\n \n else // if file could not be loaded, show error dialog\n JOptionPane.showMessageDialog(this, \"ERREUR: Le fichier n'a \"\n + \"pas pu être chargé!\\n\\nVérifiez que le fichier est \"\n + \"valid est contient <<mot & définition>> sur toutes \"\n + \"les lignes\\n\\n\", \"ERREUR\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public String getStringFile(){\n return fileView(file);\n }", "private void popHelp() {\n try {\n //File file=new File(filepath);\n Desktop.getDesktop().open(new java.io.File(\"help.pdf\"));\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(rootPane,\"File not found or supported\");\n }\n }", "public static void processOneFileSelecction()\n {\n int answer = JSoundsMainWindowViewController.jfcOneFile.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jfcOneFile.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jfcOneFile.getSelectedFile().getName();\n UtilFunctions.listOneFile(JSoundsMainWindowViewController.jfcOneFile.getSelectedFile());\n JSoundsMainWindowViewController.orderBy(true, false, false); \n }\n }", "public String show() {\n Stage stage = new Stage();\n FileChooser fc = new FileChooser();\n\n //geef de filechooser een duidelijke naam zodat de gebruiker weet wat hij/zij moet doen.\n fc.setTitle(\"Selecteer een eerder opgeslagen .SAV bestand.\");\n\n //zorg dat de filechooser alleen .sav files accepteert.\n FileChooser.ExtensionFilter extentionFilter = new FileChooser.ExtensionFilter(\"SAV files .sav\", \"*.sav\");\n fc.getExtensionFilters().add(extentionFilter);\n\n //initial directory = de home folder van de user.\n String currentDir = System.getProperty(\"user.home\");\n File directoryPath = new File(currentDir);\n fc.setInitialDirectory(directoryPath);\n String filePath = fc.showOpenDialog(stage).getAbsolutePath();\n return filePath;\n }", "@Override\n public void actionPerformed(AnActionEvent event) {\n\n Project project = event.getData(PlatformDataKeys.PROJECT);\n\n DataContext dataContext = event.getDataContext();\n VirtualFile file = DataKeys.VIRTUAL_FILE.getData(dataContext);\n if(file != null){\n //获取选中的文件\n file = DataKeys.VIRTUAL_FILE.getData(dataContext);\n if(file == null){\n Messages.showErrorDialog(\"未选中文件\",\"error\");\n return;\n }\n }\n Module module = StringUtil.getModule(event.getProject(),dataContext,file.getPath());\n ExportDialog exportDialog = new ExportDialog(project,module,file);\n exportDialog.setTitle(\"Export Files\");\n exportDialog.show();\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser jfc=new JFileChooser(); \r\n\t\t jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES ); \r\n\t\t jfc.showDialog(new JLabel(), \"选择\"); \r\n\t\t File file=jfc.getSelectedFile();\r\n\t\t if(null==file){\r\n\t\t \treturn;\r\n\t\t }\r\n\t\t if(file.isDirectory()){\r\n\t\t System.out.println(\"文件夹:\"+file.getAbsolutePath()); \r\n\t\t }else if(file.isFile()){\r\n\t\t System.out.println(\"文件:\"+file.getAbsolutePath()); \r\n\t\t }\r\n\t\t if(Util.isImage(file)){\r\n\t\t \tImageIcon img = new ImageIcon(file.getAbsolutePath());\r\n\t\t\t\t\tlbImage.setIcon(img);\r\n\t\t\t\t\tMain.img = img.getImage();\r\n\t\t }else{\r\n\t\t \tJOptionPane.showMessageDialog(Main.this, \"请选择图片\");\r\n\t\t }\r\n\t\t\t}", "private void selectPDFFile() {\n JFileChooser jfc = new JFileChooser();\n jfc.setFileFilter(new PDFFilter());\n jfc.setMultiSelectionEnabled(false);\n int ret = jfc.showDialog(this, \"Open\");\n if (ret == 0) {\n readFile = jfc.getSelectedFile();\n inputField.setText(readFile.getAbsolutePath());\n String outString = readFile.getAbsolutePath();\n outString = outString.substring(0, outString.length() - 3);\n outString = outString + \"txt\";\n outputField.setText(outString);\n progressLabel.setBackground(INFO);\n progressLabel.setText(PRESS_EXTRACT);\n } else {\n System.out.println(NO_FILE_SELECTED);\n progressLabel.setBackground(WARNING);\n progressLabel.setText(SELECT_FILE);\n }\n }", "@Override\n\t/**\n\t * if a value is clicked in the list, this method shows its information on the\n\t * right text area. It has to get the specific information and that is what\n\t * this method does.\n\t */\n\tpublic void valueChanged(ListSelectionEvent e) {\n\n\t\tif(allMedia.getLastVisibleIndex() == -1){\n\t\t\tinfo.setText(\"\");\n\t\t\tinfo.append(\"Name of File:\");\n\t\t\tinfo.append(\"\\n\\n\\n\\n\\n\\nPath to File:\");\n\t\t\tinfo.append(\"\\n\\n\\n\\n\\n\\n\\nFile Size:\");\n\t\t}\n\t\t\n\t\t// get value adjusting is when the value is changing. This ensures that the value got is fixed.\n\t\tif(!e.getValueIsAdjusting()){\n\n\t\t\t// to ensure that the item is not clicked twice ensure that the value is not adjusting\n\t\t\tif(allMedia.getSelectedValue() != null){\n\n\t\t\t\tString name = allMedia.getSelectedValue().toString();\n\t\t\t\t// get the value of the selected value and then\n\t\t\t\tObject selected = allMedia.getSelectedValue();\n\t\t\t\tString pathOfFile = paths.get(selected).toString();\n\t\t\t\tString size = sizes.get(selected).toString();\n\t\t\t\tint megabytes =(int)((Double.parseDouble(size))/1024)/1024;\n\t\t\t\tinfo.setText(\"\");\n\t\t\t\tinfo.append(\"Name of File: \" + name);\n\t\t\t\tinfo.append(\"\\n\\n\\n\\n\\n\\nPath to File: \" + pathOfFile);\n\t\t\t\tinfo.append(\"\\n\\n\\n\\n\\n\\n\\nFile Size: \" + megabytes + \" megabytes\");\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n displayFileWindow();\n }", "private void loadGUI() {\n JMenuItem tmp;\n Font font = new Font(\"Arial\", Font.ITALIC, 10);\n \n // Project menu\n projectMenu = new JPopupMenu();\n tmp = new JMenuItem(\"Selected project\");\n tmp.setEnabled(false);\n tmp.setFont(font);\n projectMenu.add(tmp);\n projectMenu.addSeparator();\n \n properties = new JMenuItem(\"Properties\");\n properties.addActionListener(this);\n projectMenu.add(properties);\n \n reimport = new JMenuItem(\"Re-Import Files\");\n reimport.addActionListener(this);\n projectMenu.add(reimport);\n \n removeProject = new JMenuItem(\"Remove project\");\n removeProject.addActionListener(this);\n projectMenu.add(removeProject);\n \n // Directory menu\n dirMenu = new JPopupMenu();\n tmp = new JMenuItem(\"Selected directory\");\n tmp.setEnabled(false);\n tmp.setFont(font);\n dirMenu.add(tmp);\n dirMenu.addSeparator();\n \n removeDir = new JMenuItem(\"Remove from project\");\n removeDir.addActionListener(this);\n dirMenu.add(removeDir);\n \n deleteDir = new JMenuItem(\"Delete from disk\");\n deleteDir.addActionListener(this);\n dirMenu.add(deleteDir);\n \n renameDir = new JMenuItem(\"Rename\");\n renameDir.addActionListener(this);\n dirMenu.add(renameDir);\n \n // File menu\n fileMenu = new JPopupMenu();\n tmp = new JMenuItem(\"Selected file\");\n tmp.setEnabled(false);\n tmp.setFont(font);\n fileMenu.add(tmp);\n fileMenu.addSeparator();\n \n removeFile = new JMenuItem(\"Remove from project\");\n removeFile.addActionListener(this);\n fileMenu.add(removeFile);\n \n deleteFile = new JMenuItem(\"Delete from disk\");\n deleteFile.addActionListener(this);\n fileMenu.add(deleteFile);\n \n renameFile = new JMenuItem(\"Rename\");\n renameFile.addActionListener(this);\n fileMenu.add(renameFile);\n\t\n\t // sutter2k: need to tap in here for preview in browser\n miLaunchBrowser= new JMenuItem(\"Preview in Browser\");\n miLaunchBrowser.addActionListener(this);\n fileMenu.add(miLaunchBrowser);\n\t\n // Menu to show when multiple nodes are selected\n multipleSelMenu = new JPopupMenu();\n tmp = new JMenuItem(\"Multiple selection\");\n tmp.setEnabled(false);\n tmp.setFont(font);\n multipleSelMenu.add(tmp);\n multipleSelMenu.addSeparator();\n \n removeMulti = new JMenuItem(\"Remove from project\");\n removeMulti.addActionListener(this);\n multipleSelMenu.add(removeMulti);\n \n deleteMulti = new JMenuItem(\"Delete from disk\");\n deleteMulti.addActionListener(this);\n multipleSelMenu.add(deleteMulti);\n \n }", "public void newFileButtonListener() {\r\n workSpace.setText(null);\r\n fileName = null;\r\n sansSerifButton.setSelected(true);\r\n italicFormatCheckBox.setSelected(false);\r\n boldFormatCheckBox.setSelected(false);\r\n }", "private void openFile(File file){\r\n\t\ttry {\r\n\t\t\tlocal.openFile(file);\r\n\t\t\topenFile = file;\r\n\t\t\tframe.setTitle(file.getName());\r\n\t\t\tedit = false;\r\n\t\t\tBibtexPrefs.addOpenedFile(file);\r\n\t\t\tpopulateRecentMenu();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\terrorDialog(e.toString());\r\n\t\t} catch (IllegalArgumentException e){\r\n\t\t\terrorDialog(\"The bibtex file \" +file.getPath()+ \" appears to be invalid.\\n\"\r\n\t\t\t\t\t+ \"Parsing error occured because you have the following in your file:\\n\"\r\n\t\t\t\t\t+e.getMessage());\r\n\t\t}\r\n\t}", "public void showInfo(String fileName) {\r\n\t\tviewer.setUrl(\"info/\"+fileName);\r\n\t\tcenter();\r\n\t}", "void printFile(String path) {\n try {\n String[] readFileOutPut = readFile(path);\n for (int i = 0; i < readFileOutPut.length;i++) System.out.println(readFileOutPut[i]);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tJFileChooser fc = new JFileChooser();\r\n\t\t\t\t\tfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t\t\t\tint result = fc.showOpenDialog(new JFrame());\r\n\t\t\t\t\tif(result == JFileChooser.APPROVE_OPTION){\r\n\t\t\t\t\t\tString path = fc.getSelectedFile().getAbsolutePath();\r\n\t\t\t\t\t\ttfPath.setText(path);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private void updateListView() {\n fileList.getItems().setAll(files.readList());\n //System.out.println(System.currentTimeMillis() - start + \" мс\");\n }" ]
[ "0.70695585", "0.70277697", "0.69791394", "0.69362324", "0.6858723", "0.67330796", "0.6684322", "0.66314495", "0.6608295", "0.6573775", "0.65235466", "0.6518369", "0.6508273", "0.649684", "0.6440556", "0.6424596", "0.6415781", "0.6403392", "0.6388428", "0.6365537", "0.63343924", "0.63291687", "0.63275754", "0.63074225", "0.62893003", "0.62771195", "0.6275992", "0.62720525", "0.62528497", "0.62412775", "0.62292784", "0.6223603", "0.62231725", "0.6216215", "0.6211837", "0.6190238", "0.6184077", "0.6182632", "0.6176755", "0.61687076", "0.61671066", "0.61662704", "0.613631", "0.6134272", "0.6132611", "0.6126138", "0.6116902", "0.6109581", "0.6104822", "0.61022264", "0.608402", "0.60817397", "0.6069575", "0.60671777", "0.60651743", "0.6049899", "0.60439444", "0.6031277", "0.6022794", "0.6017232", "0.601299", "0.6011878", "0.5996068", "0.5993304", "0.59921795", "0.59876126", "0.5986072", "0.5979829", "0.59623426", "0.5956886", "0.59546685", "0.59526336", "0.59517974", "0.595016", "0.59480953", "0.59477144", "0.5944388", "0.5932127", "0.59142303", "0.5910518", "0.5910327", "0.59043664", "0.58944875", "0.58939946", "0.5878458", "0.58756584", "0.5874549", "0.5873229", "0.5872012", "0.5871312", "0.5864193", "0.5856816", "0.585441", "0.58498204", "0.5849263", "0.5846474", "0.5846288", "0.58409125", "0.5840537", "0.5836034", "0.58356315" ]
0.0
-1
int ret = 0;
public int videoStitching(int[][] clips, int t) { if (clips == null || clips.length == 0) return -1; if (t <= 0) return t < 0 ? -1 : 0; int n = clips.length; // int[] dp = new int[t + 1]; int maxEnd = 0; TreeMap<Integer, Integer> startPos = new TreeMap<>(); TreeMap<Integer, Integer> endPos = new TreeMap<>(); for (int i = 0; i < n; ++i) { int[] clip = clips[i]; addPos(clips, startPos, i, true); addPos(clips, endPos, i, false); if (maxEnd < clip[1]) { maxEnd = clip[1]; } // Set<Integer> set1 = endPos.computeIfAbsent(clip[1], e -> new TreeSet<>()); // set1.add(len); } if (!startPos.containsKey(0) || t > maxEnd) return -1; int start = 0; int end = t; Set<Integer> selectedClip = new HashSet<>(); while (start < end) { NavigableMap<Integer, Integer> headMap = startPos.headMap(start, true); if (headMap.size() == 0) return -1; start = searchMaxLen(headMap, clips, true, selectedClip); if (start >= end) break; NavigableMap<Integer, Integer> tailMap = endPos.tailMap(end, true); if (tailMap.size() == 0) return -1; end = searchMaxLen(tailMap, clips, false, selectedClip); } return selectedClip.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int return0() ;", "public int get_return(){\r\n return local_return;\r\n }", "int exitValue();", "public int result() {\n return 0;\n }", "public int getresult(){\n return result;}", "public int getReturnValue() {\n if (success)\r\n return 0;\r\n else\r\n return ret;\r\n }", "@Override\n\tpublic int javaMethodBaseWithIntRet() {\n\t\treturn 0;\n\t}", "public int getRet() {\n\t\treturn ret;\n\t}", "int getEresult();", "static int test()\n\t{\n\n\t\treturn 20;\n\t}", "public int getResult(){\n return localResult;\n }", "int getResult();", "public void setRet(int ret) {\n\t\tthis.ret = ret;\n\t}", "public static int returnCount()\n {return counter;}", "public int test1()\n\t{\n\t\treturn 1;\n\t}", "public int g()\r\n/* 173: */ {\r\n/* 174:198 */ return 0;\r\n/* 175: */ }", "public int returnValue() {\n\t\treturn returnValue;\n\t}", "public int testmethod1()\n\t{\n\t\treturn 0;\n\t\t\n\t}", "public int returnInt(int x);", "public int getResult(){\r\n\t\t return result;\r\n\t }", "@Override\n public int retroceder() {\n return 0;\n }", "private static int testOne(){\n var var = 10;\n return var;\n }", "int mo98209b();", "int mo98207a();", "public boolean get_return(){\n return local_return;\n }", "public int withreturn (){\n int num1 = 555;\n return num1;\n //\n }", "public static int getNewReturnWithFinally(){\n try {\n return 0;\n } finally {\n return 1;\n }\n }", "public int method_113() {\r\n return 0;\r\n }", "public float main(){\n return 0;\n }", "public int a()\n {\n return 2;\n }", "public int g()\r\n {\r\n return 1;\r\n }", "void reset() {\r\n\t\tresult = 0;\r\n\t}", "@Override\n\tpublic long javaMethodBaseWithUIntRet() {\n\t\treturn 0;\n\t}", "public int method_209() {\r\n return 0;\r\n }", "public static int methodWithoutReturn(){\n throw new Error();\n }", "int getResult() {\n return result;\n }", "public void set_return(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n local_returnTracker =\r\n param != java.lang.Integer.MIN_VALUE;\r\n \r\n this.local_return=param;\r\n \r\n\r\n }", "int getResultValue();", "int getResultValue();", "int mo44964a();", "int method_113();", "public static int nextInt() {\n\treturn 0;\r\n}", "int mo306b();", "static int type_of_ret(String passed){\n\t\treturn 1;\n\t}", "public int g()\r\n/* 601: */ {\r\n/* 602:645 */ return 0;\r\n/* 603: */ }", "int getUknown();", "public int getInt() throws Exception\n {\n return 0;\n }", "public int a_(int paramInt)\r\n/* 594: */ {\r\n/* 595:636 */ return 0;\r\n/* 596: */ }", "int getReturnCode();", "int getReturnCode();", "@Override\n\tpublic int FunctionCall() {\n\t\tint s=success;\n\t\t\n\t\treturn s;\n\n\t}", "int getResultCode();", "int getResultCode();", "int getResultCode();", "int getResultCode();", "int getResultCode();", "static int returnFive() {\r\n return 5;\r\n }", "Exp\ngetReturnValue();", "Variable getReturn();", "@Override\n public int f() {\n return 0;\n }", "public int check(){\r\n\r\n\treturn count ++;\r\n\t\r\n}", "public double result() {return 0;}", "public int _getvalue() throws Exception{\nif (true) return _mvalue;\n //BA.debugLineNum = 154;BA.debugLine=\"End Sub\";\nreturn 0;\n}", "public int a_(int paramInt)\r\n/* 166: */ {\r\n/* 167:189 */ return 0;\r\n/* 168: */ }", "public int R(){\r\n return R;\r\n }", "public int foo()\n {\n }", "public abstract long i();", "static int size_of_ret(String passed){\n\t\treturn 1;\n\t}", "int count();", "int count();", "int count();", "int count();", "int count();", "int count();", "int mo98357e();", "private int getMY() {\n\t\treturn 0;\r\n\t}", "int mo38567b();", "public int sampleInt() {\n\tthrow new RuntimeException();\n }", "int method20()\n {\n return 579190;\n }", "@Override\r\n\tpublic int getResult() {\n\t\treturn 0;\r\n\t}", "public int a() {\r\n/* 63 */ return 4;\r\n/* */ }", "public abstract int mo9745j();", "int mo27483b();", "int add();", "public static int randomGet() { return 0; }", "int mo302a();", "public int func_70297_j_()\n/* */ {\n/* 71 */ return 64;\n/* */ }", "public abstract int mo41077c();", "int getUnknown1();", "int getUnknown1();", "int getUnknown1();", "int getUnknown1();", "public int Check(){\n return 6;\n }", "public abstract long g();", "void onResult(int ret);", "public abstract int mo9747l();", "protocol.Result.ResultCode getResultCode();", "public int x()\r\n {\r\n return x;\r\n }", "public int x()\n {\n return x;\n }", "int mo30291e();", "@Override\n\tpublic short javaMethodBaseWithShortRet() {\n\t\treturn 0;\n\t}" ]
[ "0.8403072", "0.727131", "0.7147548", "0.7129657", "0.710408", "0.69162786", "0.6890128", "0.6889988", "0.6723391", "0.6699951", "0.6682897", "0.66500914", "0.66357076", "0.66156125", "0.6601039", "0.65983737", "0.65911335", "0.6564893", "0.652666", "0.6515095", "0.6508227", "0.64830357", "0.64435995", "0.6435445", "0.6427018", "0.6409673", "0.6406662", "0.6396933", "0.63774073", "0.63432574", "0.6340322", "0.6331839", "0.63057244", "0.629007", "0.62773234", "0.626056", "0.6254914", "0.62222964", "0.62222964", "0.6206169", "0.6198561", "0.6192028", "0.61913866", "0.617322", "0.6165382", "0.61589164", "0.61524934", "0.61459845", "0.6136549", "0.6136549", "0.613188", "0.61100274", "0.61100274", "0.61100274", "0.61100274", "0.61100274", "0.6108755", "0.61046726", "0.6085292", "0.60697967", "0.6056894", "0.60565233", "0.6050805", "0.6034651", "0.6033287", "0.60255605", "0.60210943", "0.60201", "0.60070276", "0.60070276", "0.60070276", "0.60070276", "0.60070276", "0.60070276", "0.60053915", "0.60050434", "0.59969825", "0.59859806", "0.59777826", "0.5970682", "0.5969607", "0.5962431", "0.5957875", "0.5955211", "0.5955058", "0.5951072", "0.593447", "0.5927413", "0.5923863", "0.5923863", "0.5923863", "0.5923863", "0.59038585", "0.58988714", "0.58962786", "0.58893347", "0.58853996", "0.5881567", "0.5868401", "0.5868245", "0.58665884" ]
0.0
-1
Convert from CMY color space to RGB color space
public static double[] cmyToRgb(double[] cmy) { assert(cmy != null && cmy.length == 3); double[] rgb = new double[3]; rgb[0] = (1-cmy[0]) * 255; rgb[1] = (1-cmy[1]) * 255; rgb[2] = (1-cmy[2]) * 255; return rgb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract RGBIColor toRGBColor();", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "public abstract RGBFColor toRGBFColor();", "protected abstract void toSpace( float[] rgb );", "public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "public abstract int rgbColor(double u, double v);", "public static float[] rgb2cmyk(int rgb) {\r\n float r = (rgb >> 16) & 0xFF;\r\n float g = (rgb >> 8) & 0xFF;\r\n float b = rgb & 0xFF;\r\n float C = 1.0f - (r / 255);\r\n float M = 1.0f - (g / 255);\r\n float Y = 1.0f - (b / 255);\r\n float var_K = 1;\r\n\r\n if (C < var_K) {\r\n var_K = C;\r\n }\r\n if (M < var_K) {\r\n var_K = M;\r\n }\r\n if (Y < var_K) {\r\n var_K = Y;\r\n }\r\n\r\n C = (C - var_K) / (1 - var_K);\r\n M = (M - var_K) / (1 - var_K);\r\n Y = (Y - var_K) / (1 - var_K);\r\n return new float[] { C * 100, M * 100, Y * 100, var_K * 100 };\r\n }", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public static AnsiColor rgb(Color c) {\n return new RgbColor(c);\n }", "static private int[] RGBtoYCbCr(int[] RGB) {\n int[] YCbCr = new int[3];\n\n float r = (float) RGB[0];\n float g = (float) RGB[1];\n float b = (float) RGB[2];\n\n float y = (float) (0 + (0.299 * r) + (0.587 * g) + (0.114 * b));\n float cb = (float) (128 - (0.168736 * r) - (0.331264 * g) + (0.5 * b));\n float cr = (float) (128 + (0.5 * r) - (0.418688 * g) - (0.081312 * b));\n\n\n YCbCr[0] = Math.round(y);\n YCbCr[1] = Math.round(cb);\n YCbCr[2] = Math.round(cr);\n\n\n return YCbCr;\n }", "RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}", "RGB getNewColor();", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}", "protected abstract ColorSpace getColorSpace();", "public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "private native int grayToRgb(byte src[],int dst[]);", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "protected abstract float[] getRgbLut();", "RGB getOldColor();", "void inputToCb(Mat input){\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static int toRGB(Color color) {\n int result = (int) (color.getRed() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getBlue() * 0xFF);\n return result;\n }", "public abstract HSLColor toHSLColor();", "java.awt.Color getColor();", "public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }", "void inputToCb(Mat input) {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "void inputToCb(Mat input)\n {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "void inputToCb(Mat input)\n {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "public RGBColor getColor(){\r\n return this._color;\r\n }", "public static Color getColor(int c)\n {\n int r = (7*c)%64;\n return new Color((r%4)*63+30,((r/4)%4)*63+30,(r/4/4)*63+30);\n }", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "public static Color fromBGR(int rgb) {\n return Color.rgb(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF);\n }", "public int getRGB(Object inData) {\n if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n int gray = getRed(inData); // Red sRGB component should equal\n // green and blue components\n return (getAlpha(inData) << 24)\n | (gray << 16)\n | (gray << 8)\n | gray;\n }\n if (!is_sRGB) {\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\n \"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premult values\n float[] rgb = colorSpace.toRGB(norm);\n return (getAlpha(inData) << 24)\n | (((int) (rgb[0] * 255.0f)) << 16)\n | (((int) (rgb[1] * 255.0f)) << 8)\n | (((int) (rgb[2] * 255.0f)) << 0);\n }\n return (getAlpha(inData) << 24)\n | (getRed(inData) << 16)\n | (getGreen(inData) << 8)\n | (getBlue(inData));\n }", "public static Color hex2Rgb(String colorStr) {\n return new Color(\n Integer.valueOf( colorStr.substring( 1, 3 ), 16 ),\n Integer.valueOf( colorStr.substring( 3, 5 ), 16 ),\n Integer.valueOf( colorStr.substring( 5, 7 ), 16 ) );\n }", "public static Color getRGBColor(String name)\n\t\t\tthrows IllegalArgumentException {\n\t\tint[] c = { 0, 0, 0, 0 };\n\t\tif (name.startsWith(\"#\")) {\n\t\t\tif (name.length() == 4) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;\n\t\t\t\tc[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;\n\t\t\t\tc[2] = Integer.parseInt(name.substring(3), 16) * 16;\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tif (name.length() == 7) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 3), 16);\n\t\t\t\tc[1] = Integer.parseInt(name.substring(3, 5), 16);\n\t\t\t\tc[2] = Integer.parseInt(name.substring(5), 16);\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(MessageLocalization.getComposedMessage(\"unknown.color.format.must.be.rgb.or.rrggbb\"));\n\t\t}\n else if (name.startsWith(\"rgb(\")) {\n StringTokenizer tok = new StringTokenizer(name, \"rgb(), \\t\\r\\n\\f\");\n for (int k = 0; k < 3; ++k) {\n String v = tok.nextToken();\n if (v.endsWith(\"%\"))\n c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;\n else\n c[k] = Integer.parseInt(v);\n if (c[k] < 0)\n c[k] = 0;\n else if (c[k] > 255)\n c[k] = 255;\n }\n return new Color(c[0], c[1], c[2], c[3]);\n }\n\t\tname = name.toLowerCase();\n\t\tif (!NAMES.containsKey(name))\n\t\t\tthrow new IllegalArgumentException(\"Color '\" + name\n\t\t\t\t\t+ \"' not found.\");\n\t\tc = (int[]) NAMES.get(name);\n\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t}", "public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public native int getColorspace() throws MagickException;", "public native PixelPacket[] getColormap() throws MagickException;", "public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;", "public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }", "public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "public static float[] color(Color c) {\r\n \r\n if (c == null) c = Color.BLUE;\r\n return new float[]{ ((float) c.getRed() / 255.0f), \r\n ((float) c.getGreen() / 255.0f), ((float) c.getBlue() / 255.0f) };\r\n }", "public Color getColor(RGB rgb) {\n\t\treturn colorTable.computeIfAbsent(rgb, raw -> new Color(raw));\n\t}", "public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public CMYKColors getColor() {\n return this.color;\n }", "int[] getStartRGB();", "protected Color[] generatePlotColors(int numLayers){\n\t\tColor[] clrs = new Color[numLayers];\n\t\t\n\t\t//the first layer is the backgound, so this shouldn't really\n\t\t//ever be used\n\t\tclrs[0] = Color.BLACK;\n\n\t\t//the raw data\n\t\tclrs[1] = Color.GRAY;\n\n\t\t//TODO: this should be changed to a more robust method\n\t\tint colorIdx;\n\t\tfor(int i = 2; i < numLayers; i++){\n\t\t\tcolorIdx = i % 4;\n\t\t\tswitch(colorIdx){\n\t\t\t\tcase 0:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_BLUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_RED;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_GREEN;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_YELLOW;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:{\n\t\t\t\t\tSystem.out.println(\"Problem With Color Assignment\");\n\t\t\t\t\tclrs[i] = Color.MAGENTA;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clrs;\n\t}", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }", "public static void HistogrammeCumuleRGB(Mat m,int[] R,int[] G,int[] B,int[] RC,int[] GC,int[] BC,int N)\n\t{\n\t\tint valueR=0;int valueG=0;int valueB=0;\n\t\tfor(int i=0;i<256;i++)\n\t\t{\n\t\t\tvalueR+=R[i];RC[i]=R[i]==0?0:valueR;\n\t\t\tvalueG+=G[i];GC[i]=G[i]==0?0:valueG;\n\t\t\tvalueB+=B[i];BC[i]=B[i]==0?0:valueB;\n\t\t\t\n\t\t}\n\t}", "public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}", "public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }", "public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }", "public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public native int getColors() throws MagickException;", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "private Color getColor(final RGB rgb) {\n Color color = this.colorTable.get(rgb);\n if (color == null) {\n color = new Color(Display.getCurrent(), rgb);\n this.colorTable.put(rgb, color);\n }\n return color;\n }", "public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;", "public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }", "public static Color fromRGB(int color) {\n\t\treturn Color.rgb(color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF);\n\t}", "public synchronized Color scan(){\n \tcolorRGBSensor.fetchSample(sample, 0);\n color.setR(sample[0]*1024);\n color.setG(sample[1]*1024);\n color.setB(sample[2]*1024);\n return color;\n }", "private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }", "int getAsInt32Color(int a) {\r\n\t\tint r = (int) (x * 255);\r\n\t\tint g = (int) (y * 255);\r\n\t\tint b = (int) (z * 255);\r\n\t\tif (r > 255) {\r\n\t\t\tr = 255;\r\n\t\t}\r\n\t\tif (g > 255) {\r\n\t\t\tg = 255;\r\n\t\t}\r\n\t\tif (b > 255) {\r\n\t\t\tb = 255;\r\n\t\t}\r\n\r\n\t\tif (r < 0) {\r\n\t\t\tr = 0;\r\n\t\t}\r\n\t\tif (g < 0) {\r\n\t\t\tg = 0;\r\n\t\t}\r\n\t\tif (b < 0) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\treturn (b | g << 8 | r << 16 | a << 24);\r\n\t}", "public GameColor getColor();", "public static int ColorToInt(Color c) {\n\t\treturn android.graphics.Color.argb(cap((int) (c.getAlpha() * 255), 0, 255), cap((int) (c.getRed() * 255), 0, 255), cap((int) (c.getGreen() * 255), 0, 255), cap((int) (c.getBlue() * 255), 0, 255));\n\t}", "public Color getColor() {\r\n\t\treturn new Color(Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]));\r\n\t}", "public static int rgbArrayToRgbInt(int[] array) {\n\t\tif (array == null) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (array.length != 3) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble[] doubleArray = {array[0], array[1], array[2]};\n\t\treturn ColorConverter.rgbArrayToRgbInt(doubleArray);\n\t}", "public static double getRGBColorDifference1(int color, int color2) {\r\n if (color == color2) {\r\n return 0;\r\n }\r\n Color c = new Color(color);\r\n Color c2 = new Color(color2);\r\n int dif0 = c.getRed() - c2.getRed();\r\n int dif1 = c.getGreen() - c2.getGreen();\r\n int dif2 = c.getBlue() - c2.getBlue();\r\n return Math.sqrt(dif0 * dif0 + dif1 * dif1 + dif2 * dif2);\r\n }", "protected ColorSpace getImageColorSpace() {\n return this.image.getColorSpace();\n }", "public Color getColor();", "public Color getColor();", "public Color getColor();", "void greyscale();", "void greyscale();", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "public int getColor();", "public int getColor();", "private Color getColor(RGB rgb)\n\t{\n\t\treturn rgb == null ? null : colorRegistry.get(rgb);\n\t}", "int[] getEndRGB();", "private static int[] rgbToHsl(int r, int g, int b){\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\t\tint max = java.lang.Math.max(java.lang.Math.max(r, g), b);\n\t\tint min = java.lang.Math.min(java.lang.Math.min(r, g), b);\n\t\tint h = 0;\n\t\tint s = 0;\n\t int l = (max + min) / 2;\n\t if(max == min) {\n\t h = s = 0; // achromatic\n\t }else{\n\t \tint d = max - min;\n\t s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t if(max == r) {\n\t \th = (g - b) / d + (g < b ? 6 : 0);\n\t } else if(max == g) {\n\t \th = (b - r) / d + 2;\n\t } else if (max == b) {\n\t \th = (r - g) / d + 4;\n\t }\n\t h /= 6;\n\t }\n\t int [] ret = new int[3];\n\t ret[0] = h;\n\t ret[1] = s;\n\t ret[2] = l;\n\t return ret;\n\t}", "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 static Color fromRGB(int rgb) {\n return Color.rgb((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF);\n }" ]
[ "0.7616944", "0.7099386", "0.68859655", "0.66625154", "0.6479533", "0.64303076", "0.6382099", "0.63611907", "0.6294044", "0.6274821", "0.62351775", "0.61981386", "0.61393213", "0.60744804", "0.6057305", "0.6028522", "0.60034066", "0.59884006", "0.59776336", "0.5973182", "0.59587944", "0.5955048", "0.5949576", "0.5845932", "0.58423775", "0.5831763", "0.58272713", "0.58224595", "0.5808453", "0.5786675", "0.57861245", "0.57813615", "0.57813615", "0.5769261", "0.5761266", "0.5746155", "0.57393444", "0.56897205", "0.5688037", "0.5647456", "0.5630742", "0.5600273", "0.55572516", "0.55536497", "0.5543574", "0.55366725", "0.5535193", "0.5534964", "0.5515321", "0.5509888", "0.54946226", "0.54887164", "0.5468304", "0.5467163", "0.54612213", "0.5456041", "0.54518956", "0.54342425", "0.54342425", "0.54342425", "0.54342425", "0.54342425", "0.542512", "0.54185176", "0.54123396", "0.54066604", "0.5398849", "0.53973407", "0.5394819", "0.5386501", "0.53829205", "0.5372059", "0.53558445", "0.5350262", "0.5349679", "0.5340216", "0.5330402", "0.5309443", "0.5301973", "0.5301367", "0.5288772", "0.5285767", "0.5285609", "0.5281643", "0.5274541", "0.5265541", "0.5255056", "0.52378327", "0.52378327", "0.52378327", "0.5232161", "0.5232161", "0.52122766", "0.5210166", "0.5210166", "0.5207928", "0.5205159", "0.5200444", "0.51919913", "0.51917976" ]
0.6903662
2
Convert from HSV color space to RGB color space
public static double[] hsvToRgb(double[] hsv) { double h = hsv[0]; double s = hsv[1]; double v = hsv[2]; double r,g,b; if (s == 0) { r = v * 255; g = v * 255; b = v * 255; } else { double varH = h / 60; if ((int)varH == 6) { varH = 0; } int varI = (int)(varH); double var1 = v * (1 - s); double var2 = v * (1 - s * (varH - varI)); double var3 = v * (1 - s * (1 - (varH - varI))); double varR, varG, varB; switch (varI) { case 0: varR = v; varG = var3; varB = var1; break; case 1: varR = var2; varG = v; varB = var1; break; case 2: varR = var1; varG = v; varB = var3; break; case 3: varR = var1; varG = var2; varB = v; break; case 4: varR = var3; varG = var1; varB = v; break; default: varR = v; varG = var1; varB = var2; } r = varR * 255; g = varG * 255; b = varB * 255; } double[] result = {r,g,b}; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double[] rgbToHsv(int rgb[]) {\n\t\tdouble temp[] = new double[3];\n\t\tdouble hsv[] = new double[3];\n\t\t\n\t\ttemp[0] = (double)rgb[0]/255;\n\t\ttemp[1] = (double)rgb[1]/255;\n\t\ttemp[2] = (double)rgb[2]/255;\n\t\t\n\t\tdouble max = Math.max(temp[0], Math.max(temp[1], temp[2]));\n\t\tdouble min = Math.min(temp[0], Math.min(temp[1], temp[2]));\n\t\t\n\t\tdouble delta = max-min;\n\t\t\n\t\tif (delta == 0) {\n\t\t\thsv[0] = 0;\n\t\t} else if (max == temp[0]) {\n\t\t\thsv[0] = (60*(temp[1]-temp[2])/delta)+360;\n\t\t\twhile (hsv[0] >= 360) {\n\t\t\t\thsv[0] -= 360;\n\t\t\t}\n\t\t} else if (max == temp[1]) {\n\t\t\thsv[0] = 60 * (temp[2]-temp[0]) / delta + 120;\n\t\t} else if (max == temp[2]) {\n\t\t\thsv[0] = 60 * (temp[0]-temp[1]) / delta + 240;\n\t\t}\n\t\t\n\t\t\n\t\tif (max == 0) {\n\t\t\thsv[1] = 0;\n\t\t}\n\t\telse {\n\t\t\thsv[1] = delta/max;\n\t\t}\n\t\t\n\t\thsv[2] = max;\n\t\t\n\t\treturn hsv;\n\t\t\n\t}", "public abstract HSLColor toHSLColor();", "public abstract int rgbColor(double u, double v);", "public static int[] hsvToRgb(double hue, double saturation, double value) {\n if (hue < 0 || hue > 360) {\n throw new IllegalArgumentException(\"hue should be between 0 and 360\");\n }\n\n if (saturation < 0 || saturation > 1) {\n throw new IllegalArgumentException(\"saturation should be between 0 and 1\");\n }\n\n if (value < 0 || value > 1) {\n throw new IllegalArgumentException(\"value should be between 0 and 1\");\n }\n\n double chroma = value * saturation;\n double hueSection = hue / 60;\n double secondLargestComponent = chroma * (1 - Math.abs(hueSection % 2 - 1));\n double matchValue = value - chroma;\n\n return getRgbBySection(hueSection, chroma, matchValue, secondLargestComponent);\n }", "public abstract RGBIColor toRGBColor();", "public static double[] rgbToHsv(int red, int green, int blue) {\n if (red < 0 || red > 255) {\n throw new IllegalArgumentException(\"red should be between 0 and 255\");\n }\n\n if (green < 0 || green > 255) {\n throw new IllegalArgumentException(\"green should be between 0 and 255\");\n }\n\n if (blue < 0 || blue > 255) {\n throw new IllegalArgumentException(\"blue should be between 0 and 255\");\n }\n\n double dRed = (double) red / 255;\n double dGreen = (double) green / 255;\n double dBlue = (double) blue / 255;\n double value = Math.max(Math.max(dRed, dGreen), dBlue);\n double chroma = value - Math.min(Math.min(dRed, dGreen), dBlue);\n double saturation = value == 0 ? 0 : chroma / value;\n double hue;\n\n if (chroma == 0) {\n hue = 0;\n } else if (value == dRed) {\n hue = 60 * (0 + (dGreen - dBlue) / chroma);\n } else if (value == dGreen) {\n hue = 60 * (2 + (dBlue - dRed) / chroma);\n } else {\n hue = 60 * (4 + (dRed - dGreen) / chroma);\n }\n\n hue = (hue + 360) % 360;\n\n return new double[] {hue, saturation, value};\n }", "public static double[] getColorHSV(int h, int s, int v){\n\t\tdouble[] output=new double[3];\n\t\tColor c=new Color(Color.HSBtoRGB((float)(h/255.0), (float)(s/255.0), (float)(v/255.0)));\n\t\toutput[0]=Math.min(1.0, (double)c.getRed()/255.0);\n\t\toutput[1]=Math.min(1.0, (double)c.getGreen()/255.0);\n\t\toutput[2]=Math.min(1.0, (double)c.getBlue()/255.0);\n\t\treturn output;\n\t}", "@ParameterizedTest\n @MethodSource(\"org.nd4j.linalg.BaseNd4jTestWithBackends#configs\")\n public void testHsvToRgb(Nd4jBackend backend) {\n INDArray input = Nd4j.createFromArray(new float[]{0.705504596f, 0.793608069f, 0.65870738f, 0.848827183f, 0.920532584f,\n 0.887555957f, 0.72317636f, 0.563831031f, 0.773604929f, 0.269532293f,\n 0.332347751f, 0.111181192f}).reshape(4,3);\n\n INDArray expected = Nd4j.createFromArray(new float[]{0.257768334f, 0.135951888f, 0.65870738f, 0.887555957f, 0.0705317783f,\n 0.811602857f, 0.485313689f, 0.337422464f, 0.773604929f, 0.0883753772f,\n 0.111181192f, 0.074230373f}).reshape(4,3);\n\n HsvToRgb op = new HsvToRgb(input);\n INDArray[] ret = Nd4j.exec(op);\n assertEquals(ret[0], expected);\n }", "public static int[] rgb2hsv(int pixelValue) {\r\n int[] rgbA = Colors.hexToRgb(pixelValue);\r\n float[] hsb = rgb2hsb(rgbA[0], rgbA[1], rgbA[2]);\r\n return new int[] { Math.round(hsb[0] * 360), Math.round(hsb[1] * 100), Math.round(hsb[2] * 100) };\r\n }", "private static int[] rgbToHsl(int r, int g, int b){\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\t\tint max = java.lang.Math.max(java.lang.Math.max(r, g), b);\n\t\tint min = java.lang.Math.min(java.lang.Math.min(r, g), b);\n\t\tint h = 0;\n\t\tint s = 0;\n\t int l = (max + min) / 2;\n\t if(max == min) {\n\t h = s = 0; // achromatic\n\t }else{\n\t \tint d = max - min;\n\t s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t if(max == r) {\n\t \th = (g - b) / d + (g < b ? 6 : 0);\n\t } else if(max == g) {\n\t \th = (b - r) / d + 2;\n\t } else if (max == b) {\n\t \th = (r - g) / d + 4;\n\t }\n\t h /= 6;\n\t }\n\t int [] ret = new int[3];\n\t ret[0] = h;\n\t ret[1] = s;\n\t ret[2] = l;\n\t return ret;\n\t}", "public abstract RGBFColor toRGBFColor();", "@ParameterizedTest\n @MethodSource(\"org.nd4j.linalg.BaseNd4jTestWithBackends#configs\")\n public void testHsvToRgb_1(Nd4jBackend backend) {\n INDArray image = Nd4j.createFromArray(new float[]{0.778785586f,0.801197767f,0.724374652f}).\n reshape(1,1,3);\n HsvToRgb op = new HsvToRgb(image);\n INDArray[] ret = Nd4j.exec(op);\n System.out.println(ret[0].toStringFull());\n INDArray expected = Nd4j.createFromArray(new float[]{ 0.53442812f, 0.144007325f, 0.724374652f}).reshape(1,1,3);\n assertEquals(expected, ret[0]);\n }", "public static void main(String[] args) {\n assert Arrays.equals(hsvToRgb(0, 0, 0), new int[] {0, 0, 0});\n assert Arrays.equals(hsvToRgb(0, 0, 1), new int[] {255, 255, 255});\n assert Arrays.equals(hsvToRgb(0, 1, 1), new int[] {255, 0, 0});\n assert Arrays.equals(hsvToRgb(60, 1, 1), new int[] {255, 255, 0});\n assert Arrays.equals(hsvToRgb(120, 1, 1), new int[] {0, 255, 0});\n assert Arrays.equals(hsvToRgb(240, 1, 1), new int[] {0, 0, 255});\n assert Arrays.equals(hsvToRgb(300, 1, 1), new int[] {255, 0, 255});\n assert Arrays.equals(hsvToRgb(180, 0.5, 0.5), new int[] {64, 128, 128});\n assert Arrays.equals(hsvToRgb(234, 0.14, 0.88), new int[] {193, 196, 224});\n assert Arrays.equals(hsvToRgb(330, 0.75, 0.5), new int[] {128, 32, 80});\n\n // Test rgbToHsv-method\n // approximate-assertions needed because of small deviations due to converting between\n // int-values and double-values.\n assert approximatelyEqualHsv(rgbToHsv(0, 0, 0), new double[] {0, 0, 0});\n assert approximatelyEqualHsv(rgbToHsv(255, 255, 255), new double[] {0, 0, 1});\n assert approximatelyEqualHsv(rgbToHsv(255, 0, 0), new double[] {0, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(255, 255, 0), new double[] {60, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(0, 255, 0), new double[] {120, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(0, 0, 255), new double[] {240, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(255, 0, 255), new double[] {300, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(64, 128, 128), new double[] {180, 0.5, 0.5});\n assert approximatelyEqualHsv(rgbToHsv(193, 196, 224), new double[] {234, 0.14, 0.88});\n assert approximatelyEqualHsv(rgbToHsv(128, 32, 80), new double[] {330, 0.75, 0.5});\n }", "private native int grayToRgb(byte src[],int dst[]);", "public float hue() {\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = color & 0xFF;\n\n int V = Math.max(b, Math.max(r, g));\n int temp = Math.min(b, Math.min(r, g));\n\n float H;\n\n if (V == temp) {\n H = 0;\n } else {\n final float vtemp = (float) (V - temp);\n final float cr = (V - r) / vtemp;\n final float cg = (V - g) / vtemp;\n final float cb = (V - b) / vtemp;\n\n if (r == V) {\n H = cb - cg;\n } else if (g == V) {\n H = 2 + cr - cb;\n } else {\n H = 4 + cg - cr;\n }\n\n H /= 6.f;\n if (H < 0) {\n H++;\n }\n }\n\n return H;\n }", "protected abstract void toSpace( float[] rgb );", "@ParameterizedTest\n @MethodSource(\"org.nd4j.linalg.BaseNd4jTestWithBackends#configs\")\n public void testRgbToHsv_1(Nd4jBackend backend) {\n INDArray image = Nd4j.createFromArray(new float[]{0.778785586f,0.801197767f,0.724374652f,\n 0.230894327f, 0.727141261f, 0.180390716f }).reshape(2,3);\n RgbToHsv op = new RgbToHsv(image);\n INDArray[] ret = Nd4j.exec(op);\n INDArray expected = Nd4j.createFromArray(new float[]{0.215289578f,0.095885336f,0.801197767f,\n 0.317938268f,0.751917899f,0.727141261f}).reshape(2,3);\n assertEquals(expected, ret[0]);\n }", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "@ColorInt\n public int getColor() {\n return Color.HSVToColor(mColorHSV);\n }", "void setFromHSB(float hue, float saturation, float brightness) {\r\n\t\tfloat[] RGBColor = Color.getHSBColor(hue, saturation, brightness).getRGBComponents(null);\r\n\t\tx = RGBColor[0];\r\n\t\ty = RGBColor[1];\r\n\t\tz = RGBColor[2];\r\n\t\t// Color.getHSBColor(hue, saturation, brightness).getRGBComponents(null);\r\n\t\t// System.out.println(Color.getHSBColor(hue, saturation,\r\n\t\t// brightness).getRGBComponents(null)[0]+\",\"+Color.getHSBColor(hue, saturation,\r\n\t\t// brightness).getRGBComponents(null)[1]+\",\"+Color.getHSBColor(hue, saturation,\r\n\t\t// brightness).getRGBComponents(null)[2]);\r\n\t}", "@Override\n public void addHSV(float H, float S, float V) {\n\n }", "protected abstract float[] getRgbLut();", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "public int getHslColor()\n {\n return _hslColor;\n }", "public Color getColor() {\r\n\t\treturn new Color(Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]));\r\n\t}", "public static float[] rgb2hsb(int r, int g, int b) {\r\n float[] hsbvals = new float[3];\r\n Color.RGBtoHSB(r, g, b, hsbvals);\r\n return hsbvals;\r\n }", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "public static Color fromBGR(int rgb) {\n return Color.rgb(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF);\n }", "public static Color bvToColor(double bv)\n\t{\n\t\tdouble t;\n\t\tdouble r = 0, g = 0, b = 0;\n\t\tbv = Math.max(-0.4, Math.min(2.0, bv));\n\t\tif ((bv >= -0.40) && (bv < 0.00))\n\t\t{\n\t\t\tt = (bv + 0.40) / (0.00 + 0.40);\n\t\t\tr = 0.61 + (0.11 * t) + (0.1 * t * t);\n\t\t}\n\t\telse if ((bv >= 0.00) && (bv < 0.40))\n\t\t{\n\t\t\tt = (bv - 0.00) / (0.40 - 0.00);\n\t\t\tr = 0.83 + (0.17 * t);\n\t\t}\n\t\telse if ((bv >= 0.40) && (bv < 2.10))\n\t\t{\n\t\t\tt = (bv - 0.40) / (2.10 - 0.40);\n\t\t\tr = 1.00;\n\t\t}\n\t\tif ((bv >= -0.40) && (bv < 0.00))\n\t\t{\n\t\t\tt = (bv + 0.40) / (0.00 + 0.40);\n\t\t\tg = 0.70 + (0.07 * t) + (0.1 * t * t);\n\t\t}\n\t\telse if ((bv >= 0.00) && (bv < 0.40))\n\t\t{\n\t\t\tt = (bv - 0.00) / (0.40 - 0.00);\n\t\t\tg = 0.87 + (0.11 * t);\n\t\t}\n\t\telse if ((bv >= 0.40) && (bv < 1.60))\n\t\t{\n\t\t\tt = (bv - 0.40) / (1.60 - 0.40);\n\t\t\tg = 0.98 - (0.16 * t);\n\t\t}\n\t\telse if ((bv >= 1.60) && (bv < 2.00))\n\t\t{\n\t\t\tt = (bv - 1.60) / (2.00 - 1.60);\n\t\t\tg = 0.82 - (0.5 * t * t);\n\t\t}\n\t\tif ((bv >= -0.40) && (bv < 0.40))\n\t\t{\n\t\t\tt = (bv + 0.40) / (0.40 + 0.40);\n\t\t\tb = 1.00;\n\t\t}\n\t\telse if ((bv >= 0.40) && (bv < 1.50))\n\t\t{\n\t\t\tt = (bv - 0.40) / (1.50 - 0.40);\n\t\t\tb = 1.00 - (0.47 * t) + (0.1 * t * t);\n\t\t}\n\t\telse if ((bv >= 1.50) && (bv < 1.94))\n\t\t{\n\t\t\tt = (bv - 1.50) / (1.94 - 1.50);\n\t\t\tb = 0.63 - (0.6 * t * t);\n\t\t}\n\t\treturn new Color((float) r, (float) g, (float) b);\n\t}", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public int getRGB(Object inData) {\n if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n int gray = getRed(inData); // Red sRGB component should equal\n // green and blue components\n return (getAlpha(inData) << 24)\n | (gray << 16)\n | (gray << 8)\n | gray;\n }\n if (!is_sRGB) {\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\n \"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premult values\n float[] rgb = colorSpace.toRGB(norm);\n return (getAlpha(inData) << 24)\n | (((int) (rgb[0] * 255.0f)) << 16)\n | (((int) (rgb[1] * 255.0f)) << 8)\n | (((int) (rgb[2] * 255.0f)) << 0);\n }\n return (getAlpha(inData) << 24)\n | (getRed(inData) << 16)\n | (getGreen(inData) << 8)\n | (getBlue(inData));\n }", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public void setPatternHSVAll(int h, int s, int v) {\n for (var i = 0; i < (m_ledBuffer.getLength()); i++) {\n m_ledBuffer.setHSV(i, h, s, v);\n }\n m_led.setData(m_ledBuffer);\n }", "RGB getNewColor();", "public ColorRgb getColorRgbBiLinear(double x, double y)\n {\n //-----------------------------------------------------------------\n double u = x - Math.floor(x);\n double v = y - Math.floor(y);\n double U = u * ((double)(getXSize()-2));\n double V = v * ((double)(getYSize()-2));\n int i = (int)Math.floor(U);\n int j = (int)Math.floor(V);\n double du = U - (double)i;\n double dv = V - (double)j;\n RGBPixel p;\n\n //-----------------------------------------------------------------\n p = getPixelRgb(i, j);\n ColorRgb F00 = new ColorRgb();\n F00.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F00.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F00.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j);\n ColorRgb F10 = new ColorRgb();\n F10.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F10.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F10.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i, j+1);\n ColorRgb F01 = new ColorRgb();\n F01.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F01.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F01.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j+1);\n ColorRgb F11 = new ColorRgb();\n F11.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F11.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F11.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n //-----------------------------------------------------------------\n ColorRgb FU0 = new ColorRgb();\n FU0.r = F00.r + du * (F10.r-F00.r);\n FU0.g = F00.g + du * (F10.g-F00.g);\n FU0.b = F00.b + du * (F10.b-F00.b);\n\n ColorRgb FU1 = new ColorRgb();\n FU1.r = F01.r + du * (F11.r-F01.r);\n FU1.g = F01.g + du * (F11.g-F01.g);\n FU1.b = F01.b + du * (F11.b-F01.b);\n\n ColorRgb FVAL = new ColorRgb();\n FVAL.r = FU0.r + dv * (FU1.r-FU0.r);\n FVAL.g = FU0.g + dv * (FU1.g-FU0.g);\n FVAL.b = FU0.b + dv * (FU1.b-FU0.b);\n\n return FVAL;\n }", "RGB getOldColor();", "private Mat segmentRedColorViaInverting(Mat bgr) {\n Mat bgrInverted = new Mat();\n Mat hsvInverted = new Mat();\n Mat maskInv = new Mat();\n Core.bitwise_not(bgr, bgrInverted);\n Imgproc.cvtColor(bgrInverted, hsvInverted, Imgproc.COLOR_BGR2HSV);\n inRange(hsvInverted, new Scalar(90 - MAX_COLOR_CHANNEL_OFFSET, 70, 50), new Scalar(90 + MAX_COLOR_CHANNEL_OFFSET, 255, 255), maskInv);\n return maskInv;\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 Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }", "int[][][] generateRainbow(int height, int width, VOrH vOrH);", "public short[][] getHue(){ return hue; }", "public static\n Color convertStringToColor(String val)\n {\n Color ret_Color;\n\n try\n {\n String workstr1;\n int slen = val.length();\n if (val.startsWith(\"0x\") || val.startsWith(\"0X\"))\n {\n workstr1 = val.substring(2);\n slen -= 2;\n }\n else\n if (val.startsWith(\"#\"))\n {\n workstr1 = val.substring(1);\n slen -= 1;\n }\n else\n { // decimal integer\n return new Color(Integer.parseInt(val));\n }\n\n // process hex string\n if (slen <= 6)\n { // no alpha\n int ival = Integer.parseInt(workstr1, 16);\n ret_Color = new Color(ival);\n }\n else\n { // has alpha of some sort\n String workstr2;\n if (slen == 8)\n {\n workstr2 = workstr1;\n }\n else\n if (slen == 7)\n {\n workstr2 = \"0\" + workstr1;\n }\n else\n {\n workstr2 = workstr1.substring(slen - 8); // get rightmost 8\n }\n\n // System.out.println(\"Color,val=[\" + val + \"],key=[\" + key + \"],slen=\" + slen + \"]\");\n // System.out.println(\" workstr1=[\" + workstr1 + \"],workstr2=[\" + workstr2 + \"]\");\n int a = Integer.parseInt(workstr2.substring(0, 2), 16); // a\n int r = Integer.parseInt(workstr2.substring(2, 4), 16); // r\n int g = Integer.parseInt(workstr2.substring(4, 6), 16); // g\n int b = Integer.parseInt(workstr2.substring(6, 8), 16); // b\n // System.out.println(\" ret_Color1=[\" + r + \":\" + g + \":\" + b +\":\" + a + \"]\");\n // int ival = Integer.parseInt(workstr2, 16);\n // ret_Color = new Color(ival, true);\n // System.out.println(\" ival=\" + ival);\n try {\n ret_Color = new Color(r, g, b, a);\n }\n catch (NoSuchMethodError excp1) {\n System.out.println(\"YutilProperties:convertStringToColor|excp1=[\" + excp1 + \"]\");\n ret_Color = new Color(r, g, b);\n }\n // System.out.println(\" ret_Color1=[\" + ret_Color + \"]\");\n }\n }\n catch(NumberFormatException e)\n {\n ret_Color = Color.black;\n // System.out.println(\"Color,ret_Color3=[\" + ret_Color + \"]\");\n }\n\n return ret_Color;\n }", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "public Color getColor(RGB rgb) {\n\t\treturn colorTable.computeIfAbsent(rgb, raw -> new Color(raw));\n\t}", "public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }", "@SuppressWarnings(\"unused\")\r\n\t\tprivate void gray8toRGB32(byte[] gray8, int width, int height, int[] rgb_32s) {\r\n\t\t\tfinal int endPtr = width * height;\r\n\t\t\tint ptr = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (ptr == endPtr)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tfinal int Y = gray8[ptr] & 0xff; \r\n\t\t\t\trgb_32s[ptr] = 0xff000000 + (Y << 16) + (Y << 8) + Y;\r\n\t\t\t\tptr++;\r\n\t\t\t}\r\n\t\t}", "public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }", "public static Color getRGBColor(String name)\n\t\t\tthrows IllegalArgumentException {\n\t\tint[] c = { 0, 0, 0, 0 };\n\t\tif (name.startsWith(\"#\")) {\n\t\t\tif (name.length() == 4) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;\n\t\t\t\tc[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;\n\t\t\t\tc[2] = Integer.parseInt(name.substring(3), 16) * 16;\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tif (name.length() == 7) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 3), 16);\n\t\t\t\tc[1] = Integer.parseInt(name.substring(3, 5), 16);\n\t\t\t\tc[2] = Integer.parseInt(name.substring(5), 16);\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(MessageLocalization.getComposedMessage(\"unknown.color.format.must.be.rgb.or.rrggbb\"));\n\t\t}\n else if (name.startsWith(\"rgb(\")) {\n StringTokenizer tok = new StringTokenizer(name, \"rgb(), \\t\\r\\n\\f\");\n for (int k = 0; k < 3; ++k) {\n String v = tok.nextToken();\n if (v.endsWith(\"%\"))\n c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;\n else\n c[k] = Integer.parseInt(v);\n if (c[k] < 0)\n c[k] = 0;\n else if (c[k] > 255)\n c[k] = 255;\n }\n return new Color(c[0], c[1], c[2], c[3]);\n }\n\t\tname = name.toLowerCase();\n\t\tif (!NAMES.containsKey(name))\n\t\t\tthrow new IllegalArgumentException(\"Color '\" + name\n\t\t\t\t\t+ \"' not found.\");\n\t\tc = (int[]) NAMES.get(name);\n\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t}", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "public static BufferedImage createRGB32Image(int w, int h) {\n int transferType = DataBuffer.TYPE_INT;\n ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), \n false, false, Transparency.OPAQUE, transferType);\n WritableRaster raster = colorModel.createCompatibleWritableRaster(w, h);\n\n int[] destData = ((DataBufferInt) raster.getDataBuffer()).getData();\n final int imgDataCount = w * h * 3;\n if (destData.length != imgDataCount) {\n throw new RuntimeException(\"\");\n }\n return new BufferedImage(colorModel, raster, false, null);\n }", "public static int fixRGBValue(int v) {\n if (v < 0) v = -v;\n if (v > 255) v = 255;\n return v;\n }", "public static int toRGB(byte red, byte green, byte blue) {\n int result = byteToUnsignedShort(red);\n result = (result << 8) + byteToUnsignedShort(green);\n result = (result << 8) + byteToUnsignedShort(blue);\n return result;\n }", "private native void convertToLum( short[] data, int w, int h );", "public void rangeHSV(int min, int number, int h, int s, int v) {\n int max = min + number;\n\n for (int i = min; i < (max); i++) {\n m_ledBuffer.setHSV(i, h, s, v);\n }\n\n m_led.setData(m_ledBuffer);\n }", "public static AnsiColor rgb(Color c) {\n return new RgbColor(c);\n }", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public static Color hex2Rgb(String colorStr) {\n return new Color(\n Integer.valueOf( colorStr.substring( 1, 3 ), 16 ),\n Integer.valueOf( colorStr.substring( 3, 5 ), 16 ),\n Integer.valueOf( colorStr.substring( 5, 7 ), 16 ) );\n }", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "public static int[] convertRGB(int rgbValue) throws Exception {\r\n\t\t//RGB Array:\r\n\t\tint rgbValues[] = new int[3];\r\n\r\n\t\t//Array Values:\r\n\t\tint blue = (rgbValue) & 0x0ff;\r\n\t\tint green = (rgbValue >> 8) & 0x0ff;\r\n\t\tint red = (rgbValue >> 16) & 0x0ff;\r\n\r\n\t\t//Inputs into Array:\r\n\t\trgbValues[0] = red;\r\n\t\trgbValues[1] = green;\r\n\t\trgbValues[2] = blue;\r\n\r\n\t\t//Returns Array:\r\n\t\treturn rgbValues;\r\n\t}", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "public HSLColor(float h, float s, float l) {\n\t\tthis.color = toColorObject(h, s, l);\n\t}", "public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}", "private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }", "private Color getColor(final RGB rgb) {\n Color color = this.colorTable.get(rgb);\n if (color == null) {\n color = new Color(Display.getCurrent(), rgb);\n this.colorTable.put(rgb, color);\n }\n return color;\n }", "private Mat segmentRedColor(Mat bgr) {\n Mat mask1 = new Mat();\n Mat mask2 = new Mat();\n Mat normal = new Mat();\n Mat hsv = new Mat();\n Imgproc.cvtColor(bgr, hsv, Imgproc.COLOR_BGR2HSV, 3);\n inRange(hsv, new Scalar(0, 120, 50), new Scalar(MAX_COLOR_CHANNEL_OFFSET, 255, 255), mask1);\n inRange(hsv, new Scalar(170, 120, 50), new Scalar(180, 255, 255), mask2);\n Core.bitwise_or(mask1, mask2, normal);\n return mask1;\n }", "public static double[] cmyToRgb(double[] cmy) {\n\t\tassert(cmy != null && cmy.length == 3);\n\t\tdouble[] rgb = new double[3];\n\t\trgb[0] = (1-cmy[0]) * 255;\n\t\trgb[1] = (1-cmy[1]) * 255;\n\t\trgb[2] = (1-cmy[2]) * 255;\n\t\treturn rgb;\n\t}", "int getHighLightColor();", "public static int[][] convertToGray(int w, int h, int[][] red, int[][] green,\r\n int[][] blue) {\r\n int [][]gray = new int [w][h];\r\n for( w = 0; w<gray.length;w++) {\r\n for (h = 0; h < gray[0].length; h++) {\r\n\r\n\r\n gray[w][h] =(int) ((0.2126 * red[w][h]) +( 0.7152 * green[w][h]) + (0.0722 * blue[w][h]) );\r\n //two for nested loops\r\n }\r\n }\r\n\r\n return gray;\r\n }", "public static void main(String [] args) {\n Scanner myScanner; //define myScanner\n myScanner = new Scanner( System.in );\n System.out.print(\"Please enter three numbers representing RGB values: \");\n if (myScanner.hasNextInt() == true && myScanner.hasNextInt() == true && myScanner.hasNextInt() == true) {\n int redValue = myScanner.nextInt(); //red as first input\n int greenValue = myScanner.nextInt(); //green as second input\n int blueValue = myScanner.nextInt(); //blue is last input\n if (redValue >= 0 && redValue <= 255 && greenValue >= 0 && greenValue <= 255 && blueValue >= 0 && blueValue <= 255) {\n int firstValue = redValue/16; //calculate first number\n String firstValueHex; //declare it to use later\n switch (firstValue) {\n case 0:\n firstValueHex = \"0\";\n break;\n case 1:\n firstValueHex = \"1\";\n break;\n case 2:\n firstValueHex = \"2\";\n break;\n case 3:\n firstValueHex = \"3\";\n break;\n case 4:\n firstValueHex = \"4\";\n break;\n case 5:\n firstValueHex = \"5\";\n break;\n case 6:\n firstValueHex = \"6\";\n break;\n case 7:\n firstValueHex = \"7\";\n break;\n case 8:\n firstValueHex = \"8\";\n break;\n case 9:\n firstValueHex = \"9\";\n break;\n case 10:\n firstValueHex = \"A\";\n break;\n case 11:\n firstValueHex = \"B\";\n break;\n case 12:\n firstValueHex = \"C\";\n break;\n case 13:\n firstValueHex = \"D\";\n break;\n case 14:\n firstValueHex = \"E\";\n break;\n case 15:\n firstValueHex = \"F\";\n break;\n default:\n firstValueHex = \"0\";\n break;\n }\n int secondValue = redValue%16; //calculate second number\n String secondValueHex; //declare it to use later\n switch (secondValue) {\n case 0:\n secondValueHex = \"0\";\n break;\n case 1:\n secondValueHex = \"1\";\n break;\n case 2:\n secondValueHex = \"2\";\n break;\n case 3:\n secondValueHex = \"3\";\n break;\n case 4:\n secondValueHex = \"4\";\n break;\n case 5:\n secondValueHex = \"5\";\n break;\n case 6:\n secondValueHex = \"6\";\n break;\n case 7:\n secondValueHex = \"7\";\n break;\n case 8:\n secondValueHex = \"8\";\n break;\n case 9:\n secondValueHex = \"9\";\n break;\n case 10:\n secondValueHex = \"A\";\n break;\n case 11:\n secondValueHex = \"B\";\n break;\n case 12:\n secondValueHex = \"C\";\n break;\n case 13:\n secondValueHex = \"D\";\n break;\n case 14:\n secondValueHex = \"E\";\n break;\n case 15:\n secondValueHex = \"F\";\n break;\n default:\n secondValueHex = \"0\";\n break;\n }\n int thirdValue = greenValue/16; //calculate third number\n String thirdValueHex; //declare it to use later\n switch (thirdValue) {\n case 0:\n thirdValueHex = \"0\";\n break;\n case 1:\n thirdValueHex = \"1\";\n break;\n case 2:\n thirdValueHex = \"2\";\n break;\n case 3:\n thirdValueHex = \"3\";\n break;\n case 4:\n thirdValueHex = \"4\";\n break;\n case 5:\n thirdValueHex = \"5\";\n break;\n case 6:\n thirdValueHex = \"6\";\n break;\n case 7:\n thirdValueHex = \"7\";\n break;\n case 8:\n thirdValueHex = \"8\";\n break;\n case 9:\n thirdValueHex = \"9\";\n break;\n case 10:\n thirdValueHex = \"A\";\n break;\n case 11:\n thirdValueHex = \"B\";\n break;\n case 12:\n thirdValueHex = \"C\";\n break;\n case 13:\n thirdValueHex = \"D\";\n break;\n case 14:\n thirdValueHex = \"E\";\n break;\n case 15:\n thirdValueHex = \"F\";\n break;\n default:\n thirdValueHex = \"0\";\n break;\n }\n int fourthValue = greenValue%16; //calculate fourth number\n String fourthValueHex; //declare it to use later\n switch (fourthValue) {\n case 0:\n fourthValueHex = \"0\";\n break;\n case 1:\n fourthValueHex = \"1\";\n break;\n case 2:\n fourthValueHex = \"2\";\n break;\n case 3:\n fourthValueHex = \"3\";\n break;\n case 4:\n fourthValueHex = \"4\";\n break;\n case 5:\n fourthValueHex = \"5\";\n break;\n case 6:\n fourthValueHex = \"6\";\n break;\n case 7:\n fourthValueHex = \"7\";\n break;\n case 8:\n fourthValueHex = \"8\";\n break;\n case 9:\n fourthValueHex = \"9\";\n break;\n case 10:\n fourthValueHex = \"A\";\n break;\n case 11:\n fourthValueHex = \"B\";\n break;\n case 12:\n fourthValueHex = \"C\";\n break;\n case 13:\n fourthValueHex = \"D\";\n break;\n case 14:\n fourthValueHex = \"E\";\n break;\n case 15:\n fourthValueHex = \"F\";\n break;\n default:\n fourthValueHex = \"0\";\n break;\n }\n int fifthValue = blueValue/16; //calculate fifth number\n String fifthValueHex; //declare it to use later\n switch (fifthValue) {\n case 0:\n fifthValueHex = \"0\";\n break;\n case 1:\n fifthValueHex = \"1\";\n break;\n case 2:\n fifthValueHex = \"2\";\n break;\n case 3:\n fifthValueHex = \"3\";\n break;\n case 4:\n fifthValueHex = \"4\";\n break;\n case 5:\n fifthValueHex = \"5\";\n break;\n case 6:\n fifthValueHex = \"6\";\n break;\n case 7:\n fifthValueHex = \"7\";\n break;\n case 8:\n fifthValueHex = \"8\";\n break;\n case 9:\n fifthValueHex = \"9\";\n break;\n case 10:\n fifthValueHex = \"A\";\n break;\n case 11:\n fifthValueHex = \"B\";\n break;\n case 12:\n fifthValueHex = \"C\";\n break;\n case 13:\n fifthValueHex = \"D\";\n break;\n case 14:\n fifthValueHex = \"E\";\n break;\n case 15:\n fifthValueHex = \"F\";\n break;\n default:\n fifthValueHex = \"0\";\n break;\n }\n int sixthValue = blueValue%16; //calculate sixth number\n String sixthValueHex; //declare it to use later\n switch (sixthValue) {\n case 0:\n sixthValueHex = \"0\";\n break;\n case 1:\n sixthValueHex = \"1\";\n break;\n case 2:\n sixthValueHex = \"2\";\n break;\n case 3:\n sixthValueHex = \"3\";\n break;\n case 4:\n sixthValueHex = \"4\";\n break;\n case 5:\n sixthValueHex = \"5\";\n break;\n case 6:\n sixthValueHex = \"6\";\n break;\n case 7:\n sixthValueHex = \"7\";\n break;\n case 8:\n sixthValueHex = \"8\";\n break;\n case 9:\n sixthValueHex = \"9\";\n break;\n case 10:\n sixthValueHex = \"A\";\n break;\n case 11:\n sixthValueHex = \"B\";\n break;\n case 12:\n sixthValueHex = \"C\";\n break;\n case 13:\n sixthValueHex = \"D\";\n break;\n case 14:\n sixthValueHex = \"E\";\n break;\n case 15:\n sixthValueHex = \"F\";\n break;\n default:\n sixthValueHex = \"0\";\n break;\n } \n System.out.println(\"The decimal numbers R: \"+redValue+\" G: \"+greenValue+\" B: \"+blueValue+\n \" is represented in hexadecimal as: \"+firstValueHex+secondValueHex+thirdValueHex+fourthValueHex\n +fifthValueHex+sixthValueHex); //print numbers in hexdecimal\n }\n else{\n System.out.println(\"Sorry, you must enter numbers between 0 and 255\"); //tell user they messed up input\n }\n }\n else{\n System.out.println(\"Sorry, you must enter 3 integers\"); //tell user they messed up input\n }\n \n \n \n \n }", "public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }", "public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "void greyscale();", "void greyscale();", "public void addColor(Color rgb) {\r\n\t\thsb = Color\r\n\t\t\t\t.RGBtoHSB(rgb.getRed(), rgb.getGreen(), rgb.getBlue(), null);\r\n\t}", "public static float[] rgb2cmyk(int rgb) {\r\n float r = (rgb >> 16) & 0xFF;\r\n float g = (rgb >> 8) & 0xFF;\r\n float b = rgb & 0xFF;\r\n float C = 1.0f - (r / 255);\r\n float M = 1.0f - (g / 255);\r\n float Y = 1.0f - (b / 255);\r\n float var_K = 1;\r\n\r\n if (C < var_K) {\r\n var_K = C;\r\n }\r\n if (M < var_K) {\r\n var_K = M;\r\n }\r\n if (Y < var_K) {\r\n var_K = Y;\r\n }\r\n\r\n C = (C - var_K) / (1 - var_K);\r\n M = (M - var_K) / (1 - var_K);\r\n Y = (Y - var_K) / (1 - var_K);\r\n return new float[] { C * 100, M * 100, Y * 100, var_K * 100 };\r\n }", "public RGBColor getColor(){\r\n return this._color;\r\n }", "public static int convertSingularRGB(int[] rgbValues) throws Exception {\r\n\t\t//Color Variables:\r\n\t\tint standardColorValue = (((rgbValues[0] & 0x0ff) << 16) | ((rgbValues[1] & 0x0ff) << 8) | ((rgbValues[2] & 0x0ff)));\r\n\r\n\t\t//Returns Value:\r\n\t\treturn standardColorValue;\r\n\t}", "int[] getStartRGB();", "int[] getEndRGB();", "public void setHslColorBg(int newval) throws YAPI_Exception\n {\n _hslColor = newval;\n _ycolorled.set_hslColor(newval);\n }", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "public static BufferedImage convertG16ToRGB24(BufferedImage source) {\n int width = source.getWidth();\n int height = source.getHeight();\n BufferedImage retVal = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\n Raster raster = source.getData();\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n int original = raster.getSample(x, y, 0);\n //fixed addition of 1000m to get out of negative numbers everywhere\n //multiply by 100 to get the value in centimeters\n //this should comfortably fit in 24 bits considering lowest point\n //-418m and highest point 8800m give or take.\n //four bit left shift is for better visual representation of small\n //values (now they are represented with higher values of blue and\n //green)\n int replacement = ((original + 1000) * 100) << 4;\n\n retVal.setRGB(x, y, replacement);\n }\n }\n\n return retVal;\n }", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "public static Color deriveColorHSB(Color base, float dH, float dS, float dB) {\n float hsb[] = Color.RGBtoHSB(\n base.getRed(), base.getGreen(), base.getBlue(), null);\n\n hsb[0] += dH;\n hsb[1] += dS;\n hsb[2] += dB;\n return Color.getHSBColor(\n hsb[0] < 0? 0 : (hsb[0] > 1? 1 : hsb[0]),\n hsb[1] < 0? 0 : (hsb[1] > 1? 1 : hsb[1]),\n hsb[2] < 0? 0 : (hsb[2] > 1? 1 : hsb[2]));\n \n }", "private Color getColor(RGB rgb)\n\t{\n\t\treturn rgb == null ? null : colorRegistry.get(rgb);\n\t}", "public Color getColor();", "public Color getColor();", "public Color getColor();", "public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "int getAsInt32Color(int a) {\r\n\t\tint r = (int) (x * 255);\r\n\t\tint g = (int) (y * 255);\r\n\t\tint b = (int) (z * 255);\r\n\t\tif (r > 255) {\r\n\t\t\tr = 255;\r\n\t\t}\r\n\t\tif (g > 255) {\r\n\t\t\tg = 255;\r\n\t\t}\r\n\t\tif (b > 255) {\r\n\t\t\tb = 255;\r\n\t\t}\r\n\r\n\t\tif (r < 0) {\r\n\t\t\tr = 0;\r\n\t\t}\r\n\t\tif (g < 0) {\r\n\t\t\tg = 0;\r\n\t\t}\r\n\t\tif (b < 0) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\treturn (b | g << 8 | r << 16 | a << 24);\r\n\t}", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "java.awt.Color getColor();", "public GameColor getColor();", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }" ]
[ "0.73704934", "0.7099642", "0.7077565", "0.6938358", "0.69081855", "0.6859896", "0.6767003", "0.66153425", "0.65059745", "0.6475775", "0.64259535", "0.6364422", "0.63375443", "0.63205993", "0.62631077", "0.6238345", "0.6129053", "0.5969119", "0.5872557", "0.57994324", "0.57801175", "0.5764232", "0.5727749", "0.5721828", "0.568375", "0.5657671", "0.56348413", "0.55932283", "0.5575969", "0.55543596", "0.55490786", "0.5536744", "0.5525387", "0.5522921", "0.5521758", "0.547094", "0.54438776", "0.53993714", "0.5374419", "0.5358193", "0.53560436", "0.53222805", "0.5308354", "0.52888083", "0.528563", "0.52787054", "0.5275494", "0.5263201", "0.5243528", "0.5240176", "0.5239629", "0.5214806", "0.5209381", "0.5208594", "0.51795197", "0.5179158", "0.5173169", "0.5167034", "0.515083", "0.5146732", "0.51420456", "0.5132148", "0.51302737", "0.5128514", "0.5124849", "0.5116517", "0.510125", "0.5094621", "0.5090636", "0.5080746", "0.5079971", "0.5050106", "0.5041359", "0.5041359", "0.5034709", "0.50311065", "0.5024979", "0.5014974", "0.5013141", "0.50063026", "0.49945807", "0.49721918", "0.4941811", "0.4941489", "0.49410334", "0.49404436", "0.49177632", "0.49177632", "0.49177632", "0.4914169", "0.4912661", "0.4912661", "0.4912661", "0.4912661", "0.4912661", "0.49117687", "0.49086583", "0.49077752", "0.4898055", "0.48938224" ]
0.778027
0
Convert an RGB array to an int value that represents RGB which can be used in BufferedImage setRGB() method
public static int rgbArrayToRgbInt(double[] array) { if (array == null) { return 0 ; } if (array.length != 3) { return 0; } return (255 & 0xFF) << 24 + ((int)array[0] & 0xFF) << 16 + ((int)array[1] & 0xFF) << 8 + ((int)array[2] & 0xFF); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int rgbArrayToRgbInt(int[] array) {\n\t\tif (array == null) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (array.length != 3) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble[] doubleArray = {array[0], array[1], array[2]};\n\t\treturn ColorConverter.rgbArrayToRgbInt(doubleArray);\n\t}", "int[] getStartRGB();", "public int toInt() {\n\n\t\tint iR, iG, iB;\n\n\t\t// Here we do the dumb thing and simply clamp then scale.\n\t\t// The \"+ 0.5\" is to achieve a \"round to nearest\" effect\n\t\t// since Java float to int casting simply truncates.\n\t\tiR = (int) (255.0 * Math.max(Math.min(r, 1.0), 0.0) + 0.5);\n\t\tiG = (int) (255.0 * Math.max(Math.min(g, 1.0), 0.0) + 0.5);\n\t\tiB = (int) (255.0 * Math.max(Math.min(b, 1.0), 0.0) + 0.5);\n\n\t\t// Bit packing at its finest\n\t\treturn (iR << 16) | (iG << 8) | (iB << 0);\n\t}", "private native int grayToRgb(byte src[],int dst[]);", "public int getColorInt () {\r\n return this.colorReturned;\r\n }", "public abstract RGBIColor toRGBColor();", "public static int ColorToInt(Color c) {\n\t\treturn android.graphics.Color.argb(cap((int) (c.getAlpha() * 255), 0, 255), cap((int) (c.getRed() * 255), 0, 255), cap((int) (c.getGreen() * 255), 0, 255), cap((int) (c.getBlue() * 255), 0, 255));\n\t}", "public int getIntColor(final double value) {\n final Color color = getColor(value);\n return ((byte) (color.getOpacity() * 255) << 24) + ((byte) (color.getRed() * 255) << 16)\n + ((byte) (color.getGreen() * 255) << 8) + ((byte) (color.getBlue() * 255));\n }", "public int getRGB(Object inData) {\n if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n int gray = getRed(inData); // Red sRGB component should equal\n // green and blue components\n return (getAlpha(inData) << 24)\n | (gray << 16)\n | (gray << 8)\n | gray;\n }\n if (!is_sRGB) {\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\n \"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premult values\n float[] rgb = colorSpace.toRGB(norm);\n return (getAlpha(inData) << 24)\n | (((int) (rgb[0] * 255.0f)) << 16)\n | (((int) (rgb[1] * 255.0f)) << 8)\n | (((int) (rgb[2] * 255.0f)) << 0);\n }\n return (getAlpha(inData) << 24)\n | (getRed(inData) << 16)\n | (getGreen(inData) << 8)\n | (getBlue(inData));\n }", "public int toARGB() {\n return ((a & 255) << 24) |\n ((r & 255) << 16) |\n ((g & 255) << 8) |\n ((b & 255) );\n }", "static public int fromRGB(int red, int green, int blue) {\n red = saturate(red, 0, 255);\n green = saturate(green, 0, 255);\n blue = saturate(blue, 0, 255);\n return (0xff << 24) + ((red & 0xff) << 16) + ((green & 0xff) << 8) + (blue & 0xff);\n }", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public static int toRGB(Color color) {\n int result = (int) (color.getRed() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getBlue() * 0xFF);\n return result;\n }", "int getAsInt32Color(int a) {\r\n\t\tint r = (int) (x * 255);\r\n\t\tint g = (int) (y * 255);\r\n\t\tint b = (int) (z * 255);\r\n\t\tif (r > 255) {\r\n\t\t\tr = 255;\r\n\t\t}\r\n\t\tif (g > 255) {\r\n\t\t\tg = 255;\r\n\t\t}\r\n\t\tif (b > 255) {\r\n\t\t\tb = 255;\r\n\t\t}\r\n\r\n\t\tif (r < 0) {\r\n\t\t\tr = 0;\r\n\t\t}\r\n\t\tif (g < 0) {\r\n\t\t\tg = 0;\r\n\t\t}\r\n\t\tif (b < 0) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\treturn (b | g << 8 | r << 16 | a << 24);\r\n\t}", "public int[] getRGB() throws ImageException {\r\n\tif (!bValid){\r\n\t\tthrow new ImageException(\"image not valid\");\r\n\t}\t\r\n\treturn originalRGB;\r\n}", "public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }", "public abstract int rgbColor(double u, double v);", "public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}", "public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}", "public static int[] convertRGB(int rgbValue) throws Exception {\r\n\t\t//RGB Array:\r\n\t\tint rgbValues[] = new int[3];\r\n\r\n\t\t//Array Values:\r\n\t\tint blue = (rgbValue) & 0x0ff;\r\n\t\tint green = (rgbValue >> 8) & 0x0ff;\r\n\t\tint red = (rgbValue >> 16) & 0x0ff;\r\n\r\n\t\t//Inputs into Array:\r\n\t\trgbValues[0] = red;\r\n\t\trgbValues[1] = green;\r\n\t\trgbValues[2] = blue;\r\n\r\n\t\t//Returns Array:\r\n\t\treturn rgbValues;\r\n\t}", "public int[] convertByteToInt(BufferedImage img) throws IOException {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n ImageIO.write(img, \"png\", baos);\r\n byte[] byteArr = baos.toByteArray();\r\n int[] intArr = new int[byteArr.length];\r\n for(int i = 0; i < byteArr.length; i++) {\r\n intArr[i] = (int)byteArr[i] & 0xFF;\r\n }\r\n return intArr;\r\n }", "public static int getGrayscale(int rgb[]) throws Exception {\r\n\t\t//Weights;\r\n\t\tdouble redWeight = 0.2126;\r\n\t\tdouble greenWeight = 0.7152;\r\n\t\tdouble blueWeight = 0.0722;\r\n\r\n\t\t//Multiplies the RGB by the Weights:\r\n\t\tint redWeighted = (int) (rgb[0] * redWeight);\r\n\t\tint greenWeighted = (int) (rgb[1] * greenWeight);\r\n\t\tint blueWeighted = (int) (rgb[2] * blueWeight);\r\n\r\n\t\t//Gets the GrayScale Value:\r\n\t\tint grayscale = redWeighted + greenWeighted + blueWeighted;\r\n\r\n\t\t//Returns the GrayScale Value:\r\n\t\treturn grayscale;\r\n\t}", "public int getRGB(int pixel) {\n if (numComponents > 1) {\n throw new\n IllegalArgumentException(\"More than one component per pixel\");\n }\n\n\treturn (getAlpha(pixel) << 24)\n\t | (getRed(pixel) << 16)\n\t | (getGreen(pixel) << 8)\n\t | (getBlue(pixel) << 0);\n }", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "int[] getEndRGB();", "public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}", "private static int get(int colour) {\r\n\t\t// If the color is incorrect (less than 0) the color is set invisible\r\n\t\tif (colour < 0) {\r\n\t\t\treturn 255;\r\n\t\t}\r\n\r\n\t\t// taking each number of the argument\r\n\t\tint r = colour / 100 % 10;\r\n\t\tint g = colour / 10 % 10;\r\n\t\tint b = colour % 10;\r\n\r\n\t\t// returning the 6*6*6 color\r\n\t\treturn r * 6 * 6 + g * 6 + b;\r\n\t}", "public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }", "int getClosestPalettePixel(int[] prgb);", "public static int toRGB(byte red, byte green, byte blue) {\n int result = byteToUnsignedShort(red);\n result = (result << 8) + byteToUnsignedShort(green);\n result = (result << 8) + byteToUnsignedShort(blue);\n return result;\n }", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public Integer convertRubiksColorToInteger(RubiksColor color) {\n return rubiksColorMap.get(color);\n }", "public static int[] convertImageToIntArray(Image image)\n {\n // Get byte array representing every pixels of the image\n return ((DataBufferInt)convertImageToBufferedImage(image).getRaster().getDataBuffer()).getData();\n }", "public int getRed(int pixel) {\n if (numComponents > 1) {\n throw new\n IllegalArgumentException(\"More than one component per pixel\");\n }\n // Since there is only 1 component, there is no alpha\n\n // Normalize the pixel in order to convert it\n float[] norm = { (float) pixel / ((1<<nBits[0]) - 1) };\n float[] rgb = colorSpace.toRGB(norm);\n\n return (int) (rgb[0]*255);\n }", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }", "public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }", "int getRed(int x, int y);", "public native int getNumberColors() throws MagickException;", "public static int[] getPixelColor(final BufferedImage img, final int x, final int y){\n int rgb = img.getRGB(x, y);\n int r = (rgb >> 16) & 0xFF;\n int g = (rgb >> 8) & 0xFF;\n int b = (rgb & 0xFF);\n\t\n return new int[]{r,g,b};\n }", "private int toInt(int[] arrValue) {\n // convert int[] to int\n StringBuilder temp = new StringBuilder();\n\n int i = 0;\n while (i < arrValue.length) {\n temp.append(arrValue[i]);\n i++;\n }\n\n return Integer.parseInt(temp.toString());\n }", "public static int convertSingularRGB(int[] rgbValues) throws Exception {\r\n\t\t//Color Variables:\r\n\t\tint standardColorValue = (((rgbValues[0] & 0x0ff) << 16) | ((rgbValues[1] & 0x0ff) << 8) | ((rgbValues[2] & 0x0ff)));\r\n\r\n\t\t//Returns Value:\r\n\t\treturn standardColorValue;\r\n\t}", "public int getColorAt(float index){\n\n\t\tint i = Math.round((img.width-1)*index);\n\t\tint c = img.get(i,0);\n\t\treturn c;\n\n\t}", "RGB getOldColor();", "public int[] getColorRGBarray(WebDriver driver, By element, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tString color = driver.findElement(element).getCssValue(css);\n\t\t color = color.substring(0, color.indexOf(\")\") + 1);\n\t\tString colorAfterRed = color.substring(color.indexOf(\",\") + 2, color.length());\n\t\tString colorAfterGreen = colorAfterRed.substring(colorAfterRed.indexOf(\",\") + 2, colorAfterRed.length());\t\t\n\t\tint red = Integer.valueOf(color.substring(color.indexOf(\"(\") + 1, color.indexOf(\",\")));\n\t\tint green = Integer.valueOf(colorAfterRed.substring(0, colorAfterRed.indexOf(\",\")));\n\t\tint blue = Integer.valueOf(colorAfterGreen.substring(0, colorAfterGreen.indexOf(\",\")));\n\t\tString[] Name = {\"RED = \", \"GREEN = \", \"BLUE = \"};\n\t\tint[] Color = {red, green, blue};\n\t\tif(ifPrint){\n\t\t\tfor (int i = 0; i < Color.length; i++) {\n\t\t\t\tfileWriterPrinter(Name[0] + Color[0]);\n\t\t\t}\n\t\t}\n\t\treturn Color;\n\t}", "public static int MeanRGBtoGray(int r, int g, int b) {\n return (r + b + g) / 3;\n }", "public int getColorValue() {\r\n\t\treturn color;\r\n\t}", "static public int getRed(int color) {\n return (color >> 16) & 0xff;\n }", "public int filterRGB(int x, int y, int argb) {\n color = new Color(argb);\n newBlue = multColor(color.getBlue(), blueMultiplier);\n newGreen = multColor(color.getGreen(), greenMultiplier);\n newRed = multColor(color.getRed(), redMultiplier);\n newColor = new Color(newRed, newGreen, newBlue);\n return (newColor.getRGB());\n }", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "public native int getColors() throws MagickException;", "public int[] getColorRGBarray(WebDriver driver, String xpath, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tString color = driver.findElement(By.xpath(xpath)).getCssValue(css);\n\t\t color = color.substring(0, color.indexOf(\")\") + 1);\n\t\tString colorAfterRed = color.substring(color.indexOf(\",\") + 2, color.length());\n\t\tString colorAfterGreen = colorAfterRed.substring(colorAfterRed.indexOf(\",\") + 2, colorAfterRed.length());\t\t\n\t\tint red = Integer.valueOf(color.substring(color.indexOf(\"(\") + 1, color.indexOf(\",\")));\n\t\tint green = Integer.valueOf(colorAfterRed.substring(0, colorAfterRed.indexOf(\",\")));\n\t\tint blue = Integer.valueOf(colorAfterGreen.substring(0, colorAfterGreen.indexOf(\",\")));\n\t\tString[] Name = {\"RED = \", \"GREEN = \", \"BLUE = \"};\n\t\tint[] Color = {red, green, blue};\n\t\tif(ifPrint){\n\t\t\tfor (int i = 0; i < Color.length; i++) {\n\t\t\t\tfileWriterPrinter(Name[0] + Color[0]);\n\t\t\t}\n\t\t}\n\t\treturn Color;\n\t}", "public int getGreen(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int green = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n green = bdata[1] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n green = sdata[1] & 0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n green = idata[1];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[1] != 8) {\n int shift = nBits[1] - 8;\n green = ((shift > 0) \n ? (green>>shift)\n : (green<<(-shift)));\n\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (green*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return green;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[1] * 255.0f);\n }", "public int getArgb(int x, int y) {\n if (x < 0 || x >= width || y < 0 || y >= height) {\n throw new IllegalArgumentException(\"x,y must be >0, <width, height\");\n }\n int argb = pixelBuffer.get(x + y*scanlineStride/4);\n if ((argb >> 24) == -1) {\n return argb;\n }\n int a = argb >>> 24;\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb ) & 0xff;\n int a2 = a + (a >> 7);\n r = (r * a2) >> 8;\n g = (g * a2) >> 8;\n b = (b * a2) >> 8;\n return ((a << 24) | (r << 16) | (g << 8) | (b));\n }", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public int[] getColorIndices();", "private int getPixelBin(int[] pixel) {\r\n\t\treturn (int) ((int) (pixel[0] / redValues) * (binsPerColour)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[1] / greenValues)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[2] / blueValues));\r\n\t}", "@ColorInt\n public int getColor() {\n return Color.HSVToColor(mColorHSV);\n }", "public int getColor();", "public int getColor();", "public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}", "public static int[] getPixelColor(BufferedImage image,int x,int y) {\n int colors[] = new int[3];\n int clr = 0;\n\n try{\n clr = image.getRGB(x,y); \n }catch(Exception e){\n System.out.println(e);\n System.out.println(x + \" \" + y);\n }\n\n int red = (clr & 0x00ff0000) >> 16;\n int green = (clr & 0x0000ff00) >> 8;\n int blue = clr & 0x000000ff;\n colors[0] = red;\n colors[1] = green;\n colors[2] = blue;\n return colors;\n }", "public static int getRgbAvg(int argb0, int argb1){\n\n\t\tint red0 = argb0 & 0xff;\n\t\tint green0 = (argb0 >> 8) & 0xff;\n\t\tint blue0 = (argb0 >> 16) & 0xff;\n\n\t\tint red1 = argb1 & 0xff;\n\t\tint green1 = (argb1 >> 8) & 0xff;\n\t\tint blue1 = (argb1 >> 16) & 0xff;\n\n\t\tint red = (red0 + red1) /2;\n\t\tint green = (green0 + green1) /2;\n\t\tint blue = (blue0 + blue1) /2;\n\n\n\t\tint avg = (0xff << 24) + (red << 16) + (green << 8) + blue;\n\n\t\treturn avg;\n\t}", "public static int rgb(String hex) {\n int color = (int) Long.parseLong(hex.replace(\"#\", \"\"), 16);\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = (color >> 0) & 0xFF;\n return Color.rgb(r, g, b);\n }", "public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "void fill(int rgb);", "protected abstract float[] getRgbLut();", "RGB getNewColor();", "public int getPrimaryColor(int i) {\n return primary[i];\n }", "public static int[] luminance(int[] pixel) {\n\n\t\t// Creating it in double to have the right numbers\n\t\tdouble[] templum = new double[3]; \n\n\t\ttemplum[0] = (double) (0.299 * pixel[0]);\n\t\ttemplum[1] = (double) (0.587 * pixel[1]);\n\t\ttemplum[2] = (double) (0.114 * pixel[2]);\n\n\t\t// Summing the grey color of every pixel and parsing\n\t\tint sumlum = (int) (templum[0] + templum[1] + templum[2]); \n\n\t\tint[] lum = new int[3]; // Creating a lum array\n\n\t\tlum[0] = sumlum; // Putting the sumlum in every cell\n\t\tlum[1] = sumlum;\n\t\tlum[2] = sumlum;\n\n\t\treturn lum; \n\t}", "private static int[] rgbToHsl(int r, int g, int b){\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\t\tint max = java.lang.Math.max(java.lang.Math.max(r, g), b);\n\t\tint min = java.lang.Math.min(java.lang.Math.min(r, g), b);\n\t\tint h = 0;\n\t\tint s = 0;\n\t int l = (max + min) / 2;\n\t if(max == min) {\n\t h = s = 0; // achromatic\n\t }else{\n\t \tint d = max - min;\n\t s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t if(max == r) {\n\t \th = (g - b) / d + (g < b ? 6 : 0);\n\t } else if(max == g) {\n\t \th = (b - r) / d + 2;\n\t } else if (max == b) {\n\t \th = (r - g) / d + 4;\n\t }\n\t h /= 6;\n\t }\n\t int [] ret = new int[3];\n\t ret[0] = h;\n\t ret[1] = s;\n\t ret[2] = l;\n\t return ret;\n\t}", "int interpolateColor(int[] arr, float step) {\n int sz = arr.length;\n\n if (sz == 1 || step <= 0.0) {\n return arr[0];\n } else if (step >= 1.0) {\n return arr[sz - 1];\n }\n\n float scl = step * (sz - 1);\n int i = (int) scl;\n\n return lerpColor(arr[i], arr[i + 1], scl - i);\n }", "private int parseColour(final String value) {\n\n\t\tint result = 0xffffff;\n\n\t\t// Handle colour values that are in the format \"rgb(r,g,b)\"\n\t\tif (value.startsWith(\"rgb\")) {\n\t\t\tint r, g, b;\n\t\t\tfinal ValueTokenizer t = new ValueTokenizer();\n\t\t\tt.getToken(value.substring(3));\n\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\tr = (int) t.tokenF;\n\t\t\t\tt.getToken(null);\n\t\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\t\tg = (int) t.tokenF;\n\t\t\t\t\tt.getToken(null);\n\t\t\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\t\t\tb = (int) t.tokenF;\n\t\t\t\t\t\tresult = (r << 16) + (g << 8) + b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle colour values that are in the format #123abc. (Assume that's what it is,\n\t\t// if the length is seven characters).\n\t\telse if (value.length() == 7) {\n\t\t\ttry {\n\t\t\t\tresult = Integer.parseInt(value.substring(1, 7), 16);\n\t\t\t}\n\t\t\tcatch (final NumberFormatException e) {\n\t\t\t\tresult = 0xff0000;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public native int getTotalColors() throws MagickException;", "public abstract RGBPixel getPixelRgb(int x, int y);", "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 }", "int getColour();", "static private int[] RGBtoYCbCr(int[] RGB) {\n int[] YCbCr = new int[3];\n\n float r = (float) RGB[0];\n float g = (float) RGB[1];\n float b = (float) RGB[2];\n\n float y = (float) (0 + (0.299 * r) + (0.587 * g) + (0.114 * b));\n float cb = (float) (128 - (0.168736 * r) - (0.331264 * g) + (0.5 * b));\n float cr = (float) (128 + (0.5 * r) - (0.418688 * g) - (0.081312 * b));\n\n\n YCbCr[0] = Math.round(y);\n YCbCr[1] = Math.round(cb);\n YCbCr[2] = Math.round(cr);\n\n\n return YCbCr;\n }", "public static int getRed(int color) {\n return (color & 0x00FF0000) >> 16;\n }", "public int getBlue(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int blue = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n blue = bdata[2] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n blue = sdata[2] & 0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n blue = idata[2];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[2] != 8) {\n int shift = nBits[2] - 8;\n return ((shift > 0) \n ? (blue>>shift)\n : (blue<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (blue*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return blue;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[2] * 255.0f);\n }", "public int checkRGBValue(int redGreenOrBlue) {\n if (redGreenOrBlue > 255) redGreenOrBlue = 255;\n if (redGreenOrBlue < 0) redGreenOrBlue = 0;\n return redGreenOrBlue;\n }", "public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public abstract RGBFColor toRGBFColor();", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public static int alphaRGB(int rgb,int orgb,float alpha){\r\n\t\tif(alpha==1.0){\r\n\t\t\treturn rgb;\r\n\t\t}\r\n\t\tint a = (int)(alpha*0xff);\r\n\t\tint nrgb = 0xff000000;\r\n\t\tint r = a*((rgb&0x00ff0000)>>16); //red\r\n\t\tr+=(0xff-a)*orgb;\r\n\t\tr/=0xff;\r\n\t\tnrgb += r<<16;\r\n\t\tr = a*((rgb&0x0000ff00)>>8); \t //green\r\n\t\tr+=(0xff-a)*orgb;\r\n\t\tr/=0xff;\r\n\t//\tSystem.out.println(r);\r\n\t\tnrgb+=r<<8;\r\n\t\tr = a*(rgb&0x000000ff); \t //blue\r\n\t\tr+=(0xff-a)*orgb;\r\n\t\tr/=0xff;\r\n\t\tnrgb+=r;\r\n\t\r\n\t\treturn nrgb;\r\n\t}", "public int getColorAsInt(String colorValue) throws NumberFormatException\n {\n if (colorValue == null)\n throw new NullPointerException(\"colorValue may not be null\");\n \n if (namedColors != null)\n {\n Integer value = namedColors.get(colorValue);\n if (value != null)\n return value.intValue();\n }\n \n return Integer.decode(colorValue).intValue();\n }", "public static int[] singleArrayRGB(int rgb[][]) throws Exception {\r\n\t\t//Main Array (w/ Default):\r\n\t\tint array[] = new int[(rgb.length * rgb[0].length)];\r\n\r\n\t\t//Loop Variable:\r\n\t\tint turnsWidth = 0;\r\n\t\tint turnCounter = 0;\r\n\r\n\t\t//Loops through Array:\r\n\t\tmainLoop: while (turnsWidth < rgb.length) {\r\n\t\t\t//Loop Variable:\r\n\t\t\tint turnsHeight = 0;\r\n\t\t\tsecondLoop: while (turnsHeight < rgb[0].length) {\r\n\t\t\t\t//Sets the Array:\r\n\t\t\t\tarray[turnCounter] = rgb[turnsWidth][turnsHeight];\r\n\r\n\t\t\t\tturnsHeight++;\r\n\t\t\t\tturnCounter++;\r\n\t\t\t}\r\n\r\n\t\t\tturnsWidth++;\r\n\t\t}\r\n\r\n\t\t//Returns the Array:\r\n\t\treturn array;\r\n\t}", "public native int[] tintImage(\n int[] image, int length, int rTint, int gTint, int bTint )\n throws ImageSizeException;", "protected abstract void toSpace( float[] rgb );", "public static double[] rgbIntToRgbArray(int rgb) {\n\t\tdouble[] rgbArray = new double[3];\n\t\trgbArray[0] = (rgb >> 16) & 0xFF;\n\t\trgbArray[1] = (rgb >> 8) & 0xFF;\n\t\trgbArray[2] = (rgb) & 0xFF;\n\t\treturn rgbArray;\n\t}", "public int getColor() {\n\t\treturn getMappedColor(color);\n\t}", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "public static int colorStringToInt(String color) {\r\n\t\tswitch (color.toUpperCase()) {\r\n\t\tcase \"MAGENTA\":\r\n\t\t\treturn 16711935;\r\n\t\tcase \"BLACK\":\r\n\t\t\treturn 0;\r\n\t\tcase \"WHITE\":\r\n\t\t\treturn 16767215;\r\n\t\tcase \"ORANGE\":\r\n\t\t\treturn 16762880;\r\n\t\tcase \"CYAN\":\r\n\t\t\treturn 65535;\r\n\t\tcase \"PINK\":\r\n\t\t\treturn 16756655;\r\n\t\tdefault:\r\n\t\t\tthrow new IllegalStateException(\"il colore inserito non è corretto\");\r\n\t\t}\r\n\t}", "public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }" ]
[ "0.8086974", "0.6744437", "0.66964453", "0.6666481", "0.6512728", "0.65079445", "0.64741135", "0.64678127", "0.6463723", "0.6431115", "0.6426185", "0.63876903", "0.6336825", "0.628355", "0.62781", "0.6266843", "0.6265148", "0.621372", "0.6176449", "0.6170444", "0.61661685", "0.6164912", "0.61360633", "0.6111399", "0.6069776", "0.6061415", "0.60611856", "0.60502917", "0.60233986", "0.60210145", "0.6009802", "0.59915984", "0.5978399", "0.59773993", "0.59527594", "0.5946309", "0.591013", "0.5908269", "0.58870107", "0.5882523", "0.5879593", "0.58757603", "0.5830827", "0.5825395", "0.58194435", "0.58152354", "0.58124053", "0.5791986", "0.5791266", "0.5774238", "0.5765883", "0.57602435", "0.5742741", "0.5735242", "0.57320523", "0.57306415", "0.5699297", "0.5686775", "0.5686556", "0.568286", "0.5669041", "0.5662433", "0.56532335", "0.56506395", "0.56506395", "0.5647267", "0.5637033", "0.56192595", "0.5609003", "0.5606924", "0.55874604", "0.55861187", "0.55814046", "0.5561391", "0.5552904", "0.5550212", "0.5549513", "0.55387", "0.55349565", "0.55272007", "0.5525767", "0.55139357", "0.55069333", "0.5505099", "0.55019265", "0.54943395", "0.549386", "0.5493512", "0.54697204", "0.546945", "0.5468857", "0.546035", "0.54446816", "0.5438272", "0.5433546", "0.54308605", "0.54213595", "0.5414063", "0.54061526", "0.54050136" ]
0.7770057
1
Convert an RGB int value to RGB array
public static double[] rgbIntToRgbArray(int rgb) { double[] rgbArray = new double[3]; rgbArray[0] = (rgb >> 16) & 0xFF; rgbArray[1] = (rgb >> 8) & 0xFF; rgbArray[2] = (rgb) & 0xFF; return rgbArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "public static int[] convertRGB(int rgbValue) throws Exception {\r\n\t\t//RGB Array:\r\n\t\tint rgbValues[] = new int[3];\r\n\r\n\t\t//Array Values:\r\n\t\tint blue = (rgbValue) & 0x0ff;\r\n\t\tint green = (rgbValue >> 8) & 0x0ff;\r\n\t\tint red = (rgbValue >> 16) & 0x0ff;\r\n\r\n\t\t//Inputs into Array:\r\n\t\trgbValues[0] = red;\r\n\t\trgbValues[1] = green;\r\n\t\trgbValues[2] = blue;\r\n\r\n\t\t//Returns Array:\r\n\t\treturn rgbValues;\r\n\t}", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "public static int rgbArrayToRgbInt(int[] array) {\n\t\tif (array == null) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (array.length != 3) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble[] doubleArray = {array[0], array[1], array[2]};\n\t\treturn ColorConverter.rgbArrayToRgbInt(doubleArray);\n\t}", "private native int grayToRgb(byte src[],int dst[]);", "int[] getStartRGB();", "public abstract RGBIColor toRGBColor();", "public int toARGB() {\n return ((a & 255) << 24) |\n ((r & 255) << 16) |\n ((g & 255) << 8) |\n ((b & 255) );\n }", "public static int rgbArrayToRgbInt(double[] array) {\n\t\tif (array == null) {\n\t\t\treturn 0 ;\n\t\t}\n\t\tif (array.length != 3) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn (255 & 0xFF) << 24 +\n\t\t\t\t((int)array[0] & 0xFF) << 16 +\n\t\t\t\t((int)array[1] & 0xFF) << 8 +\n\t\t\t\t((int)array[2] & 0xFF);\n\t}", "private static int[][][] convertToArray(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n int[][][] result = new int[width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public int[] getColorRGBarray(WebDriver driver, String xpath, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tString color = driver.findElement(By.xpath(xpath)).getCssValue(css);\n\t\t color = color.substring(0, color.indexOf(\")\") + 1);\n\t\tString colorAfterRed = color.substring(color.indexOf(\",\") + 2, color.length());\n\t\tString colorAfterGreen = colorAfterRed.substring(colorAfterRed.indexOf(\",\") + 2, colorAfterRed.length());\t\t\n\t\tint red = Integer.valueOf(color.substring(color.indexOf(\"(\") + 1, color.indexOf(\",\")));\n\t\tint green = Integer.valueOf(colorAfterRed.substring(0, colorAfterRed.indexOf(\",\")));\n\t\tint blue = Integer.valueOf(colorAfterGreen.substring(0, colorAfterGreen.indexOf(\",\")));\n\t\tString[] Name = {\"RED = \", \"GREEN = \", \"BLUE = \"};\n\t\tint[] Color = {red, green, blue};\n\t\tif(ifPrint){\n\t\t\tfor (int i = 0; i < Color.length; i++) {\n\t\t\t\tfileWriterPrinter(Name[0] + Color[0]);\n\t\t\t}\n\t\t}\n\t\treturn Color;\n\t}", "int[] getEndRGB();", "public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }", "public int[] getColorRGBarray(WebDriver driver, By element, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tString color = driver.findElement(element).getCssValue(css);\n\t\t color = color.substring(0, color.indexOf(\")\") + 1);\n\t\tString colorAfterRed = color.substring(color.indexOf(\",\") + 2, color.length());\n\t\tString colorAfterGreen = colorAfterRed.substring(colorAfterRed.indexOf(\",\") + 2, colorAfterRed.length());\t\t\n\t\tint red = Integer.valueOf(color.substring(color.indexOf(\"(\") + 1, color.indexOf(\",\")));\n\t\tint green = Integer.valueOf(colorAfterRed.substring(0, colorAfterRed.indexOf(\",\")));\n\t\tint blue = Integer.valueOf(colorAfterGreen.substring(0, colorAfterGreen.indexOf(\",\")));\n\t\tString[] Name = {\"RED = \", \"GREEN = \", \"BLUE = \"};\n\t\tint[] Color = {red, green, blue};\n\t\tif(ifPrint){\n\t\t\tfor (int i = 0; i < Color.length; i++) {\n\t\t\t\tfileWriterPrinter(Name[0] + Color[0]);\n\t\t\t}\n\t\t}\n\t\treturn Color;\n\t}", "protected abstract float[] getRgbLut();", "protected abstract void toSpace( float[] rgb );", "public int[] getRGB() throws ImageException {\r\n\tif (!bValid){\r\n\t\tthrow new ImageException(\"image not valid\");\r\n\t}\t\r\n\treturn originalRGB;\r\n}", "public int[] getPixelValueArray(int x, int y) {\n int pixel = getPixelValue(x, y);\n int a = 0;\n int r = 0;\n int g = 0;\n int b = 0;\n\n //Each pixel is 32 bits, from bits 0-31\n //alpha 31-24\n //r 16-23\n //g 8-15\n //b 0-7\n\n a = (pixel >> 24) & 0xFF;\n r = (pixel >> 16) & 0xFF;\n g = (pixel >> 8) & 0xFF;\n b = (pixel >> 0) & 0xFF;\n\n return new int[] {a, r, g, b};\n }", "public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }", "public static int[] unpackPixel (int rgbaValue)\n {\n int[] unpackedValues = new int[4];\n // alpha\n unpackedValues[0] = (rgbaValue >> 24) & 0xFF;\n // red\n unpackedValues[1] = (rgbaValue >> 16) & 0xFF;\n // green\n unpackedValues[2] = (rgbaValue >> 8) & 0xFF;\n // blue\n unpackedValues[3] = (rgbaValue) & 0xFF;\n\n return unpackedValues;\n }", "public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }", "public static int[] hsvToRgb(double hue, double saturation, double value) {\n if (hue < 0 || hue > 360) {\n throw new IllegalArgumentException(\"hue should be between 0 and 360\");\n }\n\n if (saturation < 0 || saturation > 1) {\n throw new IllegalArgumentException(\"saturation should be between 0 and 1\");\n }\n\n if (value < 0 || value > 1) {\n throw new IllegalArgumentException(\"value should be between 0 and 1\");\n }\n\n double chroma = value * saturation;\n double hueSection = hue / 60;\n double secondLargestComponent = chroma * (1 - Math.abs(hueSection % 2 - 1));\n double matchValue = value - chroma;\n\n return getRgbBySection(hueSection, chroma, matchValue, secondLargestComponent);\n }", "public static int[] convertImageToIntArray(Image image)\n {\n // Get byte array representing every pixels of the image\n return ((DataBufferInt)convertImageToBufferedImage(image).getRaster().getDataBuffer()).getData();\n }", "private static int[] rgbToHsl(int r, int g, int b){\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\t\tint max = java.lang.Math.max(java.lang.Math.max(r, g), b);\n\t\tint min = java.lang.Math.min(java.lang.Math.min(r, g), b);\n\t\tint h = 0;\n\t\tint s = 0;\n\t int l = (max + min) / 2;\n\t if(max == min) {\n\t h = s = 0; // achromatic\n\t }else{\n\t \tint d = max - min;\n\t s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t if(max == r) {\n\t \th = (g - b) / d + (g < b ? 6 : 0);\n\t } else if(max == g) {\n\t \th = (b - r) / d + 2;\n\t } else if (max == b) {\n\t \th = (r - g) / d + 4;\n\t }\n\t h /= 6;\n\t }\n\t int [] ret = new int[3];\n\t ret[0] = h;\n\t ret[1] = s;\n\t ret[2] = l;\n\t return ret;\n\t}", "public static float[] color(Color c) {\r\n \r\n if (c == null) c = Color.BLUE;\r\n return new float[]{ ((float) c.getRed() / 255.0f), \r\n ((float) c.getGreen() / 255.0f), ((float) c.getBlue() / 255.0f) };\r\n }", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public abstract int rgbColor(double u, double v);", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "int[] toArray();", "public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}", "public static int[] rgb2hsv(int pixelValue) {\r\n int[] rgbA = Colors.hexToRgb(pixelValue);\r\n float[] hsb = rgb2hsb(rgbA[0], rgbA[1], rgbA[2]);\r\n return new int[] { Math.round(hsb[0] * 360), Math.round(hsb[1] * 100), Math.round(hsb[2] * 100) };\r\n }", "public static int[] getPixelColor(final BufferedImage img, final int x, final int y){\n int rgb = img.getRGB(x, y);\n int r = (rgb >> 16) & 0xFF;\n int g = (rgb >> 8) & 0xFF;\n int b = (rgb & 0xFF);\n\t\n return new int[]{r,g,b};\n }", "public int getIntColor(final double value) {\n final Color color = getColor(value);\n return ((byte) (color.getOpacity() * 255) << 24) + ((byte) (color.getRed() * 255) << 16)\n + ((byte) (color.getGreen() * 255) << 8) + ((byte) (color.getBlue() * 255));\n }", "public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}", "public static int toRGB(Color color) {\n int result = (int) (color.getRed() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getBlue() * 0xFF);\n return result;\n }", "int getAsInt32Color(int a) {\r\n\t\tint r = (int) (x * 255);\r\n\t\tint g = (int) (y * 255);\r\n\t\tint b = (int) (z * 255);\r\n\t\tif (r > 255) {\r\n\t\t\tr = 255;\r\n\t\t}\r\n\t\tif (g > 255) {\r\n\t\t\tg = 255;\r\n\t\t}\r\n\t\tif (b > 255) {\r\n\t\t\tb = 255;\r\n\t\t}\r\n\r\n\t\tif (r < 0) {\r\n\t\t\tr = 0;\r\n\t\t}\r\n\t\tif (g < 0) {\r\n\t\t\tg = 0;\r\n\t\t}\r\n\t\tif (b < 0) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\treturn (b | g << 8 | r << 16 | a << 24);\r\n\t}", "private Color[] imageToArray(BufferedImage image){\n Color[] pixels = new Color[image.getWidth() * image.getWidth()];\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n Color color = new Color(image.getRGB(j,i));\n pixels[i*image.getWidth() + j] = color;\n }\n }\n return pixels;\n }", "public static int[] getPixelColor(BufferedImage image,int x,int y) {\n int colors[] = new int[3];\n int clr = 0;\n\n try{\n clr = image.getRGB(x,y); \n }catch(Exception e){\n System.out.println(e);\n System.out.println(x + \" \" + y);\n }\n\n int red = (clr & 0x00ff0000) >> 16;\n int green = (clr & 0x0000ff00) >> 8;\n int blue = clr & 0x000000ff;\n colors[0] = red;\n colors[1] = green;\n colors[2] = blue;\n return colors;\n }", "public int toInt() {\n\n\t\tint iR, iG, iB;\n\n\t\t// Here we do the dumb thing and simply clamp then scale.\n\t\t// The \"+ 0.5\" is to achieve a \"round to nearest\" effect\n\t\t// since Java float to int casting simply truncates.\n\t\tiR = (int) (255.0 * Math.max(Math.min(r, 1.0), 0.0) + 0.5);\n\t\tiG = (int) (255.0 * Math.max(Math.min(g, 1.0), 0.0) + 0.5);\n\t\tiB = (int) (255.0 * Math.max(Math.min(b, 1.0), 0.0) + 0.5);\n\n\t\t// Bit packing at its finest\n\t\treturn (iR << 16) | (iG << 8) | (iB << 0);\n\t}", "public abstract RGBFColor toRGBFColor();", "public static final int[] convert2grey_fast(BufferedImage bim) {\n return convert2grey_fast(bim.getRaster().getDataBuffer());\n }", "public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}", "public int getRGB(Object inData) {\n if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n int gray = getRed(inData); // Red sRGB component should equal\n // green and blue components\n return (getAlpha(inData) << 24)\n | (gray << 16)\n | (gray << 8)\n | gray;\n }\n if (!is_sRGB) {\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\n \"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premult values\n float[] rgb = colorSpace.toRGB(norm);\n return (getAlpha(inData) << 24)\n | (((int) (rgb[0] * 255.0f)) << 16)\n | (((int) (rgb[1] * 255.0f)) << 8)\n | (((int) (rgb[2] * 255.0f)) << 0);\n }\n return (getAlpha(inData) << 24)\n | (getRed(inData) << 16)\n | (getGreen(inData) << 8)\n | (getBlue(inData));\n }", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "private static int byteToARGB(final int brightness) {\n final int bitsInByte = 8;\n final int opaqueBitmask = 0xFF;\n final int red = 0xFFFF0000;\n// int result = ((opaqueBitmask << (bitsInByte) | brightness) << bitsInByte | brightness) << bitsInByte\n// | brightness;\n int result = (0xFF << 24) | (brightness << 16) | (brightness << 8) | brightness;\n result = result | red;\n return result;\n }", "public int[] convertByteToInt(BufferedImage img) throws IOException {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n ImageIO.write(img, \"png\", baos);\r\n byte[] byteArr = baos.toByteArray();\r\n int[] intArr = new int[byteArr.length];\r\n for(int i = 0; i < byteArr.length; i++) {\r\n intArr[i] = (int)byteArr[i] & 0xFF;\r\n }\r\n return intArr;\r\n }", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }", "public int[] getColorIndices();", "public short[] getRed() {\n short[] buf = new short[pixels.length];\n for (int i = 0; i < buf.length; ++i)\n buf[i] = (short) cModel.getRed(pixels[i]);\n return buf;\n }", "public Color[] getColors();", "public static double[] rgbToHsv(int rgb[]) {\n\t\tdouble temp[] = new double[3];\n\t\tdouble hsv[] = new double[3];\n\t\t\n\t\ttemp[0] = (double)rgb[0]/255;\n\t\ttemp[1] = (double)rgb[1]/255;\n\t\ttemp[2] = (double)rgb[2]/255;\n\t\t\n\t\tdouble max = Math.max(temp[0], Math.max(temp[1], temp[2]));\n\t\tdouble min = Math.min(temp[0], Math.min(temp[1], temp[2]));\n\t\t\n\t\tdouble delta = max-min;\n\t\t\n\t\tif (delta == 0) {\n\t\t\thsv[0] = 0;\n\t\t} else if (max == temp[0]) {\n\t\t\thsv[0] = (60*(temp[1]-temp[2])/delta)+360;\n\t\t\twhile (hsv[0] >= 360) {\n\t\t\t\thsv[0] -= 360;\n\t\t\t}\n\t\t} else if (max == temp[1]) {\n\t\t\thsv[0] = 60 * (temp[2]-temp[0]) / delta + 120;\n\t\t} else if (max == temp[2]) {\n\t\t\thsv[0] = 60 * (temp[0]-temp[1]) / delta + 240;\n\t\t}\n\t\t\n\t\t\n\t\tif (max == 0) {\n\t\t\thsv[1] = 0;\n\t\t}\n\t\telse {\n\t\t\thsv[1] = delta/max;\n\t\t}\n\t\t\n\t\thsv[2] = max;\n\t\t\n\t\treturn hsv;\n\t\t\n\t}", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "public static double[] cmyToRgb(double[] cmy) {\n\t\tassert(cmy != null && cmy.length == 3);\n\t\tdouble[] rgb = new double[3];\n\t\trgb[0] = (1-cmy[0]) * 255;\n\t\trgb[1] = (1-cmy[1]) * 255;\n\t\trgb[2] = (1-cmy[2]) * 255;\n\t\treturn rgb;\n\t}", "void fill(int rgb);", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "public int getArgb(int x, int y) {\n if (x < 0 || x >= width || y < 0 || y >= height) {\n throw new IllegalArgumentException(\"x,y must be >0, <width, height\");\n }\n int argb = pixelBuffer.get(x + y*scanlineStride/4);\n if ((argb >> 24) == -1) {\n return argb;\n }\n int a = argb >>> 24;\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb ) & 0xff;\n int a2 = a + (a >> 7);\n r = (r * a2) >> 8;\n g = (g * a2) >> 8;\n b = (b * a2) >> 8;\n return ((a << 24) | (r << 16) | (g << 8) | (b));\n }", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "public abstract int[] toIntArray();", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "static public int fromRGB(int red, int green, int blue) {\n red = saturate(red, 0, 255);\n green = saturate(green, 0, 255);\n blue = saturate(blue, 0, 255);\n return (0xff << 24) + ((red & 0xff) << 16) + ((green & 0xff) << 8) + (blue & 0xff);\n }", "public static final int[] convert2grey(Image img) {\n PixelGrabber grabber = new PixelGrabber(img, 0, 0, -1, -1, true);\n try {\n grabber.grabPixels();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n int[] data = (int[]) grabber.getPixels();\n int[] image = new int[data.length];\n\n for (int d = 0; d < data.length; d++) {\n image[d] = RGB2Grey(data[d]);\n\n }\n return image;\n }", "public static int ColorToInt(Color c) {\n\t\treturn android.graphics.Color.argb(cap((int) (c.getAlpha() * 255), 0, 255), cap((int) (c.getRed() * 255), 0, 255), cap((int) (c.getGreen() * 255), 0, 255), cap((int) (c.getBlue() * 255), 0, 255));\n\t}", "public native int getColors() throws MagickException;", "public static int ARGB_NTSC(int p) {\n int r = (p & 0xff0000) >> 16;\n int g = (p & 0xff00) >> 8;\n int b = p & 0xff;\n return NTSCRGBtoGray(r, g, b);\n }", "public static double[] hsvToRgb(double[] hsv) {\n\t\tdouble h = hsv[0];\n\t\tdouble s = hsv[1];\n\t\tdouble v = hsv[2];\n\t\tdouble r,g,b;\n\t\t\n\t\tif (s == 0) {\n\t\t\tr = v * 255;\n\t\t\tg = v * 255;\n\t\t\tb = v * 255;\n\t\t} else {\n\t\t\tdouble varH = h / 60;\n\t\t\tif ((int)varH == 6) {\n\t\t\t\tvarH = 0;\n\t\t\t}\n\t\t\tint varI = (int)(varH);\n\t\t\tdouble var1 = v * (1 - s);\n\t\t\tdouble var2 = v * (1 - s * (varH - varI));\n\t\t\tdouble var3 = v * (1 - s * (1 - (varH - varI)));\n\t\t\t\n\t\t\tdouble varR, varG, varB;\n\t\t\tswitch (varI) {\n\t\t\tcase 0:\n\t\t\t\tvarR = v;\n\t\t\t\tvarG = var3;\n\t\t\t\tvarB = var1;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tvarR = var2;\n\t\t\t\tvarG = v;\n\t\t\t\tvarB = var1;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tvarR = var1;\n\t\t\t\tvarG = v;\n\t\t\t\tvarB = var3;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tvarR = var1;\n\t\t\t\tvarG = var2;\n\t\t\t\tvarB = v;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tvarR = var3;\n\t\t\t\tvarG = var1;\n\t\t\t\tvarB = v;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tvarR = v;\n\t\t\t\tvarG = var1;\n\t\t\t\tvarB = var2;\n\t\t\t}\n\t\t\tr = varR * 255;\n\t\t\tg = varG * 255;\n\t\t\tb = varB * 255;\n\t\t}\n\t\tdouble[] result = {r,g,b};\n\t\treturn result;\n\t}", "protected int[] getPalettePixels() {\n \t\t\tif (palettePixels == null) {\n \n \t\t\t\tpalettePixels = new int[numColors];\n \t\t\t\t\n \t\t\t\tfor (int x = 0; x < numColors; x++) {\n \t\t\t\t\tpalettePixels[x] = rgb8ToPixel(palette[x]);\n \t\t\t\t}\n \t\t\t}\n \t\t\treturn palettePixels;\n \t\t}", "public static Color fromBGR(int rgb) {\n return Color.rgb(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF);\n }", "static private int[] RGBtoYCbCr(int[] RGB) {\n int[] YCbCr = new int[3];\n\n float r = (float) RGB[0];\n float g = (float) RGB[1];\n float b = (float) RGB[2];\n\n float y = (float) (0 + (0.299 * r) + (0.587 * g) + (0.114 * b));\n float cb = (float) (128 - (0.168736 * r) - (0.331264 * g) + (0.5 * b));\n float cr = (float) (128 + (0.5 * r) - (0.418688 * g) - (0.081312 * b));\n\n\n YCbCr[0] = Math.round(y);\n YCbCr[1] = Math.round(cb);\n YCbCr[2] = Math.round(cr);\n\n\n return YCbCr;\n }", "@SuppressWarnings(\"unused\")\r\n\t\tprivate void gray8toRGB32(byte[] gray8, int width, int height, int[] rgb_32s) {\r\n\t\t\tfinal int endPtr = width * height;\r\n\t\t\tint ptr = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (ptr == endPtr)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tfinal int Y = gray8[ptr] & 0xff; \r\n\t\t\t\trgb_32s[ptr] = 0xff000000 + (Y << 16) + (Y << 8) + Y;\r\n\t\t\t\tptr++;\r\n\t\t\t}\r\n\t\t}", "public int filterRGB(int x, int y, int argb) {\n color = new Color(argb);\n newBlue = multColor(color.getBlue(), blueMultiplier);\n newGreen = multColor(color.getGreen(), greenMultiplier);\n newRed = multColor(color.getRed(), redMultiplier);\n newColor = new Color(newRed, newGreen, newBlue);\n return (newColor.getRGB());\n }", "private static int get(int colour) {\r\n\t\t// If the color is incorrect (less than 0) the color is set invisible\r\n\t\tif (colour < 0) {\r\n\t\t\treturn 255;\r\n\t\t}\r\n\r\n\t\t// taking each number of the argument\r\n\t\tint r = colour / 100 % 10;\r\n\t\tint g = colour / 10 % 10;\r\n\t\tint b = colour % 10;\r\n\r\n\t\t// returning the 6*6*6 color\r\n\t\treturn r * 6 * 6 + g * 6 + b;\r\n\t}", "public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }", "RGB getNewColor();", "public Color[] getGeneColorArray(int index);", "public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }", "public abstract RGBPixel getPixelRgb(int x, int y);", "public static int createRgb(String hex, int value) {\n int color = (int) Long.parseLong(hex.replace(\"#\", \"\"), 16);\n int r = (color >> 16) & 0xFF;\n r = (r + value > 255) ? 255 : (r + value);\n int g = (color >> 8) & 0xFF;\n g = (g + value > 255) ? 255 : (g + value);\n int b = (color >> 0) & 0xFF;\n b = (b + value > 255) ? 255 : (b + value);\n return Color.rgb(r, g, b);\n }", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }", "private byte[] rgbCommand(byte r, byte g, byte b) {\n byte[] command = new byte[8];\n command[0] = (byte) 0x31;\n command[1] = r;\n command[2] = g;\n command[3] = b;\n command[4] = 0;\n command[5] = 0;\n command[6] = (byte) 0xf0;\n command[7] = (byte) 0x0f;\n return Utils.withCheckSum(command);\n }", "public static double[] rgbToHsv(int red, int green, int blue) {\n if (red < 0 || red > 255) {\n throw new IllegalArgumentException(\"red should be between 0 and 255\");\n }\n\n if (green < 0 || green > 255) {\n throw new IllegalArgumentException(\"green should be between 0 and 255\");\n }\n\n if (blue < 0 || blue > 255) {\n throw new IllegalArgumentException(\"blue should be between 0 and 255\");\n }\n\n double dRed = (double) red / 255;\n double dGreen = (double) green / 255;\n double dBlue = (double) blue / 255;\n double value = Math.max(Math.max(dRed, dGreen), dBlue);\n double chroma = value - Math.min(Math.min(dRed, dGreen), dBlue);\n double saturation = value == 0 ? 0 : chroma / value;\n double hue;\n\n if (chroma == 0) {\n hue = 0;\n } else if (value == dRed) {\n hue = 60 * (0 + (dGreen - dBlue) / chroma);\n } else if (value == dGreen) {\n hue = 60 * (2 + (dBlue - dRed) / chroma);\n } else {\n hue = 60 * (4 + (dRed - dGreen) / chroma);\n }\n\n hue = (hue + 360) % 360;\n\n return new double[] {hue, saturation, value};\n }", "float[] getColorData(int trisCount, int color) {\n float[] colDat = new float[trisCount * 4];\n float alpha = 255;\n float red = 255;\n float green = 255;\n float blue = 255;\n if(color != -1) {\n alpha = color >> 24 & 0xff;\n red = color >> 16 & 0xff;\n green = color >> 8 & 0xff;\n blue = color & 0xff;\n }\n// Log.e(\"Modelbase\", \"shift = \" + red + \",\" + green + \",\" + blue + \",\" + alpha);\n red /= 255f;\n green /= 255f;\n blue /= 255f;\n alpha /= 255f;\n// Log.e(\"Modelbase\", \"div by 255 = \" + red + \",\" + green + \",\" + blue + \",\" +\n// alpha);\n for (int i = 0; i < colDat.length; i += 4) {\n colDat[i] = red;\n colDat[i + 1] = green;\n colDat[i + 2] = blue;\n colDat[i + 3] = alpha;\n }\n return colDat;\n }", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "static public int getRed(int color) {\n return (color >> 16) & 0xff;\n }", "public int[] getUniquePixelValues() {\r\n\tint imageLength = originalRGB.length;\r\n\tif (imageLength==0){\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tint pixelValueArray[] = new int[1];\r\n\tpixelValueArray[0] = originalRGB[0];\r\n\r\n\tfor (int i=0;i<imageLength;i++){\r\n\t\tint currPixel = originalRGB[i];\r\n\r\n\t\t//\r\n\t\t// look for current pixel in list\r\n\t\t//\r\n\t\tboolean found = false;\r\n\t\tfor (int j=0;j<pixelValueArray.length;j++){\r\n\t\t\tif (pixelValueArray[j]==currPixel){\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//\r\n\t\t// if current pixel not found, extend list and add pixel to end\r\n\t\t//\r\n\t\tif (!found){\r\n\t\t\tint newArray[] = new int[pixelValueArray.length+1];\r\n\t\t\tfor (int j=0;j<pixelValueArray.length;j++){\r\n\t\t\t\tnewArray[j] = pixelValueArray[j];\r\n\t\t\t}\r\n\t\t\tnewArray[pixelValueArray.length] = currPixel;\r\n\t\t\tpixelValueArray = newArray;\r\n\t\t}\r\n\t}\r\n\treturn pixelValueArray;\r\n}", "private int[] readLut(final int size) throws FormatException {\n\t\t\tfinal int nbytes = 3 * size;\n\t\t\tfinal byte[] c = new byte[nbytes];\n\t\t\tint n = 0;\n\t\t\ttry {\n\t\t\t\tn = getSource().read(c);\n\t\t\t}\n\t\t\tcatch (final IOException e) {}\n\n\t\t\tif (n < nbytes) {\n\t\t\t\tthrow new FormatException(\"Color table not found\");\n\t\t\t}\n\n\t\t\tfinal int[] lut = new int[256];\n\t\t\tint j = 0;\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tfinal int r = c[j++] & 0xff;\n\t\t\t\tfinal int g = c[j++] & 0xff;\n\t\t\t\tfinal int b = c[j++] & 0xff;\n\t\t\t\tlut[i] = 0xff000000 | (r << 16) | (g << 8) | b;\n\t\t\t}\n\t\t\treturn lut;\n\t\t}", "public static int[] singleArrayRGB(int rgb[][]) throws Exception {\r\n\t\t//Main Array (w/ Default):\r\n\t\tint array[] = new int[(rgb.length * rgb[0].length)];\r\n\r\n\t\t//Loop Variable:\r\n\t\tint turnsWidth = 0;\r\n\t\tint turnCounter = 0;\r\n\r\n\t\t//Loops through Array:\r\n\t\tmainLoop: while (turnsWidth < rgb.length) {\r\n\t\t\t//Loop Variable:\r\n\t\t\tint turnsHeight = 0;\r\n\t\t\tsecondLoop: while (turnsHeight < rgb[0].length) {\r\n\t\t\t\t//Sets the Array:\r\n\t\t\t\tarray[turnCounter] = rgb[turnsWidth][turnsHeight];\r\n\r\n\t\t\t\tturnsHeight++;\r\n\t\t\t\tturnCounter++;\r\n\t\t\t}\r\n\r\n\t\t\tturnsWidth++;\r\n\t\t}\r\n\r\n\t\t//Returns the Array:\r\n\t\treturn array;\r\n\t}", "public static int toRGB(byte red, byte green, byte blue) {\n int result = byteToUnsignedShort(red);\n result = (result << 8) + byteToUnsignedShort(green);\n result = (result << 8) + byteToUnsignedShort(blue);\n return result;\n }", "static byte[] toArray(int value) {\n return new byte[] {\n (byte) (value >> 24),\n (byte) (value >> 16),\n (byte) (value >> 8),\n (byte) value };\n }", "public Color(int argb) {\n this.a = (byte)(argb >> 24);\n this.r = (byte)(argb >> 16);\n this.g = (byte)(argb >> 8);\n this.b = (byte)(argb );\n }", "public native int[] tintImage(\n int[] image, int length, int rTint, int gTint, int bTint )\n throws ImageSizeException;", "public Color[] getExperimentColors();", "private List<int[]> separateColorChannels(RGBImage image) {\n\t\tList<int[]> outList = new ArrayList<int[]>(3);\n\t\tint[] data = (int[]) image.getValue();\n\t\tint[] rch = new int[data.length];\n\t\tint[] gch = new int[data.length];\n\t\tint[] bch = new int[data.length];\n\t\tfor (int i = 0; i < data.length && start; i++) {\n\t\t\trch[i] = (data[i] >> 16) & MASK;\n\t\t\tgch[i] = (data[i] >> 8) & MASK;\n\t\t\tbch[i] = data[i] & MASK;\n\t\t}\n\t\toutList.add(0, rch);\n\t\toutList.add(1, gch);\n\t\toutList.add(2, bch);\n\t\treturn outList;\n\t}", "public static float[] createColors() {\n float[] data = new float[4 * 3];\n data[0] = 1f;\n data[1] = 0f;\n data[2] = 0f;\n data[3] = 1f;\n\n data[4] = 0f;\n data[5] = 1f;\n data[6] = 0f;\n data[7] = 1f;\n\n data[8] = 0f;\n data[9] = 0f;\n data[10] = 1f;\n data[11] = 1f;\n return data;\n }", "public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}", "public static int convertSingularRGB(int[] rgbValues) throws Exception {\r\n\t\t//Color Variables:\r\n\t\tint standardColorValue = (((rgbValues[0] & 0x0ff) << 16) | ((rgbValues[1] & 0x0ff) << 8) | ((rgbValues[2] & 0x0ff)));\r\n\r\n\t\t//Returns Value:\r\n\t\treturn standardColorValue;\r\n\t}", "public static float[] rgb2cmyk(int rgb) {\r\n float r = (rgb >> 16) & 0xFF;\r\n float g = (rgb >> 8) & 0xFF;\r\n float b = rgb & 0xFF;\r\n float C = 1.0f - (r / 255);\r\n float M = 1.0f - (g / 255);\r\n float Y = 1.0f - (b / 255);\r\n float var_K = 1;\r\n\r\n if (C < var_K) {\r\n var_K = C;\r\n }\r\n if (M < var_K) {\r\n var_K = M;\r\n }\r\n if (Y < var_K) {\r\n var_K = Y;\r\n }\r\n\r\n C = (C - var_K) / (1 - var_K);\r\n M = (M - var_K) / (1 - var_K);\r\n Y = (Y - var_K) / (1 - var_K);\r\n return new float[] { C * 100, M * 100, Y * 100, var_K * 100 };\r\n }", "public int[] getExperimentColorIndices();" ]
[ "0.7462477", "0.71654934", "0.7095958", "0.7026143", "0.70001394", "0.69524354", "0.6770394", "0.65391684", "0.6521993", "0.6508968", "0.6486071", "0.6371465", "0.6371166", "0.63696754", "0.6349078", "0.63256216", "0.62597764", "0.6244847", "0.6238903", "0.6220685", "0.62058765", "0.6173869", "0.61530066", "0.61439127", "0.6108575", "0.60984534", "0.60907793", "0.608977", "0.60699517", "0.6065038", "0.6056517", "0.6047748", "0.6028646", "0.6024781", "0.5976397", "0.5953467", "0.59053165", "0.5888392", "0.5878263", "0.5873729", "0.5861487", "0.5851952", "0.5850746", "0.58415234", "0.5807952", "0.5796912", "0.5796165", "0.5793424", "0.5781121", "0.5769494", "0.57675433", "0.57487345", "0.57460725", "0.5712387", "0.56985885", "0.56981826", "0.56927526", "0.56785643", "0.5674469", "0.56649256", "0.5657649", "0.5645845", "0.56303716", "0.5627276", "0.5604025", "0.55672604", "0.5566335", "0.55635583", "0.55635387", "0.55592626", "0.5553139", "0.555294", "0.5552325", "0.555196", "0.55489707", "0.55247355", "0.5502535", "0.5501383", "0.5492055", "0.5479205", "0.54773074", "0.5476557", "0.5473333", "0.54565996", "0.54519755", "0.5449803", "0.54447556", "0.5434834", "0.54180783", "0.5409345", "0.5405756", "0.5395213", "0.5392455", "0.53703487", "0.53632855", "0.53629184", "0.5362843", "0.536253", "0.5358417", "0.53560495" ]
0.6710411
7
Convert an RGB array to an int value that represents RGB which can be used in BufferedImage setRGB() method
public static int rgbArrayToRgbInt(int[] array) { if (array == null) { return 0; } if (array.length != 3) { return 0; } double[] doubleArray = {array[0], array[1], array[2]}; return ColorConverter.rgbArrayToRgbInt(doubleArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int rgbArrayToRgbInt(double[] array) {\n\t\tif (array == null) {\n\t\t\treturn 0 ;\n\t\t}\n\t\tif (array.length != 3) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn (255 & 0xFF) << 24 +\n\t\t\t\t((int)array[0] & 0xFF) << 16 +\n\t\t\t\t((int)array[1] & 0xFF) << 8 +\n\t\t\t\t((int)array[2] & 0xFF);\n\t}", "int[] getStartRGB();", "public int toInt() {\n\n\t\tint iR, iG, iB;\n\n\t\t// Here we do the dumb thing and simply clamp then scale.\n\t\t// The \"+ 0.5\" is to achieve a \"round to nearest\" effect\n\t\t// since Java float to int casting simply truncates.\n\t\tiR = (int) (255.0 * Math.max(Math.min(r, 1.0), 0.0) + 0.5);\n\t\tiG = (int) (255.0 * Math.max(Math.min(g, 1.0), 0.0) + 0.5);\n\t\tiB = (int) (255.0 * Math.max(Math.min(b, 1.0), 0.0) + 0.5);\n\n\t\t// Bit packing at its finest\n\t\treturn (iR << 16) | (iG << 8) | (iB << 0);\n\t}", "private native int grayToRgb(byte src[],int dst[]);", "public int getColorInt () {\r\n return this.colorReturned;\r\n }", "public abstract RGBIColor toRGBColor();", "public static int ColorToInt(Color c) {\n\t\treturn android.graphics.Color.argb(cap((int) (c.getAlpha() * 255), 0, 255), cap((int) (c.getRed() * 255), 0, 255), cap((int) (c.getGreen() * 255), 0, 255), cap((int) (c.getBlue() * 255), 0, 255));\n\t}", "public int getIntColor(final double value) {\n final Color color = getColor(value);\n return ((byte) (color.getOpacity() * 255) << 24) + ((byte) (color.getRed() * 255) << 16)\n + ((byte) (color.getGreen() * 255) << 8) + ((byte) (color.getBlue() * 255));\n }", "public int getRGB(Object inData) {\n if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n int gray = getRed(inData); // Red sRGB component should equal\n // green and blue components\n return (getAlpha(inData) << 24)\n | (gray << 16)\n | (gray << 8)\n | gray;\n }\n if (!is_sRGB) {\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\n \"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premult values\n float[] rgb = colorSpace.toRGB(norm);\n return (getAlpha(inData) << 24)\n | (((int) (rgb[0] * 255.0f)) << 16)\n | (((int) (rgb[1] * 255.0f)) << 8)\n | (((int) (rgb[2] * 255.0f)) << 0);\n }\n return (getAlpha(inData) << 24)\n | (getRed(inData) << 16)\n | (getGreen(inData) << 8)\n | (getBlue(inData));\n }", "public int toARGB() {\n return ((a & 255) << 24) |\n ((r & 255) << 16) |\n ((g & 255) << 8) |\n ((b & 255) );\n }", "static public int fromRGB(int red, int green, int blue) {\n red = saturate(red, 0, 255);\n green = saturate(green, 0, 255);\n blue = saturate(blue, 0, 255);\n return (0xff << 24) + ((red & 0xff) << 16) + ((green & 0xff) << 8) + (blue & 0xff);\n }", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public static int toRGB(Color color) {\n int result = (int) (color.getRed() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getBlue() * 0xFF);\n return result;\n }", "int getAsInt32Color(int a) {\r\n\t\tint r = (int) (x * 255);\r\n\t\tint g = (int) (y * 255);\r\n\t\tint b = (int) (z * 255);\r\n\t\tif (r > 255) {\r\n\t\t\tr = 255;\r\n\t\t}\r\n\t\tif (g > 255) {\r\n\t\t\tg = 255;\r\n\t\t}\r\n\t\tif (b > 255) {\r\n\t\t\tb = 255;\r\n\t\t}\r\n\r\n\t\tif (r < 0) {\r\n\t\t\tr = 0;\r\n\t\t}\r\n\t\tif (g < 0) {\r\n\t\t\tg = 0;\r\n\t\t}\r\n\t\tif (b < 0) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\treturn (b | g << 8 | r << 16 | a << 24);\r\n\t}", "public int[] getRGB() throws ImageException {\r\n\tif (!bValid){\r\n\t\tthrow new ImageException(\"image not valid\");\r\n\t}\t\r\n\treturn originalRGB;\r\n}", "public int getRed(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int red = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n red = bdata[0] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n red = sdata[0]&0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n red = idata[0];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[0] != 8) {\n int shift = nBits[0] - 8;\n red = ((shift > 0) \n ? (red>>shift)\n : (red<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (red*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return red;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n // Not TYPE_GRAY or TYPE_RGB ColorSpace\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[0] * 255.0f);\n }", "public abstract int rgbColor(double u, double v);", "public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}", "public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}", "public static int[] convertRGB(int rgbValue) throws Exception {\r\n\t\t//RGB Array:\r\n\t\tint rgbValues[] = new int[3];\r\n\r\n\t\t//Array Values:\r\n\t\tint blue = (rgbValue) & 0x0ff;\r\n\t\tint green = (rgbValue >> 8) & 0x0ff;\r\n\t\tint red = (rgbValue >> 16) & 0x0ff;\r\n\r\n\t\t//Inputs into Array:\r\n\t\trgbValues[0] = red;\r\n\t\trgbValues[1] = green;\r\n\t\trgbValues[2] = blue;\r\n\r\n\t\t//Returns Array:\r\n\t\treturn rgbValues;\r\n\t}", "public int[] convertByteToInt(BufferedImage img) throws IOException {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n ImageIO.write(img, \"png\", baos);\r\n byte[] byteArr = baos.toByteArray();\r\n int[] intArr = new int[byteArr.length];\r\n for(int i = 0; i < byteArr.length; i++) {\r\n intArr[i] = (int)byteArr[i] & 0xFF;\r\n }\r\n return intArr;\r\n }", "public static int getGrayscale(int rgb[]) throws Exception {\r\n\t\t//Weights;\r\n\t\tdouble redWeight = 0.2126;\r\n\t\tdouble greenWeight = 0.7152;\r\n\t\tdouble blueWeight = 0.0722;\r\n\r\n\t\t//Multiplies the RGB by the Weights:\r\n\t\tint redWeighted = (int) (rgb[0] * redWeight);\r\n\t\tint greenWeighted = (int) (rgb[1] * greenWeight);\r\n\t\tint blueWeighted = (int) (rgb[2] * blueWeight);\r\n\r\n\t\t//Gets the GrayScale Value:\r\n\t\tint grayscale = redWeighted + greenWeighted + blueWeighted;\r\n\r\n\t\t//Returns the GrayScale Value:\r\n\t\treturn grayscale;\r\n\t}", "public int getRGB(int pixel) {\n if (numComponents > 1) {\n throw new\n IllegalArgumentException(\"More than one component per pixel\");\n }\n\n\treturn (getAlpha(pixel) << 24)\n\t | (getRed(pixel) << 16)\n\t | (getGreen(pixel) << 8)\n\t | (getBlue(pixel) << 0);\n }", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}", "int[] getEndRGB();", "private static int get(int colour) {\r\n\t\t// If the color is incorrect (less than 0) the color is set invisible\r\n\t\tif (colour < 0) {\r\n\t\t\treturn 255;\r\n\t\t}\r\n\r\n\t\t// taking each number of the argument\r\n\t\tint r = colour / 100 % 10;\r\n\t\tint g = colour / 10 % 10;\r\n\t\tint b = colour % 10;\r\n\r\n\t\t// returning the 6*6*6 color\r\n\t\treturn r * 6 * 6 + g * 6 + b;\r\n\t}", "public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }", "int getClosestPalettePixel(int[] prgb);", "public static int toRGB(byte red, byte green, byte blue) {\n int result = byteToUnsignedShort(red);\n result = (result << 8) + byteToUnsignedShort(green);\n result = (result << 8) + byteToUnsignedShort(blue);\n return result;\n }", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public Integer convertRubiksColorToInteger(RubiksColor color) {\n return rubiksColorMap.get(color);\n }", "public static int[] convertImageToIntArray(Image image)\n {\n // Get byte array representing every pixels of the image\n return ((DataBufferInt)convertImageToBufferedImage(image).getRaster().getDataBuffer()).getData();\n }", "public int getRed(int pixel) {\n if (numComponents > 1) {\n throw new\n IllegalArgumentException(\"More than one component per pixel\");\n }\n // Since there is only 1 component, there is no alpha\n\n // Normalize the pixel in order to convert it\n float[] norm = { (float) pixel / ((1<<nBits[0]) - 1) };\n float[] rgb = colorSpace.toRGB(norm);\n\n return (int) (rgb[0]*255);\n }", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }", "public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }", "int getRed(int x, int y);", "public native int getNumberColors() throws MagickException;", "public static int[] getPixelColor(final BufferedImage img, final int x, final int y){\n int rgb = img.getRGB(x, y);\n int r = (rgb >> 16) & 0xFF;\n int g = (rgb >> 8) & 0xFF;\n int b = (rgb & 0xFF);\n\t\n return new int[]{r,g,b};\n }", "private int toInt(int[] arrValue) {\n // convert int[] to int\n StringBuilder temp = new StringBuilder();\n\n int i = 0;\n while (i < arrValue.length) {\n temp.append(arrValue[i]);\n i++;\n }\n\n return Integer.parseInt(temp.toString());\n }", "public static int convertSingularRGB(int[] rgbValues) throws Exception {\r\n\t\t//Color Variables:\r\n\t\tint standardColorValue = (((rgbValues[0] & 0x0ff) << 16) | ((rgbValues[1] & 0x0ff) << 8) | ((rgbValues[2] & 0x0ff)));\r\n\r\n\t\t//Returns Value:\r\n\t\treturn standardColorValue;\r\n\t}", "RGB getOldColor();", "public int getColorAt(float index){\n\n\t\tint i = Math.round((img.width-1)*index);\n\t\tint c = img.get(i,0);\n\t\treturn c;\n\n\t}", "public int[] getColorRGBarray(WebDriver driver, By element, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tString color = driver.findElement(element).getCssValue(css);\n\t\t color = color.substring(0, color.indexOf(\")\") + 1);\n\t\tString colorAfterRed = color.substring(color.indexOf(\",\") + 2, color.length());\n\t\tString colorAfterGreen = colorAfterRed.substring(colorAfterRed.indexOf(\",\") + 2, colorAfterRed.length());\t\t\n\t\tint red = Integer.valueOf(color.substring(color.indexOf(\"(\") + 1, color.indexOf(\",\")));\n\t\tint green = Integer.valueOf(colorAfterRed.substring(0, colorAfterRed.indexOf(\",\")));\n\t\tint blue = Integer.valueOf(colorAfterGreen.substring(0, colorAfterGreen.indexOf(\",\")));\n\t\tString[] Name = {\"RED = \", \"GREEN = \", \"BLUE = \"};\n\t\tint[] Color = {red, green, blue};\n\t\tif(ifPrint){\n\t\t\tfor (int i = 0; i < Color.length; i++) {\n\t\t\t\tfileWriterPrinter(Name[0] + Color[0]);\n\t\t\t}\n\t\t}\n\t\treturn Color;\n\t}", "public static int MeanRGBtoGray(int r, int g, int b) {\n return (r + b + g) / 3;\n }", "public int getColorValue() {\r\n\t\treturn color;\r\n\t}", "static public int getRed(int color) {\n return (color >> 16) & 0xff;\n }", "public int filterRGB(int x, int y, int argb) {\n color = new Color(argb);\n newBlue = multColor(color.getBlue(), blueMultiplier);\n newGreen = multColor(color.getGreen(), greenMultiplier);\n newRed = multColor(color.getRed(), redMultiplier);\n newColor = new Color(newRed, newGreen, newBlue);\n return (newColor.getRGB());\n }", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "public native int getColors() throws MagickException;", "public int[] getColorRGBarray(WebDriver driver, String xpath, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tString color = driver.findElement(By.xpath(xpath)).getCssValue(css);\n\t\t color = color.substring(0, color.indexOf(\")\") + 1);\n\t\tString colorAfterRed = color.substring(color.indexOf(\",\") + 2, color.length());\n\t\tString colorAfterGreen = colorAfterRed.substring(colorAfterRed.indexOf(\",\") + 2, colorAfterRed.length());\t\t\n\t\tint red = Integer.valueOf(color.substring(color.indexOf(\"(\") + 1, color.indexOf(\",\")));\n\t\tint green = Integer.valueOf(colorAfterRed.substring(0, colorAfterRed.indexOf(\",\")));\n\t\tint blue = Integer.valueOf(colorAfterGreen.substring(0, colorAfterGreen.indexOf(\",\")));\n\t\tString[] Name = {\"RED = \", \"GREEN = \", \"BLUE = \"};\n\t\tint[] Color = {red, green, blue};\n\t\tif(ifPrint){\n\t\t\tfor (int i = 0; i < Color.length; i++) {\n\t\t\t\tfileWriterPrinter(Name[0] + Color[0]);\n\t\t\t}\n\t\t}\n\t\treturn Color;\n\t}", "public int getGreen(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int green = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n green = bdata[1] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n green = sdata[1] & 0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n green = idata[1];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[1] != 8) {\n int shift = nBits[1] - 8;\n green = ((shift > 0) \n ? (green>>shift)\n : (green<<(-shift)));\n\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (green*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return green;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[1] * 255.0f);\n }", "public int getArgb(int x, int y) {\n if (x < 0 || x >= width || y < 0 || y >= height) {\n throw new IllegalArgumentException(\"x,y must be >0, <width, height\");\n }\n int argb = pixelBuffer.get(x + y*scanlineStride/4);\n if ((argb >> 24) == -1) {\n return argb;\n }\n int a = argb >>> 24;\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb ) & 0xff;\n int a2 = a + (a >> 7);\n r = (r * a2) >> 8;\n g = (g * a2) >> 8;\n b = (b * a2) >> 8;\n return ((a << 24) | (r << 16) | (g << 8) | (b));\n }", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public int[] getColorIndices();", "private int getPixelBin(int[] pixel) {\r\n\t\treturn (int) ((int) (pixel[0] / redValues) * (binsPerColour)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[1] / greenValues)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[2] / blueValues));\r\n\t}", "@ColorInt\n public int getColor() {\n return Color.HSVToColor(mColorHSV);\n }", "public int getColor();", "public int getColor();", "public static IntBuffer convertImage(BufferedImage temp)\t{\n\t\tint totalPixels = temp.getWidth() * temp.getHeight();\n\t\tint[] imgPixels = new int[totalPixels];\n\t\timgPixels = temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), null, 0, temp.getWidth());\n\t\t\n\t\t// Extract and rearrange the integer buffer in order to enable OpenGL \n\t\t// for further using the buffer data\n\t\tint[] buffer = new int[totalPixels];\n\t\tint i;\n\t\tfor(int y = 0; y < temp.getHeight(); y++)\t{\n\t\t\tfor(int x = 0; x < temp.getWidth(); x++)\t{\n\t\t\t\t// Isolate the bits and arrange them in the A-B-G-R order\n\t\t\t\t// Shift the binary digit to the right to get its value\n\t\t\t\ti = x + y * temp.getWidth();\n\t\t\t\tint a = (imgPixels[i] & 0xff000000) >> 24;\n\t\t\t\tint r = (imgPixels[i] & 0xff0000) >> 16;\n\t\t\t\tint g = (imgPixels[i] & 0xff00) >> 8;\n\t\t\t\tint b = (imgPixels[i] & 0xff);\n\t\t\t\t\n\t\t\t\tbuffer[temp.getWidth() * (temp.getHeight() - 1 - y) + x] = a << 24\n\t\t\t\t\t\t| b << 16 | g << 8 | r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Convert the array to buffer then return\n\t\treturn convertInt(buffer);\n\t}", "public static int[] getPixelColor(BufferedImage image,int x,int y) {\n int colors[] = new int[3];\n int clr = 0;\n\n try{\n clr = image.getRGB(x,y); \n }catch(Exception e){\n System.out.println(e);\n System.out.println(x + \" \" + y);\n }\n\n int red = (clr & 0x00ff0000) >> 16;\n int green = (clr & 0x0000ff00) >> 8;\n int blue = clr & 0x000000ff;\n colors[0] = red;\n colors[1] = green;\n colors[2] = blue;\n return colors;\n }", "public static int getRgbAvg(int argb0, int argb1){\n\n\t\tint red0 = argb0 & 0xff;\n\t\tint green0 = (argb0 >> 8) & 0xff;\n\t\tint blue0 = (argb0 >> 16) & 0xff;\n\n\t\tint red1 = argb1 & 0xff;\n\t\tint green1 = (argb1 >> 8) & 0xff;\n\t\tint blue1 = (argb1 >> 16) & 0xff;\n\n\t\tint red = (red0 + red1) /2;\n\t\tint green = (green0 + green1) /2;\n\t\tint blue = (blue0 + blue1) /2;\n\n\n\t\tint avg = (0xff << 24) + (red << 16) + (green << 8) + blue;\n\n\t\treturn avg;\n\t}", "public static int rgb(String hex) {\n int color = (int) Long.parseLong(hex.replace(\"#\", \"\"), 16);\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = (color >> 0) & 0xFF;\n return Color.rgb(r, g, b);\n }", "public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "void fill(int rgb);", "protected abstract float[] getRgbLut();", "RGB getNewColor();", "public int getPrimaryColor(int i) {\n return primary[i];\n }", "public static int[] luminance(int[] pixel) {\n\n\t\t// Creating it in double to have the right numbers\n\t\tdouble[] templum = new double[3]; \n\n\t\ttemplum[0] = (double) (0.299 * pixel[0]);\n\t\ttemplum[1] = (double) (0.587 * pixel[1]);\n\t\ttemplum[2] = (double) (0.114 * pixel[2]);\n\n\t\t// Summing the grey color of every pixel and parsing\n\t\tint sumlum = (int) (templum[0] + templum[1] + templum[2]); \n\n\t\tint[] lum = new int[3]; // Creating a lum array\n\n\t\tlum[0] = sumlum; // Putting the sumlum in every cell\n\t\tlum[1] = sumlum;\n\t\tlum[2] = sumlum;\n\n\t\treturn lum; \n\t}", "private static int[] rgbToHsl(int r, int g, int b){\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\t\tint max = java.lang.Math.max(java.lang.Math.max(r, g), b);\n\t\tint min = java.lang.Math.min(java.lang.Math.min(r, g), b);\n\t\tint h = 0;\n\t\tint s = 0;\n\t int l = (max + min) / 2;\n\t if(max == min) {\n\t h = s = 0; // achromatic\n\t }else{\n\t \tint d = max - min;\n\t s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t if(max == r) {\n\t \th = (g - b) / d + (g < b ? 6 : 0);\n\t } else if(max == g) {\n\t \th = (b - r) / d + 2;\n\t } else if (max == b) {\n\t \th = (r - g) / d + 4;\n\t }\n\t h /= 6;\n\t }\n\t int [] ret = new int[3];\n\t ret[0] = h;\n\t ret[1] = s;\n\t ret[2] = l;\n\t return ret;\n\t}", "int interpolateColor(int[] arr, float step) {\n int sz = arr.length;\n\n if (sz == 1 || step <= 0.0) {\n return arr[0];\n } else if (step >= 1.0) {\n return arr[sz - 1];\n }\n\n float scl = step * (sz - 1);\n int i = (int) scl;\n\n return lerpColor(arr[i], arr[i + 1], scl - i);\n }", "private int parseColour(final String value) {\n\n\t\tint result = 0xffffff;\n\n\t\t// Handle colour values that are in the format \"rgb(r,g,b)\"\n\t\tif (value.startsWith(\"rgb\")) {\n\t\t\tint r, g, b;\n\t\t\tfinal ValueTokenizer t = new ValueTokenizer();\n\t\t\tt.getToken(value.substring(3));\n\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\tr = (int) t.tokenF;\n\t\t\t\tt.getToken(null);\n\t\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\t\tg = (int) t.tokenF;\n\t\t\t\t\tt.getToken(null);\n\t\t\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\t\t\tb = (int) t.tokenF;\n\t\t\t\t\t\tresult = (r << 16) + (g << 8) + b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle colour values that are in the format #123abc. (Assume that's what it is,\n\t\t// if the length is seven characters).\n\t\telse if (value.length() == 7) {\n\t\t\ttry {\n\t\t\t\tresult = Integer.parseInt(value.substring(1, 7), 16);\n\t\t\t}\n\t\t\tcatch (final NumberFormatException e) {\n\t\t\t\tresult = 0xff0000;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public native int getTotalColors() throws MagickException;", "public abstract RGBPixel getPixelRgb(int x, int y);", "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 }", "int getColour();", "static private int[] RGBtoYCbCr(int[] RGB) {\n int[] YCbCr = new int[3];\n\n float r = (float) RGB[0];\n float g = (float) RGB[1];\n float b = (float) RGB[2];\n\n float y = (float) (0 + (0.299 * r) + (0.587 * g) + (0.114 * b));\n float cb = (float) (128 - (0.168736 * r) - (0.331264 * g) + (0.5 * b));\n float cr = (float) (128 + (0.5 * r) - (0.418688 * g) - (0.081312 * b));\n\n\n YCbCr[0] = Math.round(y);\n YCbCr[1] = Math.round(cb);\n YCbCr[2] = Math.round(cr);\n\n\n return YCbCr;\n }", "public static int getRed(int color) {\n return (color & 0x00FF0000) >> 16;\n }", "public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public int checkRGBValue(int redGreenOrBlue) {\n if (redGreenOrBlue > 255) redGreenOrBlue = 255;\n if (redGreenOrBlue < 0) redGreenOrBlue = 0;\n return redGreenOrBlue;\n }", "public int getBlue(Object inData) {\n if (is_sRGB) {\n boolean needAlpha = (supportsAlpha && isAlphaPremultiplied);\n int alp = 0;\n int blue = 0;\n switch (transferType) {\n case DataBuffer.TYPE_BYTE:\n byte bdata[] = (byte[])inData;\n blue = bdata[2] & 0xff;\n if (needAlpha) {\n alp = bdata[numColorComponents] & 0xff;\n }\n break;\n case DataBuffer.TYPE_USHORT:\n short sdata[] = (short[])inData;\n blue = sdata[2] & 0xffff;\n if (needAlpha) {\n alp = sdata[numColorComponents] & 0xffff;\n }\n break;\n case DataBuffer.TYPE_INT:\n int idata[] = (int[])inData;\n blue = idata[2];\n if (needAlpha) {\n alp = idata[numColorComponents];\n }\n break;\n default:\n throw new\n UnsupportedOperationException(\"This method has not \"+\n \"been implemented for transferType \" + transferType);\n }\n if (nBits[2] != 8) {\n int shift = nBits[2] - 8;\n return ((shift > 0) \n ? (blue>>shift)\n : (blue<<(-shift)));\n }\n if (needAlpha) {\n return (alp != 0)\n ? (int) (blue*((1<<nBits[numColorComponents])-1.f)/alp)\n : 0;\n }\n else {\n return blue;\n }\n }\n // REMIND: possible grayscale optimization here\n // else if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n // return getGray(inData);\n // }\n\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premultiplied values\n float[] rgb = colorSpace.toRGB(norm);\n return (int) (rgb[2] * 255.0f);\n }", "public abstract RGBFColor toRGBFColor();", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public static int alphaRGB(int rgb,int orgb,float alpha){\r\n\t\tif(alpha==1.0){\r\n\t\t\treturn rgb;\r\n\t\t}\r\n\t\tint a = (int)(alpha*0xff);\r\n\t\tint nrgb = 0xff000000;\r\n\t\tint r = a*((rgb&0x00ff0000)>>16); //red\r\n\t\tr+=(0xff-a)*orgb;\r\n\t\tr/=0xff;\r\n\t\tnrgb += r<<16;\r\n\t\tr = a*((rgb&0x0000ff00)>>8); \t //green\r\n\t\tr+=(0xff-a)*orgb;\r\n\t\tr/=0xff;\r\n\t//\tSystem.out.println(r);\r\n\t\tnrgb+=r<<8;\r\n\t\tr = a*(rgb&0x000000ff); \t //blue\r\n\t\tr+=(0xff-a)*orgb;\r\n\t\tr/=0xff;\r\n\t\tnrgb+=r;\r\n\t\r\n\t\treturn nrgb;\r\n\t}", "public int getColorAsInt(String colorValue) throws NumberFormatException\n {\n if (colorValue == null)\n throw new NullPointerException(\"colorValue may not be null\");\n \n if (namedColors != null)\n {\n Integer value = namedColors.get(colorValue);\n if (value != null)\n return value.intValue();\n }\n \n return Integer.decode(colorValue).intValue();\n }", "public static int[] singleArrayRGB(int rgb[][]) throws Exception {\r\n\t\t//Main Array (w/ Default):\r\n\t\tint array[] = new int[(rgb.length * rgb[0].length)];\r\n\r\n\t\t//Loop Variable:\r\n\t\tint turnsWidth = 0;\r\n\t\tint turnCounter = 0;\r\n\r\n\t\t//Loops through Array:\r\n\t\tmainLoop: while (turnsWidth < rgb.length) {\r\n\t\t\t//Loop Variable:\r\n\t\t\tint turnsHeight = 0;\r\n\t\t\tsecondLoop: while (turnsHeight < rgb[0].length) {\r\n\t\t\t\t//Sets the Array:\r\n\t\t\t\tarray[turnCounter] = rgb[turnsWidth][turnsHeight];\r\n\r\n\t\t\t\tturnsHeight++;\r\n\t\t\t\tturnCounter++;\r\n\t\t\t}\r\n\r\n\t\t\tturnsWidth++;\r\n\t\t}\r\n\r\n\t\t//Returns the Array:\r\n\t\treturn array;\r\n\t}", "public native int[] tintImage(\n int[] image, int length, int rTint, int gTint, int bTint )\n throws ImageSizeException;", "protected abstract void toSpace( float[] rgb );", "public static double[] rgbIntToRgbArray(int rgb) {\n\t\tdouble[] rgbArray = new double[3];\n\t\trgbArray[0] = (rgb >> 16) & 0xFF;\n\t\trgbArray[1] = (rgb >> 8) & 0xFF;\n\t\trgbArray[2] = (rgb) & 0xFF;\n\t\treturn rgbArray;\n\t}", "public int getColor() {\n\t\treturn getMappedColor(color);\n\t}", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "public static int colorStringToInt(String color) {\r\n\t\tswitch (color.toUpperCase()) {\r\n\t\tcase \"MAGENTA\":\r\n\t\t\treturn 16711935;\r\n\t\tcase \"BLACK\":\r\n\t\t\treturn 0;\r\n\t\tcase \"WHITE\":\r\n\t\t\treturn 16767215;\r\n\t\tcase \"ORANGE\":\r\n\t\t\treturn 16762880;\r\n\t\tcase \"CYAN\":\r\n\t\t\treturn 65535;\r\n\t\tcase \"PINK\":\r\n\t\t\treturn 16756655;\r\n\t\tdefault:\r\n\t\t\tthrow new IllegalStateException(\"il colore inserito non è corretto\");\r\n\t\t}\r\n\t}", "public BufferedImage getImage(int[][] data) {\n BufferedImage image = new BufferedImage(IMGSIZEX, IMGSIZEY,\n BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < IMGSIZEX; x++) {\n for (int y = 0; y < IMGSIZEY; y++) {\n int pixelColor = data[x][y];\n // Set Colors based on Binary Image value\n if (pixelColor == 0) {\n pixelColor = Color.ORANGE.getRGB();\n } else {\n pixelColor = Color.CYAN.getRGB();\n }\n image.setRGB(x, y, pixelColor);\n } // End for y.\n } // End for x.\n return image;\n }" ]
[ "0.7770907", "0.67422575", "0.6695676", "0.6665606", "0.65120995", "0.65079314", "0.647346", "0.6468218", "0.64622086", "0.6430217", "0.64245456", "0.6387409", "0.63352615", "0.6282497", "0.62779206", "0.6264637", "0.626284", "0.6212993", "0.61757356", "0.6170119", "0.6164967", "0.6162737", "0.613566", "0.61108583", "0.60687083", "0.6060447", "0.60582805", "0.60492975", "0.6023447", "0.60205096", "0.6008472", "0.5990179", "0.5977214", "0.59769833", "0.59513545", "0.59441686", "0.5909623", "0.59082055", "0.5884935", "0.5881324", "0.58795637", "0.58742344", "0.58294123", "0.5824032", "0.5817833", "0.5815433", "0.58136296", "0.57914776", "0.57906735", "0.5772227", "0.5764424", "0.57596624", "0.57413757", "0.573479", "0.573079", "0.572926", "0.5697577", "0.5685128", "0.56847656", "0.56821483", "0.56687564", "0.5661832", "0.56532145", "0.56505966", "0.56505966", "0.56457597", "0.5635422", "0.56174314", "0.5609116", "0.5605091", "0.5586952", "0.5584662", "0.5579925", "0.55612063", "0.55533475", "0.55490416", "0.5548674", "0.55381435", "0.55350655", "0.55247235", "0.55242157", "0.55141145", "0.5506188", "0.5503446", "0.5500755", "0.5492842", "0.54925", "0.5492179", "0.5469355", "0.54682416", "0.5466982", "0.54606444", "0.5443165", "0.5437608", "0.5431329", "0.5428569", "0.54210323", "0.5413665", "0.54059076", "0.5403998" ]
0.80884475
0
Convert from RGB color space to CMY color space
public static double[] rgbToCmy(double[] rgb) { assert(rgb != null && rgb.length == 3); double[] cmy = new double[3]; cmy[0] = 1 - (rgb[0] / 255); cmy[1] = 1 - (rgb[1] / 255); cmy[2] = 1 - (rgb[2] / 255); return cmy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract RGBIColor toRGBColor();", "public static float[] rgb2cmyk(int rgb) {\r\n float r = (rgb >> 16) & 0xFF;\r\n float g = (rgb >> 8) & 0xFF;\r\n float b = rgb & 0xFF;\r\n float C = 1.0f - (r / 255);\r\n float M = 1.0f - (g / 255);\r\n float Y = 1.0f - (b / 255);\r\n float var_K = 1;\r\n\r\n if (C < var_K) {\r\n var_K = C;\r\n }\r\n if (M < var_K) {\r\n var_K = M;\r\n }\r\n if (Y < var_K) {\r\n var_K = Y;\r\n }\r\n\r\n C = (C - var_K) / (1 - var_K);\r\n M = (M - var_K) / (1 - var_K);\r\n Y = (Y - var_K) / (1 - var_K);\r\n return new float[] { C * 100, M * 100, Y * 100, var_K * 100 };\r\n }", "void inputToCb(Mat input){\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "static private int[] RGBtoYCbCr(int[] RGB) {\n int[] YCbCr = new int[3];\n\n float r = (float) RGB[0];\n float g = (float) RGB[1];\n float b = (float) RGB[2];\n\n float y = (float) (0 + (0.299 * r) + (0.587 * g) + (0.114 * b));\n float cb = (float) (128 - (0.168736 * r) - (0.331264 * g) + (0.5 * b));\n float cr = (float) (128 + (0.5 * r) - (0.418688 * g) - (0.081312 * b));\n\n\n YCbCr[0] = Math.round(y);\n YCbCr[1] = Math.round(cb);\n YCbCr[2] = Math.round(cr);\n\n\n return YCbCr;\n }", "void inputToCb(Mat input) {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "void inputToCb(Mat input)\n {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "void inputToCb(Mat input)\n {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "protected abstract void toSpace( float[] rgb );", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "public abstract RGBFColor toRGBFColor();", "public static double[] cmyToRgb(double[] cmy) {\n\t\tassert(cmy != null && cmy.length == 3);\n\t\tdouble[] rgb = new double[3];\n\t\trgb[0] = (1-cmy[0]) * 255;\n\t\trgb[1] = (1-cmy[1]) * 255;\n\t\trgb[2] = (1-cmy[2]) * 255;\n\t\treturn rgb;\n\t}", "protected abstract ColorSpace getColorSpace();", "public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "RGB getNewColor();", "public abstract int rgbColor(double u, double v);", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static Color[][] getImageC(Image img) {\n\n // Get the raw pixel data \n iObserver observer = new iObserver();\n int width1 = img.getWidth(observer);\n int height1 = img.getHeight(observer);\n int[] rawPixels = utils.getPixels(img,width1,height1);\n\n // Each pixel is represented by 32 bits. Separate the tH32 bits into\n // four 8-bit values (red, green, blue, offset).\n\n // Arrange the data by rows and columns\n //row-col has been reversed\n Color[][] imagePixels = new Color[height1][width1];\n int index=0;\n for(int row=0; row<imagePixels.length; row++) {\n for(int col=0; col<imagePixels[0].length; col++) {\n imagePixels[col][row] = new Color(rawPixels[index]);\n index++;\n } // for col\n } // for row\n return imagePixels;\n }", "public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static AnsiColor rgb(Color c) {\n return new RgbColor(c);\n }", "public native PixelPacket[] getColormap() throws MagickException;", "private native int grayToRgb(byte src[],int dst[]);", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "java.awt.Color getColor();", "public int getRgbColor()\n {\n return _rgbColor;\n }", "public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "RGB getOldColor();", "public static Color getColor(int c)\n {\n int r = (7*c)%64;\n return new Color((r%4)*63+30,((r/4)%4)*63+30,(r/4/4)*63+30);\n }", "public abstract HSLColor toHSLColor();", "ClrConst(Color color)\n {\n this(Color.RGBtoHSB(\n color.getRed(), \n color.getGreen(),\n color.getBlue(), null)[0]);\n }", "public static void HistogrammeCumuleRGB(Mat m,int[] R,int[] G,int[] B,int[] RC,int[] GC,int[] BC,int N)\n\t{\n\t\tint valueR=0;int valueG=0;int valueB=0;\n\t\tfor(int i=0;i<256;i++)\n\t\t{\n\t\t\tvalueR+=R[i];RC[i]=R[i]==0?0:valueR;\n\t\t\tvalueG+=G[i];GC[i]=G[i]==0?0:valueG;\n\t\t\tvalueB+=B[i];BC[i]=B[i]==0?0:valueB;\n\t\t\t\n\t\t}\n\t}", "public CMYKColors getColor() {\n return this.color;\n }", "public static ColorImage toColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (int) img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "public native int getColorspace() throws MagickException;", "public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static Color fromBGR(int rgb) {\n return Color.rgb(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF);\n }", "protected Color[] generatePlotColors(int numLayers){\n\t\tColor[] clrs = new Color[numLayers];\n\t\t\n\t\t//the first layer is the backgound, so this shouldn't really\n\t\t//ever be used\n\t\tclrs[0] = Color.BLACK;\n\n\t\t//the raw data\n\t\tclrs[1] = Color.GRAY;\n\n\t\t//TODO: this should be changed to a more robust method\n\t\tint colorIdx;\n\t\tfor(int i = 2; i < numLayers; i++){\n\t\t\tcolorIdx = i % 4;\n\t\t\tswitch(colorIdx){\n\t\t\t\tcase 0:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_BLUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_RED;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_GREEN;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_YELLOW;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:{\n\t\t\t\t\tSystem.out.println(\"Problem With Color Assignment\");\n\t\t\t\t\tclrs[i] = Color.MAGENTA;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clrs;\n\t}", "protected abstract float[] getRgbLut();", "abstract public void colorize(TCell c);", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "protected ColorSpace getImageColorSpace() {\n return this.image.getColorSpace();\n }", "public Color getC(){\n\t\treturn c;\n\t}", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "RGB getRealRGB(Color color) {\n\tImage colorImage = new Image(display, 10, 10);\n\tGC imageGc = new GC(colorImage);\n\tImageData imageData;\n\tPaletteData palette;\n\tint pixel;\n\t\n\timageGc.setBackground(color);\n\timageGc.setForeground(color);\n\timageGc.fillRectangle(0, 0, 10, 10);\n\timageData = colorImage.getImageData();\n\tpalette = imageData.palette;\n\timageGc.dispose();\n\tcolorImage.dispose();\n\tpixel = imageData.getPixel(0, 0);\n\treturn palette.getRGB(pixel);\n}", "private List<int[]> separateColorChannels(RGBImage image) {\n\t\tList<int[]> outList = new ArrayList<int[]>(3);\n\t\tint[] data = (int[]) image.getValue();\n\t\tint[] rch = new int[data.length];\n\t\tint[] gch = new int[data.length];\n\t\tint[] bch = new int[data.length];\n\t\tfor (int i = 0; i < data.length && start; i++) {\n\t\t\trch[i] = (data[i] >> 16) & MASK;\n\t\t\tgch[i] = (data[i] >> 8) & MASK;\n\t\t\tbch[i] = data[i] & MASK;\n\t\t}\n\t\toutList.add(0, rch);\n\t\toutList.add(1, gch);\n\t\toutList.add(2, bch);\n\t\treturn outList;\n\t}", "@Test\n public void testICCProfileCMYKClassOutputColors() throws IOException {\n // Make sure ICC profile with class output isn't converted to too bright values\n JPEGImageReader reader = createReader();\n reader.setInput(ImageIO.createImageInputStream(getClassLoaderResource(\"/jpeg/cmyk-sample-custom-icc-bright.jpg\")));\n\n ImageReadParam param = reader.getDefaultReadParam();\n param.setSourceRegion(new Rectangle(800, 800, 64, 8));\n param.setSourceSubsampling(8, 8, 1, 1);\n\n BufferedImage image = reader.read(0, param);\n assertNotNull(image);\n\n byte[] data = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n byte[] expectedData = {34, 37, 34, 47, 47, 44, 22, 26, 28, 23, 26, 28, 20, 23, 26, 20, 22, 25, 22, 25, 27, 18, 21, 24};\n\n assertEquals(expectedData.length, data.length);\n\n assertJPEGPixelsEqual(expectedData, data, 0);\n\n reader.dispose();\n }", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}", "public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;", "protected abstract Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException;", "private static int getPrevCC(PrevArgs paramPrevArgs)\n/* */ {\n/* 574 */ return (int)(0xFF & getPrevNorm32(paramPrevArgs, 768, 65280) >> 8);\n/* */ }", "public Color getColor(RGB rgb) {\n\t\treturn colorTable.computeIfAbsent(rgb, raw -> new Color(raw));\n\t}", "public void codifRLC()\n\t{\n\t\tList<Integer> result= new ArrayList<Integer>();\n\t\tint rgb=0;\n\t\tColor color;\n\t\tint r=0;\n\t\tint ant=-1;\n\t\tint acum=0;\n\t\tfor(int i=this.inicalto;i<=this.alto;i++) {\n\t\t\tfor(int j=this.inicancho;j<=this.ancho;j++)\n\t\t\t{\n\t\t\t\trgb = this.img.getRGB(j, i);\n\t\t\t\tcolor = new Color(rgb, true);\n\t\t\t\tr = color.getRed();\n\t\t\t\t\tif(ant==-1) {\n\t\t\t\t\t\tant=r;\n\t\t\t\t\t\tacum=1;\n\t\t\t\t\t}\n\t\t\t\t\t\tif(r==ant && acum<256)\n\t\t\t\t\t\t\tacum++;\n\t\t\t\t\t\t\tif(r!=ant){\n\t\t\t\t\t\t\t\tresult.add(ant);\n\t\t\t\t\t\t\t\tresult.add(acum);\n\t\t\t\t\t\t\t\tacum=1;\n\t\t\t\t\t\t\t\tant=r;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(acum==255){\n\t\t\t\t\t\t\t\t\tresult.add(ant);\n\t\t\t\t\t\t\t\t\tresult.add(acum);\n\t\t\t\t\t\t\t\t\tacum=1;\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tresult.add(ant);\n\t\tresult.add(acum);\n\t\t\n\t\tthis.CR=new CabeceraRLC(this.inicancho,this.inicalto,this.ancho,this.alto,img.TYPE_INT_RGB);\n\t\tthis.codResultRLC=result;\n\t\tthis.generarArchivoRLC(result);\n\t}", "public static int toRGB(Color color) {\n\t\treturn toInt(color.getRed()) | (toInt(color.getGreen()) << 8) | (toInt(color.getBlue()) << 16);\n\t}", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public static int toBGR(Color color) {\n int result = (int) (color.getBlue() * 0xFF);\n result = (result << 8) + (int) (color.getGreen() * 0xFF);\n result = (result << 8) + (int) (color.getRed() * 0xFF);\n return result;\n }", "private Color NewColor(int numb) {\r\n\r\n\t\tswitch(numb){\r\n\t\tcase 0: return Color.BLACK;\r\n\t\tcase 1: return Color.RED;\r\n\t\tcase 3: return Color.BLUE;\r\n\t\t}\r\n\t\treturn Color.MAGENTA;\r\n\t}", "public char getColor();", "public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;", "public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}", "public static Color colorIntToColor(int color) {\r\n\t\treturn Color.getColor(null, color);\r\n\t}", "private static int getGrayTranslucentRGB(int rgb) {\n\t\tint r = (0xff & rgb);\n\t\tint g = (0xff & (rgb >> 8));\n\t\tint b = (0xff & (rgb >> 16));\n\t\trgb = r + (g << 8) + (b << 16) + (100 << 24);\n\t\t// rgb = r + (g << 8) + (b << 16); // 亮一些\n\t\treturn rgb;\n\t}", "Color3b colorAt(int xIndex, int yIndex);", "void setFromInt32Color(int newColor) {\r\n\t\tx = ((float) ((newColor >> 16) | 0xFF)) / 255.0f;\r\n\t\ty = ((float) ((newColor >> 8) | 0xFF)) / 255.0f;\r\n\t\tz = ((float) ((newColor) | 0xFF)) / 255.0f;\r\n\t}", "public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public native void cycleColormapImage(int amount) throws MagickException;", "void fill(int rgb);", "public static double[] rgbToXyz(double[] rgb) {\n\t\tdouble r = rgb[0]/255;\n\t\tdouble g = rgb[0]/255;\n\t\tdouble b = rgb[0]/255;\n\t\tif (r > 0.04045) {\n\t\t\tr = Math.pow((r+0.055)/1.055, 2.4);\n\t\t} else {\n\t\t\tr = r/ 12.92;\n\t\t}\n\t\tif (g > 0.04045) {\n\t\t\tg = Math.pow((g+0.055)/1.055, 2.4);\n\t\t} else {\n\t\t\tg = g/ 12.92;\n\t\t}\n\t\tif (b > 0.04045) {\n\t\t\tb = Math.pow((b+0.055)/1.055, 2.4);\n\t\t} else {\n\t\t\tb = b/ 12.92;\n\t\t}\n\t\tr *= 100;\n\t\tg *= 100;\n\t\tb *= 100;\n\t\tdouble[] xyz = new double[3];\n\t\txyz[0] = r * 0.4124 + g * 0.3576 + b * 0.1805;\n\t\txyz[1] = r * 0.2126 + g * 0.7152 + b * 0.0722;\n\t\txyz[2] = r * 0.0193 + g * 0.1192 + b * 0.9505;\n\t\treturn xyz;\n\t}", "public RGBColor getColor(){\r\n return this._color;\r\n }", "public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }", "@Override\n public Color getColor() {\n return Utils.Pion.BLANC.getCouleur();\n }", "public native PixelPacket getColormap(int index) throws MagickException;", "public static void rgb_to_lab(float[] rgb, float[] lab)\n {\n float r = rgb[0];\n float g = rgb[1];\n float b = rgb[2];\n\n // D65 standard referent\n float X = 0.950470f, Y = 1.0f, Z = 1.088830f;\n\n // second, map sRGB to CIE XYZ\n r = r <= 0.04045f ? r/12.92f : (float)Math.pow((r+0.055f)/1.055f, 2.4f);\n g = g <= 0.04045f ? g/12.92f : (float)Math.pow((g+0.055f)/1.055f, 2.4f);\n b = b <= 0.04045f ? b/12.92f : (float)Math.pow((b+0.055f)/1.055f, 2.4f);\n float x = (0.4124564f*r + 0.3575761f*g + 0.1804375f*b) / X,\n y = (0.2126729f*r + 0.7151522f*g + 0.0721750f*b) / Y,\n z = (0.0193339f*r + 0.1191920f*g + 0.9503041f*b) / Z;\n\n // third, map CIE XYZ to CIE L*a*b* and return\n x = x > 0.008856f ? (float)Math.pow(x, 1.0f/3) : 7.787037f*x + 4.0f/29;\n y = y > 0.008856f ? (float)Math.pow(y, 1.0f/3) : 7.787037f*y + 4.0f/29;\n z = z > 0.008856f ? (float)Math.pow(z, 1.0f/3) : 7.787037f*z + 4.0f/29;\n\n float L = 116*y - 16,\n A = 500*(x-y),\n B = 200*(y-z);\n\n lab[0] = L;\n lab[1] = A;\n lab[2] = B;\n }", "public static Color fromRGB(int color) {\n\t\treturn Color.rgb(color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF);\n\t}", "public Crc32C(){\n reset();\n }", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "private static void arrCHS2LBA(int[][] arr) {\n\t\tfor(int[] chs : arr){\n\t\t\tchs[3] = 255 * 63 * chs[0] + 63 * chs[1] + chs[2] - 1;\n\t\t\tchs[7] = 255 * 63 * chs[4] + 63 * chs[5] + chs[6] - 1 ;\n\t\t}\n\t}", "public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public native int getColors() throws MagickException;", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }", "private Color getColor(final RGB rgb) {\n Color color = this.colorTable.get(rgb);\n if (color == null) {\n color = new Color(Display.getCurrent(), rgb);\n this.colorTable.put(rgb, color);\n }\n return color;\n }", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "public T caseUbqRgbColor(UbqRgbColor object) {\r\n\t\treturn null;\r\n\t}", "public void init_colors(Color c1,Color c2,Color c3,Color c4){\n\t\tcolors = new Color [100];\n\t\tfor (int i = 0; i < 33; i++){\n\t\t\tdouble f = ((double)i) / 32;\n\t\t\tcolors[i] = new Color(\n\t\t\t\tclamp((int)( c1.getRed() + (f * (c2.getRed() - c1.getRed())) )),\n\t\t\t\tclamp((int)( c1.getGreen() + (f * (c2.getGreen() - c1.getGreen())) )),\n\t\t\t\tclamp((int)( c1.getBlue() + (f * (c2.getBlue() - c1.getBlue())) ))\n\t\t\t);\n\t\t}\n\t\tfor (int i = 33; i < 66; i++){\n\t\t\tdouble f = ((double)(i - 33)) / 32;\n\t\t\tcolors[i] = new Color(\n\t\t\t\tclamp((int)( c2.getRed() + (f * (c3.getRed() - c2.getRed())) )),\n\t\t\t\tclamp((int)( c2.getGreen() + (f * (c3.getGreen() - c2.getGreen())) )),\n\t\t\t\tclamp((int)( c2.getBlue() + (f * (c3.getBlue() - c2.getBlue())) ))\n\t\t\t);\n\t\t}\n\t\tfor (int i = 66; i < 100; i++){\n\t\t\tdouble f = ((double)(i - 66)) / 32;\n\t\t\tcolors[i] = new Color(\n\t\t\t\tclamp((int)( c3.getRed() + (f * (c4.getRed() - c3.getRed())) )),\n\t\t\t\tclamp((int)( c3.getGreen() + (f * (c4.getGreen() - c3.getGreen())) )),\n\t\t\t\tclamp((int)( c3.getBlue() + (f * (c4.getBlue() - c3.getBlue())) ))\n\t\t\t);\n\t\t}\n\t}", "public static Color fromRGB(int rgb) {\n return Color.rgb((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF);\n }", "public Colour(int rgb) {\n\t\tset(((rgb >> 16) & 0xff) * nf, ((rgb >> 8) & 0xff) * nf, (rgb & 0xff)\n\t\t\t\t* nf);\n\t}", "public static float[] color(Color c) {\r\n \r\n if (c == null) c = Color.BLUE;\r\n return new float[]{ ((float) c.getRed() / 255.0f), \r\n ((float) c.getGreen() / 255.0f), ((float) c.getBlue() / 255.0f) };\r\n }", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }" ]
[ "0.7129924", "0.68627024", "0.6643241", "0.6607214", "0.65567124", "0.65268075", "0.65125126", "0.6481612", "0.6481612", "0.6474144", "0.63531506", "0.63375723", "0.63190895", "0.62859344", "0.61237675", "0.6092153", "0.60118127", "0.6003794", "0.58916944", "0.5787757", "0.57228905", "0.5698257", "0.56895006", "0.5689477", "0.56648666", "0.56558317", "0.56268555", "0.5613544", "0.5608496", "0.55933577", "0.5591106", "0.5578758", "0.55642694", "0.55354637", "0.5525842", "0.5502404", "0.5477152", "0.5468659", "0.5468396", "0.5466906", "0.5459471", "0.54139477", "0.54014677", "0.5398677", "0.5397256", "0.53933555", "0.53806204", "0.5378686", "0.5376495", "0.53729373", "0.5366374", "0.5362207", "0.5358753", "0.53338665", "0.53331953", "0.5325307", "0.5299112", "0.52972627", "0.52911264", "0.52865785", "0.5283693", "0.5278981", "0.52724624", "0.52603334", "0.5238462", "0.52376264", "0.5235206", "0.5232982", "0.5231792", "0.52306527", "0.5222339", "0.5221893", "0.52091366", "0.5191275", "0.5189059", "0.5176388", "0.51717573", "0.515569", "0.5153245", "0.5150468", "0.5150468", "0.5150468", "0.5150468", "0.5150468", "0.51349676", "0.51348275", "0.51336247", "0.5130062", "0.5126854", "0.51262546", "0.51199627", "0.51168007", "0.51163656", "0.51088005", "0.5102334", "0.5099652", "0.5093584", "0.5092733", "0.5090802", "0.50874156" ]
0.689081
1
Convert rgb color space to hsv color space h: degree s,v: percentage
public static double[] rgbToHsv(int rgb[]) { double temp[] = new double[3]; double hsv[] = new double[3]; temp[0] = (double)rgb[0]/255; temp[1] = (double)rgb[1]/255; temp[2] = (double)rgb[2]/255; double max = Math.max(temp[0], Math.max(temp[1], temp[2])); double min = Math.min(temp[0], Math.min(temp[1], temp[2])); double delta = max-min; if (delta == 0) { hsv[0] = 0; } else if (max == temp[0]) { hsv[0] = (60*(temp[1]-temp[2])/delta)+360; while (hsv[0] >= 360) { hsv[0] -= 360; } } else if (max == temp[1]) { hsv[0] = 60 * (temp[2]-temp[0]) / delta + 120; } else if (max == temp[2]) { hsv[0] = 60 * (temp[0]-temp[1]) / delta + 240; } if (max == 0) { hsv[1] = 0; } else { hsv[1] = delta/max; } hsv[2] = max; return hsv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double[] hsvToRgb(double[] hsv) {\n\t\tdouble h = hsv[0];\n\t\tdouble s = hsv[1];\n\t\tdouble v = hsv[2];\n\t\tdouble r,g,b;\n\t\t\n\t\tif (s == 0) {\n\t\t\tr = v * 255;\n\t\t\tg = v * 255;\n\t\t\tb = v * 255;\n\t\t} else {\n\t\t\tdouble varH = h / 60;\n\t\t\tif ((int)varH == 6) {\n\t\t\t\tvarH = 0;\n\t\t\t}\n\t\t\tint varI = (int)(varH);\n\t\t\tdouble var1 = v * (1 - s);\n\t\t\tdouble var2 = v * (1 - s * (varH - varI));\n\t\t\tdouble var3 = v * (1 - s * (1 - (varH - varI)));\n\t\t\t\n\t\t\tdouble varR, varG, varB;\n\t\t\tswitch (varI) {\n\t\t\tcase 0:\n\t\t\t\tvarR = v;\n\t\t\t\tvarG = var3;\n\t\t\t\tvarB = var1;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tvarR = var2;\n\t\t\t\tvarG = v;\n\t\t\t\tvarB = var1;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tvarR = var1;\n\t\t\t\tvarG = v;\n\t\t\t\tvarB = var3;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tvarR = var1;\n\t\t\t\tvarG = var2;\n\t\t\t\tvarB = v;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tvarR = var3;\n\t\t\t\tvarG = var1;\n\t\t\t\tvarB = v;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tvarR = v;\n\t\t\t\tvarG = var1;\n\t\t\t\tvarB = var2;\n\t\t\t}\n\t\t\tr = varR * 255;\n\t\t\tg = varG * 255;\n\t\t\tb = varB * 255;\n\t\t}\n\t\tdouble[] result = {r,g,b};\n\t\treturn result;\n\t}", "public abstract HSLColor toHSLColor();", "public abstract int rgbColor(double u, double v);", "protected abstract void toSpace( float[] rgb );", "private static int[] rgbToHsl(int r, int g, int b){\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\t\tint max = java.lang.Math.max(java.lang.Math.max(r, g), b);\n\t\tint min = java.lang.Math.min(java.lang.Math.min(r, g), b);\n\t\tint h = 0;\n\t\tint s = 0;\n\t int l = (max + min) / 2;\n\t if(max == min) {\n\t h = s = 0; // achromatic\n\t }else{\n\t \tint d = max - min;\n\t s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t if(max == r) {\n\t \th = (g - b) / d + (g < b ? 6 : 0);\n\t } else if(max == g) {\n\t \th = (b - r) / d + 2;\n\t } else if (max == b) {\n\t \th = (r - g) / d + 4;\n\t }\n\t h /= 6;\n\t }\n\t int [] ret = new int[3];\n\t ret[0] = h;\n\t ret[1] = s;\n\t ret[2] = l;\n\t return ret;\n\t}", "public static double[] getColorHSV(int h, int s, int v){\n\t\tdouble[] output=new double[3];\n\t\tColor c=new Color(Color.HSBtoRGB((float)(h/255.0), (float)(s/255.0), (float)(v/255.0)));\n\t\toutput[0]=Math.min(1.0, (double)c.getRed()/255.0);\n\t\toutput[1]=Math.min(1.0, (double)c.getGreen()/255.0);\n\t\toutput[2]=Math.min(1.0, (double)c.getBlue()/255.0);\n\t\treturn output;\n\t}", "public static double[] rgbToHsv(int red, int green, int blue) {\n if (red < 0 || red > 255) {\n throw new IllegalArgumentException(\"red should be between 0 and 255\");\n }\n\n if (green < 0 || green > 255) {\n throw new IllegalArgumentException(\"green should be between 0 and 255\");\n }\n\n if (blue < 0 || blue > 255) {\n throw new IllegalArgumentException(\"blue should be between 0 and 255\");\n }\n\n double dRed = (double) red / 255;\n double dGreen = (double) green / 255;\n double dBlue = (double) blue / 255;\n double value = Math.max(Math.max(dRed, dGreen), dBlue);\n double chroma = value - Math.min(Math.min(dRed, dGreen), dBlue);\n double saturation = value == 0 ? 0 : chroma / value;\n double hue;\n\n if (chroma == 0) {\n hue = 0;\n } else if (value == dRed) {\n hue = 60 * (0 + (dGreen - dBlue) / chroma);\n } else if (value == dGreen) {\n hue = 60 * (2 + (dBlue - dRed) / chroma);\n } else {\n hue = 60 * (4 + (dRed - dGreen) / chroma);\n }\n\n hue = (hue + 360) % 360;\n\n return new double[] {hue, saturation, value};\n }", "public static int[] rgb2hsv(int pixelValue) {\r\n int[] rgbA = Colors.hexToRgb(pixelValue);\r\n float[] hsb = rgb2hsb(rgbA[0], rgbA[1], rgbA[2]);\r\n return new int[] { Math.round(hsb[0] * 360), Math.round(hsb[1] * 100), Math.round(hsb[2] * 100) };\r\n }", "public float hue() {\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = color & 0xFF;\n\n int V = Math.max(b, Math.max(r, g));\n int temp = Math.min(b, Math.min(r, g));\n\n float H;\n\n if (V == temp) {\n H = 0;\n } else {\n final float vtemp = (float) (V - temp);\n final float cr = (V - r) / vtemp;\n final float cg = (V - g) / vtemp;\n final float cb = (V - b) / vtemp;\n\n if (r == V) {\n H = cb - cg;\n } else if (g == V) {\n H = 2 + cr - cb;\n } else {\n H = 4 + cg - cr;\n }\n\n H /= 6.f;\n if (H < 0) {\n H++;\n }\n }\n\n return H;\n }", "public static void main(String[] args) {\n assert Arrays.equals(hsvToRgb(0, 0, 0), new int[] {0, 0, 0});\n assert Arrays.equals(hsvToRgb(0, 0, 1), new int[] {255, 255, 255});\n assert Arrays.equals(hsvToRgb(0, 1, 1), new int[] {255, 0, 0});\n assert Arrays.equals(hsvToRgb(60, 1, 1), new int[] {255, 255, 0});\n assert Arrays.equals(hsvToRgb(120, 1, 1), new int[] {0, 255, 0});\n assert Arrays.equals(hsvToRgb(240, 1, 1), new int[] {0, 0, 255});\n assert Arrays.equals(hsvToRgb(300, 1, 1), new int[] {255, 0, 255});\n assert Arrays.equals(hsvToRgb(180, 0.5, 0.5), new int[] {64, 128, 128});\n assert Arrays.equals(hsvToRgb(234, 0.14, 0.88), new int[] {193, 196, 224});\n assert Arrays.equals(hsvToRgb(330, 0.75, 0.5), new int[] {128, 32, 80});\n\n // Test rgbToHsv-method\n // approximate-assertions needed because of small deviations due to converting between\n // int-values and double-values.\n assert approximatelyEqualHsv(rgbToHsv(0, 0, 0), new double[] {0, 0, 0});\n assert approximatelyEqualHsv(rgbToHsv(255, 255, 255), new double[] {0, 0, 1});\n assert approximatelyEqualHsv(rgbToHsv(255, 0, 0), new double[] {0, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(255, 255, 0), new double[] {60, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(0, 255, 0), new double[] {120, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(0, 0, 255), new double[] {240, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(255, 0, 255), new double[] {300, 1, 1});\n assert approximatelyEqualHsv(rgbToHsv(64, 128, 128), new double[] {180, 0.5, 0.5});\n assert approximatelyEqualHsv(rgbToHsv(193, 196, 224), new double[] {234, 0.14, 0.88});\n assert approximatelyEqualHsv(rgbToHsv(128, 32, 80), new double[] {330, 0.75, 0.5});\n }", "public static int[] hsvToRgb(double hue, double saturation, double value) {\n if (hue < 0 || hue > 360) {\n throw new IllegalArgumentException(\"hue should be between 0 and 360\");\n }\n\n if (saturation < 0 || saturation > 1) {\n throw new IllegalArgumentException(\"saturation should be between 0 and 1\");\n }\n\n if (value < 0 || value > 1) {\n throw new IllegalArgumentException(\"value should be between 0 and 1\");\n }\n\n double chroma = value * saturation;\n double hueSection = hue / 60;\n double secondLargestComponent = chroma * (1 - Math.abs(hueSection % 2 - 1));\n double matchValue = value - chroma;\n\n return getRgbBySection(hueSection, chroma, matchValue, secondLargestComponent);\n }", "public static Color bvToColor(double bv)\n\t{\n\t\tdouble t;\n\t\tdouble r = 0, g = 0, b = 0;\n\t\tbv = Math.max(-0.4, Math.min(2.0, bv));\n\t\tif ((bv >= -0.40) && (bv < 0.00))\n\t\t{\n\t\t\tt = (bv + 0.40) / (0.00 + 0.40);\n\t\t\tr = 0.61 + (0.11 * t) + (0.1 * t * t);\n\t\t}\n\t\telse if ((bv >= 0.00) && (bv < 0.40))\n\t\t{\n\t\t\tt = (bv - 0.00) / (0.40 - 0.00);\n\t\t\tr = 0.83 + (0.17 * t);\n\t\t}\n\t\telse if ((bv >= 0.40) && (bv < 2.10))\n\t\t{\n\t\t\tt = (bv - 0.40) / (2.10 - 0.40);\n\t\t\tr = 1.00;\n\t\t}\n\t\tif ((bv >= -0.40) && (bv < 0.00))\n\t\t{\n\t\t\tt = (bv + 0.40) / (0.00 + 0.40);\n\t\t\tg = 0.70 + (0.07 * t) + (0.1 * t * t);\n\t\t}\n\t\telse if ((bv >= 0.00) && (bv < 0.40))\n\t\t{\n\t\t\tt = (bv - 0.00) / (0.40 - 0.00);\n\t\t\tg = 0.87 + (0.11 * t);\n\t\t}\n\t\telse if ((bv >= 0.40) && (bv < 1.60))\n\t\t{\n\t\t\tt = (bv - 0.40) / (1.60 - 0.40);\n\t\t\tg = 0.98 - (0.16 * t);\n\t\t}\n\t\telse if ((bv >= 1.60) && (bv < 2.00))\n\t\t{\n\t\t\tt = (bv - 1.60) / (2.00 - 1.60);\n\t\t\tg = 0.82 - (0.5 * t * t);\n\t\t}\n\t\tif ((bv >= -0.40) && (bv < 0.40))\n\t\t{\n\t\t\tt = (bv + 0.40) / (0.40 + 0.40);\n\t\t\tb = 1.00;\n\t\t}\n\t\telse if ((bv >= 0.40) && (bv < 1.50))\n\t\t{\n\t\t\tt = (bv - 0.40) / (1.50 - 0.40);\n\t\t\tb = 1.00 - (0.47 * t) + (0.1 * t * t);\n\t\t}\n\t\telse if ((bv >= 1.50) && (bv < 1.94))\n\t\t{\n\t\t\tt = (bv - 1.50) / (1.94 - 1.50);\n\t\t\tb = 0.63 - (0.6 * t * t);\n\t\t}\n\t\treturn new Color((float) r, (float) g, (float) b);\n\t}", "public abstract RGBIColor toRGBColor();", "@Override\n public void addHSV(float H, float S, float V) {\n\n }", "@ParameterizedTest\n @MethodSource(\"org.nd4j.linalg.BaseNd4jTestWithBackends#configs\")\n public void testHsvToRgb(Nd4jBackend backend) {\n INDArray input = Nd4j.createFromArray(new float[]{0.705504596f, 0.793608069f, 0.65870738f, 0.848827183f, 0.920532584f,\n 0.887555957f, 0.72317636f, 0.563831031f, 0.773604929f, 0.269532293f,\n 0.332347751f, 0.111181192f}).reshape(4,3);\n\n INDArray expected = Nd4j.createFromArray(new float[]{0.257768334f, 0.135951888f, 0.65870738f, 0.887555957f, 0.0705317783f,\n 0.811602857f, 0.485313689f, 0.337422464f, 0.773604929f, 0.0883753772f,\n 0.111181192f, 0.074230373f}).reshape(4,3);\n\n HsvToRgb op = new HsvToRgb(input);\n INDArray[] ret = Nd4j.exec(op);\n assertEquals(ret[0], expected);\n }", "public static float[] rgb2hsb(int r, int g, int b) {\r\n float[] hsbvals = new float[3];\r\n Color.RGBtoHSB(r, g, b, hsbvals);\r\n return hsbvals;\r\n }", "void setFromHSB(float hue, float saturation, float brightness) {\r\n\t\tfloat[] RGBColor = Color.getHSBColor(hue, saturation, brightness).getRGBComponents(null);\r\n\t\tx = RGBColor[0];\r\n\t\ty = RGBColor[1];\r\n\t\tz = RGBColor[2];\r\n\t\t// Color.getHSBColor(hue, saturation, brightness).getRGBComponents(null);\r\n\t\t// System.out.println(Color.getHSBColor(hue, saturation,\r\n\t\t// brightness).getRGBComponents(null)[0]+\",\"+Color.getHSBColor(hue, saturation,\r\n\t\t// brightness).getRGBComponents(null)[1]+\",\"+Color.getHSBColor(hue, saturation,\r\n\t\t// brightness).getRGBComponents(null)[2]);\r\n\t}", "@ParameterizedTest\n @MethodSource(\"org.nd4j.linalg.BaseNd4jTestWithBackends#configs\")\n public void testRgbToHsv_1(Nd4jBackend backend) {\n INDArray image = Nd4j.createFromArray(new float[]{0.778785586f,0.801197767f,0.724374652f,\n 0.230894327f, 0.727141261f, 0.180390716f }).reshape(2,3);\n RgbToHsv op = new RgbToHsv(image);\n INDArray[] ret = Nd4j.exec(op);\n INDArray expected = Nd4j.createFromArray(new float[]{0.215289578f,0.095885336f,0.801197767f,\n 0.317938268f,0.751917899f,0.727141261f}).reshape(2,3);\n assertEquals(expected, ret[0]);\n }", "public static float[] rgb2cmyk(int rgb) {\r\n float r = (rgb >> 16) & 0xFF;\r\n float g = (rgb >> 8) & 0xFF;\r\n float b = rgb & 0xFF;\r\n float C = 1.0f - (r / 255);\r\n float M = 1.0f - (g / 255);\r\n float Y = 1.0f - (b / 255);\r\n float var_K = 1;\r\n\r\n if (C < var_K) {\r\n var_K = C;\r\n }\r\n if (M < var_K) {\r\n var_K = M;\r\n }\r\n if (Y < var_K) {\r\n var_K = Y;\r\n }\r\n\r\n C = (C - var_K) / (1 - var_K);\r\n M = (M - var_K) / (1 - var_K);\r\n Y = (Y - var_K) / (1 - var_K);\r\n return new float[] { C * 100, M * 100, Y * 100, var_K * 100 };\r\n }", "public int getHslColor()\n {\n return _hslColor;\n }", "public abstract RGBFColor toRGBFColor();", "private static int colorspaceSh(int s) {\r\n return (s << 16);\r\n }", "@ParameterizedTest\n @MethodSource(\"org.nd4j.linalg.BaseNd4jTestWithBackends#configs\")\n public void testHsvToRgb_1(Nd4jBackend backend) {\n INDArray image = Nd4j.createFromArray(new float[]{0.778785586f,0.801197767f,0.724374652f}).\n reshape(1,1,3);\n HsvToRgb op = new HsvToRgb(image);\n INDArray[] ret = Nd4j.exec(op);\n System.out.println(ret[0].toStringFull());\n INDArray expected = Nd4j.createFromArray(new float[]{ 0.53442812f, 0.144007325f, 0.724374652f}).reshape(1,1,3);\n assertEquals(expected, ret[0]);\n }", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "private Color calcSpecularComp(double ks, Vector v, Vector normal, Vector l, double shininess, Color lightIntensity){\n Vector R = new Vector(l);\n normal.scale(2*l.dotProduct(normal));\n R.subtract(normal);\n v.normalize();\n R.normalize();\n double KsVdotR = ks * Math.pow(v.dotProduct(R), shininess);\n int red = Math.min(255,(int)(lightIntensity.getRed() * KsVdotR));\n red = Math.max(red, 0);\n int green = Math.min(255,(int)(lightIntensity.getGreen() * KsVdotR));\n green = Math.max(green, 0);\n int blue = Math.min(255,(int)(lightIntensity.getBlue() * KsVdotR));\n blue = Math.max(blue, 0);\n return new Color(red, green, blue);\n }", "public HSLColor(float h, float s, float l) {\n\t\tthis.color = toColorObject(h, s, l);\n\t}", "public static void printSHSV(FqImage imh){\n\t\tint\ti,j;\r\n\t\tfor( i = 0 ; i < imh.width ; i++ ){\r\n\t\t\tfor( j = 0 ; j < imh.height ; j++ ){\r\n\t\t\t\tSystem.out.print(\"s\"+imh.points[i][j].getSHSV() );\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t}", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "public float saturation() {\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = color & 0xFF;\n\n\n int V = Math.max(b, Math.max(r, g));\n int temp = Math.min(b, Math.min(r, g));\n\n float S;\n\n if (V == temp) {\n S = 0;\n } else {\n S = (V - temp) / (float) V;\n }\n\n return S;\n }", "public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }", "private native int grayToRgb(byte src[],int dst[]);", "public void setPatternHSVAll(int h, int s, int v) {\n for (var i = 0; i < (m_ledBuffer.getLength()); i++) {\n m_ledBuffer.setHSV(i, h, s, v);\n }\n m_led.setData(m_ledBuffer);\n }", "ClrConst(Color color)\n {\n this(Color.RGBtoHSB(\n color.getRed(), \n color.getGreen(),\n color.getBlue(), null)[0]);\n }", "public ColorRgb getColorRgbBiLinear(double x, double y)\n {\n //-----------------------------------------------------------------\n double u = x - Math.floor(x);\n double v = y - Math.floor(y);\n double U = u * ((double)(getXSize()-2));\n double V = v * ((double)(getYSize()-2));\n int i = (int)Math.floor(U);\n int j = (int)Math.floor(V);\n double du = U - (double)i;\n double dv = V - (double)j;\n RGBPixel p;\n\n //-----------------------------------------------------------------\n p = getPixelRgb(i, j);\n ColorRgb F00 = new ColorRgb();\n F00.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F00.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F00.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j);\n ColorRgb F10 = new ColorRgb();\n F10.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F10.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F10.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i, j+1);\n ColorRgb F01 = new ColorRgb();\n F01.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F01.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F01.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j+1);\n ColorRgb F11 = new ColorRgb();\n F11.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F11.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F11.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n //-----------------------------------------------------------------\n ColorRgb FU0 = new ColorRgb();\n FU0.r = F00.r + du * (F10.r-F00.r);\n FU0.g = F00.g + du * (F10.g-F00.g);\n FU0.b = F00.b + du * (F10.b-F00.b);\n\n ColorRgb FU1 = new ColorRgb();\n FU1.r = F01.r + du * (F11.r-F01.r);\n FU1.g = F01.g + du * (F11.g-F01.g);\n FU1.b = F01.b + du * (F11.b-F01.b);\n\n ColorRgb FVAL = new ColorRgb();\n FVAL.r = FU0.r + dv * (FU1.r-FU0.r);\n FVAL.g = FU0.g + dv * (FU1.g-FU0.g);\n FVAL.b = FU0.b + dv * (FU1.b-FU0.b);\n\n return FVAL;\n }", "public static Color[] getHSBWheelScheme(int n){\r\n\r\n\t\tColor[] scheme=new Color[n];\r\n\r\n\t\t// if 12 colors or less, vary hue and use 100% saturation and brightness\r\n\t\tif(n<=12){\r\n\t\t\tfor(int i=0;i<n;i++){\r\n\t\t\t\tscheme[i]=Color.getHSBColor((float)i/n,1.0f,1.0f);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if 24 colors or less, use a two-tier saturation (50% and 100%)\r\n\t\telse if(n<=24){\r\n\t\t\tint t=n/2;\r\n\t\t\tfor(int i=0;i<t;i++){\r\n\t\t\t\tscheme[i]=Color.getHSBColor((float)i/t,1.0f,1.0f);\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<n-t;i++){\r\n\t\t\t\tscheme[i+t]=Color.getHSBColor((float)i/(n-t),0.5f,1.0f);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if more than 24 colors, use a two-tier saturation and a two-tier brightness (50% and 100%)\r\n\t\telse{\t\r\n\t\t\tint t=n/4;\r\n\t\t\tfor(int i=0;i<t;i++){\r\n\t\t\t\tscheme[i]=Color.getHSBColor((float)i/t,1.0f,1.0f);\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<t;i++){\r\n\t\t\t\tscheme[i+t]=Color.getHSBColor((float)i/t,0.5f,1.0f);\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<t;i++){\r\n\t\t\t\tscheme[i+(2*t)]=Color.getHSBColor((float)i/t,1.0f,0.5f);\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<n-(3*t);i++){\r\n\t\t\t\tscheme[i+(3*t)]=Color.getHSBColor((float)i/t,0.5f,0.5f);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn scheme;\r\n\r\n\t}", "public static double similarity(ColorHsv c1,ColorHsv c2){\n LOG.info(\"Ch1,\"+c1.toString()+\",Ch2:\"+c2.toString());\n //\n double avgHue = (c1.H + c2.H)/2;\n double distance = Math.abs(c1.H-avgHue);\n double differ = distance/avgHue;\n LOG.info(\"differ:\"+differ+\"distance:\"+distance+\",avgHue:\"+avgHue);\n return 1.00-differ;\n }", "public static Color deriveColorHSB(Color base, float dH, float dS, float dB) {\n float hsb[] = Color.RGBtoHSB(\n base.getRed(), base.getGreen(), base.getBlue(), null);\n\n hsb[0] += dH;\n hsb[1] += dS;\n hsb[2] += dB;\n return Color.getHSBColor(\n hsb[0] < 0? 0 : (hsb[0] > 1? 1 : hsb[0]),\n hsb[1] < 0? 0 : (hsb[1] > 1? 1 : hsb[1]),\n hsb[2] < 0? 0 : (hsb[2] > 1? 1 : hsb[2]));\n \n }", "protected abstract float[] getRgbLut();", "@ColorInt\n public int getColor() {\n return Color.HSVToColor(mColorHSV);\n }", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "public Color compute(\r\n\t\t\t\tdouble v\r\n\t\t);", "public static\n Color convertStringToColor(String val)\n {\n Color ret_Color;\n\n try\n {\n String workstr1;\n int slen = val.length();\n if (val.startsWith(\"0x\") || val.startsWith(\"0X\"))\n {\n workstr1 = val.substring(2);\n slen -= 2;\n }\n else\n if (val.startsWith(\"#\"))\n {\n workstr1 = val.substring(1);\n slen -= 1;\n }\n else\n { // decimal integer\n return new Color(Integer.parseInt(val));\n }\n\n // process hex string\n if (slen <= 6)\n { // no alpha\n int ival = Integer.parseInt(workstr1, 16);\n ret_Color = new Color(ival);\n }\n else\n { // has alpha of some sort\n String workstr2;\n if (slen == 8)\n {\n workstr2 = workstr1;\n }\n else\n if (slen == 7)\n {\n workstr2 = \"0\" + workstr1;\n }\n else\n {\n workstr2 = workstr1.substring(slen - 8); // get rightmost 8\n }\n\n // System.out.println(\"Color,val=[\" + val + \"],key=[\" + key + \"],slen=\" + slen + \"]\");\n // System.out.println(\" workstr1=[\" + workstr1 + \"],workstr2=[\" + workstr2 + \"]\");\n int a = Integer.parseInt(workstr2.substring(0, 2), 16); // a\n int r = Integer.parseInt(workstr2.substring(2, 4), 16); // r\n int g = Integer.parseInt(workstr2.substring(4, 6), 16); // g\n int b = Integer.parseInt(workstr2.substring(6, 8), 16); // b\n // System.out.println(\" ret_Color1=[\" + r + \":\" + g + \":\" + b +\":\" + a + \"]\");\n // int ival = Integer.parseInt(workstr2, 16);\n // ret_Color = new Color(ival, true);\n // System.out.println(\" ival=\" + ival);\n try {\n ret_Color = new Color(r, g, b, a);\n }\n catch (NoSuchMethodError excp1) {\n System.out.println(\"YutilProperties:convertStringToColor|excp1=[\" + excp1 + \"]\");\n ret_Color = new Color(r, g, b);\n }\n // System.out.println(\" ret_Color1=[\" + ret_Color + \"]\");\n }\n }\n catch(NumberFormatException e)\n {\n ret_Color = Color.black;\n // System.out.println(\"Color,ret_Color3=[\" + ret_Color + \"]\");\n }\n\n return ret_Color;\n }", "public void rangeHSV(int min, int number, int h, int s, int v) {\n int max = min + number;\n\n for (int i = min; i < (max); i++) {\n m_ledBuffer.setHSV(i, h, s, v);\n }\n\n m_led.setData(m_ledBuffer);\n }", "public static void printHHSV(FqImage imh){\n\t\tint\ti,j;\r\n\t\tfor( i = 0 ; i < imh.width ; i++ ){\r\n\t\t\tfor( j = 0 ; j < imh.height ; j++ ){\r\n\t\t\t\tSystem.out.print(\"h\"+imh.points[i][j].getHHSV() );\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t}", "private static void arrCHS2LBA(int[][] arr) {\n\t\tfor(int[] chs : arr){\n\t\t\tchs[3] = 255 * 63 * chs[0] + 63 * chs[1] + chs[2] - 1;\n\t\t\tchs[7] = 255 * 63 * chs[4] + 63 * chs[5] + chs[6] - 1 ;\n\t\t}\n\t}", "private Color calcSpecular(double ks, Vector l, Vector n, Vector v, double nShininess, Color lightIntensity)\r\n\r\n\t{\r\n\t\tVector r = l.subtract(n.scale(2 * l.dotProduct(n))).normalize();\r\n\t\treturn lightIntensity.scale(ks * Math.max(0, Math.pow(v.scale(-1).dotProduct(r), nShininess)));\r\n\t}", "RGB getNewColor();", "public void addColor(Color rgb) {\r\n\t\thsb = Color\r\n\t\t\t\t.RGBtoHSB(rgb.getRed(), rgb.getGreen(), rgb.getBlue(), null);\r\n\t}", "private Mat segmentRedColorViaInverting(Mat bgr) {\n Mat bgrInverted = new Mat();\n Mat hsvInverted = new Mat();\n Mat maskInv = new Mat();\n Core.bitwise_not(bgr, bgrInverted);\n Imgproc.cvtColor(bgrInverted, hsvInverted, Imgproc.COLOR_BGR2HSV);\n inRange(hsvInverted, new Scalar(90 - MAX_COLOR_CHANNEL_OFFSET, 70, 50), new Scalar(90 + MAX_COLOR_CHANNEL_OFFSET, 255, 255), maskInv);\n return maskInv;\n }", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "String getColor();", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "float[] getColorData(int trisCount, int color) {\n float[] colDat = new float[trisCount * 4];\n float alpha = 255;\n float red = 255;\n float green = 255;\n float blue = 255;\n if(color != -1) {\n alpha = color >> 24 & 0xff;\n red = color >> 16 & 0xff;\n green = color >> 8 & 0xff;\n blue = color & 0xff;\n }\n// Log.e(\"Modelbase\", \"shift = \" + red + \",\" + green + \",\" + blue + \",\" + alpha);\n red /= 255f;\n green /= 255f;\n blue /= 255f;\n alpha /= 255f;\n// Log.e(\"Modelbase\", \"div by 255 = \" + red + \",\" + green + \",\" + blue + \",\" +\n// alpha);\n for (int i = 0; i < colDat.length; i += 4) {\n colDat[i] = red;\n colDat[i + 1] = green;\n colDat[i + 2] = blue;\n colDat[i + 3] = alpha;\n }\n return colDat;\n }", "public static Color colorHSBA(float h, float s, float b, float alpha) {\n int aint = (int) (alpha * 254);\n int rgb = Color.HSBtoRGB(h, s, b);\n return new Color((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF, aint);\n }", "public static String makeHexColor(double... vals){\n\t\treturn \"\"+formatNumberString(Integer.toHexString((int)((vals[0] * 256) - 1)),2)+\"\"+formatNumberString(Integer.toHexString((int)((vals[1] * 256) - 1)),2)+\"\"+formatNumberString(Integer.toHexString((int)((vals[2] * 256) - 1)),2);\n\t}", "private native void convertToLum( short[] data, int w, int h );", "public static Vector4f halfRGB(Vector4f color) {\n return new Vector4f(color.x / 2f, color.y / 2f, color.z / 2f, color.w);\n }", "private static int mixSigColor(int c1, int c2, int ratio) {//0~100\r\n return 0xff & (((c2 * ratio) + (c1 * (100 - ratio))) / 100);\r\n }", "public Color getColor() {\r\n\t\treturn new Color(Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]));\r\n\t}", "public static void printVHSV(FqImage imh){\n\t\tint\ti,j;\r\n\t\tfor( i = 0 ; i < imh.width ; i++ ){\r\n\t\t\tfor( j = 0 ; j < imh.height ; j++ ){\r\n\t\t\t\tSystem.out.print(\"v\"+imh.points[i][j].getVHSV() );\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t}", "private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }", "public short[][] getHue(){ return hue; }", "public static float getHue(double magnitude){\n\n float color;\n Double m = Math.abs(magnitude);\n int mag = m.intValue();\n\n if(mag >= 0 && mag < 3){\n // GREEN - LOW\n return 120;\n } else\n\n // YELLOW - MEDIUM LOW\n if(mag >= 3 && mag < 6){\n return 60;\n } else\n\n // ORANGE - MEDIUM\n if(mag >= 6 && mag < 8){\n return 30;\n } else {\n return 0;\n }\n\n }", "private Color calcSpecular(double ks, Vector l, Vector n, double nl, Vector v, int nShininess, Color ip) {\r\n\t\tdouble p = nShininess;\r\n\r\n\t\tVector R = l.add(n.scale(-2 * nl)); // nl must not be zero!\r\n\t\tdouble minusVR = -Util.alignZero(R.dotProduct(v));\r\n\t\tif (minusVR <= 0) {\r\n\t\t\treturn Color.BLACK; // view from direction opposite to r vector\r\n\t\t}\r\n\t\treturn ip.scale(ks * Math.pow(minusVR, p));\r\n\t}", "public String Color2Hex(int r, int g, int b)\n\t{\n Color c = new Color(r,g,b);\n String s=Integer.toHexString( c.getRGB() & 0x00ffffff ).toUpperCase() ;\n while(s.length()<6)\n \t s=\"0\"+s;\n return s;\n }", "private native void setModelColor(float r,float g,float b);", "public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}", "private void equalize(BufferedImage img) {\n \t\tfloat minSat = Float.MAX_VALUE, maxSat = Float.MIN_VALUE;\n \t\tfloat minVal = Float.MAX_VALUE, maxVal = Float.MIN_VALUE;\n \t\t\n \t\tint[] prgb = { 0, 0, 0 };\n \t\tfloat[] hsv = { 0, 0, 0 };\n \t\t\n \t\tint[] valCount = new int[16];\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\tminSat = Math.min(hsv[1], minSat);\n \t\t\t\tmaxSat = Math.max(hsv[1], maxSat);\n \t\t\t\tminVal = Math.min(hsv[2], minVal);\n \t\t\t\tmaxVal = Math.max(hsv[2], maxVal);\n \t\t\t\tvalCount[(int) (hsv[2] / 16)]++;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint maxPt = -1;\n \t\tfor (int i = 1; i < 15; i++) {\n \t\t\tif (maxPt == -1 || valCount[i] >= valCount[maxPt]) {\n \t\t\t\tmaxPt = i;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint valueMidpoint = maxPt * 16;\n \t\t\n \t\tSystem.out.println(\"Equalize: sat = \"+minSat+\" to \" +maxSat+\"; val = \" + minVal + \" to \" + maxVal+\"; value midpoint = \" + valueMidpoint);\n \t\tfloat satScale = 1.0f - minSat;\n \t\tfloat valScale = 255 - minVal;\n \t\tfloat satDiff = maxSat - minSat;\n \t\tfloat valDiff = maxVal - minVal;\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\t\n \t\t\t\tif (satDiff < 0.5)\n \t\t\t\t\thsv[1] = ((hsv[1] - minSat) / satDiff) * satScale + minSat;\n \t\t\t\tif (valDiff < 128)\n \t\t\t\t\thsv[2] = ((hsv[2] - minVal) / valDiff) * valScale + minVal;\n \n \t\t\t\thsvToRgb(hsv[0], hsv[1], hsv[2], prgb);\n \t\t\t\t\n \t\t\t\timg.setRGB(x, y, rgb8ToPixel(prgb) | (pixel & 0xff000000));\n \t\t\t}\n \t\t}\n \t}", "public void initColors() {\n\n int i;\n float j;\n\n int start;\n int numShades = 5;\n float shadeInc = 1 / (float) numShades;\n\n\n aColors = new Color[glb.MAXCOLORS]; /* set array size */\n\n\n /* White to Black */\n start = 0;\n for (i = start, j = 1; i < start + 6; j -= shadeInc, i++) {\n aColors[i] = new Color(j, j, j);\n }\n\n start = 6;\n /* Red to almost Magenta */\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 1, (float) 0, j);\n }\n\n\n /* Magenta to almost Blue */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color(j, (float) 0, (float) 1);\n }\n\n\n /* Blue to almost Cyan */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 0, j, (float) 1);\n }\n\n /* Cyan to almost Green */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 0, (float) 1, j);\n }\n\n\n\n /* Green to almost Yellow */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color(j, (float) 1, (float) 0);\n }\n\n /* Yellow to almost Red */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 1, j, (float) 0);\n }\n\n }", "private String rgbToHex(final String value) {\n if (\"rgba(0, 0, 0, 0)\".equals(value)) {\n return \"transparent\";\n }\n final Pattern rgb = Pattern.compile(\"rgb\\\\((\\\\d{1,3}),\\\\s(\\\\d{1,3}),\\\\s(\\\\d{1,3})\\\\)\");\n final Matcher matcher = rgb.matcher(value);\n if (matcher.find()) {\n String hex = \"#\";\n for (int i = 1; i <= 3; i++) {\n int colour = Integer.parseInt(matcher.group(i));\n String s = Integer.toHexString(colour);\n if (s.length() == 1) {\n s = \"0\" + s;\n }\n hex += s;\n }\n hex = hex.toLowerCase();\n return hex;\n }\n return value;\n }", "public static int fixRGBValue(int v) {\n if (v < 0) v = -v;\n if (v > 255) v = 255;\n return v;\n }", "public void alternateHSV(int min, int number, int h1, int s1, int v1, int h2, int s2, int v2) {\n int max = min + number;\n for (int i = min; i < (max); i = i + 2) {\n m_ledBuffer.setHSV(i, h1, s1, v1);\n }\n\n for (int j = min + 1; j < (max); j = j + 2) {\n m_ledBuffer.setHSV(j, h2, s2, v2);\n }\n m_led.setData(m_ledBuffer);\n }", "public static AnsiColor rgb(Color c) {\n return new RgbColor(c);\n }", "double redPercentage();", "int[][][] generateRainbow(int height, int width, VOrH vOrH);", "double greenPercentage();", "public static void main(String [] args) {\n Scanner myScanner; //define myScanner\n myScanner = new Scanner( System.in );\n System.out.print(\"Please enter three numbers representing RGB values: \");\n if (myScanner.hasNextInt() == true && myScanner.hasNextInt() == true && myScanner.hasNextInt() == true) {\n int redValue = myScanner.nextInt(); //red as first input\n int greenValue = myScanner.nextInt(); //green as second input\n int blueValue = myScanner.nextInt(); //blue is last input\n if (redValue >= 0 && redValue <= 255 && greenValue >= 0 && greenValue <= 255 && blueValue >= 0 && blueValue <= 255) {\n int firstValue = redValue/16; //calculate first number\n String firstValueHex; //declare it to use later\n switch (firstValue) {\n case 0:\n firstValueHex = \"0\";\n break;\n case 1:\n firstValueHex = \"1\";\n break;\n case 2:\n firstValueHex = \"2\";\n break;\n case 3:\n firstValueHex = \"3\";\n break;\n case 4:\n firstValueHex = \"4\";\n break;\n case 5:\n firstValueHex = \"5\";\n break;\n case 6:\n firstValueHex = \"6\";\n break;\n case 7:\n firstValueHex = \"7\";\n break;\n case 8:\n firstValueHex = \"8\";\n break;\n case 9:\n firstValueHex = \"9\";\n break;\n case 10:\n firstValueHex = \"A\";\n break;\n case 11:\n firstValueHex = \"B\";\n break;\n case 12:\n firstValueHex = \"C\";\n break;\n case 13:\n firstValueHex = \"D\";\n break;\n case 14:\n firstValueHex = \"E\";\n break;\n case 15:\n firstValueHex = \"F\";\n break;\n default:\n firstValueHex = \"0\";\n break;\n }\n int secondValue = redValue%16; //calculate second number\n String secondValueHex; //declare it to use later\n switch (secondValue) {\n case 0:\n secondValueHex = \"0\";\n break;\n case 1:\n secondValueHex = \"1\";\n break;\n case 2:\n secondValueHex = \"2\";\n break;\n case 3:\n secondValueHex = \"3\";\n break;\n case 4:\n secondValueHex = \"4\";\n break;\n case 5:\n secondValueHex = \"5\";\n break;\n case 6:\n secondValueHex = \"6\";\n break;\n case 7:\n secondValueHex = \"7\";\n break;\n case 8:\n secondValueHex = \"8\";\n break;\n case 9:\n secondValueHex = \"9\";\n break;\n case 10:\n secondValueHex = \"A\";\n break;\n case 11:\n secondValueHex = \"B\";\n break;\n case 12:\n secondValueHex = \"C\";\n break;\n case 13:\n secondValueHex = \"D\";\n break;\n case 14:\n secondValueHex = \"E\";\n break;\n case 15:\n secondValueHex = \"F\";\n break;\n default:\n secondValueHex = \"0\";\n break;\n }\n int thirdValue = greenValue/16; //calculate third number\n String thirdValueHex; //declare it to use later\n switch (thirdValue) {\n case 0:\n thirdValueHex = \"0\";\n break;\n case 1:\n thirdValueHex = \"1\";\n break;\n case 2:\n thirdValueHex = \"2\";\n break;\n case 3:\n thirdValueHex = \"3\";\n break;\n case 4:\n thirdValueHex = \"4\";\n break;\n case 5:\n thirdValueHex = \"5\";\n break;\n case 6:\n thirdValueHex = \"6\";\n break;\n case 7:\n thirdValueHex = \"7\";\n break;\n case 8:\n thirdValueHex = \"8\";\n break;\n case 9:\n thirdValueHex = \"9\";\n break;\n case 10:\n thirdValueHex = \"A\";\n break;\n case 11:\n thirdValueHex = \"B\";\n break;\n case 12:\n thirdValueHex = \"C\";\n break;\n case 13:\n thirdValueHex = \"D\";\n break;\n case 14:\n thirdValueHex = \"E\";\n break;\n case 15:\n thirdValueHex = \"F\";\n break;\n default:\n thirdValueHex = \"0\";\n break;\n }\n int fourthValue = greenValue%16; //calculate fourth number\n String fourthValueHex; //declare it to use later\n switch (fourthValue) {\n case 0:\n fourthValueHex = \"0\";\n break;\n case 1:\n fourthValueHex = \"1\";\n break;\n case 2:\n fourthValueHex = \"2\";\n break;\n case 3:\n fourthValueHex = \"3\";\n break;\n case 4:\n fourthValueHex = \"4\";\n break;\n case 5:\n fourthValueHex = \"5\";\n break;\n case 6:\n fourthValueHex = \"6\";\n break;\n case 7:\n fourthValueHex = \"7\";\n break;\n case 8:\n fourthValueHex = \"8\";\n break;\n case 9:\n fourthValueHex = \"9\";\n break;\n case 10:\n fourthValueHex = \"A\";\n break;\n case 11:\n fourthValueHex = \"B\";\n break;\n case 12:\n fourthValueHex = \"C\";\n break;\n case 13:\n fourthValueHex = \"D\";\n break;\n case 14:\n fourthValueHex = \"E\";\n break;\n case 15:\n fourthValueHex = \"F\";\n break;\n default:\n fourthValueHex = \"0\";\n break;\n }\n int fifthValue = blueValue/16; //calculate fifth number\n String fifthValueHex; //declare it to use later\n switch (fifthValue) {\n case 0:\n fifthValueHex = \"0\";\n break;\n case 1:\n fifthValueHex = \"1\";\n break;\n case 2:\n fifthValueHex = \"2\";\n break;\n case 3:\n fifthValueHex = \"3\";\n break;\n case 4:\n fifthValueHex = \"4\";\n break;\n case 5:\n fifthValueHex = \"5\";\n break;\n case 6:\n fifthValueHex = \"6\";\n break;\n case 7:\n fifthValueHex = \"7\";\n break;\n case 8:\n fifthValueHex = \"8\";\n break;\n case 9:\n fifthValueHex = \"9\";\n break;\n case 10:\n fifthValueHex = \"A\";\n break;\n case 11:\n fifthValueHex = \"B\";\n break;\n case 12:\n fifthValueHex = \"C\";\n break;\n case 13:\n fifthValueHex = \"D\";\n break;\n case 14:\n fifthValueHex = \"E\";\n break;\n case 15:\n fifthValueHex = \"F\";\n break;\n default:\n fifthValueHex = \"0\";\n break;\n }\n int sixthValue = blueValue%16; //calculate sixth number\n String sixthValueHex; //declare it to use later\n switch (sixthValue) {\n case 0:\n sixthValueHex = \"0\";\n break;\n case 1:\n sixthValueHex = \"1\";\n break;\n case 2:\n sixthValueHex = \"2\";\n break;\n case 3:\n sixthValueHex = \"3\";\n break;\n case 4:\n sixthValueHex = \"4\";\n break;\n case 5:\n sixthValueHex = \"5\";\n break;\n case 6:\n sixthValueHex = \"6\";\n break;\n case 7:\n sixthValueHex = \"7\";\n break;\n case 8:\n sixthValueHex = \"8\";\n break;\n case 9:\n sixthValueHex = \"9\";\n break;\n case 10:\n sixthValueHex = \"A\";\n break;\n case 11:\n sixthValueHex = \"B\";\n break;\n case 12:\n sixthValueHex = \"C\";\n break;\n case 13:\n sixthValueHex = \"D\";\n break;\n case 14:\n sixthValueHex = \"E\";\n break;\n case 15:\n sixthValueHex = \"F\";\n break;\n default:\n sixthValueHex = \"0\";\n break;\n } \n System.out.println(\"The decimal numbers R: \"+redValue+\" G: \"+greenValue+\" B: \"+blueValue+\n \" is represented in hexadecimal as: \"+firstValueHex+secondValueHex+thirdValueHex+fourthValueHex\n +fifthValueHex+sixthValueHex); //print numbers in hexdecimal\n }\n else{\n System.out.println(\"Sorry, you must enter numbers between 0 and 255\"); //tell user they messed up input\n }\n }\n else{\n System.out.println(\"Sorry, you must enter 3 integers\"); //tell user they messed up input\n }\n \n \n \n \n }", "private Color calcSpecular(double ks, Vector l, Vector n, double nl, Vector v, int nShininess, Color ip) {\n double p = nShininess;\n /**R is the vector that is symmetrically returned from L as a result of the speculator*/\n Vector R = l.add(n.scale(-2 * nl)).normalized();\n /**If v vector dir of the camera is util to R\n *or if the angle is opposite away from the camera so the R does'nt impact.*/\n double minusVR = -alignZero(R.dotProduct(v));\n if (minusVR <= 0) {\n return Color.BLACK;\n }\n return ip.scale(ks * Math.pow(minusVR, p));\n }", "public Color getColor(RGB rgb) {\n\t\treturn colorTable.computeIfAbsent(rgb, raw -> new Color(raw));\n\t}", "private int reduceColorSize(int oldColor, int colorRange) {\n return (int) Math.floor((oldColor / colorRange)) * colorRange;\n }", "private Color getColor(final RGB rgb) {\n Color color = this.colorTable.get(rgb);\n if (color == null) {\n color = new Color(Display.getCurrent(), rgb);\n this.colorTable.put(rgb, color);\n }\n return color;\n }", "public static int convertSingularRGB(int[] rgbValues) throws Exception {\r\n\t\t//Color Variables:\r\n\t\tint standardColorValue = (((rgbValues[0] & 0x0ff) << 16) | ((rgbValues[1] & 0x0ff) << 8) | ((rgbValues[2] & 0x0ff)));\r\n\r\n\t\t//Returns Value:\r\n\t\treturn standardColorValue;\r\n\t}", "public static Color getRGBColor(String name)\n\t\t\tthrows IllegalArgumentException {\n\t\tint[] c = { 0, 0, 0, 0 };\n\t\tif (name.startsWith(\"#\")) {\n\t\t\tif (name.length() == 4) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;\n\t\t\t\tc[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;\n\t\t\t\tc[2] = Integer.parseInt(name.substring(3), 16) * 16;\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tif (name.length() == 7) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 3), 16);\n\t\t\t\tc[1] = Integer.parseInt(name.substring(3, 5), 16);\n\t\t\t\tc[2] = Integer.parseInt(name.substring(5), 16);\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(MessageLocalization.getComposedMessage(\"unknown.color.format.must.be.rgb.or.rrggbb\"));\n\t\t}\n else if (name.startsWith(\"rgb(\")) {\n StringTokenizer tok = new StringTokenizer(name, \"rgb(), \\t\\r\\n\\f\");\n for (int k = 0; k < 3; ++k) {\n String v = tok.nextToken();\n if (v.endsWith(\"%\"))\n c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;\n else\n c[k] = Integer.parseInt(v);\n if (c[k] < 0)\n c[k] = 0;\n else if (c[k] > 255)\n c[k] = 255;\n }\n return new Color(c[0], c[1], c[2], c[3]);\n }\n\t\tname = name.toLowerCase();\n\t\tif (!NAMES.containsKey(name))\n\t\t\tthrow new IllegalArgumentException(\"Color '\" + name\n\t\t\t\t\t+ \"' not found.\");\n\t\tc = (int[]) NAMES.get(name);\n\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t}", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "boolean isAllowed(int rgb, float[] hsl);", "int getHighLightColor();", "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 void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }", "private Mat segmentRedColor(Mat bgr) {\n Mat mask1 = new Mat();\n Mat mask2 = new Mat();\n Mat normal = new Mat();\n Mat hsv = new Mat();\n Imgproc.cvtColor(bgr, hsv, Imgproc.COLOR_BGR2HSV, 3);\n inRange(hsv, new Scalar(0, 120, 50), new Scalar(MAX_COLOR_CHANNEL_OFFSET, 255, 255), mask1);\n inRange(hsv, new Scalar(170, 120, 50), new Scalar(180, 255, 255), mask2);\n Core.bitwise_or(mask1, mask2, normal);\n return mask1;\n }", "public void setColorAccordingToSize() {\n float s = getMeasuredSizeCorrectedByPerspective();\n float hue = 2 * s / chip.getMaxSize();\n if (hue > 1) {\n hue = 1;\n }\n setColor(Color.getHSBColor(hue, 1f, 1f));\n }", "public static Vector4f half(Vector4f color) {\n return new Vector4f(color).div(2);\n }", "public native int getColorspace() throws MagickException;", "private void updateColorPreview() {\n runOnUiThread(() -> colorView.setBackgroundColor(Utils.HSV_to_ARGB(specState.hue,\n specState.saturation,\n specState.value)));\n }", "public static int getRgbScalar(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint sc = (int)Math.sqrt(red*red + green*green + blue*blue);\n\n\t\treturn sc;\n\t}", "public static double[] rgbToXyz(double[] rgb) {\n\t\tdouble r = rgb[0]/255;\n\t\tdouble g = rgb[0]/255;\n\t\tdouble b = rgb[0]/255;\n\t\tif (r > 0.04045) {\n\t\t\tr = Math.pow((r+0.055)/1.055, 2.4);\n\t\t} else {\n\t\t\tr = r/ 12.92;\n\t\t}\n\t\tif (g > 0.04045) {\n\t\t\tg = Math.pow((g+0.055)/1.055, 2.4);\n\t\t} else {\n\t\t\tg = g/ 12.92;\n\t\t}\n\t\tif (b > 0.04045) {\n\t\t\tb = Math.pow((b+0.055)/1.055, 2.4);\n\t\t} else {\n\t\t\tb = b/ 12.92;\n\t\t}\n\t\tr *= 100;\n\t\tg *= 100;\n\t\tb *= 100;\n\t\tdouble[] xyz = new double[3];\n\t\txyz[0] = r * 0.4124 + g * 0.3576 + b * 0.1805;\n\t\txyz[1] = r * 0.2126 + g * 0.7152 + b * 0.0722;\n\t\txyz[2] = r * 0.0193 + g * 0.1192 + b * 0.9505;\n\t\treturn xyz;\n\t}", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();" ]
[ "0.6905241", "0.6846411", "0.68152815", "0.6618406", "0.6526629", "0.6507404", "0.64499885", "0.63663334", "0.61383796", "0.6113904", "0.6046668", "0.5965715", "0.5921343", "0.59153706", "0.5743641", "0.5712803", "0.5678187", "0.5646805", "0.56276023", "0.5548634", "0.5545582", "0.5537767", "0.5503209", "0.53978926", "0.53792256", "0.53678644", "0.5335099", "0.530845", "0.53069013", "0.5283783", "0.52834195", "0.52810115", "0.52655596", "0.5245954", "0.522828", "0.52157694", "0.5212009", "0.5205977", "0.5189687", "0.5189622", "0.5177932", "0.51672995", "0.5150545", "0.51492", "0.5133376", "0.51120883", "0.51111203", "0.51082456", "0.5094266", "0.50802237", "0.50409603", "0.5026847", "0.4999055", "0.49953234", "0.49907863", "0.49904615", "0.4960892", "0.4957729", "0.49565047", "0.49303138", "0.49280667", "0.49153718", "0.49021664", "0.49016684", "0.48985603", "0.4893143", "0.48858795", "0.48836112", "0.4882365", "0.48811468", "0.48748544", "0.48671108", "0.48663485", "0.48658437", "0.48651096", "0.4864288", "0.48642614", "0.48638996", "0.483673", "0.4834773", "0.48323527", "0.4823009", "0.48136947", "0.4812746", "0.48121515", "0.4799822", "0.47819638", "0.47760558", "0.47596055", "0.47535878", "0.47499293", "0.4737072", "0.47279733", "0.47213835", "0.47147235", "0.47133794", "0.47131547", "0.47131547", "0.47131547", "0.47131547" ]
0.73325783
0
Convert from RGB color space to XYZ color space
public static double[] rgbToXyz(double[] rgb) { double r = rgb[0]/255; double g = rgb[0]/255; double b = rgb[0]/255; if (r > 0.04045) { r = Math.pow((r+0.055)/1.055, 2.4); } else { r = r/ 12.92; } if (g > 0.04045) { g = Math.pow((g+0.055)/1.055, 2.4); } else { g = g/ 12.92; } if (b > 0.04045) { b = Math.pow((b+0.055)/1.055, 2.4); } else { b = b/ 12.92; } r *= 100; g *= 100; b *= 100; double[] xyz = new double[3]; xyz[0] = r * 0.4124 + g * 0.3576 + b * 0.1805; xyz[1] = r * 0.2126 + g * 0.7152 + b * 0.0722; xyz[2] = r * 0.0193 + g * 0.1192 + b * 0.9505; return xyz; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void toSpace( float[] rgb );", "protected abstract float[] getRgbLut();", "public abstract RGBIColor toRGBColor();", "static private int[] YCbCrtoRGB(int[] YCbCr) {\n int[] RGB = new int[3];\n\n float Y = (float) YCbCr[0];\n float CB = (float) YCbCr[1];\n float CR = (float) YCbCr[2];\n\n float R = (float) (Y + 1.402 * (CR - 128));\n float G = (float) (Y + -0.344136 * (CB - 128) + -0.714136 * (CR - 128));\n float B = (float) (Y + 1.772 * (CB - 128));\n\n if (R > 255) R = 255;\n if (G > 255) G = 255;\n if (B > 255) B = 255;\n\n RGB[0] = Math.round(R);\n RGB[1] = Math.round(G);\n RGB[2] = Math.round(B);\n\n return RGB;\n }", "public abstract RGBFColor toRGBFColor();", "public static double[] rgbToCmy(double[] rgb) {\n\t\tassert(rgb != null && rgb.length == 3);\n\t\tdouble[] cmy = new double[3];\n\t\tcmy[0] = 1 - (rgb[0] / 255);\n\t\tcmy[1] = 1 - (rgb[1] / 255);\n\t\tcmy[2] = 1 - (rgb[2] / 255);\n\t\treturn cmy;\n\t}", "private Color getColor( float xval, float yval ) {\n float[] rgba = (float[]) baseRgba_.clone();\n if ( xFirst_ ) {\n xShader_.adjustRgba( rgba, xval );\n yShader_.adjustRgba( rgba, yval );\n }\n else {\n yShader_.adjustRgba( rgba, yval );\n xShader_.adjustRgba( rgba, xval );\n }\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }", "static private int[] RGBtoYCbCr(int[] RGB) {\n int[] YCbCr = new int[3];\n\n float r = (float) RGB[0];\n float g = (float) RGB[1];\n float b = (float) RGB[2];\n\n float y = (float) (0 + (0.299 * r) + (0.587 * g) + (0.114 * b));\n float cb = (float) (128 - (0.168736 * r) - (0.331264 * g) + (0.5 * b));\n float cr = (float) (128 + (0.5 * r) - (0.418688 * g) - (0.081312 * b));\n\n\n YCbCr[0] = Math.round(y);\n YCbCr[1] = Math.round(cb);\n YCbCr[2] = Math.round(cr);\n\n\n return YCbCr;\n }", "public static ColorImage toColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tcolor = img.get(x, y);\n\t\t\t\ticolor[0] = (int) color[0];\n\t\t\t\ticolor[1] = (int) color[1];\n\t\t\t\ticolor[2] = (int) color[2];\n\t\t\t\tnewimg.set(x, y, icolor);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "Color3b colorAt(int xIndex, int yIndex);", "public abstract int rgbColor(double u, double v);", "public ColorRgb getColorRgbBiLinear(double x, double y)\n {\n //-----------------------------------------------------------------\n double u = x - Math.floor(x);\n double v = y - Math.floor(y);\n double U = u * ((double)(getXSize()-2));\n double V = v * ((double)(getYSize()-2));\n int i = (int)Math.floor(U);\n int j = (int)Math.floor(V);\n double du = U - (double)i;\n double dv = V - (double)j;\n RGBPixel p;\n\n //-----------------------------------------------------------------\n p = getPixelRgb(i, j);\n ColorRgb F00 = new ColorRgb();\n F00.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F00.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F00.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j);\n ColorRgb F10 = new ColorRgb();\n F10.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F10.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F10.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i, j+1);\n ColorRgb F01 = new ColorRgb();\n F01.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F01.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F01.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j+1);\n ColorRgb F11 = new ColorRgb();\n F11.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F11.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F11.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n //-----------------------------------------------------------------\n ColorRgb FU0 = new ColorRgb();\n FU0.r = F00.r + du * (F10.r-F00.r);\n FU0.g = F00.g + du * (F10.g-F00.g);\n FU0.b = F00.b + du * (F10.b-F00.b);\n\n ColorRgb FU1 = new ColorRgb();\n FU1.r = F01.r + du * (F11.r-F01.r);\n FU1.g = F01.g + du * (F11.g-F01.g);\n FU1.b = F01.b + du * (F11.b-F01.b);\n\n ColorRgb FVAL = new ColorRgb();\n FVAL.r = FU0.r + dv * (FU1.r-FU0.r);\n FVAL.g = FU0.g + dv * (FU1.g-FU0.g);\n FVAL.b = FU0.b + dv * (FU1.b-FU0.b);\n\n return FVAL;\n }", "public Color convertColor(ColorSpace to) {\n Scalar output = convertColorScalar(to);\n\n Class<? extends Color> colorClass = to.getColorClass();\n\n try {\n return colorClass.getConstructor(Scalar.class).newInstance(output);\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n }", "public native boolean rgbTransformImage(int colorspace)\n\t\t\tthrows MagickException;", "private native int grayToRgb(byte src[],int dst[]);", "private static int colorToRGB(int alpha, int red, int green, int blue) {\n \n int newPixel = 0;\n newPixel += alpha; newPixel = newPixel << 8;\n newPixel += red; newPixel = newPixel << 8;\n newPixel += green; newPixel = newPixel << 8;\n newPixel += blue;\n \n return newPixel;\n }", "public Bitmap3DColor(\n float v1Red, float v1Green, float v1Blue, float v1Alpha,\n float v2Red, float v2Green, float v2Blue, float v2Alpha,\n float v3Red, float v3Green, float v3Blue, float v3Alpha,\n float v4Red, float v4Green, float v4Blue, float v4Alpha\n ) {\n if(\n v1Red < 0 || v1Red > 1 || v2Red < 0 || v2Red > 1 || v3Red < 0 || v3Red > 1 || v4Red < 0 || v4Red > 1 ||\n v1Green < 0 || v1Green > 1 || v2Green < 0 || v2Green > 1 || v3Green < 0 || v3Green > 1 || v4Green < 0 || v4Green > 1 ||\n v1Blue < 0 || v1Blue > 1 || v2Blue < 0 || v2Blue > 1 || v3Blue < 0 || v3Blue > 1 || v4Blue < 0 || v4Blue > 1 ||\n v1Alpha < 0 || v1Alpha > 1 || v2Alpha < 0 || v2Alpha> 1 || v3Alpha < 0 || v3Alpha > 1 || v4Alpha < 0 || v4Alpha > 1\n ) {\n throw new IllegalArgumentException(\"Values should be between 0 and 1\");\n }\n\n float[] colors = {\n v1Red, v1Green, v1Blue, v1Alpha,\n v2Red, v2Green, v2Blue, v2Alpha,\n v3Red, v3Green, v3Blue, v3Alpha,\n v4Red, v4Green, v4Blue, v4Alpha\n };\n\n ByteBuffer clb = ByteBuffer.allocateDirect(colors.length * 4);\n clb.order(ByteOrder.nativeOrder());\n this.colorBuffer = clb.asFloatBuffer();\n this.colorBuffer.put(colors);\n this.colorBuffer.position(0);\n }", "void setFromInt32Color(int newColor) {\r\n\t\tx = ((float) ((newColor >> 16) | 0xFF)) / 255.0f;\r\n\t\ty = ((float) ((newColor >> 8) | 0xFF)) / 255.0f;\r\n\t\tz = ((float) ((newColor) | 0xFF)) / 255.0f;\r\n\t}", "public static ColorImage toColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tfloat gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = (int) gray;\n\t\t\t\tcolor[1] = (int) gray;\n\t\t\t\tcolor[2] = (int) gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "protected abstract Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException;", "public static RealColorImage toRealColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tint[] icolor = new int[3];\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\ticolor = img.get(x, y);\n\t\t\t\tcolor[0] = (float) icolor[0];\n\t\t\t\tcolor[1] = (float) icolor[1];\n\t\t\t\tcolor[2] = (float) icolor[2];\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "public native PixelPacket[] getColormap() throws MagickException;", "public native boolean transformRgbImage(int colorspace)\n\t\t\tthrows MagickException;", "public int getRgbColor()\n {\n return _rgbColor;\n }", "RGB getNewColor();", "public static void rgb_to_lab(float[] rgb, float[] lab)\n {\n float r = rgb[0];\n float g = rgb[1];\n float b = rgb[2];\n\n // D65 standard referent\n float X = 0.950470f, Y = 1.0f, Z = 1.088830f;\n\n // second, map sRGB to CIE XYZ\n r = r <= 0.04045f ? r/12.92f : (float)Math.pow((r+0.055f)/1.055f, 2.4f);\n g = g <= 0.04045f ? g/12.92f : (float)Math.pow((g+0.055f)/1.055f, 2.4f);\n b = b <= 0.04045f ? b/12.92f : (float)Math.pow((b+0.055f)/1.055f, 2.4f);\n float x = (0.4124564f*r + 0.3575761f*g + 0.1804375f*b) / X,\n y = (0.2126729f*r + 0.7151522f*g + 0.0721750f*b) / Y,\n z = (0.0193339f*r + 0.1191920f*g + 0.9503041f*b) / Z;\n\n // third, map CIE XYZ to CIE L*a*b* and return\n x = x > 0.008856f ? (float)Math.pow(x, 1.0f/3) : 7.787037f*x + 4.0f/29;\n y = y > 0.008856f ? (float)Math.pow(y, 1.0f/3) : 7.787037f*y + 4.0f/29;\n z = z > 0.008856f ? (float)Math.pow(z, 1.0f/3) : 7.787037f*z + 4.0f/29;\n\n float L = 116*y - 16,\n A = 500*(x-y),\n B = 200*(y-z);\n\n lab[0] = L;\n lab[1] = A;\n lab[2] = B;\n }", "protected abstract ColorSpace getColorSpace();", "public abstract RGBPixel getPixelRgb(int x, int y);", "public static int unpackGrayscale(int argb) {\n\t return (unpackRed(argb) + unpackGreen(argb) + unpackBlue(argb)) / 3;\n\t}", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "void greyscale();", "void greyscale();", "@Override\n public native Color getPixelColor(int x, int y);", "public static RealColorImage toRealColor(RealGrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "int getAsInt32Color(int a) {\r\n\t\tint r = (int) (x * 255);\r\n\t\tint g = (int) (y * 255);\r\n\t\tint b = (int) (z * 255);\r\n\t\tif (r > 255) {\r\n\t\t\tr = 255;\r\n\t\t}\r\n\t\tif (g > 255) {\r\n\t\t\tg = 255;\r\n\t\t}\r\n\t\tif (b > 255) {\r\n\t\t\tb = 255;\r\n\t\t}\r\n\r\n\t\tif (r < 0) {\r\n\t\t\tr = 0;\r\n\t\t}\r\n\t\tif (g < 0) {\r\n\t\t\tg = 0;\r\n\t\t}\r\n\t\tif (b < 0) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\treturn (b | g << 8 | r << 16 | a << 24);\r\n\t}", "public static Color fromBGR(int rgb) {\n return Color.rgb(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF);\n }", "public static RealColorImage toRealColor(RealColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static Vector4f negativeColorRGB(Vector4f color, Vector4f dest) {\n dest.zero().set(1).sub(color);\n dest.w = 1;\n return dest;\n }", "public final static int RGB2Grey(int argb) {\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb) & 0xff;\n\n //int rgb=(0xff000000 | ((r<<16)&0xff0000) | ((g<<8)&0xff00) | (b&0xff));\n int y = (int) Math.round(0.299f * r + 0.587f * g + 0.114f * b);\n return y;\n }", "RGB getOldColor();", "public static RealColorImage toRealColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tRealColorImage newimg = new RealColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = (float) img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static ColorImage toColor(ColorImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tColorImage newimg = null;\n\t\tnewimg = new ColorImage(X, Y);\n\t\tnewimg.setColorModel(img.getColorModel());\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tnewimg.set(x, y, img.get(x, y));\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public static float[] rgb2cmyk(int rgb) {\r\n float r = (rgb >> 16) & 0xFF;\r\n float g = (rgb >> 8) & 0xFF;\r\n float b = rgb & 0xFF;\r\n float C = 1.0f - (r / 255);\r\n float M = 1.0f - (g / 255);\r\n float Y = 1.0f - (b / 255);\r\n float var_K = 1;\r\n\r\n if (C < var_K) {\r\n var_K = C;\r\n }\r\n if (M < var_K) {\r\n var_K = M;\r\n }\r\n if (Y < var_K) {\r\n var_K = Y;\r\n }\r\n\r\n C = (C - var_K) / (1 - var_K);\r\n M = (M - var_K) / (1 - var_K);\r\n Y = (Y - var_K) / (1 - var_K);\r\n return new float[] { C * 100, M * 100, Y * 100, var_K * 100 };\r\n }", "public BufferedImage toBufferedImage() {\n double[][] yData = decompress(yChannel);\n double[][] cBData = upsample(decompress(cBChannel));\n double[][] cRData = upsample(decompress(cRChannel));\n\n BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n double[] aYCbCr = {alphaChannel[y][x], yData[y][x], cBData[y][x], cRData[y][x]};\n int aRGB = ImageUtils.channelInt(ImageUtils.toRGB(aYCbCr));\n image.setRGB(x, y, aRGB);\n }\n }\n return image;\n }", "private int xyTo1D(int r, int c) {\n\t\treturn r * N + c;\n\t}", "public RGBColor (int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t\tthis.index = (byte) Palm.WinRGBToIndex(this);\t\r\n\t \r\n\t}", "public Scalar convertColorScalar(ColorSpace to) {\n if (getColorSpace() == to)\n return getScalar();\n if (!getColorSpace().canConvertTo(to))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Scalar output = this.getScalar();\n\n try {\n for (int i = 0; i < getColorSpace().getConversionsTo(to).length; i += 3) {\n int conversion = getColorSpace().getConversionsTo(to)[i];\n int inputDim = getColorSpace().getConversionsTo(to)[i + 1];\n int outputDim = getColorSpace().getConversionsTo(to)[i + 2];\n\n Mat pointMatTo = new Mat();\n Mat pointMatFrom = new Mat(1, 1, CvType.CV_8UC(inputDim), output);\n Imgproc.cvtColor(pointMatFrom, pointMatTo, conversion, outputDim);\n output = new Scalar(pointMatTo.get(0, 0));\n pointMatTo.release();\n pointMatFrom.release();\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "public static Mat convertColorMat(Mat in, ColorSpace spaceIn, ColorSpace spaceOut) {\n if (spaceIn == spaceOut)\n return in;\n if (!spaceIn.canConvertTo(spaceOut))\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n\n Mat output = in.clone();\n\n try {\n for (int i = 0; i < spaceIn.getConversionsTo(spaceOut).length; i += 3) {\n int conversion = spaceIn.getConversionsTo(spaceOut)[i];\n int inputDim = spaceIn.getConversionsTo(spaceOut)[i + 1];\n int outputDim = spaceIn.getConversionsTo(spaceOut)[i + 2];\n\n Imgproc.cvtColor(output, output, conversion, outputDim);\n }\n } catch (Exception ignored) {\n throw new IllegalArgumentException(\"Cannot convert color to the desired color space.\");\n }\n\n return output;\n }", "float[] getColorData(int trisCount, int color) {\n float[] colDat = new float[trisCount * 4];\n float alpha = 255;\n float red = 255;\n float green = 255;\n float blue = 255;\n if(color != -1) {\n alpha = color >> 24 & 0xff;\n red = color >> 16 & 0xff;\n green = color >> 8 & 0xff;\n blue = color & 0xff;\n }\n// Log.e(\"Modelbase\", \"shift = \" + red + \",\" + green + \",\" + blue + \",\" + alpha);\n red /= 255f;\n green /= 255f;\n blue /= 255f;\n alpha /= 255f;\n// Log.e(\"Modelbase\", \"div by 255 = \" + red + \",\" + green + \",\" + blue + \",\" +\n// alpha);\n for (int i = 0; i < colDat.length; i += 4) {\n colDat[i] = red;\n colDat[i + 1] = green;\n colDat[i + 2] = blue;\n colDat[i + 3] = alpha;\n }\n return colDat;\n }", "private static int getGrayTranslucentRGB(int rgb) {\n\t\tint r = (0xff & rgb);\n\t\tint g = (0xff & (rgb >> 8));\n\t\tint b = (0xff & (rgb >> 16));\n\t\trgb = r + (g << 8) + (b << 16) + (100 << 24);\n\t\t// rgb = r + (g << 8) + (b << 16); // 亮一些\n\t\treturn rgb;\n\t}", "public static int[] hexToRgb(int value) {\r\n // int[] v = { (value / 65536), ((value - value / 65536 * 65536) / 256),\r\n // (value - value / 65536 * 65536 - (value - value / 65536 * 65536) /\r\n // 256 * 256), 0 };\r\n\r\n return new int[] { (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 0 };\r\n }", "public int toARGB() {\n return ((a & 255) << 24) |\n ((r & 255) << 16) |\n ((g & 255) << 8) |\n ((b & 255) );\n }", "public native int getColorspace() throws MagickException;", "private String colourToRgb(Color c)\n {\n return \"rgb(\" + (int)(c.getRed()*255) + \",\" + (int)(c.getGreen()*255) + \",\" + (int)(c.getBlue()*255) + \")\";\n }", "void fill(int rgb);", "public CVisRGBA(byte numR, byte numG, byte numB, byte numA) {\r\n\t\tm_numR = numR;\r\n\t\tm_numG = numG;\r\n\t\tm_numB = numB;\r\n\t\tm_numA = numA;\r\n\t}", "protected Color[] generatePlotColors(int numLayers){\n\t\tColor[] clrs = new Color[numLayers];\n\t\t\n\t\t//the first layer is the backgound, so this shouldn't really\n\t\t//ever be used\n\t\tclrs[0] = Color.BLACK;\n\n\t\t//the raw data\n\t\tclrs[1] = Color.GRAY;\n\n\t\t//TODO: this should be changed to a more robust method\n\t\tint colorIdx;\n\t\tfor(int i = 2; i < numLayers; i++){\n\t\t\tcolorIdx = i % 4;\n\t\t\tswitch(colorIdx){\n\t\t\t\tcase 0:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_BLUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_RED;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_GREEN;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tclrs[i] = D2KColors.D2K_YELLOW;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:{\n\t\t\t\t\tSystem.out.println(\"Problem With Color Assignment\");\n\t\t\t\t\tclrs[i] = Color.MAGENTA;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clrs;\n\t}", "public static Vector4f negativeColorRGB(Vector4f color) {\n Vector4f dest = new Vector4f(1).sub(color);\n dest.w = 1;\n return dest;\n }", "public CVisRGBA(byte num) {\r\n\t\tm_numR = num;\r\n\t\tm_numG = num;\r\n\t\tm_numB = num;\r\n\t}", "void inputToCb(Mat input){\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "public CVisRGBA(byte numR, byte numG, byte numB) {\r\n\t\tm_numR = numR;\r\n\t\tm_numG = numG;\r\n\t\tm_numB = numB;\r\n\t}", "private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }", "java.awt.Color getColor();", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }", "private static void computeAccurateXYZ(OrbitData data, double[] xyz, double time) {\n \n final double a = Constants.semiMajorAxis;\n final double b = Constants.semiMinorAxis;\n final double a2 = a*a;\n final double b2 = b*b;\n final double del = 0.002;\n final int maxIter = 200;\n \n Matrix X = new Matrix(3, 1);\n final Matrix F = new Matrix(3, 1);\n final Matrix J = new Matrix(3, 3);\n \n X.set(0, 0, xyz[0]);\n X.set(1, 0, xyz[1]);\n X.set(2, 0, xyz[2]);\n \n J.set(0, 0, data.xVel);\n J.set(0, 1, data.yVel);\n J.set(0, 2, data.zVel);\n \n for (int i = 0; i < maxIter; i++) {\n \n final double x = X.get(0,0);\n final double y = X.get(1,0);\n final double z = X.get(2,0);\n \n final double dx = x - data.xPos;\n final double dy = y - data.yPos;\n final double dz = z - data.zPos;\n \n F.set(0, 0, data.xVel*dx + data.yVel*dy + data.zVel*dz);\n F.set(1, 0, dx*dx + dy*dy + dz*dz - Math.pow(time*Constants.halfLightSpeed, 2.0));\n F.set(2, 0, x*x/a2 + y*y/a2 + z*z/b2 - 1);\n \n J.set(1, 0, 2.0*dx);\n J.set(1, 1, 2.0*dy);\n J.set(1, 2, 2.0*dz);\n J.set(2, 0, 2.0*x/a2);\n J.set(2, 1, 2.0*y/a2);\n J.set(2, 2, 2.0*z/b2);\n \n X = X.minus(J.inverse().times(F));\n \n if (Math.abs(F.get(0,0)) <= del && Math.abs(F.get(1,0)) <= del && Math.abs(F.get(2,0)) <= del) {\n break;\n }\n }\n \n xyz[0] = X.get(0,0);\n xyz[1] = X.get(1,0);\n xyz[2] = X.get(2,0);\n }", "public static ColorImage toColor(GrayImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tint[] color = new int[3];\n\t\tint gray;\n\t\tColorImage newimg = new ColorImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.get(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public int getArgb(int x, int y) {\n if (x < 0 || x >= width || y < 0 || y >= height) {\n throw new IllegalArgumentException(\"x,y must be >0, <width, height\");\n }\n int argb = pixelBuffer.get(x + y*scanlineStride/4);\n if ((argb >> 24) == -1) {\n return argb;\n }\n int a = argb >>> 24;\n int r = (argb >> 16) & 0xff;\n int g = (argb >> 8) & 0xff;\n int b = (argb ) & 0xff;\n int a2 = a + (a >> 7);\n r = (r * a2) >> 8;\n g = (g * a2) >> 8;\n b = (b * a2) >> 8;\n return ((a << 24) | (r << 16) | (g << 8) | (b));\n }", "public int filterRGB(int x, int y, int argb) {\n color = new Color(argb);\n newBlue = multColor(color.getBlue(), blueMultiplier);\n newGreen = multColor(color.getGreen(), greenMultiplier);\n newRed = multColor(color.getRed(), redMultiplier);\n newColor = new Color(newRed, newGreen, newBlue);\n return (newColor.getRGB());\n }", "public static Integer[][] fixRGBValues(Integer[][] input) {\n Integer[][] output = new Integer[input.length][input.length];\n for (int y = 0; y < input.length; y++) {\n for (int x = 0; x < input.length; x++) {\n int k = input[y][x];\n if (k < 0) k = -k;\n if (k > 255) k = 255;\n output[y][x] = k;\n }\n }\n return output;\n }", "public RGBColor (int index, int r, int g, int b) \r\n\t{\r\n \tthis.index = (byte) index;\r\n \tthis.r = (byte) r;\r\n \tthis.g = (byte) g;\r\n \tthis.b = (byte) b;\r\n\t}", "static public int fromRGB(int red, int green, int blue) {\n red = saturate(red, 0, 255);\n green = saturate(green, 0, 255);\n blue = saturate(blue, 0, 255);\n return (0xff << 24) + ((red & 0xff) << 16) + ((green & 0xff) << 8) + (blue & 0xff);\n }", "public Color(int argb) {\n this.a = (byte)(argb >> 24);\n this.r = (byte)(argb >> 16);\n this.g = (byte)(argb >> 8);\n this.b = (byte)(argb );\n }", "public static Color fromRGB(int rgb) {\n return Color.rgb((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF);\n }", "public abstract HSLColor toHSLColor();", "public abstract void getPixelRgb(int x, int y, RGBPixel p);", "public int getRGB(Object inData) {\n if (colorSpaceType == ColorSpace.TYPE_GRAY) {\n int gray = getRed(inData); // Red sRGB component should equal\n // green and blue components\n return (getAlpha(inData) << 24)\n | (gray << 16)\n | (gray << 8)\n | gray;\n }\n if (!is_sRGB) {\n int pixel[];\n if (inData instanceof int[]) {\n pixel = (int[])inData;\n } else {\n pixel = DataBuffer.toIntArray(inData);\n if (pixel == null) {\n throw new UnsupportedOperationException(\n \"This method has not been \"+\n \"implemented for transferType \" + transferType);\n }\n }\n\n // Normalize the pixel in order to convert it\n float[] norm = getNormalizedComponents(pixel, 0, null, 0);\n // Note that getNormalizedComponents returns non-premult values\n float[] rgb = colorSpace.toRGB(norm);\n return (getAlpha(inData) << 24)\n | (((int) (rgb[0] * 255.0f)) << 16)\n | (((int) (rgb[1] * 255.0f)) << 8)\n | (((int) (rgb[2] * 255.0f)) << 0);\n }\n return (getAlpha(inData) << 24)\n | (getRed(inData) << 16)\n | (getGreen(inData) << 8)\n | (getBlue(inData));\n }", "void inputToCb(Mat input)\n {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "void inputToCb(Mat input)\n {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "@LargeTest\n public void testIntrinsicsColorMatrix() {\n TestAction ta = new TestAction(TestName.INTRINSICS_COLOR_MATRIX);\n runTest(ta, TestName.INTRINSICS_COLOR_MATRIX.name());\n }", "public int colorMult(int x, int y) {\n \t\tint res = 0;\n \t\tfor (int octet = 0; octet < 3; ++octet) {\n \t\t\tres |= (((x & 0xff) * (y & 0xff)) / 0xff) << (octet << 3);\n \t\t\tx >>= 8;\n \t\t\ty >>= 8;\n \t\t}\n \t\treturn res;\n \t}", "void inputToCb(Mat input) {\n Imgproc.cvtColor(input, YCrCb, Imgproc.COLOR_RGB2YCrCb);\n Core.extractChannel(YCrCb, Cb, 1);\n }", "public ByteBuffer getColorBuffer() {\n if (colorBuf == null){\n \tcolorBuf = ByteBuffer.allocateDirect(getIndicesBuffer().limit()*4*4);\n \tcolorBuf.order(ByteOrder.nativeOrder());\n \tFloatBuffer fb = colorBuf.asFloatBuffer();\n \tfor (int i=0; i<getIndicesBuffer().limit(); i++){\n \t\tfb.put(defaultColor);\n \t}\n\t\t\tcolorBuf.position(0);\n }\n \treturn colorBuf;\n }", "public native PixelPacket getColormap(int index) throws MagickException;", "public static int getGreyscale(int argb){\n\t\tint red = argb & 0xff;\n\t\tint green = (argb >> 8) & 0xff;\n\t\tint blue = (argb >> 16) & 0xff;\n\t\tint avg = ((red + green + blue) / 3) & 0xff;\n\t\tint grey = (0xff << 24) + (avg << 16) + (avg << 8) + avg;\n\t\treturn grey;\n\t}", "public Bitmap3DColor(float red, float green, float blue, float alpha) {\n this(red, green, blue, alpha, red, green, blue, alpha, red, green, blue, alpha, red, green, blue, alpha);\n }", "@FunctionalInterface\n\tinterface ColorTransformer {\n\t\t// change the color at (x,y)\n\t\tint apply(int x, int y, int origin);\n\t}", "public Mat4RotXYZ(double alpha, double beta, double gama) {\r\n\t\tMat4 M=new Mat4RotX(alpha).mul(new Mat4RotY(beta)).mul(new Mat4RotZ(gama));\r\n\t\tfor(int i=0;i<4;i++)\r\n\t\t\tfor(int j=0;j<4;j++)\r\n\t\t\t\tthis.mat[i][j]=M.mat[i][j];\r\n\t}", "public static Color fromRGB(int color) {\n\t\treturn Color.rgb(color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF);\n\t}", "public ColorVector(float red, float green, float blue) {\n this.red = red;\n this.green = green;\n this.blue = blue;\n }", "public static RealColorImage toRealColor(ComplexImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tRealColorImage newimg = null;\n\t\tnewimg = new RealColorImage(X, Y);\n\t\tfloat[] color = new float[3];\n\t\tfloat gray;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tgray = img.getReal(x, y);\n\t\t\t\tcolor[0] = gray;\n\t\t\t\tcolor[1] = gray;\n\t\t\t\tcolor[2] = gray;\n\t\t\t\tnewimg.set(x, y, color);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public int[] getColorIndices();", "private native void setModelColor(float r,float g,float b);", "public static float[] createColors() {\n float[] data = new float[4 * 3];\n data[0] = 1f;\n data[1] = 0f;\n data[2] = 0f;\n data[3] = 1f;\n\n data[4] = 0f;\n data[5] = 1f;\n data[6] = 0f;\n data[7] = 1f;\n\n data[8] = 0f;\n data[9] = 0f;\n data[10] = 1f;\n data[11] = 1f;\n return data;\n }", "public interface IValueToColor {\r\n\r\n\tpublic Color map(double value);\r\n\r\n}", "public static double[] rgbIntToRgbArray(int rgb) {\n\t\tdouble[] rgbArray = new double[3];\n\t\trgbArray[0] = (rgb >> 16) & 0xFF;\n\t\trgbArray[1] = (rgb >> 8) & 0xFF;\n\t\trgbArray[2] = (rgb) & 0xFF;\n\t\treturn rgbArray;\n\t}", "public void expression2color(ExpressionData md, int col)\n\t{\n\tif(expData==null)\t{System.err.println(\"No expression data provided for mapping\"); return;}\n\tsetScale(md, col);\n\tCell[] cells=v.getCells();\n\tfor(Cell c:cells)\t\n\t\trecursiveExpressionNormalization(c, col);\n\t\n\treturn;\n\t}", "public Colour(int rgb) {\n\t\tset(((rgb >> 16) & 0xff) * nf, ((rgb >> 8) & 0xff) * nf, (rgb & 0xff)\n\t\t\t\t* nf);\n\t}", "public static float[] color(Color c) {\r\n \r\n if (c == null) c = Color.BLUE;\r\n return new float[]{ ((float) c.getRed() / 255.0f), \r\n ((float) c.getGreen() / 255.0f), ((float) c.getBlue() / 255.0f) };\r\n }", "private int[] makeRGBArray(Color color) {\n\t\treturn new int[]{color.getRed(), color.getGreen(), color.getBlue()};\n\t}" ]
[ "0.6855772", "0.61641574", "0.5870734", "0.5809777", "0.5767378", "0.57059187", "0.5689943", "0.55988324", "0.5544058", "0.552904", "0.55266494", "0.5521459", "0.5496563", "0.5389459", "0.53595716", "0.5274974", "0.52711785", "0.52501786", "0.523635", "0.52266693", "0.5226333", "0.52142006", "0.5189431", "0.51744646", "0.51469046", "0.5146434", "0.5116888", "0.5110853", "0.5106495", "0.5105595", "0.5088668", "0.50875026", "0.50875026", "0.50788057", "0.50611186", "0.5057602", "0.5057413", "0.505343", "0.5040767", "0.5037485", "0.4991247", "0.49899942", "0.4986419", "0.4979053", "0.49748823", "0.49693272", "0.4956695", "0.49550328", "0.49425134", "0.49417445", "0.4935764", "0.49296477", "0.49284607", "0.4923296", "0.49201056", "0.4919175", "0.4916611", "0.49078023", "0.4882337", "0.48672011", "0.48649225", "0.48644578", "0.4845189", "0.48339304", "0.48267168", "0.48217052", "0.4819097", "0.481773", "0.4816637", "0.4779364", "0.47662985", "0.47587413", "0.47505528", "0.4746128", "0.47261953", "0.47219884", "0.47194052", "0.4701714", "0.4701714", "0.47014743", "0.46917504", "0.4687443", "0.46845898", "0.46702522", "0.4660677", "0.4655602", "0.46502164", "0.46431127", "0.4642679", "0.46377388", "0.46298528", "0.4626279", "0.46036234", "0.4603095", "0.4600501", "0.4598218", "0.45920062", "0.45918024", "0.45822683", "0.45789608" ]
0.7175052
0
/ Display a prompt for the player's next move (see examples)
public void showNextMovePrompt() { if(model.isXTurn()){ resultLabel.setText("X's Turn"); } else{ resultLabel.setText("O's Turn"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void displayConfirmMove(int direction) {\n\t\t \n\t\t switch(direction) {\n\t\t \n\t\t\t //enter case 1\n\t\t\t case 1:\tSystem.out.println(\"\\nYou've successfully moved to the next Room.\\n\");\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t\t\n\t\t\t //enter case 2\n\t\t\t case 2:\tSystem.out.println(\"\\nYou've successfully moved to the previous Room.\\n\");\n\t\t\t \t\t\tbreak;\n\t\t }//end switch\n\t }", "public void invalidMovePrompt() {\n\t\tinvalidPrompted = true;\n\t\tSystem.out.println(\"Invalid move. Please try again\");\n\t}", "public void AskForMove();", "private void promptTurn()\n \t{\n \t\tUserInfo curr;\n\t\tString meow;\n \t\tcurr = players[turnIndex];\n \t\tString[] tokens;\n \t\tint x;\n \t\tint y;\n \t\n// PROTOCOL \t\n \t\tcurr.sendMessage(prtcl.makePacket(\"Please enter a move\", \"message\")); \n\t\tmeow = curr.getMessage();\n\t\ttokens = meow.split(\" \");\n// PROTOCOL\n \t\tx = Integer.parseInt(tokens[0]);\n \t\ty = Integer.parseInt(tokens[1]);\n \t\n \t\t// Should have a method to process the user's input, and provide an error message back to them if necessary. \n \t\tif(game.remove(x, y))\n \t\t{\n \t\t\tplayers[(turnIndex + 1) % 2].sendMessage(prtcl.makePacket(\"Other player took \" + tokens[0] + \" items from row \" + tokens[1] + \".\", \"message\"));\n \t\t\tbroadcast(prtcl.makePacket(game.toString(), \"message\"));\n \t\t\t// This is where the check to see if the game is won occurs. If so, a winner (the person who just moved) is \n \t\t\t// congratulated. \n \t\t\tif(!game.isDone())\n \t\t\t{\n \t\t\t\tturnIndex += 1;\n \t\t\t\tturnIndex %= 2;\n \t\t\t}\n \t\t} else\n \t\t{\n // PROTOCOL\n \t\t\tplayers[turnIndex].sendMessage(prtcl.makePacket(\"Something was wrong with that. Try again.\", \"ERROR\"));\n // PROTOCOL\n \t\t}\t\n \t}", "private void promptPlayerTurn(Player player) {\r\n JOptionPane.showMessageDialog(\r\n null,\r\n player.getName() + \", it's your turn!\",\r\n \"Player Confirmation\",\r\n JOptionPane.INFORMATION_MESSAGE);\r\n }", "protected void selectNextAction() throws IOException\n {\n HumanPlayer humanPlayer = new HumanPlayer();\n GameLogic gameLogic = new GameLogic();\n Map mapClass = new Map();\n\n System.out.println(\"Please input your next move: \");\n String response = humanPlayer.processCommand(humanPlayer.getInputFromConsole());\n\n switch (response)\n {\n case \"h\":\n System.out.println(gameLogic.hello());\n break;\n case \"mn\":\n System.out.println(gameLogic.move('n'));\n break;\n case \"ms\":\n System.out.println(gameLogic.move('s'));\n break;\n case \"me\":\n System.out.println(gameLogic.move('e'));\n break;\n case \"mw\":\n System.out.println(gameLogic.move('w'));\n break;\n case \"p\":\n System.out.println(gameLogic.pickup());\n break;\n case \"l\":\n System.out.println(gameLogic.look(mapClass.getMap(), mapClass.getPlayersPosition()));\n selectNextAction();\n break;\n case \"q\":\n gameLogic.gameFlick();\n break;\n case \"i\":\n System.out.println(\"Invalid input, please try again.\");\n default:\n selectNextAction();\n break;\n }\n }", "private void cheatMoveDialog() {\n Dialog dialog = viewer.cheatMoveDialog();\n Optional<String> result = dialog.showAndWait();\n result.ifPresent(numberOfSpaces -> {\n int simulatedDiceRolled = Integer.parseInt(result.get());\n modelEngine.moveCurrentPlayer(simulatedDiceRolled);\n });\n }", "public void invalidMove() {\n JOptionPane.showMessageDialog(frame, \"Invalid move\", \"Invalid move\", JOptionPane.ERROR_MESSAGE);\n }", "public void doNextMove(Player player) {\r\n int newX = xCoord;\r\n int newY = yCoord;\r\n switch (currentDirection) {\r\n case 1:\r\n newX = xCoord + 1;\r\n break;\r\n case 2:\r\n newY = yCoord + 1;\r\n break;\r\n case -1:\r\n newX = xCoord - 1;\r\n break;\r\n case -2:\r\n newY = yCoord - 1;\r\n break;\r\n }\r\n if (checkValidMove(newX, newY)) {\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n // System.out.println(newX + \" \" + newY);\r\n moveTo(newX, newY);\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n\r\n } else {\r\n turnAround();\r\n doNextMove(player);\r\n }\r\n }", "public void move() {\r\n\t\tSystem.out.print(\"This Goose moves forward\");\r\n\t}", "public boolean initiateMovePrompt(MapPanel caller) {\n\t\tif(activePath == null || !pf.isValidPath(activePath))\n\t\t\treturn false;\n\t\tlog.log(\"Now prompting player for move.\");\n\t\tMapViewListener l = caller.getMapViewListener();\n\t\tl.setStatus(GameState.PLAYER_CONFIRMING_MOVE);\n\t\tattackableFromHere = canAttackFromDestination();\n\t\twithinRange = findSquaresWithinAtkRange();\n\t\tl.setMoveMenu(caller, attackableFromHere.size() != 0);\n\t\treturn true;\n\t}", "public void playGame() {\t\t\r\n\t\tthis.printWelcomeMessage();\r\n\r\n\t\t// While the game hasn't finished yet. \r\n\t\twhile (!board.isGameWon()) {\r\n\t\t\tthis.printMoveText(\"What piece would you like to move: \", \"\\n-- PLEASE ENTER A VALID PIECE --\", true);\r\n\t\t\tthis.printSeparator();\r\n\t\t\tthis.printMoveText(\"Where would you like to move this piece: \", \"\\n-- PLEASE ENTER A VALID LOCATION --\",\r\n\t\t\t\t\tfalse);\r\n\t\t\tthis.printSeparator();\r\n\t\t}\r\n\t\tSystem.out.println(board.toString());\r\n\t\tSystem.out.println(\"Level Complete - Congratulations!\");\r\n\t}", "static void actionPrompt() {\n prompt:\n while (true) {\n String line = \"\";\n System.out.println(\"\\nWhat do you want to do: (S)ave, (F)ill, (L)ine, (V)isible, (Q)uit: \");\n while (line.length() < 1)\n line = scan.nextLine().toUpperCase();\n char action = line.charAt(0);\n switch (action) {\n case 'Q':\n break prompt;\n case 'V':\n visible(); break;\n case 'L':\n line(); break;\n case 'F':\n fill(); break;\n case 'S':\n save(); break;\n default:\n System.out.println(\"Not a valid command.\");\n }\n }\n }", "public static void next() {\n\t\tsendMessage(NEXT_COMMAND);\n\t}", "private String promptLoadOrNew(){\r\n Object[] options = {\"Start A New Game!\", \"Load A Previous Game.\"};\r\n String result = (String) JOptionPane.showInputDialog(\r\n null,\r\n \"What would you like to do?\",\r\n \"Welcome!\",\r\n JOptionPane.PLAIN_MESSAGE,\r\n null,\r\n options,\r\n 1);\r\n return result;\r\n \r\n }", "public void act() {\n boolean willMove = canMove();\n if (isEnd && !hasShown) {\n String msg = stepCount.toString() + \" steps\";\n JOptionPane.showMessageDialog(null, msg);\n hasShown = true;\n } else if (willMove) {\n move();\n stepCount++;\n }\n }", "public static void showPrompt() {\r\n \r\n System.out.print(\"> \");\r\n \r\n }", "public void advance() {\r\n this.command = in.nextLine();\r\n }", "private void moveToNewLocation() {\r\n System.out.println(\"\\nThis is the move to a new location option\");\r\n }", "@Override\n\tpublic void excute() {\n\t\tmoveEvent.move(commandinfo.getValue() * 200);\n\t}", "private void prompt() {\n System.out.print(Strings.MAIN_PROMPT);\n System.out.flush();\n }", "public abstract void generateNextMove(final ChessGameConsole console);", "public String getNextCommand() {\n System.out.println(\"Left, Right, Advance <n>, Quit , Help: \");\n return scanner.nextLine();\n }", "@Override\n @SneakyThrows\n public void nextRound() {\n Interpreter interpreter = Zuul.getInstance().getInterpreter();\n /*\n Getting player's input\n */\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n interpreter.handleCommand(this, reader.readLine());\n }", "public void move() {\r\n\t\tSystem.out.print(\"This animal moves forward\");\r\n\t}", "public boolean displayPrompt(String msg);", "public void move() {\r\n\t\tSystem.out.print(\"This Tiger moves forward\");\r\n\t}", "public void play() {\r\n int ii = 0;\r\n\r\n System.out.println(\"****************************************************************\");\r\n System.out.println(\"Play game: a move is expressed as \\\"row#,col#\\\", such as \\\"1,2\\\"\");\r\n System.out.println(\"Computer: X Person: O\");\r\n System.out.println(\"****************************************************************\");\r\n while(!isGameEnded()) {\r\n if (ii >= MAX_MOVE_NUMBER) {\r\n\tbreak;\r\n }\r\n\r\n nextMove();\r\n ii++;\r\n }\r\n\r\n if (isPersonWin()) {\r\n System.out.println(\"Person Wins!\");\r\n saveLoseRecord();\r\n }\r\n else if (isComputerWin()) {\r\n System.out.println(\"Computer Wins!\");\r\n }\r\n else {\r\n System.out.println(\"Tie!\");\r\n }\r\n\r\n }", "public static void prompt() {\n\t\tSystem.out.printf(\"\\n입력 > \");\n\t}", "@Override\n\tpublic CompletableFuture<Void> advance(String loc) {\n\t\treturn console(\"advance \" + loc, CompletesWithRunning.MUST);\n\t}", "private void tutorial(){\n\t\tString msg = \"[Space] = Inicia e pausa o jogo depois de iniciado.\";\n\t\tmsg += \"\\n[Seta esquerda] = Move o paddle para a esquerda.\";\n\t\tmsg += \"\\n[Seta direita] = Move o paddle para a direita.\";\n\t\tmsg += \"\\n[I] = Abre a janela de informaçoes.\";\n\t\tmsg += \"\\n[R] = Reinicia o jogo.\";\n\t\tJOptionPane.showMessageDialog(null, \"\"+msg, \"Informaçoes\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "public void advanceGame() {\n\t\tthis.status = Status.Active;\n\t\tthis.currentSuggestion = null;\n\t\tfor(User u : this.players) {\n\t\t\tu.availableActions.remove(ACTION.Wait);\n\t\t\tu.availableActions.remove(ACTION.Disprove);\n\t\t}\n\t\t\n\t\t// Next player can always move\n\t\tUser nextPlayer = null;\n\t\tdo {\n\t\t\tnextPlayer = getFollowingPlayer(this, this.getCurrentPlayer());\n\t\t\tif (nextPlayer.isActive) {\n\t\t\t\tnextPlayer.availableActions.add(ACTION.Move);\n\t\t\t\tif (this.board.getLocation(nextPlayer.character).isRoom) {\n\t\t\t\t\tnextPlayer.availableActions.add(ACTION.Accuse);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentMove++;\n\t\t} while (!nextPlayer.isActive);\n\t\t\n\t\tif (activeUserCount(this) == 1) {\n\t\t\t// Last player remaining is the winner (by default)\n\t\t\tthis.status = Status.Complete;\n\t\t\tmessages.add(String.format(\"[ %s ] has won the game (by default)!\", nextPlayer.name));\n\t\t}\n\t}", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "void chooseStarterPlayer() {\n\t\tSystem.out.println(\"\\nWer beginnt?\");\n\t\tSystem.out.println(\"1 - Computer\");\n\t\tSystem.out.println(\"2 - Human\");\n\t}", "public static void printPrompt() {\n System.out.print(\" > \");\n }", "public static void start() {\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\\n (1) Player's Move\\n (2) Gideon's Move\\n \");\r\n\t\t\r\n\t\tString prompt = \"GAME: Chess Master\\r\\n\" + \r\n\t\t\t\t\" This is a chess-like game with a \\\"Karate\\\" theme. Each side starts with 3 samurai,\\r\\n\" + \r\n\t\t\t\t\" 3 ninjas, 3 mini-samurai, 3 mini-ninjas, and a King. It is played on a 7x8 board,\\r\\n\" + \r\n\t\t\t\t\" and players \\\"attack\\\" opposing pieces by moving one of their pieces in front of\\r\\n\" + \r\n\t\t\t\t\" an opponents piece. When a piece is attacked, it is \\\"demoted\\\". When a \\\"mini\\\"\\r\\n\" + \r\n\t\t\t\t\" piece is attacked, it is removed from the board. The king cannot move, and if it\\r\\n\" + \r\n\t\t\t\t\" is attacked, then that side loses. The initial position is:\";\r\n\t\t\r\n\t\tString userInput = kb.next(); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the user's preference for whose playing the first move\r\n\t\t\r\n\t\tif(userInput.equals(\"1\")) { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Player will play the first move\r\n\t\t\tSystem.out.println(prompt);\r\n\t\t\tplayersMove(); \r\n\t\t}\r\n\t\t\r\n\t\telse if(userInput.equals(\"2\")) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Gideon will play the first move\r\n\t\t\tSystem.out.println(prompt);\r\n\t\t\tGideonsMove();\r\n\t\t}\r\n\t\t\r\n\t\telse \t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Invalid input, re-call method and attempt to get user's input again\r\n\t\t\tstart();\r\n\t\t\r\n\t}", "public boolean nextAction(Player player);", "private void continueGame() {\n System.out.println(\"\\n\" + \"Do you want to play more games or quit?\\n\" + \"1. Lotto\\n\" + \"2. Small Lotto\\n\" + \"3. Quit\");\n input = scanner.next();\n changeGame();\n }", "private void startNext() {\n \tresetGame();\n \tfor (int i = 0; i < 5; i++) {\n \t\tprintln();\n \t}\n \t\n \tprintln(\"The word now looks like this: \" + currentWord);\n \tprintln(\"You have \" + guessesLeft + \" guesses left.\");\n \tplayGame();\n }", "public void printPrompt() {\r\n\t\tif (!promptVisible) {\r\n\t\t\tsetPromptVisible(true);\r\n\t\t}\r\n\t\tprompt(rPrompt);\r\n\t}", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "void drawPrompt(String message);", "public void addContinue() {\n if (cursor == 0) {\n JOptionPane.showMessageDialog(null, \"There's no note to continue!\", \"Invalid Continue\", JOptionPane.WARNING_MESSAGE);\n } else {\n notePressed(CONTINUE);\n }\n }", "private void askUser()\n { \n System.out.println(\"What is your command?\");\n\n String command = scanner.nextLine();\n commandPrompt(command);\n }", "void advance() {\n myGameTicks--;\n myScore += myManager.advance(myGameTicks);\n if (myGameTicks == 0) {\n setGameOver();\n }\n // paint the display\n try {\n paint(getGraphics());\n flushGraphics();\n } catch (Exception e) {\n myJump.errorMsg(e);\n }\n }", "public boolean playNextStep(Move otherMove) {\n if (isGameFinished()) {\n return false;\n }\n // If we are in move creation state, we add move and move to next player.\n if (isCreateMoveState) {\n if(addMove(otherMove)){\n nextPlayer();\n isCreateMoveState = false;\n return true;\n }\n else{\n return false;\n }\n\n\n } else {\n // If we are in KopyMove state, we compare moves and increment to next move or player.\n boolean succeeded = compareMove(otherMove);\n if (!succeeded) {\n // If we kill the current player, the index will fix automatically.\n killCurrentPlayer();\n } else {\n nextMove();\n }\n return succeeded;\n }\n }", "void showmove() {\n\t\tint oldblock = blocklen[printoldline];\n\t\tint newother = newinfo.other[printnewline];\n\t\tint newblock = blocklen[newother];\n\n\t\tif (newblock < 0)\n\t\t\tskipnew(); // already printed.\n\t\telse if (oldblock >= newblock) { // assume new's blk moved.\n\t\t\tblocklen[newother] = -1; // stamp block as \"printed\".\n\t\t\tprintln(\">>>> \" + newother + \" THRU \" + (newother + newblock - 1)\n\t\t\t\t\t+ \" MOVED TO BEFORE \" + printoldline + \"<br/>\");\n\t\t\tfor (; newblock > 0; newblock--, printnewline++)\n\t\t\t{\n\t\t\t\toutput+=newinfo.symbol[printnewline].showSymbol();\n\t\t\t\toutput+=\"<br/>\";\n\t\t\t}\n\t\t\tanyprinted = true;\n\t\t\tprintstatus = idle;\n\n\t\t} else\n\t\t\t/* assume old's block moved */\n\t\t\tskipold(); /* target line# not known, display later */\n\t}", "public void makeNextMove() {\n\t\ttakeNextNonTabuedCheapestStep();\n\t\t}", "public static void enterToContinue()\r\n\t{\r\n\t\tScanner keyboard = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Press enter to continue the game : \");\r\n\t\tkeyboard.nextLine();\r\n\t}", "public static void interactivePlay() {\r\n\t\tint[][] board = createBoard();\r\n\t\tshowBoard(board);\r\n\r\n\t\tSystem.out.println(\"Welcome to the interactive Checkers Game !\");\r\n\r\n\t\tint strategy = getStrategyChoice();\r\n\t\tSystem.out.println(\"You are the first player (RED discs)\");\r\n\r\n\t\tboolean oppGameOver = false;\r\n\t\twhile (!gameOver(board, RED) && !oppGameOver) {\r\n\t\t\tboard = getPlayerFullMove(board, RED);\r\n\r\n\t\t\toppGameOver = gameOver(board, BLUE);\r\n\t\t\tif (!oppGameOver) {\r\n\t\t\t\tEnglishCheckersGUI.sleep(200);\r\n\r\n\t\t\t\tboard = getStrategyFullMove(board, BLUE, strategy);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint winner = 0;\r\n\t\tif (playerDiscs(board, RED).length == 0 | playerDiscs(board, BLUE).length == 0){\r\n\t\t\twinner = findTheLeader(board);\r\n\t\t}\r\n\r\n\t\tif (winner == RED) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t\tSystem.out.println(\"\\t * You are the winner !! *\");\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t}\r\n\t\telse if (winner == BLUE) {\r\n\t\t\tSystem.out.println(\"\\n======= You lost :( =======\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"\\n======= DRAW =======\");\r\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 displayPrompt()\n\t{\n\t\tif (ch.usingJog.length() > 0)\n\t\t\treturn;\n\t\t\t\n\t\tif (showPrompt)\n\t\t{\n\t\t\t// Show the pageMode prompt if necessary.\n\t\t\tif (pageMode)\n\t\t\t{\n\t\t\t\tpageMode = false;\n\t\t\t\tsendln(\"\");\n\t\t\t\tsendln(\"{Y[== {CPAGE MODE: {wPush enter to continue. See {W'{chelp pagemode{W' {wfor details. {Y==]{x\");\n\t\t\t\tshowPrompt = false;\n\t\t\t\tpageMode = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Show the editor prompt if necessary.\n\t\t\tif (cs == ConnState.EDITING)\n\t\t\t{\n\t\t\t\tsend(\"{G > {x\");\n\t\t\t\tshowPrompt = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsend(\"{x\");\n\t\t\tif (!prefs.get(\"compact\"))\n\t\t\t\tsendln(\"\");\n\t\t\tif (tempPrompt.length() > 0)\n\t\t\t\tsendln(tempPrompt);\n\t\t\telse\n\t\t\t{\n\t\t\t\tString pr = prompt;\n\t\t\t\tif (ch.fighting != null)\n\t\t\t\t\tpr = bprompt;\n\t\t\t\tif (!prefs.get(\"prompt\"))\n\t\t\t\t\tpr = \"\";\n\t\t\t\t\n\t\t\t\tString exitLine = \"\";\n\t\t\t\tfor (Exit e : ch.currentRoom.exits)\n\t\t\t\t\tif (e.flags.get(\"hidden\") && !(e.flags.get(\"door\") && !e.flags.get(\"closed\")))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\telse if (e.flags.get(\"door\") && e.flags.get(\"closed\"))\n\t\t\t\t\t\texitLine = exitLine+e.direction.substring(0, 1).toLowerCase();\n\t\t\t\t\telse\n\t\t\t\t\t\texitLine = exitLine+e.direction.substring(0, 1).toUpperCase();\n\t\t\t\t\n\t\t\t\tString lightString = \"\";\n\t\t\t\tint hour = Fmt.getHour();\n\t\t\t\tint season = Fmt.getSeason();\n\t\t\t\tint sunrise = Fmt.getSunrise(season);\n\t\t\t\tint sunset = Fmt.getSunset(season);\n\t\t\t\tif (hour < sunrise || hour > sunset)\n\t\t\t\t\tlightString = \"{D(){x\";\n\t\t\t\telse if (hour >= sunrise && hour < sunrise+2)\n\t\t\t\t\tlightString = \"{D({Y){x\";\n\t\t\t\telse if (hour <= sunset && hour > sunset-2)\n\t\t\t\t\tlightString = \"{Y({D){x\";\n\t\t\t\telse\n\t\t\t\t\tlightString = \"{Y(){x\";\n\n\t\t\t\tpr = pr.replace(\"%%\", \"SPEC_PERCENT\");\n\n\t\t\t\tpr = pr.replace(\"%h\", \"\"+ch.hp);\n\t\t\t\tpr = pr.replace(\"%H\", \"\"+ch.maxHp());\n\t\t\t\tpr = pr.replace(\"%p\", \"\"+((ch.hp*100)/ch.maxHp()));\n\t\t\t\tpr = pr.replace(\"%m\", \"\"+ch.mana);\n\t\t\t\tpr = pr.replace(\"%M\", \"\"+ch.maxMana());\n\t\t\t\tpr = pr.replace(\"%n\", \"\"+((ch.mana*100)/ch.maxMana()));\n\t\t\t\tpr = pr.replace(\"%s\", \"\"+ch.energy);\n\t\t\t\tpr = pr.replace(\"%S\", \"\"+ch.maxEnergy());\n\t\t\t\tpr = pr.replace(\"%i\", \"\"+((ch.energy*100)/ch.maxEnergy()));\n\t\t\t\t\n\t\t\t\tpr = pr.replace(\"%x\", \"\"+ch.tnl);\n\t\t\t\tpr = pr.replace(\"%g\", \"\"+ch.gold);\n\t\t\t\tpr = pr.replace(\"%G\", \"\"+ch.bank);\n\t\t\t\tpr = pr.replace(\"%c\", \"\"+ch.combatQueue.size()/2);\n\n\t\t\t\tpr = pr.replace(\"%a\", ch.currentArea().name);\n\t\t\t\tpr = pr.replace(\"%r\", ch.currentRoom.name);\n\t\t\t\tpr = pr.replace(\"%e\", \"\"+exitLine);\n\t\t\t\tpr = pr.replace(\"%t\", \"\"+savedTells.size());\n\t\t\t\tpr = pr.replace(\"%T\", \"\"+timeFrmt.format(System.currentTimeMillis()));\n\t\t\t\tpr = pr.replace(\"%d\", \"\"+dateFrmt.format(System.currentTimeMillis()));\n\t\t\t\tpr = pr.replace(\"%D\", \"\"+longDateFrmt.format(System.currentTimeMillis()));\n\t\t\t\tpr = pr.replace(\"%l\", lightString);\n\t\t\t\t\n\t\t\t\tpr = pr.replace(\"%A\", \"\"+ch.currentArea().id);\n\t\t\t\tpr = pr.replace(\"%R\", \"\"+ch.currentRoom.id);\n\t\t\t\tpr = pr.replace(\"%o\", olcMode);\n\n\t\t\t\tif (ch.fighting != null)\n\t\t\t\t{\n\t\t\t\t\tpr = pr.replace(\"%O\", Fmt.seeName(ch, ch.fighting));\n\t\t\t\t\tpr = pr.replace(\"%P\", \"\"+((ch.fighting.hp*100)/ch.fighting.maxHp()));\n\t\t\t\t\tpr = pr.replace(\"%N\", \"\"+((ch.fighting.mana*100)/ch.fighting.maxMana()));\n\t\t\t\t\tpr = pr.replace(\"%I\", \"\"+((ch.fighting.energy*100)/ch.fighting.maxEnergy()));\n\t\t\t\t}\n\n\t\t\t\tpr = pr.replace(\"SPEC_PERCENT\", \"%\");\n\t\t\t\t\n\t\t\t\tsend(pr+\"{x\");\n\t\t\t}\n\t\t\tshowPrompt = false;\n\t\t}\n\t}", "public void movementStrategy() {\n System.out.println(\"Player has chosen\" + this.playerMovement);\n }", "private void move() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.resetGameMessage();\n gameMessage.notify(gameMessage);\n\n\n if( liteGame.isWinner() ) endOfTheGame = true;\n }", "public void generalPrompt() {\n System.out.println(\"What would you like to do?\");\n }", "public void welcomeToGame() {\r\n System.out.println(\" _____ _____ _ \\n\" +\r\n\" / ____| / ____| | | \\n\" +\r\n\" | (___ _ __ __ _ ___ ___ | | _ __ __ _ __ __ | | ___ _ __ \\n\" +\r\n\" \\\\___ \\\\ | '_ \\\\ / _` | / __| / _ \\\\ | | | '__| / _` | \\\\ \\\\ /\\\\ / / | | / _ \\\\ | '__|\\n\" +\r\n\" ____) | | |_) | | (_| | | (__ | __/ | |____ | | | (_| | \\\\ V V / | | | __/ | | \\n\" +\r\n\" |_____/ | .__/ \\\\__,_| \\\\___| \\\\___| \\\\_____| |_| \\\\__,_| \\\\_/\\\\_/ |_| \\\\___| |_| \\n\" +\r\n\" | | \\n\" +\r\n\" |_| \\n\\n\");\r\n System.out.println(\"=== WELCOME ===\\n\");\r\n System.out.println(\"Welcome to the game\\n\");\r\n System.out.println(\"Intro Blah blah blah\");\r\n System.out.println(\"Intro Blah blah blah\");\r\n System.out.println(\"Intro Blah blah blah\");\r\n System.out.println(\"Intro Blah blah blah\");\r\n }", "public void AskName(){\r\n\t\tSystem.out.println(\"Player 2, please enter your name: \\nPredictable Computer\");\r\n\t\tplayerName = \"Predictable Computer\";\r\n\t}", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"하늘을 날다\");\n\t}", "void next() {\n\tcheckWinCondition();\n\tnew ClientServer(arr);\n\tif (!win) {\n\t\tchangePlayer();\n\t\tP2P.yourTurn = false;\n\t\tP2P.displayTextChanger(Display.txt1, \"Opponents turn!\", Color.lightGray);\n\t} else {\n\t\tgameEnder();\n\t\tEndScreen.showEndGameWindow();\n\tif (curPlayer == 1)\n\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Red player won! </font></b></center></html>\");\n\telse\n\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Black player won! </font></b></center></html>\");\n\t\tP2P.displayTextChanger(Display.txt1, \"Game has ended!\", Color.blue);\n\t\tP2P.yourTurn = false;\n\t}\n}", "public static void playerMove() \n\t{\n\t\tSystem.out.println(\"\\nPlayer: Enter a slot number :\\n\");\n\t\tint boardSlotNumber = scanner.nextInt();\n\n\t\tif (boardSlotNumber > 0 && boardSlotNumber <= 9 && tictactoeBoard[boardSlotNumber] != 'x' && tictactoeBoard[boardSlotNumber] != 'o')\n\t\t{\n\t\t\ttictactoeBoard[boardSlotNumber] = playerInput;\n\t\t\t//beforeMoveBoard();\n\t\t\tshowBoard();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\tplayerMove();\n\t\t}\n\t}", "public static void Welcome (){ //this method outputs welcome information and possibly other relevant information to user\r\n System.out.println(\"Welcome to the Maze Pathfinder Program! \\n\\nThis program can either create a random maze or accept input from a file to create one. Then the program will find a path from the start point to the end point in the maze.\\nEnjoy! \");\r\n System.out.println(\"\\n\");\r\n }", "public void nextTurn(){\n\t\tplayers[currentPlayer].setNotCurrentPlayer();\n\t\t\n\t\t//increment current player to advance to next player\n\t\tcurrentPlayer = (currentPlayer + 1) % players.length;\n\t\t\n\t\t//update the new current player\n\t\tupdateCurrentPlayerView();\n\t}", "private void menu() { \r\n\t\tSystem.out.println(\" ---------WHAT WOULD YOU LIKE TO DO?---------\");\r\n\t\tSystem.out.println(\"1) Move\");\r\n\t\tSystem.out.println(\"2) Save\");\r\n\t\tSystem.out.println(\"3) Quit\");\r\n\t\t\r\n\t}", "private void prompt() {\n System.out.print(\"> \");\n System.out.flush();\n }", "public void actionPerformed (ActionEvent e) {\n \t\tJOptionPane.showMessageDialog(frame3,\n \t\t\t \"Player 1 is blue \\n\"\n \t\t\t \t\t+ \"Player 2 is red \\n\"\n \t\t\t \t\t+ \"Player 3 is green \\n\"\n \t\t\t \t\t+ \"Player 4 is yellow \\n\"\n \t\t\t \t\t+ \"A Warrior's token is a circle. Range:1, Move:3\\n\"\n \t\t\t \t\t+ \"A Ranger's token is a square. Range:4, Move:5\\n\"\n \t\t\t \t\t+ \"A Rogue's token is a triangle. Range:1, Move:6\\n\"\n \t\t\t \t\t+ \"A healer's token is a star. Range:3, Move:4\\n\"\n \t\t\t \t\t+ \"A Damage Mage's token is a pentagon. Range:3, Move:4\\n\", \n \t\t\t \"Key\",\n \t\t\t JOptionPane.PLAIN_MESSAGE);\n \t}", "public static void userMover(){\n System.out.println(\"Where would you like to move? Please choose (R)ight, (L)eft, (U)p, or (D)own \");\n String move = input.next();\n\n while (!\"RLUD\".contains(move)) {\n System.out.println(\"Where would you like to move? Please choose (R)ight, (L)eft, (U)p, or (D)own \");\n move = input.next();\n }\n\n if (move.equals(\"R\") && (myMap.canIMoveRight())) {\n myMap.moveRight();\n } else if (move.equals(\"L\") && myMap.canIMoveLeft()) {\n myMap.moveLeft();\n } else if (move.equals(\"U\") && myMap.canIMoveUp()) {\n myMap.moveUp();\n } else if (move.equals(\"D\") && myMap.canIMoveDown()) {\n myMap.moveDown();\n } else if (myMap.isThereAPit(move)) {\n navigatePit(move);\n } else {\n System.out.println(\"Sorry, you’ve hit a wall.\");\n }\n\n myMap.printMap();\n }", "void userMoveRequested(int playerIndex);", "public void move(String direction) {\n\tpreviousMove = direction;\n\tout.println(\"MOVE \" + direction);\n}", "public void displaySecond() {\r\n System.out.println(secondPrompt);\r\n }", "private String getPlayerName() {\n\t\tString[] options = {\"OK\"};\n\t\tJPanel namePanel = new JPanel(new GridLayout(0, 1));\n\t\tJLabel lbl = new JLabel(\"Next player, what is your name?\");\n\t\tJTextField txt = new JTextField(10);\n\t\tnamePanel.add(lbl);\n\t\tnamePanel.add(txt);\n\t\t\n\t\t// show dialog box\n\t\tJOptionPane.showOptionDialog(frame, namePanel, \"Player name\",\n\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);\n\t\tString playerName = txt.getText();\n\t\twhile(playerName.length() < 1){\n\t\t\tlbl.setText(\"Name must be at least one character long.\");\n\t\t\tJOptionPane.showOptionDialog(frame, namePanel, \"Player name\",\n\t\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options , options[0]);\n\t\t\tplayerName = txt.getText();\n\t\t}\n\t\treturn playerName;\n\t}", "public void startGame() {\n Scanner in = new Scanner(System.in);\n Player player = Player.getInstance();\n setPlayer(player);\n\n try {\n\n System.out.println(\"\\t\\u2680\\t\\u2681\\t\\u2682\\t\\u2683\\t\\u2684\\t\\u2685\" +\n \"\\nWelcome to the World Series of Craps!\\n\" +\n \"Please enter your name\");\n\n player.setName(in.nextLine());\n\n }\n catch(NoSuchElementException e){\n System.out.println(\"Exiting system, thank you for playing\");\n System.exit(0);\n }\n catch (Exception e) {\n e.printStackTrace();\n setExit(true);\n }\n System.out.println(\"Welcome \" + player.getName() + \"\\n\");\n }", "public void start() {\n\t\tinstruct();\n\t\tint pad1 = (26-player1.getName().length())/2;\n\t\tint pad2 = (26-player2.getName().length())/2;\n\t\tString heading = \" \".repeat(pad1) +\n\t\t\t\tplayer1.getName() +\n\t\t\t\t\" \".repeat(26 - player1.getName().length() - pad1) +\n\t\t\t\t\" \".repeat(pad2) +\n\t\t\t\tplayer2.getName() +\n\t\t\t\t'\\n';\n\n\t\tfor (int i = 0; i < rounds; i++) {\n\t\t\tString round = \"Round \"+(i+1);\n\t\t\tSystem.out.println(\" \".repeat(26-round.length()/2) + round + '\\n');\n\t\t\tint choice1 = getChoice(), choice2 = random.nextInt(3);\n\n\t\t\tSystem.out.println(heading);\n\t\t\tdraw(choice1, choice2);\n\t\t\tSystem.out.println('\\n'+remarks(choice1, choice2));\n\t\t\tSystem.out.printf(\"%s - %d\\t\\t%s - %d\\n\\n\", player1.getName(), player1.getPoints(), player2.getName(), player2.getPoints());\n\t\t\tif (!vsComputer) {\n\t\t\t\tSystem.out.print(\"Press enter to continue \");\n\t\t\t\tsc.nextLine();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Override\n\tpublic void moveExecStart(Counter player) {\n\n\t}", "public void goOnToNextQuestion(){\n\t\tbtnConfirmOrNext.setText(\"Next Question\");\n\t\tenableAllButtons();// need to be able to click to proceed\n\t\tquizAccuracy.setText(\": \"+spellList.getLvlAccuracy()+\"%\");\n\t\t// if user got answer correct move on immediately, else let user look at the correct answer first\n\t\tif(correctFlag){\n\t\t\t// set it to false initially for the next question\n\t\t\tcorrectFlag = false;\n\t\t\tbtnConfirmOrNext.doClick();\n\t\t}\n\n\t}", "void onClickNextTurn();", "private void displayPlayerMenu () {\n System.out.println();\n System.out.println(\"Player Selection Menu:\");\n System.out.println(\n \"Timid player...........\" + TIMID);\n System.out.println(\n \"Greedy player..........\" + GREEDY);\n System.out.println(\n \"Clever player..........\" + CLEVER);\n System.out.println(\n \"Interactive player.....\" + INTERACTIVE);\n }", "public static void displayMove(Move m, Fighter s)\n {\n if(m != Move.SWITCH)\n JOptionPane.showMessageDialog(null, \"The enemy has used \" + m.getName());\n else\n JOptionPane.showMessageDialog(null, \"Enemy has switched to\\n\" + s);\n }", "private String getPrompt(){\n return \"Now \" + (isWhiteTurn ? \"White\" : \"Black\");\n }", "public void playerFinishedGoNext() {\n\t\t// If game is over we don't want to switch turn.\n\t\tif (!isOver()) {\n\t\t\tswitchTurn();\n\t\t}\n\t}", "public void actionPerformed (ActionEvent e) {\n\t \t\tJOptionPane.showMessageDialog(frame3,\n\t \t\t\t \"Player 1 is blue \\n\"\n\t \t\t\t \t\t+ \"Player 2 is red \\n\"\n\t \t\t\t \t\t+ \"Player 3 is green \\n\"\n\t \t\t\t \t\t+ \"Player 4 is yellow \\n\"\n\t \t\t\t \t\t+ \"A Warrior's token is a circle. Range:1, Move:3\\n\"\n\t \t\t\t \t\t+ \"A Ranger's token is a square. Range:4, Move:5\\n\"\n\t \t\t\t \t\t+ \"A Rogue's token is a triangle. Range:1, Move:6\\n\"\n\t \t\t\t \t\t+ \"A healer's token is a star. Range:3, Move:4\\n\"\n\t \t\t\t \t\t+ \"A Damage Mage's token is a pentagon. Range:3, Move:4\\n\", \n\t \t\t\t \"Key\",\n\t \t\t\t JOptionPane.PLAIN_MESSAGE);\n\t \t}", "public void moveAccepted()\n {\n printOut(printerMaker.moveAccepted());\n }", "private static void displayPrompt() {\n System.out.println(\"This program converts a temperature in degrees Celsius into\");\n System.out.println(\"a temperature in degrees Fahrenheit. Enter a temperature in\");\n System.out.print(\"degrees Celsius: \");\n }", "private char playSingleGame() {\n this.resetGame();\n System.out.println(\"\\n---------- NEW GAME ----------\\n\");\n System.out.println(this);\n int turn = (int) (2 * Math.random());\n char res;\n do {\n Move move = this.players[turn].pickMove();\n if (move == null) {\n return 'Q';\n }\n this.executeMove(move, this.players[turn].getSymbol());\n System.out.println(this);\n if (turn == 0) { // changes turns from one player to the other\n turn = 1;\n } else turn = 0;\n res = this.getGameStatus();\n switch (res) {\n case 'O':\n res = 'C';\n break;\n case 'X':\n res = 'H';\n }\n } while (res == '?');\n return res;\n }", "private void printWelcomeMessage() {\r\n\t\tthis.printSeparator();\r\n\t\tSystem.out.println(\"-- Welcome to the JumpIN game --\\n\");\r\n\t\tSystem.out.println(\"Currently five levels are developed.\");\r\n\t\tSystem.out.println(\"Playing level 2\");\r\n\t\tSystem.out.println(\"To move a piece:\"); \r\n\t\tSystem.out.println(\"-Enter the piece's location\");\r\n\t\tSystem.out.println(\"-Wait for validation\");\r\n\t\tSystem.out.println(\"-Enter the location you want to move the piece to\\n\");\r\n\t\tthis.printSeparator();\r\n\t}", "@Override\r\n\tpublic void makeRandonMove() {\r\n\t\tif (randPlayer.getPlayerNumber() == game.getState().getTurn() && !game.getState().isFinished()) game.execute(randPlayer.requestAction(game.getState()));\r\n\t}", "private void showTurn()\n {\n if( PlayerOneTurn == true )\n {\n if( messageShown == false )\n {\n JOptionPane.showMessageDialog( null, playerOneName + \"it is your turn.\", \"for playerOne\", JOptionPane.PLAIN_MESSAGE );\n \n }\n }\n else\n {\n if( messageShown == false )\n {\n JOptionPane.showMessageDialog( null, playerTwoName + \"it is your turn.\", \"for playerTwo\", JOptionPane.PLAIN_MESSAGE );\n \n }\n }\n }", "public void play() {\n HashSet<Board> positionsPlayed = new HashSet<Board>();\n _board = new Board();\n\n while (true) {\n int playerInd = _board.turn().ordinal();\n Move next;\n if (_playing) {\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n continue;\n }\n if (_hasGUI) {\n if (_players[playerInd].type().equals(\"human\")) {\n if (_ready) {\n next = _nextMove;\n } else if (_readyCommand) {\n processCommand(_nextCommand);\n next = null;\n } else {\n continue;\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n assert !_playing || next != null;\n } else {\n if (_hasGUI) {\n System.out.print(\"\");\n if (_readyCommand) {\n processString(_nextCommand);\n }\n } else {\n getMove();\n }\n next = null;\n }\n if (next != null) {\n assert _board.isLegal(next);\n _board.makeMove(next);\n if (_players[playerInd].type().equals(\"machine\") && !_hasGUI) {\n System.out.println(_players[playerInd].side().abbrev().toUpperCase() + \"::\" + next.toString());\n if (_autoprint) {\n System.out.println(_board.toString2());\n }\n }\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n }\n }\n _ready = false;\n }\n }", "public Player nextMove() {\n\t\treturn null;\n\t\t\n\t}", "public void nextTurn()\n\t{\n\t\tthis.actionListToExecute.clear();\n\t\tthis.board.discardLastPlayedCard();\n\t\tthis.getCurrentPlayer().getDataInput().printMessage(this.getCurrentPlayerGameStatus());\n\t\tthis.getCurrentPlayer().execEndOfTurn();\n\t\t\n\t\tint nbPlayerCardPickup = this.getAmountOfPlayerCardToFillYourHand() - this.getCurrentPlayer().getPlayerCardDeck().size();\n\t\tfor(int i = 0; i < nbPlayerCardPickup; i++)\n\t\t{\n\t\t\tthis.getCurrentPlayer().getPlayerCardDeck().addCard(this.getNextPlayerCard());\n\t\t}\n\t\t\n\t\tcurrentPlayerID = (currentPlayerID + 1) % this.getPlayerList().size();\n\t\tif(currentPlayerID == 0)\n\t\t{\n\t\t\tcurrentPlayerID = this.getPlayerList().size();\n\t\t}\n\t\tthis.getCurrentPlayer().execBeginOfTurn();\n\t\tinitBeginOfTurn();\n\t}", "private void help() {\n System.out.println(\"PLACE X,Y,F #Placing the robot in (X,Y) facing F. \\n\" +\n \"\\tX and Y are numbers between 0 AND 5, F is NORTH, EAST, WEST, SOUTH directions\\n\" +\n \"MOVE #Move one position towards the current direction\\n\" +\n \"LEFT #Turn left\\n\" +\n \"RIGHT #Turn right\\n\" +\n \"REPORT #Prints current position and the direction\\n\" +\n \"HELP #Help menu\");\n }", "public void nextTurn() {\r\n activePlayer = nextPlayer;\r\n advanceNextPlayer();\r\n }", "public void requestMovePoseUp()\r\n {\r\n \tAnimatedSpriteEditor singleton = AnimatedSpriteEditor.getEditor();\r\n \tAnimatedSpriteEditorGUI gui = singleton.getGUI(); \r\n \t \r\n boolean continueToMove = true;\r\n if (!saved)\r\n {\r\n // THE USER CAN OPT OUT HERE\r\n continueToMove = promptToSave();\r\n }\r\n if(continueToMove)\r\n {\r\n \tposeIO.movePose(poseID, 0);\r\n \tsingleton.getFileManager().reloadSpriteType();\r\n \tsingleton.getGUI().updatePoseList();\r\n \tJOptionPane.showMessageDialog(\r\n gui,\r\n POSE_MOVED_TEXT,\r\n POSE_MOVED_TITLE_TEXT,\r\n JOptionPane.INFORMATION_MESSAGE);\r\n } \r\n }", "public String printNewUsernamePrompt() {\n return \"Please enter new username: \";\n }", "public void showNextQuestion() {\n currentQuiz++;\n gui.setUp();\n if (currentQuiz <= VocabularyQuizList.MAX_NUMBER_QUIZ) {\n showQuestion(currentQuiz);\n } else {\n result();\n }\n gui.getFrame().setVisible(true);\n }", "public void addMove() {\n\t\tmove = \"mv \" + posX + \" \" + posY;\n\t}", "public void nextPlayer() {\r\n if (currentPlayer == totalPlayer) {\r\n currentPlayer = 1;\r\n } else {\r\n currentPlayer++;\r\n }\r\n }", "public void play() \n { \n printWelcome();\n\n // Enter the main command loop. Here we repeatedly read commands and\n // execute them until the game is over.\n \n boolean finished = false;\n while (! finished) {\n Command command = parser.getCommand();\n finished = processCommand(command);\n if(currentRoom == win)\n {\n finished = true;\n }\n if (timer > 10)\n {\n currentRoom = fail;\n System.out.println(currentRoom.getLongDescription());\n finished = true;\n }\n }\n System.out.println(\"Thank you for playing. Good bye.\");\n }", "public abstract void printPromptMessage();", "public String advanceGame(){\n return (isAdvantage()) ? \"Advantage \" + getPlayerName() : \"Win for \" + getPlayerName();\n }", "public String move(String direction) {\r\n currentRoom = player.getCurrentRoom();\r\n String res;\r\n int moveTo = 0;\r\n while (!currentRoom.getMonsters().isEmpty()) {\r\n res = \"In your attempt to escape, a \" + currentRoom.getMonster(0).getName() + \" blocks your path\" + System.getProperty(\"line.separator\");\r\n return res;\r\n }\r\n switch (direction) {\r\n case \"north\":\r\n moveTo = currentRoom.getNorth();\r\n break;\r\n case \"south\":\r\n moveTo = currentRoom.getSouth();\r\n break;\r\n case \"east\":\r\n moveTo = currentRoom.getEast();\r\n break;\r\n case \"west\":\r\n moveTo = currentRoom.getWest();\r\n break;\r\n }\r\n if (moveTo > 0) {\r\n for (int i = 0; i < dungeon.size(); i++) {\r\n if (dungeon.getRoom(i).getId() == moveTo) {\r\n player.setCurrentRoom(dungeon.getRoom(i));\r\n res = System.lineSeparator();\r\n res += \"You go towards \" + direction + System.getProperty(\"line.separator\");\r\n res += System.lineSeparator();\r\n res += \"You enter \" + getCurrentRoom().getTitle() + System.getProperty(\"line.separator\");\r\n res += getCurrentRoom().getDescription() + System.getProperty(\"line.separator\");\r\n res += player.getCurrentRoom().getAvailableDirections();\r\n return res;\r\n }\r\n }\r\n\r\n }\r\n res = \"You walk into the wall.. AND IT HURTS!\" + System.getProperty(\"line.separator\");\r\n return res;\r\n }" ]
[ "0.70453066", "0.69903094", "0.682807", "0.6685021", "0.6621955", "0.6611249", "0.63251746", "0.61592686", "0.6158325", "0.61457646", "0.6095878", "0.60689974", "0.6068644", "0.60647947", "0.60510075", "0.6049253", "0.6039178", "0.6034848", "0.60299665", "0.60195297", "0.60135037", "0.60130304", "0.5999742", "0.59988326", "0.5987295", "0.5969168", "0.59454864", "0.59049296", "0.5852344", "0.5833233", "0.5824941", "0.58244115", "0.58238703", "0.58234775", "0.5820021", "0.58094686", "0.58054245", "0.5778476", "0.57595026", "0.57543075", "0.57430255", "0.57409656", "0.57405126", "0.5737857", "0.573671", "0.5733721", "0.5720316", "0.57185596", "0.5708831", "0.5707296", "0.5706942", "0.57038414", "0.5680851", "0.5680687", "0.56592417", "0.5657256", "0.5655408", "0.56517196", "0.56364065", "0.5635589", "0.56323093", "0.5627837", "0.56229764", "0.5614166", "0.56091803", "0.56072134", "0.5607197", "0.56021065", "0.5587771", "0.5583202", "0.558089", "0.5575925", "0.55756015", "0.5573734", "0.55718017", "0.55676734", "0.5566155", "0.556615", "0.55654114", "0.55647844", "0.5558858", "0.55513614", "0.5550132", "0.55441934", "0.55379105", "0.5535411", "0.5532399", "0.5532122", "0.55298984", "0.5523027", "0.5520558", "0.55165714", "0.5515687", "0.55079615", "0.55078006", "0.55063695", "0.55052", "0.5498774", "0.54980177", "0.5497559" ]
0.7885591
0
/ Display an error if input is invalid (see examples)
public void showInputError() { resultLabel.setText("Choose another space!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void invalid() {\r\n\t\tSystem.out.println(\"Please enter a valid input\");\r\n\t}", "public static String invalidInput() {\n return \"Invalid input!\";\n }", "public static void printErrorForInvalidCommand(String userInput) {\n System.out.println(\"Aw man! I am unable to \" + userInput + \" yet! Please specify a different function! :D\");\n }", "public static void userInputError(int input) //users inputs option that is out of bounds\n\t{\n\t\tSystem.out.println(\"ERROR: Selection Out Of Bounds! \\nOption \" + input + \" Does Not Exist\"); //error message\n\t\tSystem.out.println(\"Press 'Enter' To try Again\"); // prompt to try again\n\t}", "private void printErrorMenu() {\n System.out.println(\"Invalid input. Please check inputs and try again.\");\n }", "public static void notValidNumberErr(){\n printLine();\n System.out.println(\" Oops! Please enter a valid task number\");\n printLine();\n }", "public void InvalidFormat();", "public final void invalidInput() {\n\t\tout.println(\"Command not recognized. Please try again.\");\n\t}", "public void showError(String error);", "void showError(String errorMessage);", "private static void printErrorMessage() {\n System.out.println(\"Oh no! It looks like I wasn't able to understand the arguments you passed in :(\"\n + \"\\nI can only handle arguments passed in a format like the following: 1/2 * 3/4\\n\");\n }", "void showError(String message);", "void showError(String message);", "private static void exitAsInvalidInput() {\n\t\tSystem.out.println(\n\t\t\t\t\"You have entered invalid input. Exiting the system now.\");\n\t\tSystem.exit(0);\n\t}", "public void showError(String errorMessage);", "public void showBadInputMessage() {\n\t\tJOptionPane.showMessageDialog(frame, \"Vänligen skriv siffror mellan 1 och \" + size);\n\t}", "void showErrorMsg(String string);", "public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}", "public void validationErr()\r\n\t{\n\t\tSystem.out.println(\"validation err\");\r\n\t}", "private int errorCheckingInt(String display) {\n\n\t\tint tempChoice;\n\t\tScanner input = new Scanner(System.in);\n\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"\\n\" + display);\n\t\t\ttry {\n\t\t\t\ttempChoice = input.nextInt();\n\t\t\t\tif(display.equals(\"Enter number of kids: \")) { //only for kids\n\t\t\t\t\tif(tempChoice < 0)\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\t}\n\t\t\t\telse if (tempChoice < 1)\n\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\tbreak;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Error input \\n\");\n\t\t\t\tinput.next();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t}\n\n\t\tinput.nextLine();\n\n\t\treturn tempChoice;\n\t}", "private String getGUIErrorMsg(long errorcode) {\n\t\tif (errorcode == 0) {\n\t\t\treturn \"This popup shouldn't have launched!\";\n\t\t} else if (errorcode == 9) {\n\t\t\treturn \"Latitude input format incorrect!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 10) {\n\t\t\treturn \"Longitude input format incorrect!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 11) {\n\t\t\treturn \"Date input format incorrect!\\nValid dates go <year>-<month>-<day>\\nValid month values are 1- 12 and valid day values are 1 - 31.\";\n\t\t} else if (errorcode == 12) {\n\t\t\treturn \"Time input format incorrect!\\nValid times go <hour>-<minute>-<second>\\nValid hour values are 0 - 23 and valid minute and second values are 0 - 59\";\n\t\t} else if (errorcode == 1) {\n\t\t\treturn \"Invalid latitude!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 2) {\n\t\t\treturn \"Invalid Longitude!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 3) {\n\t\t\treturn \"Invalid Year!\\nValid year values are \" + Integer.MIN_VALUE + \" - \" + Integer.MAX_VALUE + \".\";\n\t\t} else if (errorcode == 4) {\n\t\t\treturn \"Invalid Month!\\nValid month values are 1 - 12\";\n\t\t} else if (errorcode == 5) {\n\t\t\treturn \"Invalid Day!\\nValid day values are 1 - 31\";\n\t\t} else if (errorcode == 6) {\n\t\t\treturn \"Invalid Hour!\\nValid hour values are 0 - 23\";\n\t\t} else if (errorcode == 7) {\n\t\t\treturn \"Invalid Minute!\\nValid minute values are 0 - 59\";\n\t\t} else if (errorcode == 8) {\n\t\t\treturn \"Invalid Second!\\nValid second values are 0 - 59\";\n\t\t} \n\t\treturn \"Undefined Error Message!\";\n\t}", "void showAlertForInvalidNumber();", "public void printErrorParse() {\n\t\tSystem.out.println(ConsoleColors.RED + \"Invalid option. Please re-enter a valid option.\" + ConsoleColors.RESET);\n\t\t\n\t}", "public void correctErrors();", "protected void validateInput()\r\n\t{\r\n\t\tString errorMessage = null;\r\n\t\tif ( validator != null ) {\r\n\t\t\terrorMessage = validator.isValid(text.getText());\r\n\t\t}\r\n\t\t// Bug 16256: important not to treat \"\" (blank error) the same as null\r\n\t\t// (no error)\r\n\t\tsetErrorMessage(errorMessage);\r\n\t}", "public void error();", "void errorBox(String title, String message);", "private static boolean isBadInput(String s) {\n\t\tString[] split = s.split(\"\\\\s+\");\n\t\tif (split.length != 3) {\n\t\t\tSystem.err.printf(\"Unknow length: %d\\n\", split.length);\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tInteger.parseInt(split[0]);\n\t\t\tInteger.parseInt(split[2]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.err.printf(\"Input numbers only.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (split[1].length() != 1) {\n\t\t\tSystem.err.printf(\"Operator should be one character.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "void displayErrorMessage(String message);", "public static boolean printErrorMessage() {\n System.out.println(\"Error: Invalid URL entered\");\n return true;\n }", "public String checkFormat() {\r\n\t\t\r\n\t\tString msg = null;\r\n\t\t\r\n\t\ttry {\t\t\t\t\t\t\t\t\t\t\t//input is not a number\r\n\t\t\t\r\n\t\t\tDouble.parseDouble(price.getText());\r\n\t\t\tInteger.parseInt(quantity.getText());\r\n\t\t\t \r\n\t\t}\r\n\t\t\r\n\t\tcatch(Exception e) {\r\n\t\t\t\r\n\t\t\treturn msg = \"Data format is invalid\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(name.getText().isEmpty() \t\t\t\t\t//wine name is empty\r\n\t\t\t\t|| name.getText().length() > 30\t\t\t//wine name is more than 30 letters\r\n\t\t\t\t\t|| quantity.getText().isEmpty()\t\t//quantity is empty\r\n\t\t\t\t\t\t||price.getText().isEmpty()\t\t//price is empty\r\n\t\t\t\t\t\t\t||((!(price.getText().length() - price.getText().indexOf('.') == 3))\t//price is not two decimal spaces \r\n\t\t\t\t\t\t\t\t\t&& price.getText().indexOf('.') != -1))\r\n\t\t{\r\n\t\t\t\r\n\t\t\tmsg = \"Data format is invalid\";\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tmsg = null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn msg;\r\n\t\t\r\n\t}", "private boolean isInputValid() {\n return true;\n }", "String getErrorMessage(E input);", "abstract void error(String error);", "void invalid() {\n\t\tSystem.out.println(\"falsche Eingabe...\");\n\t}", "public ParseResult failure (Object input) {\n return failure(input, 1);\n }", "protected abstract void error(String err);", "private void error(String string) {\n\t\r\n}", "private void checkUserInput() {\n }", "private static Boolean errorCheck(String Buffer){\n if(Buffer.matches(\"Y\")) return true;\n if(Buffer.matches(\"N\")) return false;\n screenClear(); //Clears the screen and applies an error message.\n return moreInput(); //Recursive repeat upon error.\n }", "protected abstract boolean isInputValid();", "private int errorCheckingInt(String display, int lastItem) {\n\t\tint index;\n\t\tScanner input = new Scanner(System.in);\n\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"\\n\" + display);\n\t\t\ttry {\n\t\t\t\tindex = input.nextInt();\n\t\t\t\tif (index < 1 || index > lastItem)\n\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\tbreak;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Error input\\n\");\n\t\t\t\tinput.next();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t}\n\n\t\tinput.nextLine();\n\n\t\treturn index;\n\t}", "void drawError(String message);", "public static void error()\r\n {\r\n valid=false;\r\n\r\n }", "private void correctError()\r\n\t{\r\n\t\t\r\n\t}", "private void errorCheck( Token token, String kind ) {\n if( ! token.isKind( kind ) ) {\n System.out.println(\"Error: expected \" + token + \" to be of kind \" + kind );\n System.exit(1);\n }\n }", "void printError(String errorMsg, boolean displayHelp);", "private static double checkInput(String input) {\n\t\tdouble parsedValue = 0;\n\t\ttry {\n\t\t\tparsedValue = Double.parseDouble(input);\n\t\t} catch (NumberFormatException parseFailed) {\n\t\t\tSystem.out.println(\"'\" + input + \"' se ne može protumačiti kao broj.\");\n\t\t\treturn ERROR;\n\t\t}\n\n\t\tif (parsedValue > 0) {\n\t\t\treturn parsedValue;\n\t\t} else if (parsedValue < 0) {\n\t\t\tSystem.out.println(\"Unijeli ste negativnu vrijednost.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Ne postoji pravokutnik sa stranicom duljine nula.\");\n\t\t}\n\t\treturn ERROR;\n\t}", "public void checkInput(TextField number) {\r\n\t\ttry {\r\n\t\t\tlong num = Long.parseLong(number.getText());\r\n\t\t\tif (num < 0) \t\t\t\t\t// ako je negativan broj, pretvorit cemo ga u pozitivan\r\n\t\t\t\tnum = Math.abs(num);\r\n\t\t\tif (isValid(num)) \r\n\t\t\t\tscene2();\r\n\t\t}\r\n\t\tcatch (Exception e) {\t\t\t\t// hvatanje greske\r\n\t\t\talert(\"Wrong input, try again!\");\r\n\t\t}\r\n\t}", "private boolean checkForWrongInput(){\n if(this.studentCode.getText().isEmpty())\n return true;\n //Check for length\n if(this.studentCode.getText().length() != 3)\n return true;\n //Check for invalid characters\n for(char c: this.studentCode.getText().toCharArray())\n if(!Character.isDigit(c))\n return true;\n\n return false;\n }", "private boolean isInputValid() {\r\n String errorMessage = \"\";\r\n\r\n if (errorMessage.length() == 0) {\r\n return true;\r\n } else {\r\n// Show the error message.\r\n Dialogs.create()\r\n .title(\"Invalid Fields\")\r\n .masthead(\"Please correct invalid fields\")\r\n .message(errorMessage)\r\n .showError();\r\n return false;\r\n }\r\n }", "public static String checkStringFormat(String str, String error, String format) {\r\n while (true) {\r\n System.out.print(str);\r\n inputValue = sc.nextLine().trim();//trim to let input only string (After blankspace doesn't count)\r\n if (inputValue.isEmpty() || inputValue.matches(format) == false) {//check if inputed value is empty or match the right format.\r\n System.out.println(error);\r\n } else {\r\n break; // if correct formated, exit loop\r\n }\r\n }\r\n return inputValue;\r\n }", "public void error(String message);", "boolean hasErrormessage();", "private boolean isInputValid() {\r\n String errorMessage = \"\";\r\n\r\n if (nameField.getText() == null || nameField.getText().length() == 0) {\r\n errorMessage += \"请输入直播名!\\n\";\r\n }\r\n if (urlField.getText() == null || urlField.getText().length() == 0) {\r\n errorMessage += \"请输入直播流!\\n\";\r\n }\r\n\r\n if (errorMessage.length() == 0) {\r\n return true;\r\n } else {\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"输入错误\");\r\n alert.setContentText(errorMessage);\r\n return false;\r\n }\r\n }", "protected abstract int isValidInput();", "private void checkInput(String input)throws Exception{\n\n if (input.getBytes(\"UTF-8\").length > 255){\n throw new IOException(\"Message too long\");\n\n }\n try {\n if (Integer.parseInt(input) < 0 || Integer.parseInt(input) > 65535) {\n throw new IOException(\"Port not valid\");\n }\n }catch (NumberFormatException e){\n //nothing should happen\n }\n }", "public abstract void showErrorBox(Throwable error);", "public String error();", "private void inputValidation(String[] args) {\r\n\t\t// Must have two argument inputs - grammar and sample input\r\n\t\tif (args.length != 2) {\r\n\t\t\tSystem.out.println(\"Invalid parameters. Try:\\njava Main <path/to/grammar> <path/to/input>\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "private void errorCheck(String nonterminal, int number) {\r\n if (nonterminal == null || !isNonTerminal(nonterminal) || number < 0) {\r\n throw new IllegalArgumentException();\r\n }\r\n }", "public static void printIndexInputNotDetectedError() {\n botSpeak(Message.INDEX_INPUT_NOT_DETECTED_ERROR);\n }", "@Nullable\n/* */ protected String getFailedValidationText(@NotNull ConversationContext context, @NotNull String invalidInput) {\n/* 57 */ if (NumberUtils.isNumber(invalidInput)) {\n/* 58 */ return getFailedValidationText(context, NumberUtils.createNumber(invalidInput));\n/* */ }\n/* 60 */ return getInputNotNumericText(context, invalidInput);\n/* */ }", "private void validateInputParameters(){\n\n }", "@Test\n public void parse_invalidValues_failure() {\n assertParseFailure(parser, \"1 2 3\", String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n String.format(MESSAGE_TOO_MANY_ARGUMENTS,\n VendorCommand.COMMAND_WORD, 1, SwitchVendorCommand.MESSAGE_USAGE)));\n\n // Index passed is not a non-zero integer\n assertParseFailure(parser, \"1.4\", String.format(MESSAGE_INVALID_INDEX, \"Vendor Index\"));\n }", "abstract void consoleError(String error);", "private boolean isInputValid() {\n\t\tString errorMessage = \"\";\n\t\t\n\t\tif (dateField.getText() == null || dateField.getText().length() == 0) {\n\t\t\terrorMessage += \"Kein gültiges Datum!\\n\";\n\t\t} else {\n\t\t\tif (!DateUtil.validDate(dateField.getText())) {\n\t\t\t\terrorMessage += \"Kein gültiges Datum. Benutze das dd.mm.yyy Format!\\n\";\n\t\t\t}\n\t\t}\n\t\tString categoryFieldSelection = categoryField.getSelectionModel().getSelectedItem();\n\t\tif (categoryFieldSelection.isEmpty() || categoryFieldSelection.length() == 0) {\n\t\t\terrorMessage += \"Keine gültige Kategorie!\\n\";\n\t\t}\n\t\tif (useField.getText() == null || useField.getText().length() == 0) {\n\t\t\terrorMessage += \"Kein gültiger Verwendungszweck!\\n\";\n\t\t}\n\t\tif (amountField.getText() == null || amountField.getText().length() == 0) {\n\t\t\terrorMessage += \"Kein gültiger Betrag!\\n\";\n\t\t} \n\t\t/**else {\n\t\t\t// try to parse the amount into a double\n\t\t\ttry {\n\t\t\t\tDouble.parseDouble(amountField.getText());\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\terrorMessage += \"Kein zulässiger Betrag! (Nur Dezimalzahlen erlaubt)\\n\";\n\t\t\t}\n\t\t}**/\n\t\tif (distributionKindField.getText() == null || distributionKindField.getText().length() == 0) {\n\t\t\terrorMessage += \"Keine gültige Ausgabeart!\\n\";\n\t\t}\n\n\t\tif (errorMessage.length() == 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// Show the error message.\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\talert.initOwner(dialogStage);\n\t\t\talert.setTitle(\"Ungültige Eingaben\");\n\t\t\talert.setHeaderText(\"Bitte korrigieren Sie die Fehler in den Feldern.\");\n\t\t\talert.setContentText(errorMessage);\n\t\t\talert.showAndWait();\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "public void exibeDataNascimentoInvalida() {\n JOptionPane.showMessageDialog(\n null,\n Constantes.GERENCIAR_FUNCIONARIO_DATA_NASCIMENTO_INVALIDA,\n Constantes.GERENCIAR_FUNCIONARIO_TITULO,\n JOptionPane.PLAIN_MESSAGE\n );\n }", "public InvalidInputException(String code) {\n super(\"Invalid Input : \" + code);\n }", "public static void isInputValid(String errorMessage){\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(errorMessage);\r\n\t\talert.showAndWait();\r\n\t}", "public void error(String string) {\n\t\t\n\t}", "@Test\n\t// exception for when user inputs negative number\n\tpublic void testHappy_throwsException_incorrectNumber() {\n\n\t\tAssertions.assertThrows(InputMismatchException.class, () -> {\n//\t ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n//\t System.setErr(new PrintStream(outputStream));\n\n\t\t\tByteArrayInputStream in = new ByteArrayInputStream(\"happy\\ntest\\n\".getBytes());\n\t\t\tSystem.setIn(in);\n\n\t\t\tMovie movie = new Movie();\n\t\t\tmovie.Play();\n\t\t});\n\t}", "String errorMessage();", "private void checkRuntimeFail(String filename, int... input){\n\t\tString inputString = createInput(input);\n\t\t\n\t\tProgram prog;\n\t\tSimulator sim = null;\n\t\tMachine vm = null;\n\t\tPipedInputStream in = null;\n\t\ttry {\n\t\t\tprog = compiler.compile(new File(BASE_DIR, filename + EXT));\n\t\t\tvm = new Machine();\n\t\t\tsim = new Simulator(prog, vm);\n\t\t\tvm.clear();\n\t\t\tsim.setIn(new ByteArrayInputStream(inputString.getBytes()));\n\t\t\tin = new PipedInputStream();\n\t\t\tOutputStream out;\n\t\t\tout = new PipedOutputStream(in);\n\t\t\tsim.setOut(out);\n\t\t} catch (ParseException e) {fail(filename + \" did not generate\");\n\t\t} catch (IOException e) {\tfail(filename + \" did not generate\");}\n\t\t\n\t\ttry{\n\t\t\tsim.run();\n\t\t\tString output = \"\";\n\t\t\tint max = in.available();\n\t\t\tfor(int index = 0; index < max; index++)\n\t\t\t\toutput += (char)in.read();\n\t\t\t/** Check whether there was an error outputted. */\n\t\t\tif(!output.toLowerCase().contains(\"error: \"))\n\t\t\t\tfail(filename + \" shouldn't check but did\");\n\t\t} catch (Exception e) {\n\t\t\t// this is the expected behaviour\n\t\t}\n\t}", "public static int checkInput() {\r\n\t\tint num = 0;\r\n\t\tboolean error = true; // check for error\r\n\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\t// input has to be an integer and not negative number\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0)\r\n\t\t\t\t\tthrow new InputMismatchException();\r\n\t\t\t\terror = false;\r\n\r\n\t\t\t} catch (InputMismatchException e) {\r\n\r\n\t\t\t\tSystem.out.print(\"Wrong input, try again...: \");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t\t// loop continue while there is an error\r\n\t\t} while (error);\r\n\r\n\t\treturn num;\r\n\t}", "public void error(ValidationType type, String validationName, String content);", "private void ImproperFillOutException() {\n JOptionPane.showMessageDialog(null, \"Fill out the form properly\");\n }", "public void onError(String cadena) {\r\n\t\tJOptionPane.showMessageDialog(null, cadena, \"Movimiento invalido\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\r\n\t}", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify at least one component\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "public void usageError(String msg) {\n System.err.println(\"Usage error: \" + msg + \"\\n\");\n printUsage(System.err);\n System.exit(1);\n }", "void notSupported(String errorcode);", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (commentField.getText() == null || commentField.getText().length() == 0) {\n errorMessage += \"Не введен комментарий!\\n\";\n }\n if (timeField.getText() == null || timeField.getText().length() == 0) {\n errorMessage += \"Не введено время выполнения задачи!\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Не введены все данные!\");\n alert.setHeaderText(null);\n alert.setContentText(\"Пожалуйста, введите все данные!\");\n alert.showAndWait();\n return false;\n }\n }", "@Test(priority=5)\n\tpublic void validatePleaseEnterTheValueErrorMsg1()\n\t{\n\t\tc.addButton.click();\n\t\tAssert.assertTrue(c.msg.getText().equalsIgnoreCase(\"Please Enter A Value.\"));\n\t}", "private boolean isInputValid() {\r\n String errorMessage = \"\";\r\n\r\n if (idLabel.getText() == null || idLabel.getText().length() == 0) {\r\n errorMessage += \"No valid ID number!\\n\"; \r\n } else {\r\n // try to parse the postal code into an int.\r\n try {\r\n Integer.parseInt(idLabel.getText());\r\n } catch (NumberFormatException e) {\r\n errorMessage += \"No valid ID number (must be an integer)!\\n\"; \r\n }\r\n }\r\n \r\n if (firstNameField.getText() == null || firstNameField.getText().length() == 0) {\r\n errorMessage += \"No valid first name!\\n\"; \r\n }\r\n if (lastNameField.getText() == null || lastNameField.getText().length() == 0) {\r\n errorMessage += \"No valid last name!\\n\"; \r\n }\r\n if (industryField.getText() == null || industryField.getText().length() == 0) {\r\n errorMessage += \"No valid industry!\\n\"; \r\n }\r\n\r\n if (workTypeField.getText() == null || workTypeField.getText().length() == 0) {\r\n errorMessage += \"No valid work type!\\n\"; \r\n }\r\n\r\n if (addressField.getText() == null || addressField.getText().length() == 0) {\r\n errorMessage += \"No valid address!\\n\";\r\n }\r\n\r\n if (errorMessage.length() == 0) {\r\n return true;\r\n } else {\r\n // Show the error message.\r\n Alert alert = new Alert(AlertType.ERROR);\r\n alert.initOwner(dialogStage);\r\n alert.setTitle(\"Invalid Fields\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.setContentText(errorMessage);\r\n\r\n alert.showAndWait();\r\n\r\n return false;\r\n }\r\n }", "@Override\n public void showError() {\n }", "private boolean noErrors(String semester, String year) {\n \n //check that semester and year contain valid input\n if (Semester.isSemesterCode(year + semester)) {\n \n return true;\n }\n else {\n \n JOptionPane.showMessageDialog(null, \"Either your year or semester input is invalid, please re-enter it and try again\", \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n \n return false;\n }", "public static void handleInvalidCommandException() {\n System.out.println(\"\\tSorry sir, I do not recognise this command.\");\n Help.execute();\n Duke.jarvis.printDivider();\n }", "private void displayDuplicateInputError(){\n\t\tAlert alert = new Alert(Alert.AlertType.INFORMATION);\n\t\talert.setTitle(\"Duplicate Letter Dialog\");\n\t\talert.setHeaderText(\"Pay Attention!\");\n\t\talert.setContentText(\"You have already tried that letter, please try again\");\n\t\talert.showAndWait();\n\t}", "public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "private void errorCheck( Token token, String kind, String details ) {\n if( ! token.isKind( kind ) || ! token.getDetails().equals( details ) ) {\n System.out.println(\"Error: expected \" + token + \" to be kind=\" + kind + \" and details=\" + details );\n System.exit(1);\n }\n }", "java.lang.String getError();", "java.lang.String getError();", "java.lang.String getError();", "private boolean validateUserInputs() {\n ArrayList<String> errors = new ArrayList();\n \n if (this.view.getContent().equals(\"\")) {\n errors.add(\"\\t - Enter a comment\");\n }\n \n if (errors.size() > 0) {\n String errorMsg = \"Unable to save new Asset.\\nDetails:\";\n for (String error : errors) {\n errorMsg += \"\\n\" + error;\n }\n JOptionPane.showMessageDialog(this.view, errorMsg, \"Unable to Save\", JOptionPane.INFORMATION_MESSAGE);\n return false;\n }\n return true;\n }", "public void invalidClubs() {\r\n\t\tJOptionPane.showMessageDialog(null,\r\n\t\t\t\t\"A club can not play against itself\");\r\n\t}", "public static void printDateTimeErr() {\n printLine();\n System.out.println(\" Oops! Please enter your date in the yyyy-mm-dd format\\n\");\n printLine();\n }", "private String addressError(Address addr, int cause){\n\n \tif(cause == DirectionsFinder.ADDRESS_VALID){\n \t\treturn \"Should not have thrown error for \"+addr+\"\\n\";\n \t}else if(cause == DirectionsFinder.ADDRESS_ZIPCODE_INVALID){\n\t\t\treturn \"No such zipcode: \"+addr+\"\\n\";\n\t\t}else if(cause == DirectionsFinder.ADDRESS_STREET_INVALID){\n\t\t\treturn \"No such street: \"+addr+\"\\n\";\n\t\t}else if(cause == DirectionsFinder.ADDRESS_NUM_INVALID){\n\t\t\treturn \"No such number: \"+addr+\"\\n\";\n\t\t}else if(cause == DirectionsFinder.ADDRESS_NULL){\n\t\t\treturn \"Address \"+addr+\" was not entered in the correct format.\\nEnter \" +\n\t\t\t\t\t\"the address number, the street name, then a 5 \" +\n\t\t\t\t\t\"digit zipcode...\\n\";\n\t\t}else{ // address is null\n\t\t\treturn \"Complete your address selection...\\n\";\n\t\t}\n }" ]
[ "0.7695867", "0.74156547", "0.7179793", "0.7164079", "0.7048511", "0.6959371", "0.69351494", "0.6901", "0.68647707", "0.6857352", "0.68289316", "0.6816304", "0.6816304", "0.6750743", "0.6691428", "0.6662059", "0.6635057", "0.6634648", "0.66161567", "0.6592291", "0.6591387", "0.65413654", "0.65386623", "0.65314066", "0.65096664", "0.65081483", "0.6506326", "0.64862555", "0.6481758", "0.64617383", "0.6449704", "0.6444905", "0.6444443", "0.6402816", "0.6400737", "0.6361667", "0.6326878", "0.6308647", "0.63055694", "0.6299503", "0.6293658", "0.627571", "0.6265235", "0.6252296", "0.6252247", "0.62437737", "0.6241583", "0.62349725", "0.62210995", "0.6189828", "0.61565304", "0.61526984", "0.61522615", "0.6146927", "0.6129556", "0.61218584", "0.61188966", "0.6111151", "0.61097693", "0.61059", "0.60995734", "0.60898876", "0.6085975", "0.60827506", "0.607944", "0.60792875", "0.607401", "0.6071908", "0.60550225", "0.6048099", "0.60329443", "0.6026566", "0.60263926", "0.6024731", "0.6024021", "0.60234404", "0.6014464", "0.60079575", "0.6005806", "0.6003527", "0.59999955", "0.5996429", "0.5990645", "0.5987614", "0.5982122", "0.5972725", "0.596963", "0.5968897", "0.5961464", "0.5954731", "0.5952023", "0.59485865", "0.5942885", "0.5935661", "0.5935661", "0.5935661", "0.5932255", "0.5929692", "0.5926388", "0.59246325" ]
0.6968151
5
Creates new form PantallaPrincipalEnfermeria
public PantallaPrincipalEnfermeria(Usuario usuario) { initComponents(); this.setResizable(false); Image icon = new ImageIcon(getClass().getResource("/Vistas/imagenes/pinaricono.jpg")).getImage(); setIconImage(icon); this.usuario = usuario; controladorEventos = new ControladorCalendario(); personal = usuario.getPersonal(); controlador = new ControladorConsultarSugerencia(); this.setLocationRelativeTo(null); textodeBienvenida2.setText("Bienvenido " + usuario.getPersonal().getNombre() + " " + usuario.getPersonal().getApellido() + " Al area " + usuario.getPersonal().getArea().getNombreArea()); start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PantallaPrincipal() {\n initComponents();\n }", "public frm_tutor_subida_prueba() {\n }", "public frmPrincipal() {\n initComponents(); \n inicializar();\n \n }", "public VentanaPrincipal() {\n initComponents();\n\n idUsuariosControlador = Fabrica.getInstance().getControladorUsuarios(null).getId();\n idProductosControlador = Fabrica.getInstance().getControladorProductos(null).getId();\n idOrdenesControlador = Fabrica.getInstance().getControladorOrdenes(null).getId();\n controlarUsuario = Fabrica.getInstance().getControladorUsuarios(idUsuariosControlador);\n controlarProducto = Fabrica.getInstance().getControladorProductos(idProductosControlador);\n controlarOrden = Fabrica.getInstance().getControladorOrdenes(idOrdenesControlador);\n }", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "public VentanaPrincipal() {\n initComponents();\n editar = false;\n }", "public PantallaPrincipal() {\n gestor= new Gestor();\n initComponents();\n inicializarTablaCarreras();\n inicializarTablaCorredorTotales();\n inicializarTablaCorredor();\n mostrarCarreras();\n mostrarCorredoresTotales();\n \n \n }", "public creacionempresa() {\n initComponents();\n mostrardatos();\n }", "public VentanaPrincipal() {\n initComponents();\n menuTelefono.setVisible(false);\n menuItemCerrarSesion.setVisible(false);\n controladorUsuario = new ControladorUsuario();\n\n ventanaRegistrarUsuario = new VentanaRegistrarUsuario(controladorUsuario);\n ventanaBuscarUsuarios = new VentanaBuscarUsuarios(controladorUsuario, controladorTelefono);\n \n }", "public TelaPrincipal() {\n initComponents();\n Consultorio.Instance().efetuaBalanco(false);\n setSize(1029,764);\n }", "public abstract Anuncio creaAnuncioIndividualizado();", "public VentanaPrincipal() throws IOException {\n initComponents();\n buscador = new Busqueda();\n }", "public VentaPrincipal() {\n initComponents();\n }", "public Principal() {\n initComponents();\n Desabilitar();\n ChoicePro.add(\"\");\n ChoicePro.add(\"Guerrero\");\n ChoicePro.add(\"Mago\");\n ChoicePro.add(\"Arquero\");\n Llenar();\n\n }", "public void createAgendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.createTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento cadastrado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado cadastro do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n }", "public VistaCrearPedidoAbonado() {\n initComponents();\n errorLabel.setVisible(false);\n controlador = new CtrlVistaCrearPedidoAbonado(this);\n }", "@RequestMapping(value=\"/formpaciente\")\r\n\tpublic String crearPaciente(Map<String, Object> model) {\t\t\r\n\t\t\r\n\t\tPaciente paciente = new Paciente();\r\n\t\tmodel.put(\"paciente\", paciente);\r\n\t\tmodel.put(\"obrasociales\",obraSocialService.findAll());\r\n\t\t//model.put(\"obrasPlanesForm\", new ObrasPlanesForm());\r\n\t\t//model.put(\"planes\", planService.findAll());\r\n\t\tmodel.put(\"titulo\", \"Formulario de Alta de Paciente\");\r\n\t\t\r\n\t\treturn \"formpaciente\";\r\n\t}", "public VentanaPrincipal(Controlador main) {\n controlador = main;\n initComponents();\n }", "@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}", "public void SalvarNovaPessoa(){\r\n \r\n\t\tpessoaModel.setUsuarioModel(this.usuarioController.GetUsuarioSession());\r\n \r\n\t\t//INFORMANDO QUE O CADASTRO FOI VIA INPUT\r\n\t\tpessoaModel.setOrigemCadastro(\"I\");\r\n \r\n\t\tpessoaRepository.SalvarNovoRegistro(this.pessoaModel);\r\n \r\n\t\tthis.pessoaModel = null;\r\n \r\n\t\tUteis.MensagemInfo(\"Registro cadastrado com sucesso\");\r\n \r\n\t}", "public ControladorPrueba() {\r\n }", "public void crearEntidad() throws EntidadNotFoundException {\r\n\t\tif (validarCampos(getNewEntidad())) {\r\n\t\t\tif (validarNomNitRepetidoEntidad(getNewEntidad())) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null,\r\n\t\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN, \"Advertencia: \", \"Nombre, Nit o Prejifo ya existe en GIA\"));\r\n\t\t\t} else {\r\n\t\t\t\tif (entidadController.crearEntidad(getNewEntidad())) {\r\n\t\t\t\t\tmensajeGrow(\"Entidad Creada Satisfactoriamente\", getNewEntidad());\r\n\t\t\t\t\tRequestContext.getCurrentInstance().execute(\"PF('entCrearDialog').hide()\");\r\n\t\t\t\t\tsetNewEntidad(new EntidadDTO());\r\n\t\t\t\t\tresetCodigoBUA();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmensajeGrow(\"Entidad No Fue Creada\", getNewEntidad());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlistarEntidades();\r\n\t\t\t// newEntidad = new EntidadDTO();\r\n\t\t\t// fechaActual();\r\n\t\t}\r\n\r\n\t}", "@RequestMapping(value = \"/create\", method = RequestMethod.POST)\n public ModelAndView create(@RequestParam(\"horasalida\") Date horasalida,@RequestParam(\"horallegada\") Date horallegada,@RequestParam(\"aeropuerto_idaeropuerto\") Long aeropuerto_idaeropuerto,\n \t\t@RequestParam(\"aeropuerto_idaeropuerto2\") Long aeropuerto_idaeropuerto2,@RequestParam(\"avion_idavion\") Long avion_idavion) {\n Vuelo post=new Vuelo();\n post.setHorallegada(horallegada);\n post.setHorasalida(horasalida);\n\t\t\n post.setAeropuerto_idaeropuerto(aeropuerto_idaeropuerto);\n post.setAeropuerto_idaeropuerto2(aeropuerto_idaeropuerto2);\n post.setAvion_idavion(avion_idavion);\n repository.save(post);\n return new ModelAndView(\"redirect:/vuelos\");\n }", "@RequestMapping(method = RequestMethod.POST, value = {\"\",\"/\"})\r\n\tpublic ResponseEntity<FormularioDTO> add(@RequestBody @Valid Formulario formulario) throws AuthenticationException {\r\n\t\tformulario.setInstituicao(new Instituicao(authService.getDados().getInstituicaoId()));\r\n\t\treturn new ResponseEntity<>(formularioService.create(formulario), HttpStatus.CREATED);\r\n\t}", "public void CrearNew(ActionEvent e) {\n List<Pensum> R = ejbFacade.existePensumID(super.getSelected().getIdpensum());\n if(R.isEmpty()){\n super.saveNew(e);\n }else{\n new Auxiliares().setMsj(3,\"PENSUM ID YA EXISTE\");\n }\n }", "public SalidaCajaForm() {\n\t\tinicializarComponentes();\n }", "public Principal() {\n initComponents();\n ab = new adminbarra(pg_Ordenes);\n }", "public JanelaPrincipal() {\n initComponents();\n }", "public FormPrincipal(String privilegio) {\r\n\r\n initComponents();\r\n// jTextFieldPreco.setText(\"0.0\");\r\n// System.out.println(Float.valueOf(\"\"));\r\n if (privilegio.equals(\"administrador\") == false) {\r\n jButtonNovoUsuario.setEnabled(false);\r\n jButtonRemover.setEnabled(false);\r\n\r\n }\r\n atualizarLinhas();\r\n\r\n }", "public VentanaPrincipal() {\n\t\tinitComponents();\n\t\tthis.setLocationRelativeTo(this);\n\t\ttry {\n\t\t\tcontroladorCliente = new ControladorVentanaCliente();\n\t\t\tcargarFranquicia();\n\t\t\tcargarTipoTransacion();\n\t\t\ttipoCompra();\n\t\t} catch (NamingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "protected void creaPagine() {\n Pagina pag;\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* crea la pagina e aggiunge campi e pannelli */\n pag = this.addPagina(\"generale\");\n\n pan = PannelloFactory.orizzontale(this);\n pan.add(Cam.data);\n pan.add(Cam.importo.get());\n pan.add(Cam.note.get());\n pag.add(pan);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public TelaPrincipal() {\r\n initComponents();\r\n con.conecta();\r\n }", "public void crearPersonaje(ActionEvent event) {\r\n\r\n\t\tthis.personaje.setAspecto(url);\r\n\r\n\t\tDatabaseOperaciones.guardarPersonaje(stats, personaje);\r\n\r\n\t\tvisualizaPersonajes();\r\n\t}", "public abstract Anuncio creaAnuncioTematico();", "Compuesta createCompuesta();", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "public formPrincipal() {\n initComponents();\n }", "public void postularse() {\n\t\t\n\t\ttry {\t\t\t\n\n\t\t\tPostulante postulante= new Postulante();\n\t\t\tpostulante.setLegajo(Integer.valueOf(this.txtLegajo.getText()));\n\t\t\tpostulante.setFamiliaresACargo(Integer.valueOf(this.txtFamiliaresACargo.getText()));\n\t\t\tpostulante.setNombre(txtNombre.getText());\n\t\t\tpostulante.setApellido(txtApellido.getText());\n\t\t\t//postulante.setFechaDeNacimiento(this.txtFechaDeNaciminto.getText());\n\t\t\tpostulante.setCarrera(this.cmbCarrera.getSelectedItem().toString());\n\t\t\tpostulante.setNacionalidad(this.txtNacionalidad.getText());\n\t\t\tpostulante.setLocalidad(this.txtLocalidad.getText());\n\t\t\tpostulante.setProvincia(this.txtProvincia.getText());\n\t\t\t//postulante.setSituacionSocial(this.txtSituacionSocial.getText());\n\t\t\tpostulante.setDomicilio(this.txtDomicilio.getText());\n\t\t\tpostulante.setCodigoPostal(this.txtCodigoPostal.getText());\n\t\t\tpostulante.setEmail(this.txtEmail.getText());\n\t\t\tpostulante.setTelefono(Long.valueOf(this.txtTelefono.getText()));\n\t\t\t\n\t\t\t\n\t\t\tint ingresos=0, miembrosEconomicamenteActivos = 0;\n\t\t\tfor(Familiar familiar: familiares) {\n\t\t\t\tingresos+=familiar.getIngresos();\n\t\t\t\tif(ingresos > 0) {\n\t\t\t\t\tmiembrosEconomicamenteActivos++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpostulante.setCantidadDeFamiliares(familiares.size());\n\t\t\tdouble promedio = Math.random() * (61) + 30 ; \n\t\t\tpostulante.setPromedio((int) promedio);\n\t\t\t\n\t\t\t\n\t\t\tint pIngresos, pActLaboral = 0, pVivienda = 0, pSalud = 0, pDependencia, pPromedio, pRendimiento, pDesarrollo;\n\t\t\t\n\t\t\t//Puntaje Ingresos\n\t\t\tint canastaBasicaPostulante = familiares.size() * canastaBasicaPromedio; \n\t\t\tif(ingresos <= canastaBasicaPostulante) {\n\t\t\t\tpIngresos = 30;\n\t\t\t}\n\t\t\telse if(ingresos >= (2*canastaBasicaPostulante)) {\n\t\t\t\tpIngresos = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpIngresos = (int) (30 - 0.15 * (familiares.size() - ingresos));\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Condicion Actividad Laboral\n\t\t\t\n\t\t\t\n\t\t\tint puntajeMiembros = 0;\n\t\t\t\n\t\t\tfor (Familiar familiar: familiares) {\n\t\t\t\t\tif(familiar.getIngresos() == 0) {\n\t\t\t\t\t\tpuntajeMiembros = puntajeMiembros + 5;\n\t\t\t\t\t}\n\t\t\t\t\telse if(familiar.getIngresos() < salarioMinimo) {\n\t\t\t\t\t\tpuntajeMiembros = puntajeMiembros + 3;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(miembrosEconomicamenteActivos>0) {\n\t\t\tpActLaboral = puntajeMiembros/miembrosEconomicamenteActivos;\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Vivienda - Extrae de cmbVivienda: 0 sin deudas - 1 con deudas - 2 sin propiedad\n\t\t\tint condicionVivienda = this.cmbVivienda.getSelectedIndex();\n\t\t\tswitch (condicionVivienda) {\n\t\t\tcase 0:\n\t\t\t\tpVivienda = 0;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tpVivienda = 3;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpVivienda = 5;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Salud - Extrae de cmbSalud: 0 tiene obra - 1 cobertura parcial - 2 no tiene\n\t\t\tint condicionSalud = this.cmbSalud.getSelectedIndex();\n\t\t\tswitch (condicionSalud) {\n\t\t\tcase 0:\n\t\t\t\tpSalud = 0;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tpSalud = 3;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpSalud = 5;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Dependencia\n\t\t\tif (familiares.size() - miembrosEconomicamenteActivos == 0) {\n\t\t\t\tpDependencia = 0;\n\t\t\t}\n\t\t\telse if(familiares.size() - miembrosEconomicamenteActivos > 2) {\n\t\t\t\tpDependencia = 5;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpDependencia = 3;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Rendimiento académico\n\t\t\tint materiasAprobadas = (int) (Math.random() * (11));\n\t\t\tif(materiasAprobadas == 0) {\n\t\t\t\tpRendimiento = 4;\n\t\t\t\tpPromedio = 14;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint materiasRegularizadas = (int) (Math.random() * (41 - materiasAprobadas));\n\t\t\t\tpRendimiento = materiasAprobadas/materiasRegularizadas * 10;\n\t\t\t//Puntaje Promedio: Se recuperaria del sysacad\n\t\t\t\tpPromedio = (int) (promedio/10 * 3.5);\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Plan Desarrollo: Evaluado por comisión local\n\t\t\tpDesarrollo = (int) (Math.random() * 5 + 1);\n\n\n\t\t\tpuntaje = pIngresos + pActLaboral + pVivienda + pSalud + pDependencia + pPromedio + pRendimiento + pDesarrollo;\n\t\t\tpostulante.setMatAprobadas(materiasAprobadas);\n\t\t\t\n\t\t\ttry{ \n\t\t\t\tcontroller.postular(postulante,puntaje); \n\t\t\t\tJOptionPane.showMessageDialog(null, \"Se postuló al alumno \"+postulante.getNombre()+\" \"+postulante.getApellido()+\".\", \"Postulación exitosa.\", JOptionPane.OK_OPTION);\n\t\t\t\tlimpiarCampos();\n\t\t\t} \n\t\t\tcatch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\tJOptionPane.showMessageDialog(null, \"No se pudo postular el alumno\", \"Error\", JOptionPane.OK_OPTION);\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tJOptionPane.showMessageDialog(null, \"Datos incorrectos\", \"Error\", JOptionPane.OK_OPTION);\n\t\t}\n\t\t\n\t}", "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "public static void create(Formulario form){\n daoFormulario.create(form);\n }", "public Perfil create(Perfil perfil);", "public vistaPrincipal() {\n initComponents();\n }", "protected RespostaFormularioPreenchido() {\n // for ORM\n }", "@POST\n\t@Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON} )\n\t@Produces(MediaType.TEXT_HTML)\n\tpublic void createPunto(Punto punto,\n\t\t\t@Context HttpServletResponse servletResponse) throws IOException {\n\t\tpunto.setId(AutoIncremental.getAutoIncremental());\n\t\tpuntoService.agregarPunto(punto);\n\t\tservletResponse.sendRedirect(\"./rutas/\");\n\t}", "public String crea() {\n c.setId(0);\n clienteDAO.crea(c); \n //Post-Redirect-Get\n return \"visualiza?faces-redirect=true&id=\"+c.getId();\n }", "@Override\n\tpublic Pane generateForm() {\n\t\treturn painelPrincipal;\n\t}", "protected void nuevo(){\n wp = new frmEspacioTrabajo();\n System.runFinalization();\n inicializar();\n }", "public FRM_MenuPrincipal() {\n initComponents();\n archivos = new ArchivoUsuarios(); \n controlador = new CNTRL_MenuPrincipal(this, archivos);\n agregarControlador(controlador);\n setResizable(false);\n ordenarVentanas();\n }", "public JPDV1(Principal P) {\n this.Princi = P;\n initComponents();\n }", "@Override\n\tprotected BaseProcesoForm devuelveFormProceso() throws Exception {\n\t\tProcesoBASLoggerForm objForm = new ProcesoBASLoggerForm();\n\t\treturn objForm;\n\t}", "public TelaPrincipal() {\n initComponents();\n }", "public TelaPrincipal() {\n initComponents();\n }", "public Principal() {\n initComponents();\n empresaControlador = new EmpresaControlador();\n clienteControlador = new ClienteControlador();\n vehiculoControlador = new VehiculoControlador();\n servicioControlador = new ServicioControlador();\n archivoObjeto = new ArchivoObjeto(\"/home/diego/UPS/56/ProgramacionAplicada/Parqueadero/src/archivo/ClienteArchivo.obj\");// Ruta Absolojuta\n archivosBinarios = new ArchivosBinarios();\n archivosBinariosAleatorio = new ArchivosBinariosAleatorio(\"ServicioArchivo.dat\");//Ruta relativa\n }", "@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}", "public DCrearDisco( InterfazDiscotienda id ){\r\n super( id, true );\r\n principal = id;\r\n\r\n panelDatos = new PanelCrearDisco( );\r\n panelBotones = new PanelBotonesDisco( this );\r\n\r\n getContentPane( ).add( panelDatos, BorderLayout.CENTER );\r\n getContentPane( ).add( panelBotones, BorderLayout.SOUTH );\r\n\r\n setTitle( \"Crear Disco\" );\r\n pack();\r\n }", "@PostMapping(\"/creargrupo\")\n public String create(@ModelAttribute (\"grupo\") Grupo grupo) throws Exception {\n try {\n grupoService.create(grupo);\n return \"redirect:/pertenezco\";\n }catch (Exception e){\n LOG.log(Level.WARNING,\"grupos/creargrupo\" + e.getMessage());\n return \"redirect:/error\";\n }\n }", "@Override\r\n\tprotected void agregarObjeto() {\r\n\t\t// opcion 1 es agregar nuevo justificativo\r\n\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (AGREGANDO)\");\r\n\t\tthis.opcion = 1;\r\n\t\tactivarFormulario();\r\n\t\tlimpiarTabla();\r\n\t\tthis.panelBotones.habilitar();\r\n\t}", "public void registrarPersona() {\n\t\ttry {\n\t\t\tif (validaNumDocumento(getNumDocumentPersona())) {\n\t\t\t\t\tif (validaDireccion()) {\n\t\t\t\t\t\tif (validaApellidosNombres()) {\n\t\t\t\t\t\t\tPaPersona persona = new PaPersona();\n\t\t\t\t\t\t\tif (getActualizaPersona() != null && getActualizaPersona().equals(\"N\")) {\n\t\t\t\t\t\t\t\tpersona.setPersonaId(Constante.RESULT_PENDING);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpersona.setPersonaId(getPersonaId() == null ? Constante.RESULT_PENDING: getPersonaId());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpersona.setTipoDocumentoId(Integer.valueOf(mapTipoDocumento.get(getTipoDocumento())));\n\t\t\t\t\t\t\tpersona.setNroDocIdentidad(getNumDocumentPersona());\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif (persona.getTipoDocumentoId() == Constante.TIPO_DOCUMENTO_RUC_ID) {\n\t\t\t\t\t\t\t\tpersona.setRazonSocial(getRazonSocial());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpersona.setPrimerNombre(getPrimerNombre());\n\t\t\t\t\t\t\t\tpersona.setSegundoNombre(getSegundoNombre());\n\t\t\t\t\t\t\t\tpersona.setApePaterno(getApellidoPaterno());\n\t\t\t\t\t\t\t\tpersona.setApeMaterno(getApellidoMaterno());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tPaDireccion direccion = new PaDireccion();\n\t\t\t\t\t\t\tdireccion.setDireccionId(getDireccionId() == null ? Constante.RESULT_PENDING: getDireccionId());\n\t\t\t\t\t\t\tif (getSelectedOptBusc().intValue() == 1) {\n\t\t\t\t\t\t\t\tdireccion.setTipoViaId(mapGnTipoVia.get(getCmbtipovia().getValue()));\n\t\t\t\t\t\t\t\tdireccion.setViaId(mapGnVia.get(getCmbvia().getValue()));\n\t\t\t\t\t\t\t\tdireccion.setLugarId(null);\n\t\t\t\t\t\t\t\tdireccion.setSectorId(null);\n\t\t\t\t\t\t\t\tdireccion.setNumero(numero);\n\t\t\t\t\t\t\t\tdireccion.setPersonaId(persona.getPersonaId());\n\n\t\t\t\t\t\t\t\tString direccionCompleta = papeletaBo.getDireccionCompleta(direccion,mapIGnTipoVia, mapIGnVia);\n\t\t\t\t\t\t\t\tif (direccionCompleta != null && direccionCompleta.trim().length() > 0) {\n\t\t\t\t\t\t\t\t\tdireccion.setDireccionCompleta(direccionCompleta);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdireccion.setDireccionCompleta(getDireccionCompleta());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tBuscarPersonaDTO personaDto = getPersonaDto(persona, direccion);\n\t\t\t\t\t\t\tString personaPapeleta = (String) getSessionMap().get(\"personaPapeleta\");\n\t\t\t\t\t\t\tif (personaPapeleta != null\n\t\t\t\t\t\t\t\t\t&& personaPapeleta.equals(\"I\")) {\n\t\t\t\t\t\t\t\tRegistroPapeletasManaged registro = (RegistroPapeletasManaged) getManaged(\"registroPapeletasManaged\");\n\t\t\t\t\t\t\t\tregistro.setDatosInfractor(personaDto);\n\t\t\t\t\t\t\t} else if (personaPapeleta != null\n\t\t\t\t\t\t\t\t\t&& personaPapeleta.equals(\"P\")) {\n\t\t\t\t\t\t\t\tRegistroPapeletasManaged registro = (RegistroPapeletasManaged) getManaged(\"registroPapeletasManaged\");\n\t\t\t\t\t\t\t\tregistro.setDatosPropietario(personaDto);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlimpiar();\n\t\t\t\t\t\t\tesContribuyente = (Boolean) getSessionMap().get(\"esContribuyente\");\n\t\t\t\t\t\t\tif (esContribuyente == true) {\t\n\t\t\t\t\t\t\t\tWebMessages.messageError(\"Es un Contribeyente s�lo se Actualiz� la Direcci�n para Papeletas, los otros datos es por DJ\");\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWebMessages\n\t\t\t\t\t\t\t\t\t.messageError(\"Apellidos y nombres no valido\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWebMessages\n\t\t\t\t\t\t\t\t.messageError(\"Especifique la direccion de la persona\");\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWebMessages\n\t\t\t\t\t\t.messageError(\"Número de documento de identidad no valido\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Principal() {\n initComponents();\n setLocationRelativeTo(null);\n deshabilitarPermisos();\n String titulos[] = {\"Nº\", \"Fecha y Hora\", \"Actividad\"};\n modeloTabla.setColumnIdentifiers(titulos);\n this.tabla.setModel(modeloTabla);\n }", "@RequestMapping(value = { \"/new\" }, method = RequestMethod.POST)\n\tpublic String saveEntity(@Valid ENTITY tipoConsumo, BindingResult result, ModelMap model,\n\t\t\t@RequestParam(required = false) Integer idEstadia) {\n\t\ttry{\n\t\n\t\t\tif (result.hasErrors()) {\n\t\t\t\treturn viewBaseLocation + \"/form\";\n\t\t\t}\n\t\n\t\t\tabm.guardar(tipoConsumo);\n\t\n\t\t\tif(idEstadia != null){\n\t\t\t\tmodel.addAttribute(\"idEstadia\", idEstadia);\n\t\t\t}\n\t\n\t\t\tmodel.addAttribute(\"success\", \"La creaci&oacuten se realiz&oacute correctamente.\");\n\t\t\t\n\t\t} catch(Exception e) {\n\t\t\tmodel.addAttribute(\"success\", \"La creaci&oacuten no pudo realizarse.\");\n\t\t}\n\t\tmodel.addAttribute(\"loggedinuser\", getPrincipal());\n\t\treturn \"redirect:list\";\n\t}", "public frmPrincipal() {\n initComponents();\n }", "void crearNuevaPersona(Persona persona);", "public PlanoSaude create(long plano_id);", "public Principal_jefe_decredito() {\n initComponents();\n\n }", "public CrearPedidos() {\n initComponents();\n }", "public Principal() {\n initComponents();\n setResizable(false);\n setLocationRelativeTo(null);\n asignarListeners();\n listaGatos = Utilidad.leerArchivoGatos();\n listaPerros = Utilidad.leerArchivoPerros();\n // Actualizacion al iniciar el proyecto, carga de informacion de los\n // archivos planos\n actualizarListas();\n }", "@Override\n public void registrarPropiedad(Propiedad nuevaPropiedad, String pIdAgente) {\n int numFinca = nuevaPropiedad.getNumFinca();\n String modalidad = nuevaPropiedad.getModalidad();\n double area = nuevaPropiedad.getAreaTerreno();\n double metro = nuevaPropiedad.getValorMetroCuadrado();\n double fiscal = nuevaPropiedad.getValorFiscal();\n String provincia = nuevaPropiedad.getProvincia();\n String canton = nuevaPropiedad.getCanton();\n String distrito = nuevaPropiedad.getDistrito();\n String dirExacta = nuevaPropiedad.getDirExacta();\n String estado = nuevaPropiedad.getEstado();\n String tipo = nuevaPropiedad.getTipo();\n System.out.println(nuevaPropiedad.getFotografias().size());\n double precio = nuevaPropiedad.getPrecio();\n try {\n bdPropiedad.manipulationQuery(\"INSERT INTO PROPIEDAD (ID_PROPIEDAD, ID_AGENTE, MODALIDAD, \"\n + \"AREA_TERRENO, VALOR_METRO, VALOR_FISCAL, PROVINCIA, CANTON, DISTRITO, DIREXACTA, TIPO, \"\n + \"ESTADO, PRECIO) VALUES (\" + numFinca + \", '\" + pIdAgente + \"' , '\" + modalidad + \"',\" + \n area + \",\" + metro + \",\" + fiscal + \", '\" + provincia + \"' , '\" + canton + \"' , '\" + distrito \n + \"' , '\" + dirExacta + \"' , '\" + tipo + \"' , '\" + estado + \"', \" + precio + \")\");\n bdPropiedad.insertarFotografias(nuevaPropiedad);\n } catch (SQLException ex) {\n Logger.getLogger(Propiedad.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public TelaPrincipalMDI() {\n initComponents();\n }", "Secuencia createSecuencia();", "public VentanaPrincipal() {\r\n\t\t\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tsetBounds(100, 100, 643, 414);\r\n\t\t\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tsetJMenuBar(menuBar);\r\n\t\t\r\n\t\tmnPersona = new JMenu(\"Persona\");\r\n\t\tmenuBar.add(mnPersona);\r\n\t\t\r\n\t\tmntmAgregar = new JMenuItem(\"Agregar\");\r\n\t\tmnPersona.add(mntmAgregar);\r\n\t\t\r\n\t\tmntmModificar = new JMenuItem(\"Modificar\");\r\n\t\tmnPersona.add(mntmModificar);\r\n\t\t\r\n\t\tmntmListar=new JMenuItem(\"Listar\");\r\n\t\tmnPersona.add(mntmListar);\r\n\t\t\r\n\t\tmntmEliminar = new JMenuItem(\"Eliminar\");\r\n\t\tmnPersona.add(mntmEliminar);\r\n\t\t\r\n\t\tcontentPane = new JPanel();\r\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\r\n\t\tsetContentPane(contentPane);\r\n\t\t\r\n\r\n\t}", "public frmPrincipal() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setResizable(false);\n btnReiniciar.setEnabled(false);\n txtSuma.setEditable(false);\n txtSupletorio.setEnabled(false);\n btnObtenerNotaFinal.setEnabled(false);\n txtNotaFinal.setEditable(false);\n }", "@Override\n public Paciente create(Paciente paciente) {\n return this.pacienteRepository.save(paciente);\n }", "public abstract Anuncio creaAnuncioGeneral();", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "private void criaCabecalho() {\r\n\t\tJLabel cabecalho = new JLabel(\"Cadastro de Homem\");\r\n\t\tcabecalho.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tcabecalho.setFont(new Font(\"Arial\", Font.PLAIN, 16));\r\n\t\tcabecalho.setForeground(Color.BLACK);\r\n\t\tcabecalho.setBounds(111, 41, 241, 33);\r\n\t\tpainelPrincipal.add(cabecalho);\r\n\t}", "public FormularioPregunta() {\n initComponents();\n \n setLocationRelativeTo(this);\n }", "public VentanaPrincipal() {\n initComponents();\n }", "@PutMapping(\"/anuncios/crear/{idAutor}\")\n public void createAnuncio(@PathVariable Long idAutor, @RequestBody Anuncio nuevoAnuncio) throws DataConsistencyException {\n anuncioService.crearAnuncio(idAutor, nuevoAnuncio);\n }", "Documento createDocumento();", "public void insertar(Proceso p) {\n\t\tif (p == null) {\n\t\t\treturn;\n\t\t}\n\t\tProceso nuevo = new Proceso();\n\t\tnuevo.rafaga = p.rafaga;\n\t\tnuevo.tllegada = p.tllegada;\n\t\tnuevo.IdCola = this.IdCola;\n\t\tnuevo.NombreCola = this.NombreCola;\n\t\tnuevo.rrejecutada = p.rrejecutada;\n\t\tnuevo.ColaProviene = p.ColaProviene;\n\t\tint tamaņo = p.id.length();\n\t\tif (tamaņo == 1) {\n\t\t\tnuevo.id = p.id + \"1\";\n\t\t} else {\n\t\t\tchar id = p.id.charAt(0);\n\t\t\tint numeroId = Integer.parseInt(String.valueOf(p.id.charAt(1))) + 1;\n\t\t\tnuevo.id = String.valueOf(id) + String.valueOf(numeroId);\n\t\t}\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tcabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t\tthis.rafagaTotal += nuevo.rafaga;\n\t\tthis.Ordenamiento();\n\t}", "@Override\n\tpublic void crearPoblacion() {\n\t\tif(this.terminales == null || this.funciones == null) {\n\t\t\tSystem.out.println(\"Error. Los terminales y las funciones tienen que estar inicializados\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tpoblacion = new ArrayList<>();\n\t\tfor(int i = 0; i < this.numIndividuos; i++) {\n\t\t\tIndividuo ind = new Individuo();\n\t\t\tind.crearIndividuoAleatorio(this.profundidad, this.terminales, this.funciones);\n\t\t\tthis.poblacion.add(ind);\n\t\t}\n\t}", "public VentanaPrincipal(Modelo s) {\n modelo = s;\n initComponents();\n capturarEventos();\n }", "private void creaPannelli() {\n /* variabili e costanti locali di lavoro */\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* pannello date */\n pan = this.creaPanDate();\n this.addPannello(pan);\n\n /* pannello coperti */\n PanCoperti panCoperti = new PanCoperti();\n this.setPanCoperti(panCoperti);\n this.addPannello(panCoperti);\n\n\n /* pannello placeholder per il Navigatore risultati */\n /* il navigatore vi viene inserito in fase di inizializzazione */\n pan = new PannelloFlusso(Layout.ORIENTAMENTO_ORIZZONTALE);\n this.setPanNavigatore(pan);\n this.addPannello(pan);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "public JogadorTradutor() {\n this.nome= \"Sem Registro\";\n this.pontuacao = pontuacao;\n id = id;\n \n geradorDesafioItaliano = new GerarPalavra(); // primeira palavra ja é gerada para o cliente\n }", "public GUI_MenuPrincipal_Profissional(Usuario profissional) {\n initComponents();\n \n // Centraliza o JFrame na tela\n this.setLocationRelativeTo(null);\n this.profissional = profissional;\n }", "public CrearQuedadaVista() {\n }", "public String crearPostulante() {\n\t\tString r = \"\";\n\t\ttry {\n\t\t\tif (edicion) {\n\t\t\t\tsetPos_password(Utilidades.Encriptar(getPos_password()));// PASS\n\t\t\t\tmanagergest.editarPostulante(pos_id.trim(), pos_nombre.trim(),\n\t\t\t\t\t\tpos_apellido.trim(), pos_direccion.trim(),\n\t\t\t\t\t\tpos_correo.trim(), pos_telefono.trim(),\n\t\t\t\t\t\tpos_celular.trim(), pos_password.trim(), \"A\");\n\t\t\t\tpos_id = \"\";\n\t\t\t\tpos_nombre = \"\";\n\t\t\t\tpos_apellido = \"\";\n\t\t\t\tpos_direccion = \"\";\n\t\t\t\tpos_correo = \"\";\n\t\t\t\tpos_password = \"\";\n\t\t\t\tpos_telefono = \"\";\n\t\t\t\tpos_celular = \"\";\n\t\t\t\tpos_institucion = \"\";\n\t\t\t\tpos_gerencia = \"\";\n\t\t\t\tpos_area = \"\";\n\t\t\t\tMensaje.crearMensajeINFO(\"Modificado - Editado\");\n\t\t\t\tr = \"home?faces-redirect=true\";\n\t\t\t} else {\n\t\t\t\tMensaje.crearMensajeINFO(\"Error..!!! Usuario no pudo ser Creado\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tMensaje.crearMensajeINFO(\"Error..!!! Usuario no pudo ser Creado\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn r;\n\t}", "public Principal() {\r\n initComponents();\r\n setLocationRelativeTo(null); \r\n panel_Compras = new Compras();\r\n panel_Ventas = new Ventas();\r\n }", "private void agregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_agregarActionPerformed\n boolean salida = true;\n Palabra p; \n p = new Palabra(campo1.getText());\n boolean continua = p.estaBien();\n if (continua) {\n agregarDiccionario(p);\n salida = pregunta();\n setVisible(true);\n }else {\n JOptionPane.showMessageDialog(null,\"#- Palabra mal escrita intente de nuevo -#\");\n }\n \n if (!salida) {\n JOptionPane.showMessageDialog(null,\"Gracias por usar el Corrector Ortográfico\");\n dic.guardarDiccionario();\n dispose(); //setVisible(false);\n }\n }", "public void salvarFornecedor()\r\n {\r\n /*\r\n * Implementação da lógica de salvar um fornecedor. Tratando as\r\n * mensagens conforme solicitado no desafio 1\r\n */\r\n try\r\n {\r\n fornecedorBusiness.salvarFornecedor(fornecedorResource);\r\n FacesContext.getCurrentInstance().addMessage(\"formFornecedor:messages\",\r\n new FacesMessage(FacesMessage.SEVERITY_INFO, \"Fornecedor Adicionado com Sucesso!\", \"\"));\r\n } catch (RuntimeException e)\r\n {\r\n FacesContext.getCurrentInstance().addMessage(\"formFornecedor:messages\",\r\n new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), \"\"));\r\n }\r\n }", "void crearCampania(GestionPrecioDTO campania);", "public InicioPrincipal() {\n initComponents();\n }", "@Override\n public void beforeShowNewEntity()\n {\n entity = new Aluno();\n entity.setDataNascimento(new GregorianCalendar());\n String senha = CriptografiaLogic.encriptar(\"123\");\n entity.setSenha(senha);\n }", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "@POST\r\n public ProveedorDTO crearProveedor(ProveedorDTO proveedor) throws BusinessLogicException {\r\n ProveedorDTO proveedorDTO = new ProveedorDTO(proveedorLogic.createProveedor(proveedor.toEntity()));\r\n return proveedorDTO;\r\n }", "@Override\n public ComprobanteContable createComprobante(Aerolinea a, Boleto boleto, Cliente cliente, String tipo, NotaDebito nota) throws CRUDException {\n\n ComprobanteContable comprobante = new ComprobanteContable();\n //ComprobanteContablePK pk = new ComprobanteContablePK();\n //pk.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n\n //creamos el concepto\n StringBuilder buff = new StringBuilder();\n\n // DESCRIPCION \n // AEROLINEA/ # Boleto / Pasajero / Rutas\n buff.append(a.getNumero());\n\n buff.append(\"/\");\n\n //numero boleto\n buff.append(\"#\");\n buff.append(boleto.getNumero());\n buff.append(\"/\");\n\n //Pasajero\n buff.append(boleto.getNombrePasajero().toUpperCase());\n\n // Rutas\n buff.append(\"/\");\n buff.append(boleto.getIdRuta1() != null ? boleto.getIdRuta1() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta2() != null ? boleto.getIdRuta2() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta3() != null ? boleto.getIdRuta3() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta4() != null ? boleto.getIdRuta4() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta5() != null ? boleto.getIdRuta5() : \"\");\n\n //jala el nombre cliente\n comprobante.setIdCliente(cliente);\n comprobante.setConcepto(buff.toString());\n comprobante.setFactorCambiario(boleto.getFactorCambiario());\n comprobante.setFecha(boleto.getFechaEmision());\n comprobante.setFechaInsert(boleto.getFechaInsert());\n comprobante.setIdEmpresa(boleto.getIdEmpresa());\n comprobante.setIdUsuarioCreador(boleto.getIdUsuarioCreador());\n comprobante.setTipo(tipo);\n comprobante.setEstado(ComprobanteContable.EMITIDO);\n //comprobante.setComprobanteContablePK(pk);\n\n //ComprobanteContablePK numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n Integer numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n comprobante.setIdNumeroGestion(numero);\n comprobante.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n return comprobante;\n }", "@FXML\r\n private void crearSolicitud() {\r\n try {\r\n //Carga la vista de crear solicitud rma\r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(Principal.class.getResource(\"/vista/CrearSolicitud.fxml\"));\r\n BorderPane vistaCrear = (BorderPane) loader.load();\r\n\r\n //Crea un dialogo para mostrar la vista\r\n Stage dialogo = new Stage();\r\n dialogo.setTitle(\"Solicitud RMA\");\r\n dialogo.initModality(Modality.WINDOW_MODAL);\r\n dialogo.initOwner(primerStage);\r\n Scene escena = new Scene(vistaCrear);\r\n dialogo.setScene(escena);\r\n\r\n //Annadir controlador y datos\r\n ControladorCrearSolicitud controlador = loader.getController();\r\n controlador.setDialog(dialogo, primerStage);\r\n\r\n //Carga el numero de Referencia\r\n int numReferencia = DAORma.crearReferencia();\r\n\r\n //Modifica el dialogo para que no se pueda cambiar el tamaño y lo muestra\r\n dialogo.setResizable(false);\r\n dialogo.showAndWait();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void crearDisco( ){\r\n boolean parameter = true;\r\n String artista = panelDatos.darArtista( );\r\n String titulo = panelDatos.darTitulo( );\r\n String genero = panelDatos.darGenero( );\r\n String imagen = panelDatos.darImagen( );\r\n\r\n if( ( artista.equals( \"\" ) || titulo.equals( \"\" ) ) || ( genero.equals( \"\" ) || imagen.equals( \"\" ) ) ) {\r\n parameter = false;\r\n JOptionPane.showMessageDialog( this, \"Todos los campos deben ser llenados para crear el disco\" );\r\n }\r\n if( parameter){\r\n boolean ok = principal.crearDisco( titulo, artista, genero, imagen );\r\n if( ok )\r\n dispose( );\r\n }\r\n }", "public VentanaMiPerfil() {\r\n\t\tsetTitle(\"PERFIL\");\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tsetBounds(100, 100, 450, 300);\r\n\t\t\r\n\t\t//Creamos las etiquetas para los textfied\r\n\t\tJLabel EtiquetaNombre = new JLabel(\"NOMBRE\");\r\n\t\tEtiquetaNombre.setFont(new Font(\"Lucida Console\", Font.BOLD, 10));\r\n\t\t//Rellenamos la textfield nombre\r\n\t\tcajaNombre = new JTextField();\r\n\t\tcajaNombre.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tcajaNombre.setText(\"FRANCISCO JOS\\u00C9\");\r\n\t\tcajaNombre.setColumns(15);\r\n\t\t\r\n\t\t//Etiqueta apellido\r\n\t\tJLabel EtiquetaApellidos = new JLabel(\"APELLIDOS\");\r\n\t\tEtiquetaApellidos.setFont(new Font(\"Lucida Console\", Font.BOLD, 10));\r\n\t\t//Relleno de apellidos\r\n\t\tcajaApellidos = new JTextField();\r\n\t\tcajaApellidos.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tcajaApellidos.setText(\"ESCRIBANO ZACAR\\u00C9S\");\r\n\t\tcajaApellidos.setColumns(10);\r\n\t\t\r\n\t\t//Etiqueta edad\r\n\t\tJLabel EtiquetaEdad = new JLabel(\"EDAD\");\r\n\t\tEtiquetaEdad.setFont(new Font(\"Lucida Console\", Font.BOLD, 10));\r\n\t\t//Relleno textfield edad\r\n\t\tcajaEdad = new JTextField();\r\n\t\tcajaEdad.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tcajaEdad.setText(\"33\");\r\n\t\tcajaEdad.setColumns(10);\r\n\t\t\r\n\t\t//Etiqueta Mail\r\n\t\tJLabel EtiquetaMail = new JLabel(\"CORREO ELECTR\\u00D3NICO\");\r\n\t\tEtiquetaMail.setFont(new Font(\"Lucida Console\", Font.BOLD, 10));\r\n\t\t//Relleno textfield mail\r\n\t\tcajaEmail = new JTextField();\r\n\t\tcajaEmail.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tcajaEmail.setText(\"[email protected]\");\r\n\t\tcajaEmail.setColumns(10);\r\n\t\t\r\n\t\t//Creación de la caja mostrada final.\r\n\t\tGroupLayout groupLayout = new GroupLayout(getContentPane());\r\n\t\tgroupLayout.setHorizontalGroup(\r\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t.addGap(22)\r\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addComponent(EtiquetaEdad)\r\n\t\t\t\t\t\t.addComponent(EtiquetaApellidos)\r\n\t\t\t\t\t\t.addComponent(EtiquetaNombre, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(cajaEmail, GroupLayout.PREFERRED_SIZE, 271, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t\t\t.addComponent(cajaNombre, Alignment.LEADING, 0, 0, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(EtiquetaMail, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(cajaApellidos, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE))\r\n\t\t\t\t\t\t\t.addGap(123))\r\n\t\t\t\t\t\t.addComponent(cajaEdad, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t.addGap(141))\r\n\t\t);\r\n\t\tgroupLayout.setVerticalGroup(\r\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t.addGap(23)\r\n\t\t\t\t\t.addComponent(EtiquetaNombre)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addComponent(cajaNombre, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addGap(18)\r\n\t\t\t\t\t.addComponent(EtiquetaApellidos)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addComponent(cajaApellidos, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t.addComponent(EtiquetaEdad)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t.addComponent(cajaEdad, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t.addComponent(EtiquetaMail)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t.addComponent(cajaEmail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addContainerGap(41, Short.MAX_VALUE))\r\n\t\t);\r\n\t\tgetContentPane().setLayout(groupLayout);\r\n\t}", "public MantenimientoReserva() {\n initComponents();\n PanelFondo panel=new PanelFondo(this.screenSize.width,this.screenSize.height);\n this.add(panel,BorderLayout.CENTER);\n }" ]
[ "0.6641977", "0.65608174", "0.6558945", "0.65453005", "0.64930385", "0.6477853", "0.64029384", "0.63834363", "0.632518", "0.6290638", "0.62693995", "0.6268008", "0.6256322", "0.62090844", "0.6190969", "0.61750025", "0.61326593", "0.61171275", "0.61039346", "0.608629", "0.6084038", "0.60722727", "0.60668856", "0.60635614", "0.6062433", "0.6044074", "0.60440505", "0.6030514", "0.6016418", "0.6012746", "0.60115236", "0.6011145", "0.6004405", "0.59968245", "0.599015", "0.59857905", "0.59519666", "0.59366935", "0.5922835", "0.5922326", "0.59191", "0.5898168", "0.5895003", "0.58915406", "0.5883006", "0.5873662", "0.5829704", "0.58197963", "0.5816535", "0.5813293", "0.5810671", "0.5810671", "0.580489", "0.58041584", "0.57989585", "0.57942605", "0.5788153", "0.57848454", "0.5773613", "0.5767203", "0.5766865", "0.5765928", "0.575133", "0.5750373", "0.5737733", "0.57240236", "0.57236606", "0.57233375", "0.57188827", "0.57017446", "0.569833", "0.56939137", "0.56918854", "0.5690889", "0.56822383", "0.5680117", "0.5675095", "0.5673701", "0.56723374", "0.56592274", "0.56575024", "0.5655665", "0.5651796", "0.56487423", "0.5647863", "0.5645101", "0.56421167", "0.56408715", "0.56399655", "0.56390375", "0.56348664", "0.56341505", "0.5634064", "0.5633526", "0.5629994", "0.56297654", "0.56284076", "0.5625774", "0.5615133", "0.5614443" ]
0.5787483
57
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() { jPanel8 = new Background("/Vistas/imagenes/fondoPantallaPrincipal.jpg"); jLabel11 = new javax.swing.JLabel(); textodeBienvenida2 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jScrollPane4 = new javax.swing.JScrollPane(); jPanel9 = new Background("/Vistas/imagenes/fondoPantallaPrincipaljpanel2.jpg"); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jPanel5 = new Background("/Vistas/imagenes/fondoPantallaPrincipaljpanel2.jpg"); jLabel7 = new javax.swing.JLabel(); jCalendar1 = new com.toedter.calendar.JCalendar(); jButton7 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); botonRealizarInterconsulta = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem7 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMaximumSize(new java.awt.Dimension(1110, 832)); jPanel8.setMaximumSize(new java.awt.Dimension(1110, 950)); jPanel8.setPreferredSize(new java.awt.Dimension(1280, 800)); jLabel11.setFont(new java.awt.Font("Arial", 1, 36)); // NOI18N jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel11.setText("Sistema Interno"); textodeBienvenida2.setFont(new java.awt.Font("Andalus", 1, 24)); // NOI18N textodeBienvenida2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel12.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel12.setText("Lista de avisos de pacientes a revisar"); jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane4.setPreferredSize(new java.awt.Dimension(908, 195)); jPanel9.setPreferredSize(new java.awt.Dimension(908, 215)); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 908, Short.MAX_VALUE) ); jPanel9Layout.setVerticalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 215, Short.MAX_VALUE) ); jScrollPane4.setViewportView(jPanel9); jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel13.setText("Menu principal"); jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel14.setText("Realizar reporte de enfermeria"); jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel15.setText("Consultar historial clinico del paciente"); jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Vistas/imagenes/informe.png"))); // NOI18N jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Vistas/imagenes/historialclinico.jpg"))); // NOI18N jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Lista de sugerencias"); jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 311, Short.MAX_VALUE) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 387, Short.MAX_VALUE) ); jScrollPane2.setViewportView(jPanel5); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel7.setText("Calendario"); jCalendar1.setMaximumSize(new java.awt.Dimension(184, 157)); jCalendar1.setMinimumSize(new java.awt.Dimension(1, 1)); jButton7.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N jButton7.setText("Consultar evento"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Vistas/imagenes/organizarEnfermeria.jpg"))); // NOI18N jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel8.setText("Organizar Evento en calendario."); botonRealizarInterconsulta.setText("Realizar sugerencia"); botonRealizarInterconsulta.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botonRealizarInterconsultaActionPerformed(evt); } }); javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 1070, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(4, 4, 4) .addComponent(textodeBienvenida2, javax.swing.GroupLayout.PREFERRED_SIZE, 1060, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(29, 29, 29) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 670, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(11, 11, 11) .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(860, 860, 860) .addComponent(jButton7)) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(770, 770, 770) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(4, 4, 4) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 760, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(20, 20, 20) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(66, 66, 66) .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(50, 50, 50) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel8Layout.createSequentialGroup() .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(66, 66, 66) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(36, 36, 36) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGap(18, 18, 18) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(botonRealizarInterconsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel8Layout.setVerticalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(6, 6, 6) .addComponent(textodeBienvenida2, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5) .addComponent(jLabel2) .addGap(8, 8, 8) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addComponent(jLabel13) .addGap(38, 38, 38) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(5, 5, 5) .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(11, 11, 11) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel14) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(4, 4, 4) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel15) .addComponent(jLabel8))))) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(botonRealizarInterconsulta) .addGap(7, 7, 7) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel12) .addComponent(jLabel7)) .addGap(3, 3, 3) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addGap(1, 1, 1) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8) .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jMenu1.setText("Menu"); jMenuItem7.setText("Cerrar Sesion"); jMenuItem7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem7ActionPerformed(evt); } }); jMenu1.add(jMenuItem7); jMenuBar1.add(jMenu1); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, 1110, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 8, Short.MAX_VALUE)) ); 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 PatientUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Magasin() {\n initComponents();\n }", "public intrebarea() {\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 }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public MusteriEkle() {\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 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 Botonera() {\n initComponents();\n }", "public FrmMenu() {\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 vpemesanan1() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public FormHorarioSSE() {\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 IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\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.7321342", "0.7292121", "0.7292121", "0.7292121", "0.72863305", "0.7249828", "0.7213628", "0.7209084", "0.7197292", "0.71912086", "0.7185135", "0.7159969", "0.7148876", "0.70944786", "0.70817256", "0.7057678", "0.69884527", "0.69786763", "0.69555986", "0.69548863", "0.69453996", "0.69434965", "0.69369817", "0.6933186", "0.6929363", "0.69259083", "0.69255763", "0.69123995", "0.6911665", "0.6894565", "0.6894252", "0.68922615", "0.6891513", "0.68894076", "0.6884006", "0.68833494", "0.6882281", "0.6879356", "0.68761575", "0.68752", "0.6872568", "0.68604666", "0.68577915", "0.6856901", "0.68561065", "0.6854837", "0.68547136", "0.6853745", "0.6853745", "0.68442935", "0.6838013", "0.6837", "0.6830046", "0.68297213", "0.68273175", "0.682496", "0.6822801", "0.6818054", "0.68177056", "0.6812038", "0.68098444", "0.68094784", "0.6809155", "0.680804", "0.68033874", "0.6795021", "0.67937285", "0.6793539", "0.6791893", "0.6790516", "0.6789873", "0.67883795", "0.67833847", "0.6766774", "0.6766581", "0.67658913", "0.67575616", "0.67566", "0.6754101", "0.6751978", "0.6741716", "0.6740939", "0.6738424", "0.6737342", "0.6734709", "0.672855", "0.6728138", "0.6721558", "0.6716595", "0.6716134", "0.6715878", "0.67096144", "0.67083293", "0.6703436", "0.6703149", "0.6701421", "0.67001027", "0.66999036", "0.66951054", "0.66923416", "0.6690235" ]
0.0
-1
hasa Launch the application.
public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { AtmLogin frame = new AtmLogin(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void launchApp();", "public static void main(String[] args) \r\n\t {\r\n\t\tApplication.launch(args);\r\n\t }", "void launch();", "void launch();", "void launch();", "public static void main(String[] args) {\n\t\t\n\t\tApplication.launch(args);\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tApplication.launch(args);\r\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\n\t}", "public void startApp()\r\n\t{\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args); // Not needed for running from the command line\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "public static void main(String[] args) {\n Application.launch(args);\n }", "public static void main(String[] args) {\n\n Application.launch(args);\n }", "private void launchMain() {\n\t\tfinal Intent i = new Intent(this, MainActivity.class);\n\t\tstartActivity(i);\n\t}", "public static void main(String[] args) {\n // Create the system.\n Application.launch( args );\n }", "public static void main(final String... args) {\n\n Application.launch();\n }", "public static void main(String[] args){\r\n //Launch the JavaFX app\r\n Application.launch(args);\r\n }", "public void startApp() {\n\n\t\tboolean isContinue = true;\n\t\tint i = 0;\n\t\twhile (isContinue) {\n\t\t\ti = displayAppMenu();\n\t\t\texecuteMenuItem(i);\n\n\t\t\tif (i == APP_EXIT) {\n\t\t\t\tisContinue = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\r\n\t launch(args); \r\n \r\n}", "public static void launch() {\r\n\t\tint choice = EXIT;\r\n\t\tdo {\r\n\t\t\tchoice = displayMenu();\r\n\t\t\texecuteMenuItem(choice);\r\n\t\t} while (choice != EXIT);\r\n\t}", "public static void main(String... args) {\n\t\tApplication.launch(View.class, args);\n\t}", "public static void main(String[] args) {\n Application.launch(App.class, args);\n }", "public static void main(String[] args) {\n\t\tApplication.launch(TamaView.class, args);\n\n\t}", "public static void main(String[] args)\r\n {\r\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n \r\n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "@Override\r\n\tpublic void launch(ISelection arg0, String arg1) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tSystem.out.println(\"Ok launch\");\r\n\t\tMessageBox dialog = new MessageBox(shell, SWT.ICON_QUESTION | SWT.OK\r\n\t\t\t\t| SWT.CANCEL);\r\n\t\tdialog.setText(\"ZCWeb Running Application\");\r\n\t\tdialog.setMessage(\"You choosed to run/debug ---- \"\r\n\t\t\t\t+ sampleGetSelectedProject() + \" ---- as a Web Application\");\r\n\t\tdialog.open();\r\n\t\tLaunchWebApp.main(args);\r\n\r\n\t}", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n //launch it\n launch();\n }", "public static void main(String[] args) {\n\tNaukriPopup oo= new NaukriPopup();\n\too.launch();\n\too.launch1();\n}", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args); \n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet();\n } else {\n initialize();\n startMIDlet();\n }\n midletPaused = false;\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }", "public static void main (String[] args) {\n launch(args);\n }", "public static void main(String[] args)\r\n {\r\n launch(args);\r\n }", "public static void main(String[] args) {\n\t\tlaunch(PhotoFlowApplication.class, args);\n\t}", "public static void main(String[] args) {\n\t\tlaunch(args);\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n launch(args);\n\n }", "public static void main(String[] args) {\n launch(RestaurantManagementApp.class, args);\n }", "public static void launch(String[] args) {\r\n\t\t// Figure out the right class to call\r\n\t\tStackTraceElement[] cause = Thread.currentThread().getStackTrace();\r\n\r\n\t\tboolean foundThisMethod = false;\r\n\t\tString callingClassName = null;\r\n\t\tfor (StackTraceElement se : cause) {\r\n\t\t\t// Skip entries until we get to the entry for this class\r\n\t\t\tString className = se.getClassName();\r\n\t\t\tString methodName = se.getMethodName();\r\n\t\t\tif (foundThisMethod) {\r\n\t\t\t\tcallingClassName = className;\r\n\t\t\t\tbreak;\r\n\t\t\t} else if (LWJGUIApplication.class.getName().equals(className) && \"launch\".equals(methodName)) {\r\n\t\t\t\tfoundThisMethod = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (callingClassName == null) {\r\n\t\t\tthrow new RuntimeException(\"Error: unable to determine main class\");\r\n\t\t}\r\n\t\tObject object = null;\r\n\t\ttry {\r\n\t\t\tClass<?> theClass = Class.forName(callingClassName, true, Thread.currentThread().getContextClassLoader());\r\n\t\t\tobject = theClass.newInstance();\r\n\t\t} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlaunch((LWJGUIApplication) object,args);\r\n\t}", "public static void main(String[] args) {\r\n\t launch(args);\r\n\t}", "boolean launch();", "public static void main(String[] args) {\n\n launch(args);\n }", "private void openApp(String packageName) {\n final String launcherPackage = packageName;\n assertThat(launcherPackage, notNullValue());\n mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT);\n\n // Launcher app\n Context context = InstrumentationRegistry.getContext();\n final Intent intent = context.getPackageManager()\n .getLaunchIntentForPackage(packageName);\n\n // Clear out any previous instances\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n context.startActivity(intent);\n\n // Wait for the app to appear\n mDevice.wait(Until.hasObject(By.pkg(packageName).depth(0)), LAUNCH_TIMEOUT);\n }", "public static void main(String[] args)\r\n {\r\n launch(args);\r\n }", "public static void main(String[] args) {\n\t launch(args);\n\t }", "public static void main(String[] args) {\n\t launch(args);\n\t }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args)\n {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args) {\n launch(args);\n }", "public static void main(String[] args)\n {\n launch(args);\n }", "public static void main(String[] args)\n {\n launch(args);\n }", "public static void main(String[] args)\n {\n launch(args);\n }" ]
[ "0.8138296", "0.7401657", "0.7313135", "0.7313135", "0.7313135", "0.73116744", "0.7288523", "0.72311825", "0.7189435", "0.71800053", "0.71800053", "0.71480554", "0.7107671", "0.7107671", "0.7107671", "0.7094954", "0.70776993", "0.7022026", "0.69748455", "0.69666046", "0.69051594", "0.6900791", "0.6897145", "0.6869197", "0.68599623", "0.68181825", "0.680126", "0.67634386", "0.6753756", "0.6740044", "0.6740044", "0.6740044", "0.6740044", "0.6740044", "0.6686814", "0.66836387", "0.66836387", "0.66836387", "0.6682357", "0.666744", "0.66620654", "0.66620654", "0.6657866", "0.66550875", "0.66525894", "0.66180813", "0.66180813", "0.66180813", "0.66180813", "0.66180813", "0.66180813", "0.66180813", "0.6609396", "0.66019666", "0.65972453", "0.6585871", "0.65847474", "0.6579494", "0.65745604", "0.6570566", "0.65699404", "0.6563709", "0.656273", "0.65579385", "0.6552168", "0.6552168", "0.6542552", "0.6542552", "0.6542552", "0.6542552", "0.6542552", "0.6542552", "0.65405965", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.6520085", "0.65166664", "0.65166664", "0.65166664" ]
0.0
-1
Default constructor for objects of class PersonWithZip
public PersonWithZip(String firstName, String lastName, int zipCode) { this.firstName = firstName; this.lastName = lastName; this.zipCode = zipCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ZipCodes() {}", "public /* synthetic */ Employee(Integer num, String str, String str2, String str3, int i, DefaultConstructorMarker defaultConstructorMarker) {\n this((i & 1) != 0 ? null : num, (i & 2) != 0 ? null : str, (i & 4) != 0 ? null : str2, (i & 8) != 0 ? null : str3);\n }", "public Address(int zip, int street) {\n\t\tthis.zip = zip;\n\t\tthis.street = street;\n\t}", "public Person (String firstName, String lastName, String address) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.address = address;\n\n }", "public Person(String name, String address, String postalCode, String city, String phone){\n // initialise instance variables\n this.name = name;\n this.address = address;\n this.postalCode = postalCode;\n this.city = city;\n this.phone = phone;\n }", "public Person(String first, String last) {\n\t\tthis(first, last, -1);\n\t}", "public Person() {}", "public Address() {}", "private ZipUtils() {\n }", "public StreetAddress() {}", "public Person(String name, ArrayList<String> pnArray) {\n\n\t}", "public Person() {\n\t\tname \t= \"\";\n\t\taddress = \"\";\n\t\tcity \t= \"\";\n\t\tage \t= 0;\n\t}", "public ZipCode(final String x) {\n this.codigo = x;\n }", "public Address(String someStreetAddress, String someCity, String someState, int someZip) {\n this.streetAddress = someStreetAddress;\n this.city = someCity;\n this.state = someState;\n this.zipCode = someZip;\n }", "public Person(String vorname, String nachname) {\n\n\t}", "public Person(String name, int age, String city /* ,*ArrayList friends*/) {\n this.name = name;\n this.age = age;\n this.city = city;\n //this.friends = new ArrayList<>();\n }", "public Person(String name, String address, String phoneNumber, String emailAddress)\n {\n this.name = name;\n this.address = address;\n this.phoneNumber = phoneNumber;\n this.emailAddress = emailAddress;\n }", "public Customer(Person person) {\n this(person.getName(), person.getLastName(), person.getSex(), person.getBirthDay(), 0);\n }", "public Address() {\n \t\n }", "public PersonRecord() {}", "public Address() {\n\t}", "public PersonBean() {\n\t}", "private TypicalPersons() {}", "private TypicalPersons() {}", "public Person() {\n\t\t\n\t}", "public Person(String firstName, String lastName) {\n this.lastName = lastName;\n this.firstName = firstName;\n }", "public Person(String firstName, String lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n }", "public Person1() {\n\t\tsuper();\n\t}", "public Person()\n {\n this.name = \"John Doe\";\n this.address = \"1234 Somewhere Dr.\";\n this.phoneNumber = \"309-555-1234\";\n this.emailAddress = \"[email protected]\";\n }", "public Address(String street, String city, String zipCode, String country)\n {\n //reference the object classes constructors\n this.street = street;\n this.city = city;\n this.zipCode = zipCode;\n this.country = country;\n }", "public addressBean() {\n }", "private ZipCompressor(){}", "public Address() {\n }", "public Address() {\n }", "public DataCaseWorker(String firstName, String middleName, String lastName, IAddress address, String phone, String email) {\n super(firstName, middleName, lastName, address, phone, email);\n this.id = 0;\n }", "void DefaultConstructor(){}", "defaultConstructor(){}", "public Person(){\r\n\t\tsuper();\r\n\t}", "public PersonSummary() {}", "public Person() {\n }", "public Person() {\n }", "public Person() {\n }", "public Person() {\n }", "public Person() {\r\n\t\tid = \"00000\";\r\n\t\tfName = \"unknown\";\r\n\t\tlName = \"unknown\";\r\n\t\tbirthday = LocalDate.now();\r\n\t\tphone = \"unknown\";\r\n\t\tstatus = \"unknown\";\r\n\t\tcontacts = new ArrayList<String>();\r\n\t}", "public Person(String first, String last) {\n // Set instance var firstname to what is called from constructor\n this.firstName = first; \n // Set instance var lastname to what is called from constructor\n this.lastName = last;\n }", "public Person()\n {\n //intentionally left empty\n }", "public Address() {\r\n\t\tsuper();\r\n\t}", "public PersonaDTO(){}", "public Person(String lastName, String firstName, String street, long tid, String phone, String mobile, String email) {\n this.lastName = lastName;\n this.firstName = firstName;\n this.address = street;\n this.tid = tid;\n this.phone = phone;\n this.mobile = mobile;\n this.email = email;\n }", "public Address(String l1, String l2, String l3, String c, String s, String z, String t) {\n line1 = l1;\n line2 = l2;\n line3 = l3;\n city = c;\n state = s;\n zip = z;\n type = t;\n }", "public Address(\n int number, String street, String apartment, String town, String state, int zipcode) {\n\n this(number, street, town, state, zipcode); // call the general constructor\n this.apartment = apartment;\n }", "public Person(String name, String city) {\n this.name = name;\n this.city = city;\n }", "public PortugueseAddressContactDTO() {\r\n\t\tsuper();\r\n\t}", "public Person(Name name, Phone phone, Email email, Address address, Salary salary, Username username,\n Password password, Set<Project> projects) {\n this(name, phone, email, address, salary, username, password, projects, new PermissionSet());\n }", "public Address() {\n\t\tsuper();\n\n\t}", "public Address()\n\t{\n\t\tCity = \"?\";\n\t\tState = \"?\";\n\t}", "public List <Person> sortZip(List <Person> listOfPerson)\n\t{\n\t\tfor(int i = 0; i < listOfPerson.size(); i++)\n\t\t{\n\t\t\tfor(int j = i+1; j < listOfPerson.size(); j++)\n\t\t\t{\n\t\t\t\tif(listOfPerson.get(i).getZip() > listOfPerson.get(j).getZip())\n\t\t\t\t{\n\t\t\t\t\tPerson temp;\n\t\t\t\t\ttemp = listOfPerson.get(i);\n\t\t\t\t\tlistOfPerson.set(i, listOfPerson.get(j));\n\t\t\t\t\tlistOfPerson.set(j, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn listOfPerson;\n\t}", "Employees() { \r\n\t\t this(100,\"Hari\",\"TestLeaf\");\r\n\t\t System.out.println(\"default Constructor\"); \r\n\t }", "public Customer(int id, String name, int age, String address) {\r\n super(id, name, age, address);\r\n }", "public Address(String streetNumbers, String city, StateCode state, String postalCode) {\n\t\tthis.streetNumbers = streetNumbers;\n\t\tthis.city = city;\n\t\tthis.state = state;\n\t\tthis.postalCode = postalCode;\n\t\tthis.hashCode = hashCode();\n\t}", "private void __sep__Constructors__() {}", "public Person()\n\t{\n\t\tthis.age = -1;\n\t\tthis.name = \"Unknown\";\n\t}", "public Person2(String fname, String lname) {\n this.fname = fname;\n this.lname = lname;\n }", "public Company(String name, String street, String city, String state, int zip) {\n this.name = name;\n this.street = street;\n this.floor = \"\\0\";\n this.city = city;\n this.state = state;\n this.zip = zip;\n }", "public Company(String name, String street, String floor, String city, String state, int zip) {\n this.name = name;\n this.street = street;\n this.floor = floor;\n this.city = city;\n this.state = state;\n this.zip = zip;\n }", "public Employee(){\r\n this(\"\", \"\", \"\", 0, \"\", 0.0);\r\n }", "public XmlAdaptedPerson() {}", "private ZipConstants() {}", "public Person1(int[] celNumber, int age, String name) {\n\t\tsuper();\n\t\tthis.celNumber = celNumber;\n\t\tthis.age = age;\n\t\tthis.name = name;\n\t}", "public Person(String name, String address, String aadharId) {\n this.name = name;\n this.address = address;\n this.aadharId = aadharId;\n }", "public Person(String firstName, String lastName) {\r\n name = new Name(firstName, lastName); \r\n id = (int )(Math.random() * 200 + 100);; \r\n }", "public Person() {\n\t\tthis.name = \"Unknown\"; \n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "public PersonaFisica() {}", "public Person (String _name, int _ID) {\n name = _name;\n ID = _ID;\n }", "public Employee(String code, Name name, Address address, String[] emails){\n super(code, address);\n this.emails = emails;\n this.name = name;\n }", "public Person(String first, String middle, String last) {\n this.firstNames = first+ \" \" +middle;\n this.lastName = last;\n }", "public Borrower(String fName, String lName, String lNumber, int numberOfBooks, \r\n String street, String town, String postcode)\r\n {\r\n firstName = fName;\r\n lastName = lName;\r\n libraryNumber = lNumber;\r\n noOfBooks = numberOfBooks; \r\n address = new Address(street, town, postcode);\r\n }", "public BsAddressExample() {\r\n\t\toredCriteria = new ArrayList<Criteria>();\r\n\t}", "public Employee(int id, String name, double salary, Date dateOfBirth,\n String mobileNumber, String emailId, List<Address> address) {\n this.name = name;\n this.id = id;\n this.salary = salary;\n this.dateOfBirth = dateOfBirth;\n this.address = address;\n this.mobileNumber = mobileNumber;\n this.emailId = emailId;\n }", "public Address(int doorNo, String streetName, String city, String zip, String state, String country) {\r\n\t\tsuper();\r\n\t\tthis.doorNo = doorNo;\r\n\t\tthis.streetName = streetName;\r\n\t\tthis.city = city;\r\n\t\tthis.zip = zip;\r\n\t\tthis.state = state;\r\n\t\tthis.country = country;\r\n\t}", "public Employee(int id, String firstName, String lastName, int age, double salary, String address) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.age = age;\n\t\tthis.salary = salary;\n\t\tthis.address = address;\n\t}", "public Persona() {\n\t}", "protected Customers(int ID, String first, String last, Adress adress, String mail, String phone, int typeCusto) {\r\n // Bouml preserved body begin 00040A82\r\n\t this.adress = adress;\r\n\t this.firstName = first;\r\n\t this.lastName = last;\r\n\t this.phoneNumber = phone;\r\n this.email = mail;\r\n\t this.ID = ID;\r\n //Mdero\r\n this.typeCusto = typeCusto;\r\n // Bouml preserved body end 00040A82\r\n if (!customersMap.containsKey(ID)&&ID!=-1)\r\n customersMap.put(ID, this);\r\n }", "@Test\n @DisplayName(\"PersonDTOAssembler - Intantiates DTOAssembler-ThirdConstructor\")\n void personDTOAssembler_InstatiatesDTOAssembler_ThirdConstructor() {\n String mariaEmail = \"[email protected]\";\n String mariaName = \"Maria Silva\";\n LocalDate mariaBirthDate = LocalDate.of(1973, 07, 25);\n String mariaBirthplace = \"Braga\";\n\n Email emailMaria = Email.createEmail(mariaEmail);\n Name nameMaria = Name.createName(mariaName);\n Birthdate birthateMaria = Birthdate.createBirthdate(mariaBirthDate);\n Birthplace birthplaceMaria = Birthplace.createBirthplace(mariaBirthplace);\n\n LedgerID ledgerID = LedgerID.createLedgerID();\n String ledgerId = ledgerID.toString();\n\n PersonID fatherID = null;\n PersonID motherID = null;\n\n String IS_NOT_DEFINED = \"Is Not Defined\";\n\n //PersonDTO\n String personMariaBirthdate = birthateMaria.getBirthdate().toString();\n\n //Expected\n PersonDTO personDTOExpected = new PersonDTO(mariaEmail, mariaName, personMariaBirthdate, mariaBirthplace);\n\n //Act\n\n PersonDTOAssembler personDTOAssembler = new PersonDTOAssembler();\n PersonDTO personDTO = personDTOAssembler.createDTOFromPrimitiveTypes(mariaEmail, mariaName, mariaBirthDate.toString(), mariaBirthplace);\n\n\n //Assert\n assertEquals(personDTOExpected, personDTO);\n }", "public static List<Person> getExamplePeople() {\n return Arrays.asList(\n new Person(\"1230\", \"John\", \"Smith\", LocalDate.of(1965, 1, 20), \"Some Street 3, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 4567890\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"[email protected]\")\n )\n ),\n new Person(\"1231\", \"Jack\", \"Tree\", LocalDate.of(1971, 3, 20), \"Some Street 9, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.MOBILE, \"Personal number\", \"+123 456789011\")\n )\n ),\n new Person(\"1232\", \"Mary\", \"Jones\", LocalDate.of(1980, 2, 20), \"Some Street 7, Some City, Some Country\", \n null\n ),\n new Person(\"1233\", \"Maria\", \"Johnson\", LocalDate.of(1991, 9, 12), \"Some Street 30, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Work number\", \"+123 4634563\")\n )\n ),\n new Person(\"1234\", \"Luke\", \"Miller\", LocalDate.of(1986, 12, 3), \"Some Street 87, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 13433653\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"[email protected]\"),\n new PersonContact(PersonContactType.MOBILE, \"Preferred contact\", \"+123 365346456\")\n )\n ),\n new Person(\"1235\", \"Michelle\", \"Smith\", LocalDate.of(1966, 6, 30), \"Some Street 3, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 4567890\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"[email protected]\")\n )\n )\n );\n }", "public AvroPerson() {}", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "public static void main(String[] args) {\n\n VipPerson person1 = new VipPerson();\n System.out.println(person1.getName());\n\n VipPerson person2 = new VipPerson(\"Timmy\", 25000.00);\n System.out.println(person2.getName());\n\n VipPerson person3 = new VipPerson(\"Tony\", 100.00, \"[email protected]\");\n System.out.println(person3.getName());\n System.out.println(person3.getEmailAddress());\n\n\n }", "public SalesPerson(String firstName, String lastName, String ppsNumber){\r\n //pulls the constructor with parameters from the superclass SalesEmployee\r\n super(firstName, lastName, ppsNumber);\r\n }", "public ZTest1() {\n this(\"z_test1\", null);\n }", "public Employee(String firstName, String lastName, Date birthDate, \n Date hireDate, Address Address) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.birthDate = birthDate;\n this.hireDate = hireDate;\n this.Address = Address;\n }", "private ImmutablePerson(ImmutablePerson other) {\n firstName = other.firstName;\n middleName = other.middleName;\n lastName = other.lastName;\n nickNames = new ArrayList<>(other.nickNames);\n }", "public /* synthetic */ AutoPurchaseResult(boolean z, String str, String str2, Object obj, int i, DefaultConstructorMarker pVar) {\n this(z, str, str2, (i & 8) != 0 ? null : obj);\n }", "public Demo3() {}", "public Persona() {\n }", "public Borrower(String fName, String lName, String lNumber, \r\n String street, String town, String postcode)\r\n {\r\n firstName = fName;\r\n lastName = lName;\r\n libraryNumber = lNumber;\r\n noOfBooks = 1; \r\n address = new Address(street, town, postcode);\r\n }", "public Bank(){\n this(\"Seneca@York\", 0);\n }", "public Address(String street, String city, String state){\n this.street=street;\n this.city=city;\n this.state=state;\n\n }", "public Employee(int empID, String firstName, String lastName, int ssNum,\n Date hireDate, double salary) {\n if (Employee.setOfIDs.contains(empID) || !Employee.isPositive(empID)) {\n this.empID = Employee.generateID();\n } else {\n this.empID = empID;\n }\n Employee.sortType = SortType.SORT_BY_ID;\n Employee.setOfIDs.add(this.empID);\n this.firstName = firstName;\n this.lastName = lastName;\n this.ssNum = ssNum;\n this.hireDate = hireDate;\n this.salary = salary;\n }" ]
[ "0.62724674", "0.6058396", "0.59817904", "0.5911467", "0.58130854", "0.5639886", "0.55438197", "0.55321735", "0.54999006", "0.54627275", "0.5456735", "0.5435577", "0.5365916", "0.5361765", "0.5359376", "0.53397495", "0.53315836", "0.5317366", "0.5314967", "0.5302169", "0.53011364", "0.52896804", "0.528884", "0.528884", "0.52877843", "0.52792895", "0.5279142", "0.5279036", "0.5275199", "0.5265442", "0.52476203", "0.52414536", "0.523252", "0.523252", "0.522784", "0.52130604", "0.5207892", "0.51995796", "0.51971483", "0.51916146", "0.51916146", "0.51916146", "0.51916146", "0.51841134", "0.51747257", "0.51679206", "0.51400983", "0.513009", "0.5122965", "0.5120757", "0.51169336", "0.5115959", "0.51112926", "0.50971067", "0.50741637", "0.505438", "0.5044114", "0.50331944", "0.502782", "0.5010851", "0.50026464", "0.5002447", "0.5000787", "0.49963397", "0.4994101", "0.49940526", "0.49932906", "0.49907514", "0.49653363", "0.49598986", "0.49568865", "0.4952772", "0.4952465", "0.49468088", "0.4932087", "0.49292383", "0.4928175", "0.4911917", "0.49109855", "0.49109736", "0.49089554", "0.49051988", "0.49037", "0.48991463", "0.48988414", "0.4886875", "0.48755094", "0.48739606", "0.48727912", "0.48692775", "0.48577085", "0.48544803", "0.48540822", "0.4844993", "0.48447937", "0.48430213", "0.48384145", "0.48368672", "0.48350623", "0.4827491" ]
0.7746075
0
public, private, protected, default
public static void main(String[] args) { Scope obj = new Scope(); obj.test1(); obj.test2(); Scope.test2(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Default()\n {}", "private Public() {\n super(\"public\", null);\n }", "private stendhal() {\n\t}", "public static void main(String[] args) {\n ClassDefault claseDefault = new ClassDefault(\"hola\");\n claseDefault.setAttrPrivate(\"Modigficado atrr privado\");\n System.out.println(\"Privado \"+ claseDefault.getAttrPrivate());\n //claseDefault.attrPrivate = \"Cambio desde la prueba\";\n //Systease1 = \" + clase1.attrPublico);\n //clase1.metodoPublico();m.out.println(\"claseDefault.attrDefault = \" + claseDefault.attrDefault);\n //claseDefault.metodoDefault();\n //System.out.println(\"clase1 = \" + clase1.attrPublico);\n //clase1.metodoPublico();\n }", "public void myPublicMethod() {\n\t\t\n\t}", "private Get() {}", "private Get() {}", "public void checkPublic() {\n }", "default void init() {\n }", "@Override\n\tpublic boolean isPublic() {\n\t\treturn false;\n\t}", "private UserPrefernce(){\r\n\t\t\r\n\t}", "DefaultAttribute()\n {\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.514 -0500\", hash_original_method = \"E49204FD271E895B10D86A1AFEA21B04\", hash_generated_method = \"59B3C6A592AE63BEE2BC1CC1723B36DF\")\n \nprivate Settings() {}", "default boolean isSpecial() { return false; }", "default String notRequired() {\n return \"Default implementation\";\n }", "@Override\n public boolean isPrivate() {\n return true;\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void prot() {\n }", "defaultConstructor(){}", "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}", "public default int getLevel(){ return 0; }", "private CommonMethods() {\n }", "void DefaultConstructor(){}", "private Infer() {\n\n }", "private TypicalPersons() {}", "private TypicalPersons() {}", "private test5() {\r\n\t\r\n\t}", "default int getPriority() {\n return 0;\n }", "public default boolean canBePermanent(){ return false; }", "private MApi() {}", "private ObiWanKenobi(){\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public static void main(String[] args) {\n // since we declared the variables in access modifier class as static ==> we can call them through class name\n // here we will call the variables BUT private variable cannot be called into inherited\n System.out.println(c04_TestData2.publicVariable);\n System.out.println(c04_TestData2.protectedVariable);\n System.out.println(c04_TestData2.defaultVariable);\n\n // here we will call the method that were created in AccessModifier class into here\n // only public, protected, and default methods only can be inherited and used here\n c04_TestData2.publicMethod();\n c04_TestData2.protectedMethod();\n c04_TestData2.defaultMethod();\n\n // because they are static method we can call them like this too\n publicMethod();\n protectedMethod();\n defaultMethod();\n }", "public OOP_207(){\n\n }", "@Override\n public void pub() {\n // can only be public\n }", "private Helper() {\r\n // empty\r\n }", "protected Doodler() {\n\t}", "public Fun_yet_extremely_useless()\n {\n\n }", "default void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}", "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}", "Petunia() {\r\n\t\t}", "public static void main(String[] args) {\n\t\tAccessModifiers am = new AccessModifiers();\r\n\t\tSystem.out.println(am.publicInt);\r\n\t\t//System.out.println(am.privatefloat);\r\n\t\tSystem.out.println(am.protectedName);\r\n\t\tSystem.out.println(am.defaultAge);\r\n\t}", "public abstract Member mo23408O();", "private Utils() {\n\t}", "private Utils() {\n\t}", "private LocalParameters() {\n\n\t}", "Properties defaultProperties();", "public abstract Object mo26777y();", "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}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.917 -0500\", hash_original_method = \"4F6254C867328A153FDD5BD23453E816\", hash_generated_method = \"627F9C594B5D3368AD9A21A5E43D2CB8\")\n \nprivate Extensions() {}", "private User() {}", "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 }", "private PermissionHelper() {}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "public Boolean getPublicAccess() {\n return publicAccess;\n }", "public Methods() {\n // what is this doing? -PMC\n }", "default int getOrder() {\n\treturn 0;\n }", "default String display() { //just wanted to try out default methods we learned in class here-- abstract format below\r\n\t\treturn \"Nothing to show here\";\r\n\t}", "private ChainingMethods() {\n // private constructor\n\n }", "protected DefaultLink() {\n }", "private Constantes() {\r\n\t\t// No way\r\n\t}", "private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}", "@RegionEffects(\"writes publicField; reads defaultField\")\n private void someButNotAll() {\n publicField = privateField;\n protectedField = defaultField;\n }", "default boolean isSharded() {\n return false;\n }", "private VarietyPackage() {}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "public void returnDefault();", "@Override\n public boolean getAllowPrivateConstructors()\n {\n \treturn allowPrivateConstructors;\n }", "default void msg()\n {\n System.out.println(\"Default method...\");\n }", "default String getAuthor() {\r\n\t\treturn \"unknown\";\r\n\t}", "private Params()\n {\n }", "boolean isPrivate();", "private Utility() {\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:33:59.663 -0500\", hash_original_method = \"7BA2DC4B038FD72F399C633B1C4B5B34\", hash_generated_method = \"3D1B22AE31FE9AB2658DC3713C91A6C9\")\n \nprivate Groups() {}", "private DarthSidious(){\n }", "private abstract void privateabstract();", "protected Provider() {}", "private UsineJoueur() {}", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "protected EditorLanguage funcDefPrefix(EditorDataType funcRetType)\n\t{\n\t\treturn text(\"private static \").text(getTypeName(funcRetType)).text(' ');\n\t}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "default void beforeUse() {\n\t}", "public default void defaultMethod(){\r\n System.out.println(\"This is a method from Other Interface and can be overriden.\");\r\n }", "private SecurityConsts()\r\n\t{\r\n\r\n\t}", "public java.lang.String getDefaultCaseAccess() {\n return defaultCaseAccess;\n }", "private NaturePackage() {}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "private Store() {\n\t}", "private static void oneUserExample()\t{\n\t}", "private Helper() {\r\n // do nothing\r\n }", "protected abstract S createDefault();", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.504 -0500\", hash_original_method = \"F5E3085137E37D29F0F8CB3C296F1F57\", hash_generated_method = \"47D4A76F75042B03A266F16D90E98429\")\n \nprivate Contacts() {}", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "private LevelConstants() {\n\t\t\n\t}", "private E() {}", "@Override\r\n\tpublic String permission() {\n\t\treturn Permissions.DEFAULT;\r\n\t}", "protected Approche() {\n }", "private Object setupDefaultPrototype() {\n }" ]
[ "0.70222855", "0.67293847", "0.67007345", "0.6445357", "0.6434178", "0.6374214", "0.6374214", "0.6281644", "0.6163077", "0.6152848", "0.61501396", "0.61044836", "0.6083276", "0.5985646", "0.5978308", "0.5962879", "0.59581023", "0.5949553", "0.59405863", "0.59375966", "0.59122026", "0.59081507", "0.5871134", "0.58652335", "0.5858208", "0.5858208", "0.58342034", "0.5821332", "0.58213305", "0.5803159", "0.5797223", "0.5756929", "0.5754324", "0.57531303", "0.5744448", "0.57435197", "0.5737945", "0.5736414", "0.5726558", "0.57220286", "0.5720703", "0.5707234", "0.5705128", "0.5699542", "0.5699542", "0.56940913", "0.56827503", "0.56787026", "0.56720537", "0.5671455", "0.5665351", "0.566295", "0.56598157", "0.5633679", "0.56200874", "0.5616993", "0.56123865", "0.56101716", "0.5606091", "0.56026495", "0.5601329", "0.5600433", "0.55996025", "0.55994457", "0.55963194", "0.5594459", "0.55891204", "0.5588415", "0.557906", "0.5573454", "0.5573401", "0.55665064", "0.5562833", "0.5545684", "0.55434877", "0.55415565", "0.5538641", "0.55372137", "0.5536393", "0.5534898", "0.553394", "0.553394", "0.553394", "0.553394", "0.5532622", "0.55294764", "0.5528137", "0.5524699", "0.55186915", "0.55084795", "0.55053145", "0.54977655", "0.5491954", "0.54897535", "0.5488239", "0.54849344", "0.54844993", "0.54841393", "0.54791915", "0.547141", "0.54677105" ]
0.0
-1
What happens if I uncomment this?
@Override public boolean equals(Object obj) { if (super.equals(obj)) return true; if (!obj.getClass().equals(this.getClass())) return false; Point p = (Point) obj; if ((this.x == p.x) && (this.y == p.y)) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "private void m50366E() {\n }", "public final void mo91715d() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public boolean method_4132() {\n return false;\n }", "public boolean method_2453() {\r\n return false;\r\n }", "public void method_4270() {}", "public boolean method_4088() {\n return false;\n }", "public boolean method_2434() {\r\n return false;\r\n }", "public void m23075a() {\n }", "protected boolean func_70814_o() { return true; }", "public boolean method_4093() {\n return false;\n }", "public boolean method_208() {\r\n return false;\r\n }", "protected boolean func_70041_e_() { return false; }", "public boolean method_194() {\r\n return false;\r\n }", "public void mo23813b() {\n }", "public boolean method_218() {\r\n return false;\r\n }", "public boolean method_216() {\r\n return false;\r\n }", "public final void mo11687c() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public void mo38117a() {\n }", "public boolean method_108() {\r\n return false;\r\n }", "private stendhal() {\n\t}", "public void mo21779D() {\n }", "private void m50367F() {\n }", "public boolean method_3897() {\r\n return false;\r\n }", "public boolean method_4102() {\n return false;\n }", "public boolean method_210() {\r\n return false;\r\n }", "void m1864a() {\r\n }", "public void mo115190b() {\n }", "private /* synthetic */ void m57187h() {\n this.f41189e = true;\n }", "public void mo21787L() {\n }", "static void m7753b() {\n f8029a = false;\n }", "public void mo21792Q() {\n }", "private void kk12() {\n\n\t}", "public final void mo8775b() {\n }", "public /* bridge */ /* synthetic */ void mo55097d() {\n super.mo55097d();\n }", "public boolean method_214() {\r\n return false;\r\n }", "public boolean method_196() {\r\n return false;\r\n }", "public void mo21785J() {\n }", "public void mo56167c() {\n }", "public void mo3749d() {\n }", "public void mo12930a() {\n }", "public void mo21877s() {\n }", "public void mo97908d() {\n }", "public void mo12628c() {\n }", "public boolean method_198() {\r\n return false;\r\n }", "public void method_9653() {\r\n this.field_9138.method_4479(false);\r\n }", "public /* bridge */ /* synthetic */ void mo55096c() {\n super.mo55096c();\n }", "public void mo21825b() {\n }", "public final void mo1285b() {\n }", "public void mo6944a() {\n }", "public void mo44053a() {\n }", "public void smell() {\n\t\t\n\t}", "public boolean method_109() {\r\n return true;\r\n }", "public void mo21878t() {\n }", "public void method_6349() {\r\n super.method_6349();\r\n }", "public final /* bridge */ /* synthetic */ void mo43571c() {\n super.mo43571c();\n }", "public void mo21782G() {\n }", "public void m9741j() throws cf {\r\n }", "public void mo3376r() {\n }", "public boolean method_1456() {\r\n return true;\r\n }", "public void mo21794S() {\n }", "public void mo2740a() {\n }", "public void mo21781F() {\n }", "private ElementDebugger() {\r\n\t\t/* PROTECTED REGION ID(java.constructor._17_0_5_12d203c6_1363681638138_829588_2092) ENABLED START */\r\n\t\t// :)\r\n\t\t/* PROTECTED REGION END */\r\n\t}", "public void mo21795T() {\n }", "public static void m71676a() {\n f57214d = false;\n }", "public final /* bridge */ /* synthetic */ void mo43569b() {\n super.mo43569b();\n }", "public void mo21793R() {\n }", "protected void method_2241() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void mo4359a() {\n }", "public void mo21789N() {\n }", "public boolean c()\r\n/* 56: */ {\r\n/* 57: 77 */ return false;\r\n/* 58: */ }", "void m5770d() throws C0841b;", "public void mo1335b() {\n m18896a(false);\n }", "public final /* bridge */ /* synthetic */ void mo43566a() {\n super.mo43566a();\n }", "public void mo33392b() {\n mo33395e();\n }", "public /* bridge */ /* synthetic */ void mo55094a() {\n super.mo55094a();\n }", "public void mo23446a() {\n if (!DeeplabProcessor.m39110b()) {\n DeeplabProcessor.m39108a(this);\n }\n }", "@Override\n public boolean d() {\n return false;\n }", "public boolean mo8393h() {\n return false;\n }", "public void gored() {\n\t\t\n\t}", "public void mo1335b() {\n m18899a(false);\n }", "public void o_()\r\n/* 533: */ {\r\n/* 534:539 */ this.e = true;\r\n/* 535: */ }", "public void method_6191() {\r\n super.method_6191();\r\n }", "public void mo9137b() {\n }", "static void m7752a() {\n f8029a = true;\n }", "@Override\n public void perish() {\n \n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void mo5248a() {\n }", "public void mo1334a() {\n m18896a(true);\n }", "public boolean c()\r\n/* 36: */ {\r\n/* 37:51 */ return false;\r\n/* 38: */ }", "private void method_7083() {\r\n // $FF: Couldn't be decompiled\r\n }", "public boolean method_195() {\r\n return false;\r\n }", "public int method_209() {\r\n return 0;\r\n }", "public void mo115188a() {\n }", "static void feladat9() {\n\t}", "public boolean i()\r\n/* 46: */ {\r\n/* 47:50 */ return true;\r\n/* 48: */ }", "public boolean A_()\r\n/* 21: */ {\r\n/* 22:138 */ return true;\r\n/* 23: */ }", "static void feladat6() {\n\t}" ]
[ "0.69371724", "0.67744094", "0.67652553", "0.6717996", "0.66980207", "0.6696502", "0.66506755", "0.6650032", "0.6641723", "0.65978765", "0.6596692", "0.657968", "0.6575881", "0.65110713", "0.64943236", "0.6482621", "0.6463863", "0.6462292", "0.64187443", "0.64019626", "0.6395917", "0.6381592", "0.6364951", "0.6361378", "0.63595295", "0.6350735", "0.6346812", "0.6338041", "0.6336173", "0.6335048", "0.6325096", "0.6317617", "0.6297124", "0.6296072", "0.6273868", "0.62717456", "0.62715733", "0.62704307", "0.6265344", "0.6245669", "0.6242122", "0.6240204", "0.6235141", "0.6233869", "0.6229626", "0.6229268", "0.62209934", "0.62159646", "0.62146693", "0.61980945", "0.61967474", "0.61809355", "0.6176174", "0.6165483", "0.6165338", "0.6165041", "0.61405367", "0.61361074", "0.6113308", "0.6110039", "0.6108976", "0.61021316", "0.608695", "0.6086067", "0.60854304", "0.6083762", "0.6067944", "0.60539526", "0.6047096", "0.60453355", "0.60436153", "0.60369843", "0.6035219", "0.60333365", "0.60320336", "0.6021067", "0.60120493", "0.60087436", "0.5999069", "0.5996638", "0.5994832", "0.5990797", "0.5988539", "0.59881926", "0.59880835", "0.59854174", "0.59848386", "0.5964918", "0.59636277", "0.5957429", "0.5947561", "0.59464014", "0.5943954", "0.59432197", "0.594214", "0.59415823", "0.5940891", "0.59406996", "0.59395695", "0.5938831", "0.59308743" ]
0.0
-1
Provides a synchronous method of connecting to a server
public void connect();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void doConnect() {\r\n\t\tlogger.info(\"Connecting to server......\");\r\n\t\tChannelFuture future = null;\r\n\t\ttry {\r\n\t\t\tfuture = bootstrap.connect(new InetSocketAddress(host, port));\r\n\t\t\tfuture.addListener(channelFutureListener);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t// future.addListener(channelFutureListener);\r\n\t\t\tlogger.warn(\"Closed connection.\");\r\n\t\t}\r\n\r\n\t}", "ClientConnection connection();", "public void doConnect() {\n Debug.logInfo(\"Connecting to \" + client.getServerURI() + \" with device name[\" + client.getClientId() + \"]\", MODULE);\n\n IMqttActionListener conListener = new IMqttActionListener() {\n\n public void onSuccess(IMqttToken asyncActionToken) {\n Debug.logInfo(\"Connected.\", MODULE);\n state = CONNECTED;\n carryOn();\n }\n\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n ex = exception;\n state = ERROR;\n Debug.logError(\"connect failed\" + exception.getMessage(), MODULE);\n carryOn();\n }\n\n public void carryOn() {\n synchronized (caller) {\n donext = true;\n caller.notifyAll();\n }\n }\n };\n\n try {\n // Connect using a non-blocking connect\n client.connect(conOpt, \"Connect sample context\", conListener);\n } catch (MqttException e) {\n // If though it is a non-blocking connect an exception can be\n // thrown if validation of parms fails or other checks such\n // as already connected fail.\n state = ERROR;\n donext = true;\n ex = e;\n }\n }", "void connect(ServerEntry server, String name) throws Exception;", "public Channel connect() {\n\t\tChannelFuture channel = bootstrap.connect(new InetSocketAddress(host, port));\n\n\t\t// wait for the connection to establish\n\t\tchannel.awaitUninterruptibly();\n\n\t\tif (channel.isDone() && channel.isSuccess()) {\n\t\t\treturn channel.getChannel();\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Not able to establish connection to server\");\n\t\t}\n\t}", "public int connectAsync (SocketAddress addr)\n throws IOException,IllegalArgumentException\n {\n InetSocketAddress inetSockAddr = (InetSocketAddress) addr;\n int remotePort = inetSockAddr.getPort();\n InetAddress inetAddr = inetSockAddr.getAddress();\n String remoteHost = inetAddr.getHostAddress();\n System.out.println(\"Debug wrapper: host \" + remoteHost + \" port \" + remotePort);\n return connectAsyncNative (remoteHost, remotePort);\n }", "public void Connect() {\n run = new Thread(\"Connect\") {\n @Override\n public void run() {\n running = true;\n try {\n server = new ServerSocket(9080);\n waitingForConnection();\n } catch (IOException ex) {\n Logger.getLogger(Dashboard.class\n .getName()).log(Level.SEVERE, null, ex);\n }\n }\n };\n run.start();\n }", "private void connectToServer() throws IOException {\n\t\tna.message(\"Connecting to \" + serverAddress.getHostAddress()\n\t\t\t\t+ \" at port#: \" + portNumber);\n\t\tclientSocket = new Socket(serverAddress, portNumber);\n\t}", "public abstract void connect() throws UnknownHostException, IOException;", "public int connectAsync (String remoteHost,int remotePort)\n throws IOException,IllegalArgumentException\n {\n return connectAsyncNative (remoteHost, remotePort);\n }", "protected Channel connect() {\n\t\tint port = 6501;\n\t\t\n\t\tSocket socket1 = null, socket2 = null, socket3 = null;\n\t\tboolean fullyConnected = false;\n\t\t\n\t\t// Make several attempts to connect to the server\\\n\t\tlog.debug(\"Attemping connections with server [\" + hostIP + \"] on ports \" + port + \" through \" + (port + 2) + \".\");\n\t\tfor(int attempts = 0; !fullyConnected && attempts < 3; attempts++) {\n\t\t\ttry {\n\t\t\t\t// Connecting to the server using the IP address and port\n\t\t\t\tif(socket1 == null) socket1 = new Socket(InetAddress.getByName(hostIP), port);\n\t\t\t\tif(socket2 == null) socket2 = new Socket(InetAddress.getByName(hostIP), port + 1);\n\t\t\t\tif(socket3 == null) socket3 = new Socket(InetAddress.getByName(hostIP), port + 2);\n\t\t\t\tif(socket1 != null && socket2 != null && socket3 != null) fullyConnected = true;\n\t\t\t}\n\t\t\tcatch(IOException e) {\n\t\t\t\tlog.debug(\"Attempt \" + (attempts + 1) + \" failed. \" + e);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t// Wait a short period before attempting to connect again\n\t\t\t\t\tThread.sleep(50);\n\t\t\t\t} catch (InterruptedException e2) {\n\t\t\t\t\tlog.error(e2.getStackTrace(), e2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(socket1 == null || socket2 == null || socket3 == null) {\n\t\t\tlog.error(\"Connection timeout. (One or more sockets is null)\");\n\t\t\treturn null;\n\t\t}\n\t\telse {\n\t\t\tlog.debug(\"Fully Connected:\");\n\t\t\tlog.debug(\"ADD socket [Local: \" + socket1.getLocalPort() + \" Remote: \" + socket1.getPort() + \"]\");\n\t\t\tlog.debug(\"RETRIEVE socket [Local: \" + socket2.getLocalPort() + \" Remote: \" + socket2.getPort() + \"]\");\n\t\t\tlog.debug(\"STREAM socket [Local: \" + socket3.getLocalPort() + \" Remote: \" + socket3.getPort() + \"]\");\n\t\t\tlog.debug(\"Creating channel...\");\n\t\t\tChannel channel = new Channel(socket1, socket2, socket3);\n\t\t\tlog.debug(\"Done.\");\n\t\t\treturn channel;\n\t\t}\n\t}", "public TcpClient() {\n connector = new NioSocketConnector();\n connector.setHandler(this);\n connector.getFilterChain().addLast(\"codec\", \n new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName(\"UTF-8\")))); \n ConnectFuture connFuture = connector.connect(new InetSocketAddress(\"localhost\", TcpServer.PORT));\n connFuture.awaitUninterruptibly();\n session = connFuture.getSession();\n }", "public void connect(HTransportCallback callback, HTransportOptions options){\t\n \t\tif (connection != null && connection.isConnected()) {\n \t\t\tconnection.disconnect();\n \t\t}\n \t\t\n \t\tthis.connectionStatus = ConnectionStatus.CONNECTING;\n \t\t\n \t\tthis.callback = callback;\n \t\tthis.options = options;\n \t\t\n \t\tString serverHost = options.getServerHost();\n \t\tint serverPort = options.getServerPort();\n \t\tString serviceName = options.getJid().getDomain();\n \n \t\t//each time it connect we create a new configuration and connection objects\n \t\t//because smack doesn't allow setting host, or configuration on existing objects\n \t\t//@todo check if config has changed rather than create a new one\n \t\tthis.config = new ConnectionConfiguration(serverHost, serverPort, serviceName);\n //\t\t//patch for android to support security\n //\t\tconfig.setTruststorePath(\"/system/etc/security/cacerts.bks\");\n //\t config.setTruststoreType(\"bks\");\n \n \t // Sets whether the client will use SASL authentication when logging into the server.\n \t //config.setSASLAuthenticationEnabled(true);\n \t\t\t \n \t // Sets the TLS security mode used when making the connection.\n \t //config.setSecurityMode(SecurityMode.required);\n \t \n \t config.setReconnectionAllowed(false);\n \t config.setSendPresence(true);\n \t \n \t //add a timer to monitor connection thread. If it takes too long kill it and return conn timeout\n \t final Timer timer = new Timer();\n \t \n \t try {\n \t \tthis.connection = new XMPPConnection(config);\n \t \n \t\t final HTransportOptions localOptions = options;\n \t\t final HTransportXMPP outerClass = this;\n \t\t \n \t\t //create a thread to connect async\n \t\t this.connectionThread = new Thread(new Runnable() {\n \n \t\t\t\tpublic void run() {\n \t\t\t\t\ttry {\n \t\t\t\t\t\t//launch connection and add connection listener for errors\n \t\t\t\t\t\tconnection.connect();\n \t\t\t\t\t\tconnection.addConnectionListener(outerClass);\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t//try to login and update status\n \t\t\t\t\t\t\tconnection.login(localOptions.getUsername(), localOptions.getPassword(), localOptions.getResource());\n \t\t\t\t\t\t\tupdateStatus(ConnectionStatus.CONNECTED, null, null);\n\t\t\t\t\t\t\tPacketFilter packetFilter = new FromContainsFilter(localOptions.getHserverService());\n \t\t\t\t\t\t\tconnection.addPacketListener(outerClass,packetFilter);\n \t\t\t\t\t\t} catch(Exception e) { //login failed\n \t\t\t\t\t\t\tboolean wasConnected = false;\n \t\t\t\t\t\t\tif (connection.isConnected()) {\n \t\t\t\t\t\t\t\twasConnected = true;\n \t\t\t\t\t\t\t\tconnection.disconnect();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tconnection = null;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t//update status only if connected, because if not, it's a network error not a login error\n \t\t\t\t\t\t\tif(wasConnected) {\n \t\t\t\t\t\t\t\tupdateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.AUTH_FAILED, e.getMessage());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t} catch(Exception e) { //in case connection failed\n \t\t\t\t\t\tconnection = null;\n \t\t\t\t\t\tupdateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.TECH_ERROR , e.getMessage());\n \t\t\t\t\t}\t\n \t\t\t\t\ttimer.cancel();\n \t\t\t\t}\n \t\t\t});\n \t\t this.connectionThread.start(); //start async thread\n \t } catch(Exception e) { //in case thread creation failed or it was interrupted\n \t \tif (connection.isConnected()) {\n \t\t\t\tconnection.disconnect();\n \t\t\t}\n \t \t//e.printStackTrace();\n \t \tthis.connection = null;\n \t \tthis.updateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.TECH_ERROR, e.getMessage());\n \t }\n \t \n \t \n \t //set timer task to add a connection timeout\n \t timer.schedule(new TimerTask() {\n \t\t\t\n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tif (connectionThread != null && connectionThread.isAlive()) {\n \t\t\t\t\tconnectionThread.interrupt();\n \t\t\t\t\tif(connection.isConnected()) {\n \t\t\t\t\t\tconnection.disconnect();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tupdateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.CONN_TIMEOUT, null);\n \t\t\t}\n \t\t}, SmackConfiguration.getPacketReplyTimeout());\n \t}", "protected Channel connect() {\n\t\t\tif (channel == null) {\n\t\t\t\tinit();\n\t\t\t}\n\t\t\tSystem.out.println(\"channel === \"+channel);\n\t\t\tif (channel.isDone() && channel.isSuccess())\n\t\t\t\treturn channel.channel();\n\t\t\telse\n\t\t\t\tthrow new RuntimeException(\"Not able to establish connection to server\");\n\t\t}", "protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception {\n/* 207 */ if (localAddress != null) {\n/* 208 */ doBind0(localAddress);\n/* */ }\n/* */ \n/* 211 */ boolean success = false;\n/* */ try {\n/* 213 */ javaChannel().connect(remoteAddress);\n/* 214 */ success = true;\n/* 215 */ return true;\n/* */ } finally {\n/* 217 */ if (!success) {\n/* 218 */ doClose();\n/* */ }\n/* */ } \n/* */ }", "private synchronized int srvConnect() {\n \n\t\ttry {\n\t\t\t// The address to connect to\n\t\t\tSystem.out.println(TAG + \":Address:\" + getAddress());\n\t\t\tSystem.out.println(TAG + \":Port:\" + String.valueOf(getPort()));\n\t\t\taddr = InetAddress.getByName(getAddress());\n\t\t\t// The address plus the port\n\t\t\tservAddress = new InetSocketAddress(addr, getPort());\n\n\t\t\t// Try to connect\n\t\t\tmysock = new Socket();\n\t\t\t// This socket will block/ try connect for 5s\n\t\t\tmysock.connect(servAddress, 5000);\n\t\t\t// Show me if i was connected successfully\n\t\t\tif (mysock.isConnected()) {\n\t\t\t\tif(out == null){\n\t\t\t\t\tout = new PrintWriter(mysock.getOutputStream(),true);\n\t\t\t\t\tSystem.out.println(TAG + \":New socket and new streamer was created.\");\n\t\t\t\t}\n\t\t\t}\n \n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(TAG + \":Null Pointer occured.\");\n\t\t\treturn -1;\n\t\t} catch (UnknownHostException e) {\n\t\t\tSystem.out.println(TAG + \":Server does not exist.\");\n\t\t\treturn -1;\n\t\t} catch (IOException e) {\n\t\t\tif (e instanceof SocketException && e.getMessage().contains(\"Permission denied\")) {\n\t\t\t\tSystem.out.println(TAG + \":You don't have internet permission:\" + e);\n\t\t\t} else if(e instanceof ConnectException && e.getMessage().contains(\"Connection refused\")){\n\t\t\t\tSystem.out.println(TAG + \":Connection is refused, the service on the server is probably down:\" + e);\n\t\t\t} else {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.out.println(TAG + \":Could not connect\");\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n \n\t\treturn 0;\n\t}", "private synchronized void doConnect() {\n try {\n String host = agent.getHost();\n int port = agent.getPort();\n log.fine(\"Connecting to server \" + host + ':' + port);\n socket = new Socket(host, port);\n input = socket.getInputStream();\n output = new OutputStreamWriter(socket.getOutputStream());\n disconnected = false;\n new Thread(this).start();\n\n // Automatically login! -> give an auth to the agent...\n TACMessage msg = new TACMessage(\"auth\");\n msg.setParameter(\"userName\", agent.getUser());\n msg.setParameter(\"userPW\", agent.getPassword());\n msg.setMessageReceiver(agent);\n sendMessage(msg);\n\n } catch (Exception e) {\n disconnected = true;\n log.log(Level.SEVERE, \"connection to server failed:\", e);\n socket = null;\n }\n }", "public CompletableFuture<TarantoolConnection> singleConnection(InetSocketAddress serverAddress) {\n CompletableFuture<Channel> connectionFuture = new CompletableFuture<>();\n RequestFutureManager requestManager = new RequestFutureManager(config);\n TarantoolVersionHolder versionHolder = new TarantoolVersionHolder();\n ChannelFuture future = bootstrap.clone()\n .handler(new TarantoolChannelInitializer(config, requestManager, versionHolder, connectionFuture))\n .remoteAddress(serverAddress).connect();\n future.addListener((ChannelFutureListener) f -> {\n //TODO reconnect when failed\n if (!f.isSuccess()) {\n connectionFuture.completeExceptionally(new TarantoolClientException(\n \"Failed to connect to the Tarantool server\", f.cause()));\n }\n });\n return connectionFuture.thenApply(ch -> new TarantoolConnectionImpl(requestManager, versionHolder, ch));\n }", "public void connect() {}", "public void conectServer() {\n\n\t}", "public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }", "public Object startSync(\r\n\t\t\tString serverHost,\r\n\t\t\tshort serverPort,\r\n\t\t\tbyte[] serverCertificate,\r\n\t\t\tString serverUniqueId,\r\n\t\t\tString notifyEndpoint\r\n\t\t\t);", "private void attemptToConnect() {\n LOG.warn(\"Attempting to connect....\");\n \n if (// No connection configuration\n getConnectionConfiguration() == null &&\n (getServerHostname() == null || getServerPort() == 0 ||\n getServiceName() == null || getFromAddress() == null ||\n getPassword() == null || getResource() == null)\n \n ||\n \n // Already logged in.\n getConnection() != null && getConnection().isAuthenticated()) {\n \n return;\n }\n \n try {\n if (getConnectionConfiguration() == null) {\n setConnectionConfiguration(new ConnectionConfiguration(\n getServerHostname(), getServerPort(), getServiceName()));\n }\n\n connect();\n }\n catch (Throwable t) {\n LOG.error(t);\n }\n }", "@Override\r\n public Object connect() {\n if(status()){\r\n //creates thread that checks messages in the network\r\n System.out.println(\"notifying network that connection is good\");\r\n notifyObservers(this);\r\n }\r\n return socket;\r\n }", "synchronized private final void connectToServer() throws IOException {\n if(this.provider.useSSH()){\n if(this.userinfo == null) this.userinfo = new SSHSocket.SshUserInfo();\n this.sock = MdsIp.newSSHSocket(this.userinfo, this.provider);\n }else this.sock = new Socket(this.provider.host, this.provider.port);\n if(DEBUG.D) System.out.println(this.sock.toString());\n this.sock.setTcpNoDelay(true);\n this.dis = this.sock.getInputStream();\n this.dos = this.sock.getOutputStream();\n /* connect to mdsip */\n final Message message = new Message(this.provider.user, this.getMsgId());\n message.useCompression(this.use_compression);\n this.sock.setSoTimeout(3000);\n long tick = -System.nanoTime();\n message.send(this.dos);\n final Message msg = Message.receive(this.dis, null);\n tick += System.nanoTime();\n if(DEBUG.N) System.out.println(tick);\n this.isLowLatency = tick < 50000000;// if response is faster than 50ms\n this.sock.setSoTimeout(0);\n if(msg.header.get(4) == 0){\n this.close();\n return;\n }\n this.receiveThread = new MRT();\n this.receiveThread.start();\n this.connected = true;\n MdsIp.this.dispatchMdsEvent(new MdsEvent(this, MdsEvent.HAVE_CONTEXT, \"Connected to \" + this.provider.toString()));\n }", "private void connectToServer() {\n\t\ttry {\n\t\t\tsocket = new Socket(InetAddress.getLocalHost(), Server.SERVER_PORT);\n\t\t\tin = new BufferedReader(new InputStreamReader(\n\t\t\tsocket.getInputStream()));\n\t\t\tout = new PrintWriter(socket.getOutputStream());\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot connect to server\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "public <T extends ClientHandler> AsyncResult<T> connectTo(\n int port,\n String host,\n Signature.PublicKey remotePublicKey,\n ClientHandlerFactory<T> handlerFactory) {\n client = vertx.createNetClient(new NetClientOptions().setTcpKeepAlive(true));\n CompletableAsyncResult<T> completion = AsyncResult.incomplete();\n client.connect(port, host, res -> {\n if (res.failed()) {\n completion.completeExceptionally(res.cause());\n } else {\n NetSocket socket = res.result();\n new NetSocketClientHandler<T>(\n loggerProvider.getLogger(host + \":\" + port),\n socket,\n remotePublicKey,\n handlerFactory,\n completion);\n }\n });\n\n return completion;\n }", "public static void connect() {\n \t\tconnPool.start();\n \t}", "private boolean connectServer() {\n\t\tclNetwork networkInfo = new clNetwork();\n\t\ttry {\n\t\t\tSocket _socket = new Socket(dstAddress, networkInfo.NTP_PORT);\n\t\t\t_socket.setSoTimeout(1000);\n\t\t\t_socket.setTcpNoDelay(true);\n\t\t\topenedSocket = _socket;\n\t\t\tinStream = openedSocket.getInputStream();\n\t\t\toutStream = openedSocket.getOutputStream();\n\t\t\treturn true;\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public Socket connect() {\n\t\ttry{\n\t\t connection = new Socket(serverAddress, port);\n\t\t System.out.println(\"Connessione aperta\");\n\t\t}\n\t\tcatch(ConnectException e){\n\t\t System.err.println(\"Server non disponibile!\");\n\t\t}\n\t\tcatch(UnknownHostException e1){\n\t\t System.err.println(\"Errore DNS!\");\n\t\t}\t\t\n\t\tcatch(IOException e2){//\n\t\t System.err.println(e2);\n\t\t e2.printStackTrace();\n\t\t}\n\t\treturn connection;\n }", "public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "void connect() throws UnknownHostException, IOException {\n\t\tif (isConnected()) {\n\t\t\tdisconnect();\n\t\t}\n\t\t\n\t\tif (!ssl) {\n\t\t\tsock = new Socket();\n\t\t} else {\n\t\t\tsock = SSLSocketFactory.getDefault().createSocket();\n\t\t}\n\t\tsock.connect(new InetSocketAddress(host, port));\n\t\t\n\t\tif (sock != null) {\n\t\t\tsock.setKeepAlive(true);\n\t\t\tinStream = new UByteInputStream(new BufferedInputStream(sock.getInputStream(), sock.getReceiveBufferSize()));\n\t\t\tconnected();\n\t\t}\n\t}", "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}", "public void connect() throws IOException;", "public boolean connectTo(Recipient server) {\r\n\t\ttry {\r\n\t\t\tserverConnection = new Server(new NetworkConnection(server,\r\n\t\t\t\t\tresourceManager.getMessageParser(), this));\r\n\t\t\tEventLogger.log(\"Client now connected to server: \"\r\n\t\t\t\t\t+ server.getIPAddressString() + \" on port: \"\r\n\t\t\t\t\t+ server.getPortNumber());\r\n\t\t\tconnected.set(true);\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\tErrorLogger.log(e.getMessage());\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void connect() {\n synchronized (globalLock) {\n if (isRunning) {\n throw new IllegalStateException(\"WebSocketClient is not reusable\");\n }\n\n this.isRunning = true;\n createAndStartConnectionThread();\n }\n }", "public Reply connect(String connectAddress, int connectPort) throws ThingsException, InterruptedException;", "public void awaitConnection(){\n System.out.println(\"Waiting for connection from client\");\n\n try {\n socket = server.accept();\n System.out.println(\"Client Connected!\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void connecting() {\n\n }", "private void connect() {\n ftp.connect();\n if (ftp.goodReply()) sendResponse(\"Connected\");\n else sendResponse(\"Could not connect to server\");\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 }", "private void establishServerConnection() {\n int lb_port = Integer.parseInt(gui.getLBPort_Text().getText());\n gui.getLBPort_Text().setEnabled(false);\n String lb_ip = gui.getLBIP_Text().getText();\n gui.getLBIP_Text().setEnabled(false);\n int server_port = Integer.parseInt(gui.getServerPort_Text().getText());\n gui.getServerPort_Text().setEnabled(false);\n String server_ip = gui.getServerIP_Text().getText();\n gui.getServerIP_Text().setEnabled(false);\n obtainId(server_ip, server_port);\n lbInfo = new ConnectionInfo(lb_ip, lb_port, 3);\n\n if (connection.startServer(server_port)) {\n connectionHandler = new ServerConnections(connection, lbInfo, requestsAnswered, processingRequests, gui.getCompleted_Text(), gui.getProcessing_Text());\n new Thread(connectionHandler).start();\n\n requestServerId();\n scheduler.scheduleAtFixedRate(heartbeat, 10, 10, TimeUnit.SECONDS);\n } else {\n gui.getLBPort_Text().setEnabled(true);\n gui.getLBIP_Text().setEnabled(true);\n gui.getServerPort_Text().setEnabled(true);\n gui.getServerIP_Text().setEnabled(true);\n gui.getButton_Connect().setEnabled(true);\n }\n }", "public static Comms connect() {\r\n\t\tComms client = null;\r\n\t\ttry(ServerSocket server = new ServerSocket(4444)) {\r\n\t\t\tclient = new Comms(server.accept());\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn client;\r\n\t}", "public void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(host, port);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error connecting: \" + e.getMessage());\n\t\t}\n\t}", "public void establishSocketConnection() {\n\t\ttry {\n\t\t\tsocket = new Socket(serverIP, serverPort);\n\t\t\tlogger.info(\"Connection with JSON-RPC server opened at local endpoint \" + socket.getLocalAddress().getHostAddress() + \":\" + socket.getLocalPort());\n\t\t\t// create a writer to send JSON-RPC requests to the JSON-RPC server\n\t\t\twriter = new OutputStreamWriter(socket.getOutputStream(), \"utf-8\");\n\t\t\t// create a JsonReader object to receive JSON-RPC response\n\t\t\tjsonReader = new JsonReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void connect() throws IOException {\n\t\tsocket = new Socket(host, port);\n\t\tin = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\tout = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));\n\t\tconnected = true;\n\t\texecutor = Executors.newScheduledThreadPool(5);\n\t}", "public boolean initAndConnectToServer() {\n try {\n mTCPSocket.connect(new InetSocketAddress(mIpAdress, port), 1000);\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n return true;\n }", "@Override\n public synchronized void connect() throws AlluxioStatusException {\n if (mConnected) {\n return;\n }\n disconnect();\n Preconditions.checkState(!mClosed, \"Client is closed, will not try to connect.\");\n\n IOException lastConnectFailure = null;\n RetryPolicy retryPolicy = mRetryPolicySupplier.get();\n\n while (retryPolicy.attempt()) {\n if (mClosed) {\n throw new FailedPreconditionException(\"Failed to connect: client has been closed\");\n }\n // Re-query the address in each loop iteration in case it has changed (e.g. master\n // failover).\n try {\n mServerAddress = queryGrpcServerAddress();\n } catch (UnavailableException e) {\n LOG.debug(\"Failed to determine {} rpc address ({}): {}\",\n getServiceName(), retryPolicy.getAttemptCount(), e.toString());\n continue;\n }\n try {\n beforeConnect();\n LOG.debug(\"Alluxio client (version {}) is trying to connect with {} @ {}\",\n RuntimeConstants.VERSION, getServiceName(), mServerAddress);\n // set up rpc group channel\n mChannel = createChannel();\n // Create stub for version service on host\n mVersionService = ServiceVersionClientServiceGrpc.newBlockingStub(mChannel);\n mConnected = true;\n afterConnect();\n checkVersion(getServiceVersion());\n\n LOG.debug(\"Alluxio client (version {}) is connected with {} @ {}\", RuntimeConstants.VERSION,\n getServiceName(), mServerAddress);\n return;\n } catch (IOException e) {\n LOG.debug(\"Failed to connect ({}) with {} @ {}\", retryPolicy.getAttemptCount(),\n getServiceName(), mServerAddress, e);\n lastConnectFailure = e;\n if (e instanceof UnauthenticatedException) {\n // If there has been a failure in opening GrpcChannel, it's possible because\n // the authentication credential has expired. Re-login.\n mContext.getUserState().relogin();\n }\n if (e instanceof NotFoundException) {\n // service is not found in the server, skip retry\n break;\n }\n }\n }\n // Reaching here indicates that we did not successfully connect.\n if (mChannel != null) {\n mChannel.shutdown();\n }\n\n if (mServerAddress == null) {\n throw new UnavailableException(\n String.format(\"Failed to determine address for %s after %s attempts\", getServiceName(),\n retryPolicy.getAttemptCount()));\n }\n\n /*\n * Throw as-is if {@link UnauthenticatedException} occurred.\n */\n if (lastConnectFailure instanceof UnauthenticatedException) {\n throw (AlluxioStatusException) lastConnectFailure;\n }\n if (lastConnectFailure instanceof NotFoundException) {\n throw new NotFoundException(lastConnectFailure.getMessage(),\n new ServiceNotFoundException(lastConnectFailure.getMessage(), lastConnectFailure));\n }\n\n throw new UnavailableException(\n String.format(\n \"Failed to connect to master (%s) after %s attempts.\"\n + \"Please check if Alluxio master is currently running on \\\"%s\\\". Service=\\\"%s\\\"\",\n mServerAddress, retryPolicy.getAttemptCount(), mServerAddress, getServiceName()),\n lastConnectFailure);\n }", "public void connect(String hostname, ClientInfo clientInfo){\n\t\tMainLoop.schedule(new ConnectTask(hostname, clientInfo, this));\n\t}", "private SocketChannel connectToJavaServer() throws IOException {\n\t\t\tSocketChannel java_server_socket_channel;\n\t\t\tjava_server_socket_channel = SocketChannel.open();\n\t\t\tjava_server_socket_channel.configureBlocking(true);\n\t\t\tjava_server_socket_channel.connect(new InetSocketAddress(JAVA_SERVER_INET_ADDRESS, JAVA_PORT));\n\t\t\tjava_server_socket_channel.configureBlocking(false);\n\t\t\treturn java_server_socket_channel;\n\t\t}", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "private void connectUsingToken() {\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(sslContext.getSocketFactory());\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(Server.ADDRESS, Server.PORT_NUMBER);\n\t\t\tthis.oos = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tthis.ois = new ObjectInputStream(socket.getInputStream());\n\t\t\tServerListener serverlistener = new ServerListener();\n\t\t\tserverlistener.start();\n\t\t\tRequest request = new Request(RequestCode.START_DOCUMENT_STREAM);\n\t\t\trequest.setUsername(user.getUsername());\n\t\t\toos.writeObject(request);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void connect() throws Exception;", "private void connectUsingCertificate() {\n\t\tfinal String METHOD = \"connectUsingCertificate\";\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\t\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\t/* This isn't needed as the production messaging.internetofthings.ibmcloud.com \n\t\t\t * certificate should already be in trust chain.\n\t\t\t * \n\t\t\t * See: \n\t\t\t * http://stackoverflow.com/questions/859111/how-do-i-accept-a-self-signed-certificate-with-a-java-httpsurlconnection\n\t\t\t * https://gerrydevstory.com/2014/05/01/trusting-x509-base64-pem-ssl-certificate-in-java/\n\t\t\t * http://stackoverflow.com/questions/12501117/programmatically-obtain-keystore-from-pem\n\t\t\t * https://gist.github.com/sharonbn/4104301\n\t\t\t * \n\t\t\t * CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\t\t\t * InputStream certFile = AbstractClient.class.getResourceAsStream(\"messaging.pem\");\n\t\t\t * Certificate ca = cf.generateCertificate(certFile);\n\t\t\t *\n\t\t\t * KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t\t * keyStore.load(null, null);\n\t\t\t * keyStore.setCertificateEntry(\"ca\", ca);\n\t\t\t * TrustManager trustManager = TrustManagerUtils.getDefaultTrustManager(keyStore);\n\t\t\t * SSLContext sslContext = SSLContextUtils.createSSLContext(\"TLSv1.2\", null, trustManager);\n\t\t\t * \n\t\t\t */\n\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\t//Validate the availability of Server Certificate\n\t\t\t\n\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tserverCert = trimedValue(options.getProperty(\"Server-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Server Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Client Certificate\n\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tclientCert = trimedValue(options.getProperty(\"Client-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t//Validate the availability of Client Certificate Key\n\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")).contains(\".key\")){\n\t\t\t\t\tclientCertKey = trimedValue(options.getProperty(\"Client-Key\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only Certificate key in .key format is supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Key is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Certificate Password\n\t\t\ttry{\n\t\t\tif (trimedValue(options.getProperty(\"Certificate-Password\")) != null){\n\t\t\t\tcertPassword = trimedValue(options.getProperty(\"Certificate-Password\"));\n\t\t\t\t} else {\n\t\t\t\t\tcertPassword = \"\";\n\t\t\t\t}\n\t\t\t} catch (Exception e){\n\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Certificate Password is missing\", e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(getSocketFactory(serverCert, clientCert, clientCertKey, certPassword));\n\n\t\t} catch (Exception e) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, \"Unable to configure TLSv1.2 connection: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ZooKeeper connect(String host) throws Exception {\r\n zk = new ZooKeeper(host, 3000, new Watcher() {\r\n public void process(WatchedEvent event) {\r\n if (event.getState() == KeeperState.SyncConnected) {\r\n connSignal.countDown();\r\n }\r\n }\r\n });\r\n connSignal.await();\r\n return zk;\r\n }", "public boolean connect(){\r\n\r\n\t\t// Connect to server via TCP socket\r\n\t\ttry {\r\n\r\n\t\t\tclient = new Socket(host, port);\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"[EXCEPTION] connecting to server\");\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Connection to server could not be made. Try again later.\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\r\n\t\t// Get input and output Streams\r\n\t\ttry {\r\n\r\n\t\t\tpw = new PrintWriter(client.getOutputStream());\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(client.getInputStream()));\r\n\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"[EXCEPTION] creating streams\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Connection to server SUCESSFULL\");\r\n\t\treturn true;\r\n\t}", "public void connect(String host, int port) throws IllegalStateException,\n \t\t\tIOException, JHGDException {\n \t\t// Check if the client is already connected\n \t\tif (connected) {\n \t\t\tthrow new IllegalStateException(\"Client already connected to \"\n \t\t\t\t\t+ host + \" on port \" + port);\n \t\t}\n \n \t\t// Open socket\n \t\topenSocket(host, port);\n \n \t\tString returnMessage = (String) input.readLine();\n \n \t\tif (checkServerResponse(returnMessage) != HGDConsts.SUCCESS) {\n \t\t\tthrow new JHGDException(returnMessage.substring(returnMessage\n \t\t\t\t\t.indexOf('|') + 1));\n \t\t}\n \t\t\n \t\tString protocolVersion = requestProto();\n \t\tif ( !protocolVersion.equalsIgnoreCase(HGDConsts.PROTOCOLVERSION)) {\n \t\t\tthrow new JHGDException(\"Incompatible protocols. Client: \" + HGDConsts.PROTOCOLVERSION + \", Daemon: \" + protocolVersion);\n \t\t}\n \t\t\n \t\t// set the flags\n \t\tthis.connected = true;\n \t\tthis.authenticated = false;\n \t\tthis.host = host;\n \t\tthis.port = port;\n \t\tthis.username = null;\n \t\tthis.password = null;\n \t\t\n \t}", "public Status connect()\n {\n return connect(5.0);\n }", "void connect( String name,\n ServerSocket socket,\n ConnectionHandlerFactory handlerFactory,\n ThreadPool threadPool )\n throws Exception;", "protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}", "private TTransport connectToServer(InetSocketAddress serverAddress) throws Exception {\n TTransport thriftTransport = createTransport(serverAddress);\n thriftTransport.open();\n LOGGER.debug(\"Successfully opened transport {} to {}\", thriftTransport, serverAddress);\n return thriftTransport;\n }", "private void connectToServer(String uri) {\n Log.i(\"Connection with server\", \"start\");\n try {\n socket = IO.socket(uri);\n } catch (URISyntaxException e) {\n throw new RuntimeException(e);\n }\n\n // Set the created socket in the SocketHandler\n SocketHandler.setSocket(socket);\n\n socket.on(Socket.EVENT_CONNECT,onConnect);\n socket.on(Socket.EVENT_DISCONNECT,onDisconnect);\n socket.on(Socket.EVENT_CONNECT_ERROR, onConnectError);\n socket.on(Socket.EVENT_CONNECT_TIMEOUT, onConnectError);\n socket.on(\"userData\", onUserData);\n socket.on(\"updateUserResponse\", onUpdateUserResponse);\n socket.on(\"loginResponse\", onLoginResponse);\n socket.on(\"highScoreData\", onHighScoreData);\n socket.on(\"lobbyData\", onLobbyData);\n socket.on(\"userLeft\", onUserLeft);\n socket.on(\"newUserInLobby\", onNewUserInLobby);\n socket.on(\"userCreated\", onUserCreated);\n socket.on(\"chatData\", onChatData);\n socket.on(\"newMessage\", onNewMessage);\n socket.on(\"notLoggedIn\", onNotLoggedIn);\n socket.connect();\n\n Log.i(\"Connection with server\", \"done\");\n }", "public void connectToServer() throws IOException {\n\t\t\tString serverAddress = \"localhost\";\r\n\r\n\t\t\t// Make connection and initialize streams\r\n\t\t\tsocket = new Socket(serverAddress, 9898);\r\n\t\t\tin = new BufferedReader(\r\n\t\t\t\t\tnew InputStreamReader(socket.getInputStream()));\r\n\t\t\tout = new PrintWriter(socket.getOutputStream(), true);\r\n\t\t}", "abstract T connect();", "public void run() {\n // Initial connect request comes in\n Request request = getRequest();\n\n if (request == null) {\n closeConnection();\n return;\n }\n\n if (request.getConnectRequest() == null) {\n closeConnection();\n System.err.println(\"Received invalid initial request from Remote Client.\");\n return;\n }\n\n ObjectFactory objectFactory = new ObjectFactory();\n Response responseWrapper = objectFactory.createResponse();\n responseWrapper.setId(request.getId());\n responseWrapper.setSuccess(true);\n responseWrapper.setConnectResponse(objectFactory.createConnectResponse());\n responseWrapper.getConnectResponse().setId(id);\n\n // Return connect response with our (statistically) unique ID.\n if (!sendMessage(responseWrapper)) {\n closeConnection();\n System.err.println(\"Unable to respond to connect Request from remote Client.\");\n return;\n }\n\n // register our thread with the server\n Server.register(id, this);\n\n // have handler manage the protocol until it decides it is done.\n while ((request = getRequest()) != null) {\n\n Response response = handler.process(this, request);\n\n if (response == null) {\n continue;\n }\n\n if (!sendMessage(response)) {\n break;\n }\n }\n\n // client is done so thread can be de-registered\n if (handler instanceof IShutdownHandler) {\n ((IShutdownHandler) handler).logout(Server.getState(id));\n }\n Server.unregister(id);\n\n // close communication to client.\n closeConnection();\n }", "protected Socket connectHost() throws KVException {\n try {\n \treturn new Socket(this.server, this.port);\n } catch (UnknownHostException uhe) {\n \tthrow new KVException(ERROR_COULD_NOT_CONNECT);\n } catch (IOException ioe) {\n \tthrow new KVException(ERROR_COULD_NOT_CREATE_SOCKET);\n }\n }", "void connect() throws TransportException;", "public ZooKeeper connect(String host) throws Exception {\n\t\tzk = new ZooKeeper(host, 2101, new Watcher() {\n\t\t\tpublic void process(WatchedEvent event) {\n\t\t\t\tif (event.getState() == KeeperState.SyncConnected) {\n\t\t\t\t\tconnSignal.countDown();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tconnSignal.await();\n\t\treturn zk;\n\t}", "public void OnConnectSuccess();", "public void connect() {\n if (isShutdown)\n return;\n\n setNewConnection(reconnectInternal());\n }", "private void connection() {\n boolean connect;\n try {\n connect = true;\n this.jTextArea1.setText(\"Server starts...\");\n server = new MultiAgentServer(this);\n String ip = \"\";\n int errorBit = 256;\n for (int i = 0; i < server.getIpAddr().length; i++) {\n int currentIP = server.getIpAddr()[i];\n if (currentIP < 0) {\n currentIP += errorBit;\n }\n ip += currentIP + \".\";\n }\n ip = ip.substring(0, ip.length() - 1);\n System.out.println(ip);\n Naming.rebind(\"//\" + ip + \"/server\", server);\n this.jTextArea1.setText(\"Servername: \" + ip);\n this.jTextArea1.append(\"\\nServer is online\");\n } catch (MalformedURLException | RemoteException e) {\n this.jTextArea1.append(\"\\nServer is offline, something goes wrong!!!\");\n connect = false;\n }\n if (dialog.getMusicBox().isSelected()) {\n sl = new SoundLoopExample();\n }\n reconnectBtn.setEnabled(!connect);\n }", "default void connect() { }", "void handshake() throws SyncConnectionException;", "public void connect() throws ConnectionFailedException\n {\n isConnected = true;\n }", "private void startKlient() {\n\t\tSystem.out.println(\"Trying to connect\");\r\n\t\ttry (Socket serverkontakt = new Socket(\"127.0.0.1\", 8000);\r\n\t\t// Step 2 - obtaining input/output streams\r\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(\r\n\t\t\t\t\t\tserverkontakt.getOutputStream())) {\r\n\t\t\toutput.flush();\r\n\t\t\tSystem.out.println(\"Connected\");\r\n\t\t\tsendObject(output);\r\n\t\t} catch (EOFException eofException) {\r\n\t\t\tSystem.out.println(\"Server closing connection\\n\");\r\n\t\t} catch (IOException ioException) {\r\n\t\t\tSystem.out.println(\"Problem with server connection\\n\");\r\n\t\t}\r\n\t}", "public void connect() throws IOException {\n/* 151 */ this.delegate.connect();\n/* */ }", "public ZooKeeper connect() throws InterruptedException, IOException {\n zooKeeper = new ZooKeeper(\"127.0.0.1:2181\", 5000, new Watcher() {\n public void process(WatchedEvent watchedEvent) {\n if (watchedEvent.getState() == Event.KeeperState.SyncConnected) {\n countDownLatch.countDown();\n }\n }\n });\n countDownLatch.await();\n return zooKeeper;\n }", "private Channel connect(ChannelInitializer<SocketChannel> handler) {\n // Configure worker pools and buffer allocator\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n Bootstrap b = new Bootstrap();\n b.group(workerGroup);\n b.channel(NioSocketChannel.class);\n b.option(ChannelOption.SO_KEEPALIVE, true);\n // TODO(user): Evaluate use of pooled allocator\n b.option(ChannelOption.ALLOCATOR, UnpooledByteBufAllocator.DEFAULT);\n\n // Install the handler\n b.handler(handler);\n\n // Connect and wait for connection to be available\n ChannelFuture channelFuture = b.connect(host, port);\n try {\n // Wait for the connection\n channelFuture.get(5, TimeUnit.SECONDS);\n channel = channelFuture.channel();\n ChannelFuture closeFuture = channel.closeFuture();\n closeFuture.addListener(new WorkerCleanupListener(b.group()));\n return channel;\n } catch (TimeoutException te) {\n throw new IllegalStateException(\"Timeout waiting for connection to \" + host + \":\" + port, te);\n } catch (Throwable t) {\n throw new IllegalStateException(\"Error connecting to \" + host + \":\" + port, t);\n }\n }", "@Override\n public abstract void connect();", "public static Socket ConnectionToServer(){\n try {\n // Gathers the information from server.config file\n resources.GetPropertyValues properties = new resources.GetPropertyValues();\n properties.ReadPropertyFile();\n\n // Create a socket connect If the server connection was made\n return new Socket(properties.serverName, GetPropertyValues.port);\n } catch (IOException e) {\n\n // Alert the user that the server is offline. Produce a pop up window\n DialogWindow.ShowErrorPane(\"Server is offline\", \"Error\");\n return new Socket();\n }\n }", "@Override\n public boolean connect() {\n\n if (!isConnected) {\n try {\n\n Socket socket = new Socket(hostName, portNumber);\n out = new PrintWriter(socket.getOutputStream(), true);\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n isConnected = true;\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return isConnected;\n }", "public Connection getConnection();", "public Connection getConnection();", "public Connection getConnection();", "void startConnectionReader()\n {\n if (! synchronousMode)\n {\n connectionReader.start();\n }\n }", "@Override\r\n\tpublic void connect(URL url) throws RemoteException {\n\t\tclientPool=ClientPoolManager.INSTANCE.getClientPool(url);\r\n\r\n\t}", "private void establishConnection() throws UnknownHostException, \n \t\t\t\t\t\t\t\t\t\t IOException {\n \t socket = new Socket(serverIP, serverPort);\n }", "@Override\r\n\tpublic ServerBean connect(String username, String password)\r\n\t\t\tthrows RemoteException {\n\t\treturn null;\r\n\t}", "@Override\n public void run()\n {\n close(false);\n try\n {\n if (!isConnected())\n connectMS(msServer.getIp(), msServer.getPort());\n }\n catch (Exception e)\n {\n Log.e(\"Dudu_SDK\",\n \"getServer ...failed ...user default server... \");\n }\n }", "protected void connect() {\n for (int attempts = 3; attempts > 0; attempts--) {\n try {\n Socket socket = new Socket(\"localhost\", serverPort);\n attempts = 0;\n\n handleConnection(socket);\n }\n catch (ConnectException e) {\n // Ignore the 'connection refused' message and try again.\n // There may be other relevant exception messages that need adding here.\n if (e.getMessage().equals(\"Connection refused (Connection refused)\")) {\n if (attempts - 1 > 0) {\n // Print the number of attempts remaining after this one.\n logger.warning(\"Connection failed (\" + name + \"). \" + \n (attempts - 1) + \" attempts remaining.\");\n }\n else {\n logger.severe(\"Connection failed (\" + name + \"). \");\n }\n }\n else {\n logger.severe(e.toString());\n break;\n }\n }\n catch (Exception e) {\n logger.severe(\"Socket on module '\" + name + \"': \" + e.toString());\n }\n }\n }", "Socket connect() throws CommunicationException {\r\n\t\treturn connect(null);\r\n\t}", "public Socket connect() {\r\n\t\ts = null;\r\n\t\ttry {\r\n\t\t\ts = new Socket(hostName, port);\r\n\t\t\tdos = Utils.deflatedDataOut(s.getOutputStream(), 8);\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn s;\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}", "public void connect() throws Exception\n\t{\n\t\tHostnameVerifier hv = new HostnameVerifier()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic boolean verify(String urlHostName, SSLSession session)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\ttrustAllHttpsCertificates();\n\t\tHttpsURLConnection.setDefaultHostnameVerifier(hv);\n\t\t// These following methods have to be called in this order.\n\t\tinitSvcInstRef();\n\t\tinitVimPort();\n\t\tinitServiceContent();\n\t\tvimPort.login(serviceContent.getSessionManager(), user, password, null);\n\t\tinitPropertyCollector();\n\t\tinitRootFolder();\n\t\tisConnected = true;\n\t}", "public void connect() throws Exception\n {\n if(connected)\n return;\n connectionSocket = new Socket(address, CommonRegister.DEFAULT_PORT);\n localPeerID = ++localPeerIDCount;\n initListener();\n reader = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));\n writer = new PrintWriter(connectionSocket.getOutputStream(),true);\n connected = true;\n }", "@Override\n\tprotected void onConnect() {\n\t\tLogUtil.debug(\"server connect\");\n\n\t}", "void connect( String name,\n ServerSocket socket,\n ConnectionHandlerFactory handlerFactory )\n throws Exception;", "public void start()\r\n\t\t{\r\n\t\tDebug.assert(serverSocket != null, \"(Server/123)\");\r\n\r\n \t// flag the server as running\r\n \tstate = RUNNING;\r\n\r\n // Loop while still listening, accepting new connections from the server socket\r\n while (state == RUNNING)\r\n \t{\r\n // Get a connection from the server socket\r\n\t\t\tSocket socket = null;\r\n\t\t\ttry {\r\n socket = serverSocket.accept();\r\n \tif (state == RUNNING) \r\n \t createLogin(socket);\r\n }\r\n \r\n // The socket timeout allows us to check if the server has been shut down.\r\n // In this case the state will not be RUNNING and the loop will end.\r\n\t\t catch ( InterruptedIOException e )\r\n\t\t \t{\r\n\t\t \t// timeout happened\r\n\t\t \t}\r\n\t\t \r\n\t\t // This shouldn't happen...\r\n \t catch ( IOException e )\r\n \t \t{\r\n log(\"Server: Error creating Socket\");\r\n \t \tDebug.printStackTrace(e);\r\n \t }\r\n\t }\r\n\t \r\n\t // We've finished, clean up\r\n disconnect();\r\n\t\t}" ]
[ "0.6853442", "0.67947346", "0.6767561", "0.65208256", "0.6494176", "0.63263386", "0.6256023", "0.6243111", "0.6232915", "0.620291", "0.61955047", "0.6152016", "0.6122587", "0.6101149", "0.6094804", "0.60908014", "0.6083017", "0.60704833", "0.60643893", "0.6032996", "0.59916717", "0.5990811", "0.59853065", "0.5963211", "0.59512305", "0.594763", "0.59435004", "0.5933521", "0.59216565", "0.5908389", "0.590366", "0.59016913", "0.58892864", "0.58764327", "0.58678687", "0.5864963", "0.5864503", "0.585698", "0.5856357", "0.58452207", "0.5841523", "0.58100027", "0.5803839", "0.5799924", "0.5787008", "0.5781622", "0.5766103", "0.5764546", "0.5758762", "0.5724598", "0.5722383", "0.57122034", "0.57105446", "0.57059944", "0.5701143", "0.5693275", "0.56847304", "0.5670411", "0.5658207", "0.5641869", "0.5632481", "0.5630232", "0.562344", "0.5622244", "0.56131566", "0.5591485", "0.558585", "0.55789226", "0.5570951", "0.55703366", "0.55645406", "0.5559364", "0.5557234", "0.5551527", "0.55420524", "0.55403256", "0.55301416", "0.5525189", "0.55238616", "0.55188847", "0.5512097", "0.5512", "0.55085546", "0.55085546", "0.55085546", "0.5505151", "0.55041295", "0.5502885", "0.54955435", "0.5484639", "0.54808867", "0.5475035", "0.5457925", "0.5457284", "0.54571754", "0.5455208", "0.54550683", "0.5453201" ]
0.59366494
29
Disconnects the user from the server
public void disconnect();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onDisconnect(User user);", "public void disconnectUser(User user) {\n connect();\n\n try {\n doStream.writeUTF(\"DISCONNECT\");\n doStream.writeUTF(user.getUserName());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n disconnect();\n }", "public static opCode logoutUser()\n {\n Operation request = new Operation(username);\n request.setPassword(password);\n request.setCode(opCode.LOGOUT);\n\n sendReq(clientSocketChannel,request);\n\n //chiudo socket del client\n if(clientSocketChannel != null)\n {\n try { clientSocketChannel.close(); }\n catch(IOException ioe)\n {\n System.err.println(\"Error in closing clientSocketChannel\");\n ioe.printStackTrace();\n }\n }\n\n //interrompo il thread degli inviti\n if(inviteThread != null)\n inviteThread.interrupt();\n\n\n //chiudo socket degli inviti\n if(inviteSocketChannel != null)\n {\n try { inviteSocketChannel.close(); }\n catch(IOException ioe)\n {\n System.err.println(\"Error in closing inviteSocketChannel\");\n ioe.printStackTrace();\n }\n }\n\n //mando un messaggio agli altri utenti, per notificare la mia disconnessione\n Utils.sendChatMessage(username, \"left the chat\", TuringPanel.editingFileAddress,null);\n\n //interrompo il thread della chat\n if(chatThread != null)\n chatThread.interrupt();\n\n\n return opCode.OP_OK;\n }", "public void disconnect(){\n\n\t\tserverConnection.disconnect();\n\t}", "public void disconnect() {\n\t\tMessage quitMessage = Message.makeQuitMessage(getUserName());\n\t\tsocketConnection.print(quitMessage);\n\t\tKeyboardScanner.close();\n\t}", "public void disconnect()\n\t{\n\t\tif (isConnected)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvimPort.logout(serviceContent.getSessionManager());\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlogger.trace(\"Failed to logout esx: \" + host, e);\n\t\t\t}\n\t\t}\n\t\tisConnected = false;\n\t}", "public static void logout() {\n try {\n buildSocket();\n ClientService.sendMessageToServer(connectionToServer, ClientService.logoutUser());\n closeSocket();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void Logout()\n {\n isLoggedIn = false;\n connection.Disconnect(); \n connection = null;\n }", "public void disconnectSSH(){\n\t log.info(\"Trying to disconnect to device \"+deviceIP+\" ...\\n\");\n\t session.disconnect();\n\t if(!session.isConnected())\n\t\t log.info(\"Successfully disconnected from device \"+deviceIP+\"\\n\");\n\t else\n\t\t log.error(\"Unable to disconnect to the device \"+deviceIP+\"\\n\");\n\t if(FETCHING_DATA_VIA_DATABASE){\n\t\t dbConnect.closeConnection();\n\t\t log.info(\"Successfully closed the database. \");\n\t }\n }", "private void UserDisconnectChannel(ClientData d)\n\t{\n\t\tApplicationManager.textChat.writeLog(d.ClientName + \" Quit \" + currentChannel.ChannelName);\n\t\tSendMessage(null, MessageType.channelInfo);\n\n\t}", "public void sendDisconnect() {\n\t\tString bye = (username + \": :Disconnect\");\n\n\t\ttry {\n\n\t\t\t// print string\n\t\t\twriter.println(bye);\n\n\t\t\t// flush the stream\n\t\t\twriter.flush();\n\n\t\t} catch (Exception e) {\n\t\t\t// print if exception is caught\n\t\t\ttextAreaChat.append(\"Could not send Disconnect message.\\n\");\n\n\t\t}\n\t}", "public void onDisconnect(DisconnectMsg msg) {\n\n\t\tString user = msg.getUser();\n\n\t\tLogger.log(\"onDisconnect:\" + msg.toString());\n\n\t\tstorage.removeClientSession(user);\n\n\t\tstorage.addBuffer(user);\n\t\t\n\t\tstorage.getThread(user).doStop();\n\t\t\n\t\t\n\t}", "public void disconnect()\n {\n this.uri = null;\n this.userAddress = null;\n this.password = null;\n connected = false;\n }", "public void disconnect(){\n if(out != null) {\n out.println(\"IDisconnect:\" + username);\n }\n }", "public void disconnect() {\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mApplicationContext);\n prefs.edit().putBoolean(\"xmpp_logged_in\", false).commit();\n\n if (mConnection != null) {\n mConnection.disconnect();\n }\n\n mConnection = null;\n // Unregister the message broadcast receiver.\n if (uiThreadMessageReceiver != null) {\n mApplicationContext.unregisterReceiver(uiThreadMessageReceiver);\n uiThreadMessageReceiver = null;\n }\n }", "public void disconnect( ) {\n disconnect( \"\" );\n }", "public boolean disconnect() {\r\n\t\t\r\n\t\tString message;\r\n\t\t//ENTER YOUR CODE TO DISCONNECT\r\n\t\tif (isChatSessionOpened()){\r\n\t\t\tsendChatClosure();\r\n\t\t}\r\n\t\t\r\n\t\tmessage= \"106\";\r\n\t\tsendDatagramPacket(message);\r\n\t\t\r\n\t\tthis.connectedUser = null;\r\n\t\tthis.chatReceiver = null;\r\n\t\t\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public static void deleteUser() {\n try {\n buildSocket();\n ClientService.sendMessageToServer(connectionToServer, ClientService.deleteUser());\n closeSocket();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void disconnect()\n {\n isConnected = false;\n }", "public void sendDisconnectToServer(){\n try {\n if (socket == null){\n JOptionPane.showMessageDialog(null, \"SSLSocket is not connected to server. Connect before sending username.\",Env.ChatClientMessageBoxTitle, JOptionPane.ERROR_MESSAGE);\n return;\n }\n PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), \"UTF-8\"), true);\n writer.println(passUtil.toHexString(\"disconnect-me\"));\n writer.flush();\n System.out.println(\"Sent disconnect message to server\");\n } catch (Exception ex){\n ex.printStackTrace();\n if (ex.toString().toLowerCase().contains(\"socket output is already shutdown\")){\n disconnectFromServer(false);\n }\n JOptionPane.showMessageDialog(null, \"Error sending disconnect message: \" + ex.toString(),Env.ChatClientMessageBoxTitle, JOptionPane.ERROR_MESSAGE);\n }\n }", "public static void Logout() throws IOException {\n Socket client = ConnectionToServer();\n // Checks if the sever is online\n if (client.isConnected()) {\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"Logout\"); // Send logout to server\n send.writeUTF(loggedInUser); // Send username to server\n send.flush();\n// End connections\n send.close();\n receiver.close();\n client.close();\n }\n// Resetting the application for the user on the client-side\n loggedInUser = \"\";\n Login.usernameText.setText(\"\");\n loginSuccessful = false;\n boolean[] falsePermission = {false, false, false, false};\n permission.SetUserPermission(falsePermission);\n token = \"\";\n ControlPanelFrameHandler.LogoutWindow();\n }", "public void disconnect() {}", "private void logout(){\r\n\t\ttry {\r\n\t\t\tserver.rmvClient(user);\r\n\t\t} catch (RemoteException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tSystem.exit(0);\r\n\t}", "public void disconnect() {\n\t\tdisconnect(true);\n\t}", "void onDisconnect();", "void onDisconnect();", "@Override\r\n\tpublic Boolean disconnectIMUser(String userName) {\n\t\treturn null;\r\n\t}", "public void disconnect() {\n\t\tif (con.isConnected()) {\n\t\t\tcon.disconnect();\n\t\t}\n\t}", "public void disconnect() {\n SocketWrapper.getInstance(mContext).disConnect();\n }", "public void closeConnection(){\r\n\t\t_instance.getServerConnection().logout();\r\n\t}", "public void logout(){\r\n\t\t// Creating register message\r\n\t\tmessageToServer = GET_LOGOUT_KEYWORD;\t\t\t\t\r\n\r\n\t\t// Sending message\r\n\t\tpw.println(messageToServer);\t\t\r\n\t\tpw.flush();\r\n\r\n\t\t// Closing connection\r\n\t\ttry {\r\n\r\n\t\t\tif(client != null) \r\n\t\t\t\tclient.close();\r\n\r\n\t\t\tif(pw != null) \r\n\t\t\t\tpw.close();\r\n\r\n\t\t\tif(br != null) \r\n\t\t\t\tbr.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"[EXCEPTION] closing streams, socket\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\r\n\t\t\t\tpublic void onServerDisconnect() {\n\t\t\t\t}", "public static void disconnect(){\n Session session = (Session)_sessionRef.get();\n if(session != null && session.isConnected()){\n session.disconnect();\n _sessionRef.set(null);\n }\n }", "private void disconnect() {\n activityRunning = false;\n MRTClient.getInstance().doHangup();\n MRTClient.getInstance().removeClientListener(this);\n\n finish();\n }", "protected void onDisconnect() {}", "public void disconnect() {\r\n\t\tif (connected.get()) {\r\n\t\t\tserverConnection.getConnection().requestDestToDisconnect(true);\r\n\t\t\tconnected.set(false);\r\n\t\t}\r\n\t}", "@Override\r\n\t\t\t\tpublic void onClientDisconnect(ServerConnection sc) {\n\t\t\t\t}", "public void handleDisconnect(){\r\n consoleAppend(this.getName() + \" disconnected.\");\r\n clientThreads.remove(getIndex(this.getName()));\r\n sendToAll(this.getName() + \" disconnected.\");\r\n sendCTToAll(new ControlToken(ControlToken.REMOVECODE, this.getName()));\r\n }", "public void disconnect() {\n\t\t\n\t}", "@Override\n public void disconnect(Channel channel)\n {\n Log.e(\"Dudu_SDK\",\n \"disconnect \" + ((user == null) ? \"true\" : user.getUserid()));\n close(false);\n isConnected = false;\n reconnect();\n Log.e(\"Dudu_SDK\",\n \"connectCallBack==null \" + (connectCallBack == null));\n if (connectCallBack != null)\n connectCallBack.disconnect(channel);\n }", "public void disconnect() {\t\n\t\t\n\t\ttry {\n\t\t\tconnection.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Disconnected\");\n\t}", "public void disconnect() throws OOBException {\n \t\tsession.disconnect();\n \t}", "public void disconnect()\n {\n \tLog.d(TAG, \"disconnect\");\n\n \tif(this.isConnected) {\n \t\t// Disable the client connection if have service\n \t\tif(mLedService != null) {\n \t\t\tthis.disable();\n \t\t}\n \t\t\n \t\t// Unbind service\n mContext.unbindService(mServiceConnection);\n \n this.isConnected = false;\n \t}\n }", "public void deconnect_station(Station s) throws Exception{\r\n\t\ts.remove_user(this);\r\n\t}", "public void disconnect(ClientAddress clientAddress);", "public void logout(){\n\t\ttry{\n\t\t\tif(sock.isConnected()){\n\t\t\t\tOutputStream sout = sock.getOutputStream();\n\t\t\t\tCryptoHelper ch = new CryptoHelper();\n\t\t\t\t\n\t\t\t\t// Send K{LOGOUT} to server\n\t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(out, LOGOUT);\n\t\t\t\tbyte[] msg = ch.symEncrypt(symK, out.toByteArray());\n\t\t\t\tHashHelper.WriteInt(sout, msg.length);\n\t\t\t\tsout.write(msg);\n\t\t\t\tlogout = true;\n\t\t\t\tsock.close();\n\t\t\t\tlistenerSock.close();\n\t\t\t\tSystem.out.println(\"Client logged out\");\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t}\n\t\n\n\t}", "@Override\r\n\t\t\t\tpublic void onServerDisconnect() {\n\t\t\t\t\tSystem.out.println(\"CONNECTION HAS BEEN LOST.\");\r\n\t\t\t\t}", "public void disconnect() {\n try {\n Socket socket = new Socket(\"127.0.0.1\",33333);\n ObjectOutputStream outputStream = new ObjectOutputStream(socket.getOutputStream());\n clientMain.clientData[1] = \"no\";\n outputStream.writeObject(clientMain.clientData);\n\n clientMain.showConnectionPage();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\t\t\t\tpublic void onClientDisconnect(ServerConnection sc) {\n\t\t\t\t\tSystem.out.println(\"CLIENT DISCONNECTED FROM SERVER.\");\r\n\t\t\t\t}", "private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }", "void clientDisconnected(Client client, DisconnectInfo info);", "public CompletionStage<Void> disconnect() {\n\t\treturn this.finConnection.sendMessage(\"disconnect-from-channel\", FinBeanUtils.toJsonObject(this.routingInfo)).thenAccept(ack->{\n\t\t\tif (!ack.isSuccess()) {\n\t\t\t\tthrow new RuntimeException(\"error disconnecting channel client, reason: \" + ack.getReason());\n\t\t\t}\n\t\t});\n\t}", "public void disconnect() {\n\t\tdisconnect(null);\n\t}", "private void disconnectFromServer() {\n\t\ttry {\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot disconnect from server\");\n\t\t}\n\t}", "public void disconnectedFromHost();", "public void disconnect() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t\tSystem.out.println(\"切断された/Disconnected\");\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Close Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void windowClosing(java.awt.event.WindowEvent windowEvent) {\n JSONObject logout = Command.createLogout(Settings.getUsername(), Settings.getSecret());\n ClientSkeleton.getInstance().writeMsg(logout.toJSONString());\n log.info(\"User is going to log out....\");\n ClientSkeleton.getInstance().disconnect();\n }", "void disconnect();", "void disconnect();", "public void disconnect(){\n\t\tif(player!=null){\n\t\t\tplayer.getConnection().close();\n\t\t\t\n\t\t\t// we get no disconnect signal if we close the connection ourself\n\t\t\tnotifyHandlers(MessageFlag.DISCONNECTED);\n\t\t}\n\t}", "public void disconnect() {\n if (serverSocket != null) {\n try {\n serverSocket.close();\n Log.i(TAG, \"ServerSocket closed\");\n } catch (IOException e) {\n Log.e(TAG, \"Error closing the serverSocket\");\n }\n }\n\n sendDisconnectionMessage();\n\n // FIXME - Change this into a message sent it listener\n // Wait 2 seconds to disconnection message was sent\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n public void run() {\n WiFiDirectUtils.clearServiceRequest(wiFiP2PInstance);\n WiFiDirectUtils.stopPeerDiscovering(wiFiP2PInstance);\n WiFiDirectUtils.removeGroup(wiFiP2PInstance);\n\n serverSocket = null;\n isRegistered = false;\n clientsConnected.clear();\n }\n }, 2000);\n }", "public void disconnect(){\n\t\tfor (NodeInfo peerInfo : peerList) {\r\n\t\t\t// send leave to peer\r\n\t\t\tsend(\"0114 LEAVE \" + ip + \" \" + port, peerInfo.getIp(), peerInfo.getPort());\r\n\t\t\t\r\n\t\t\tfor (NodeInfo peerInfo2 : peerList) {\r\n\t\t\t\tif (!peerInfo.equals(peerInfo2)) {\r\n\t\t\t\t\tString joinString = \"0114 JOIN \" + peerInfo2.getIp() + \" \" + peerInfo2.getPort();\r\n\t\t\t\t\t\r\n\t\t\t\t\tsend(joinString, peerInfo.getIp(), peerInfo.getPort());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tunRegisterBootstrapServer(serverIp, serverPort, ip, port, username);\r\n\t\t\tapp.printInfo(\"Node disconnected from server....\");\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//socket = null;\r\n\t}", "@Override\n\t\t\tpublic void onDisconnectRemoteNode(String url) {\t\t\t\t\n\t\t\t}", "public void disconnect() {\r\n\t\tsuper.disconnect();\r\n\t}", "public void disconnectFromServer(boolean sendDisconnectToServer) {\n if (chatClientMainReceiver == null & sendDisconnectToServer){\n JOptionPane.showMessageDialog(null, \"You are not connected to a server\", Env.ChatClientMessageBoxTitle, JOptionPane.ERROR_MESSAGE);\n return;\n }\n if (sendDisconnectToServer) {\n sendDisconnectToServer();\n }\n try {\n socket.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n socket = null;\n try {\n chatClientMainReceiver.socket.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n chatClientMainReceiver.socket = null;\n try {\n chatClientMainReceiver.stop();\n }catch (Exception ex){\n ex.printStackTrace();\n }\n chatClientMainReceiver = null;\n chatClientController.appendToPane(new Date(System.currentTimeMillis()) + \": Disconnected from server\", \"RED\", null);\n }", "@Override\n public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {\n ctx.getChannel().getRemoteAddress();\n System.out.println(ctx.getChannel().getRemoteAddress()+\" Disconnected..\");\n Client user = ServerTools.getClientByChannel(ctx.getChannel());\n if(Server.live_clients.contains(user)){\n Server.live_clients.remove(user);\n System.out.println(\"User removed\");\n }\n }", "public void logOut() {\n Logger.d(TAG,\"login#logOut\");\n Logger.d(TAG,\"login#stop reconnecting\");\n //\t\teverlogined is enough to stop reconnecting\n everLogined = false;\n isLocalLogin = false;\n reqLoginOut();\n }", "protected void onRobotDisconnect (boolean bbUserNotify)\r\n\t{\r\n\t\tUI_RefreshConnStatus ();\r\n\t}", "@Override\n public void Disconnect() {\n bReConnect = true;\n }", "void onUserSessionDisconnected(WebSocketConnection connection, Session session, String accountId);", "public void disconnect ()\n {\n org.omg.CORBA.portable.InputStream $in = null;\n try {\n org.omg.CORBA.portable.OutputStream $out = _request (\"disconnect\", true);\n $in = _invoke ($out);\n return;\n } catch (org.omg.CORBA.portable.ApplicationException $ex) {\n $in = $ex.getInputStream ();\n String _id = $ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException $rm) {\n disconnect ( );\n } finally {\n _releaseReply ($in);\n }\n }", "public static void disconnect() {\r\n if (isConnected()) {\r\n listener.interrupt();\r\n timerThread.interrupt();\r\n keepAliveThread.interrupt();\r\n db.writeDatabase();\r\n ObjectIO.writeObjectToFile(cmdPath, cmd);\r\n tc.stopCommands();\r\n ObjectIO.writeObjectToFile(tcPath, tc);\r\n try {\r\n irc.close();\r\n }\r\n catch (IOException e) { /* Shouldn't happen */ }\r\n }\r\n irc = null;\r\n }", "public void closeConnection() {\n //handles the case of a disconnection before the login\n if (userNickname == null) {\n synchronized (this) {\n answer = null;\n answerReady = true;\n notifyAll();\n }\n }\n connected = false;\n synchronized (C2SMessages){\n C2SMessages.clear();\n C2SMessages.notifyAll();\n }\n synchronized (S2CMessages){\n S2CMessages.clear();\n S2CMessages.notifyAll();\n }\n }", "public synchronized void stopConnection (boolean bbUserNotify)\r\n\t{\r\n\t\tsynchronized (this)\r\n \t\t{\r\n\t\t\tif (_roboCOM==null) return;\r\n\t\t\t\r\n\t\t\tLog.d(TAG,\"stopConnection\");\r\n\t\t\t_roboCOM.sendMessageToServer(\"End Connection ACCE\");\r\n\t\t\t{\r\n\t\t\t\tif (bbUserNotify && !_bbCanSend)\r\n\t\t\t\t\tbbUserNotify=false;\r\n\t\t\t\t_bbCanSend=false;\r\n\t\t\t\t// async quit: thread will terminate\r\n\t\t\t\t_roboCOM.quit();\r\n\t\t\t\t_roboCOM = null;\r\n\t\t\t}\r\n \t\t}\r\n\t\tonRobotDisconnect (bbUserNotify);\r\n\t}", "public void disconnect() {\n try {\n client.disconnect(null, null);\n } catch (MqttException e) {\n Debug.logError(e, MODULE);\n }\n }", "protected void processDisconnect() {\n\t\tconnected.set(false);\n\t\tsenderChannel = null;\n\t}", "public String logout(Request req, Response res) {\n String body = req.body();\n ServerResponse err = ValidationUtil.validateBody(body);\n\n // Return on error\n if (err != null) {\n res.status(400);\n return JsonUtil.stringify(err);\n }\n\n JsonObject bodyJson = JsonUtil.parse(body);\n\n // get user by name\n String name = bodyJson.getString(COM_NAME);\n\n // check if user already logged out, if yes, return with error message\n User currentUser = null;\n for (User user : model.getAvailableUser()) {\n if (user.getName().equals(name)) {\n currentUser = user;\n break;\n }\n }\n if (currentUser == null || !currentUser.getStatus()) {\n res.status(400);\n return JsonUtil.stringify(new ServerResponse(FAILURE, \"Already logged out\"));\n }\n\n // end websocket connection of user\n // set user offline\n // send logout websocket message\n chatSocket.killConnection(currentUser, \"User logged out\");\n\n // send response that everything went fine\n res.status(200);\n return JsonUtil.stringify(new ServerResponse(SUCCESS, JsonUtil.buildOkLogout()));\n }", "void userPressDisconnectButton();", "void onDisconnectSuccess();", "@Override\n public void disconnectIntraUSer(String intraUserLoggedPublicKey, String intraUserToDisconnectPublicKey) throws IntraUserDisconnectingFailedException {\n try\n {\n /**\n *Call Actor Intra User to disconnect request connection\n */\n this.intraWalletUserManager.disconnectIntraWalletUser(intraUserLoggedPublicKey, intraUserToDisconnectPublicKey);\n\n /**\n *Call Network Service Intra User to disconnect request connection\n */\n\n this.intraUserNertwokServiceManager.disconnectIntraUSer(intraUserLoggedPublicKey, intraUserToDisconnectPublicKey);\n\n } catch (CantDisconnectIntraWalletUserException e) {\n throw new IntraUserDisconnectingFailedException(\"CAN'T DISCONNECT INTRA USER CONNECTION- KEY:\" + intraUserToDisconnectPublicKey, e, \"\", \"\");\n } catch (Exception e) {\n throw new IntraUserDisconnectingFailedException(\"CAN'T DISCONNECT INTRA USER CONNECTION- KEY:\" + intraUserToDisconnectPublicKey, FermatException.wrapException(e), \"\", \"unknown exception\");\n }\n }", "void disconnect(String reason);", "public void disconnect(String message);", "public void disconnect() {\n\t\ttry { \n\t\t\tif(loginInput != null) loginInput.close();\n\t\t\tif(registerInput != null) registerInput.close();\n\t\t}\n\t\tcatch(Exception e) {} // not much else I can do\n\t\ttry {\n\t\t\tif(loginOutput != null) loginOutput.close();\n\t\t\tif(registerOutput != null) registerOutput.close();\n\t\t}\n\t\tcatch(Exception e) {} // not much else I can do\n try{\n\t\t\tif(loginSocket != null) loginSocket.close();\n\t\t\tif(registerSocket != null) registerSocket.close();\n\t\t}\n\t\tcatch(Exception e) {} // not much else I can do\n\n\t\tcg.connectionFailed();\n\t\t\t\n }", "@Override\r\n\t\tpublic void onDisconnect(Connection connection) {\n\r\n\t\t}", "@Override\r\n\tpublic void disconnect();", "@Override\n\tpublic void disconnect() {\n\t\t\n\t}", "@Override\n\tpublic void disconnect() {\n\t\t\n\t}", "void disconnect() throws Exception;", "public void disconnect() {\n if (logger.isActivated()) {\n logger.info(\"Network access disconnected\");\n }\n ipAddress = null;\n }", "public void disconnect() {\n \ttry {\n \t\tctx.unbindService(apiConnection);\n } catch(IllegalArgumentException e) {\n \t// Nothing to do\n }\n }", "@FXML\r\n\tvoid logout_btn_clicked(MouseEvent event) {\r\n\t\tString quary = \"UPDATE users SET connection_status = 0 WHERE userID = \" + MainClientGUI.getUserID();\r\n\t\tMessage message = new Message(MessageType.LOGOUT, \"MarketingAgentSalesMainController_logout_clicked\", quary);\r\n\t\tMainClientGUI.client.handleMessageFromClientUI(message);\r\n\t}", "public static void disconnect() {\n \t\tconnPool.stop();\n \t}", "void disconnect( String name )\n throws Exception;", "public synchronized void disconnect()\r\n\t\t{\r\n\t\tif (state == RUNNING)\r\n\t\t stop();\r\n\t\tif (state == CLOSING_DOWN)\r\n\t\t {\r\n // Close the server socket\t\t \r\n try {\r\n \t\tserverSocket.close();\r\n \t}\r\n catch (IOException e)\r\n {\r\n }\r\n \r\n \t\t// flag the server as stopped\r\n \t\tstate = STOPPED;\r\n\t\t }\r\n\t\t}", "public void Disconnect(){\n \n try {\n connect.close();\n// JOptionPane.showMessageDialog(null, \"Disconnected.\");\n } catch (SQLException ex) {\n// JOptionPane.showMessageDialog(null, \"Connection fail.\\n\"+ex.getMessage());\n } \n }", "@Override\n\tpublic void disconnect() {\n\n\t}", "@Override\n\tpublic void disconnect() {\n\n\t}" ]
[ "0.7844574", "0.7474776", "0.74110466", "0.73744607", "0.7225879", "0.72018456", "0.717484", "0.7073774", "0.69697934", "0.6962878", "0.69394284", "0.6935819", "0.6922965", "0.6907675", "0.6902322", "0.6889131", "0.68588924", "0.6854834", "0.68214613", "0.6799853", "0.67609996", "0.67537826", "0.67494464", "0.6733051", "0.6721777", "0.6721777", "0.67203194", "0.6715329", "0.6693306", "0.6687363", "0.6687322", "0.66840464", "0.6676735", "0.6633391", "0.6631558", "0.6623793", "0.6614553", "0.660183", "0.65869206", "0.6585001", "0.65521616", "0.6547557", "0.6540288", "0.65361094", "0.6535505", "0.6533225", "0.65246564", "0.6520093", "0.65137655", "0.6512764", "0.65125644", "0.6496207", "0.6483695", "0.64823025", "0.6479071", "0.64697707", "0.6461125", "0.6447415", "0.6447415", "0.6441353", "0.6437961", "0.6422482", "0.6416575", "0.64100266", "0.6409056", "0.639094", "0.6389134", "0.63688576", "0.63473225", "0.6323331", "0.6317863", "0.63077646", "0.6282822", "0.627397", "0.62739116", "0.627275", "0.6271223", "0.62703735", "0.62499106", "0.62431073", "0.62390715", "0.623737", "0.6231312", "0.62223744", "0.62100047", "0.6210002", "0.6210002", "0.6206059", "0.6186024", "0.6181484", "0.61781555", "0.61746675", "0.6172782", "0.6172028", "0.61701757", "0.6162886", "0.6162886" ]
0.662966
37
Is null. Test if the list L is null.
protected static <C> boolean isNull(LIST<C> L) { if ( L == null || L.list == null ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> boolean isEmpty(LIST<C> L) {\n if ( isNull( L ) || L.list.isEmpty() ) {\n return true;\n }\n if ( L.iter != null ) {\n return ! L.iter.hasNext();\n }\n return false;\n }", "public boolean checkListNull() {\n\t\treturn ((drawerItems == null) ? true : false);\n\t}", "@Test\n public void testNulLContainsCheck(){\n List<String> strList = new ArrayList<>();\n strList.add(null);\n assertTrue(strList.contains(null));\n // List<String> strList = new ArrayList<>(null); !! COMPILE ERROR ,instantiating a list with null throws a null pointer error\n }", "public boolean isEmpty() {\n\t\tif (l.getHead() == null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static boolean isList(RDFNode l) {\n if (l.isLiteral()) return false;\n Resource r = (Resource) l;\n return\n r.equals(RDF.nil)\n || r.hasProperty(RDF.first)\n || r.hasProperty(RDF.type, RDF.List)\n ;\n }", "boolean isEmpty(int list) {\n\t\treturn m_lists.getField(list, 0) == -1;\n\t}", "public /*@ pure @*/ boolean isEmpty() {\n return the_list == null;\n }", "public boolean isEmpty(){\n\t\treturn firstNode == null; //return true if List is empty\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn data != null && data.list != null && data.list.isEmpty();\r\n\t}", "public static boolean MarklogicNullNodeTest(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"MarklogicNullNodeTest\")) return false;\n if (!nextTokenIs(b, K_NULL_NODE)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, MARKLOGIC_NULL_NODE_TEST, null);\n r = consumeTokens(b, 2, K_NULL_NODE, L_PAR);\n p = r; // pin = 2\n r = r && report_error_(b, MarklogicNullNodeTest_2(b, l + 1));\n r = p && consumeToken(b, R_PAR) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "public static <C> int LENGTH(LIST<C> L) {\n if ( isNull( L ) ) {\n return 0;\n }\n return L.list.size();\n }", "public void testEmptyList() {\n SortedLinkedList s = new SortedLinkedList();\n assertEquals(s.getName(0), null);\n assertEquals(s.getQuantity(0), -1);\n assertEquals(s.length(), 0);\n assertTrue(s.isMember(null)); \n }", "public boolean isLinkedListEmpty()\r\n {\r\n \treturn(firstNode==null);\r\n }", "boolean isListRemainingEmpty();", "public boolean isEmpty(){\n\n \treturn list.size() == 0;\n\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}", "public boolean supportsEmptyInList() {\n \t\treturn true;\n \t}", "public boolean isEmpty() // true if list is empty\r\n\t{\r\n\t\treturn (first == null);\r\n\t}", "public static void main(String... args) {\n\n List<String> list = new ArrayList<>();\n if( list != null && !list.isEmpty()) {\n System.out.println(\"1\");\n } else {\n System.out.println(\"2\");\n }\n\n }", "public boolean isEmptyStepList(){ return this.step==null&&this.rest==null;}", "public boolean isEmpty() {\n\t\treturn firstNode == null; // return true if List is empty\n\t}", "boolean isNilRaceList();", "public boolean isEmpty(){\n\t\treturn sizeOfLinkedList() == 0;\n\t}", "public static boolean isNullOrEmpty(List<?> list) {\r\n\t\treturn list == null || list.isEmpty();\r\n\t}", "@Test\r\n\tpublic void testLinkedListRecursive() {\r\n\t\tassertNotNull(ll);\r\n\t\tassertTrue(ll.isEmpty());\r\n\t}", "boolean hasList();", "@Override\n public boolean isEmpty()\n {\n return list.size()<1;\n }", "public static boolean isEmpty(List list){\n\n if(list == null){\n return true;\n }\n if(list.size() == 0){\n return true;\n }\n return false;\n }", "public boolean isEmpty()\n\t{\n\t\treturn list.isEmpty();\n\t}", "public static boolean isNullOrEmpty(List list) {\n return list == null || list.isEmpty();\n }", "public boolean isEmpty()\n {\n return ll.getSize()==0? true: false;\n }", "boolean isEmpty() {\n\t\treturn m_list_nodes.size() == 0;\n\t}", "public boolean isEmpty() {\r\n\t\treturn al.listSize == 0;\r\n\t}", "@Test\n void testGetHeadWithEmptyList() {\n MyList l = new MyList();\n assertEquals(null, l.getHead());\n }", "public boolean isHeadLwm() {\n return !(list.get(0) == list.get(1) - 1);\n }", "public boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}", "public boolean equals(Object L)\n\t{\n\t\tList tempList = (List) L; //creates a List object \n\n\t\tboolean isEqual = true;\n\t\tNode thisTempFront = front; \n\t\tNode thatTempFront = tempList.front; \n\t\tif (length == tempList.length) //check if the List and L are at least the same length\n\t\t {\n\t\t\twhile( isEqual == true && thisTempFront != null && thatTempFront != null) \n\t\t\t{\n\t\t\t\tif (thisTempFront.data.equals(thatTempFront.data)) //if the data within each node is equivalent move on to the next node to check\n\t\t\t\t{\n\n\t\t\t\t\tthatTempFront = thatTempFront.next;\n\t\t\t\t\tthisTempFront = thisTempFront.next;\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tisEqual = false; //if the data is not the same within each node then the integer sequence is not the same and the loop ends\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn isEqual;\n\t\t}\n\t\telse //the List and L are not the same length, therefore they cannot be the same integer sequence\n\t\t{\n\t\t\tisEqual = false;\n\t\t\treturn isEqual;\n\t\t}\n\t}", "public static <C> C FIRST(LIST<C> L) {\n if ( isNull( L ) ) {\n return null;\n }\n if ( L.iter != null ) {\n if ( L.iter.hasNext() ) {\n return L.iter.next();\n } else {\n L.iter = null;\n return null;\n }\n }\n return L.list.getFirst();\n }", "public boolean isEmpty() { return head==null;}", "public synchronized boolean isEmpty(){\n return list.isEmpty();\n }", "public T caseNonEmptyList(NonEmptyList object)\n {\n return null;\n }", "public boolean empty() {\n\t\treturn list.size() == 0;\n\t}", "public boolean contains(List l) {\n if (lists.contains(l.obtainTitle())) return true;\n else return false;\n }", "protected boolean islSubsWithTranslationsNull() {\n List<List<NetSubtitle>> swt = lSubsWithTranslations;\n return (swt == null || swt.size() < 2 ||\n swt.get(0) == null || swt.get(0).isEmpty() ||\n swt.get(1) == null || swt.get(1).isEmpty());\n }", "public boolean isEmpty()\n {\n //this method is used to check length\n //replacing head == null so I don't have to maintain a head\n //also error checks for null lists\n return (entryList == null || (entryList.size() == 0));\n //just doing .size() == 0 will raise a null pointer exception on occasion\n }", "@Override\n\tpublic boolean isEmpty()\n\t{\n if (list.isEmpty())\n {\n return true;\n } \n else\n {\n return false;\n }\n\t}", "default boolean isNil(final SObjectWithoutFields obj) {\n return obj == Nil.nilObject;\n }", "private boolean isEmpty(){\n return head==null;\n }", "public boolean isEmpty() {\n return list.isEmpty();\n }", "public boolean isEmpty()\r\n\t {\r\n\t return head == null;\r\n\t }", "public void testCopyList_copyNullList()\n\t{\n\t\t// Arrange\n\t\t// let's add a new list, category, and a few items to the new list\n\t\tUri listUri = helper.insertNewList(\"testlist\");\n\t\tint listId = Integer.parseInt(listUri.getPathSegments().get(1));\n\t\tassertEquals(2, listId);\n\n\t\t// Act\n\t\tservice.copyList(-13, \"testList2\");\n\t\tActivitiesDataSource allLists = service.getActivitiesWithChildren(new Long[]\n\t\t{}, true);\n\t\tActivityBean newList = allLists.getActivity(\"testList2\");\n\n\t\t// Assert\n\t\tassertNull(newList);\n\t}", "public boolean hasList() {\n return msgCase_ == 5;\n }", "protected boolean checkLobPresence(NbaLob workLob, ArrayList lobList) {\n\t\tint size = lobList.size();\n\t\tString lobName = null;\n\t\tString lobValue = null;\n\t\tNbaOinkDataAccess aNbaOinkDataAccess = new NbaOinkDataAccess(workLob);\n\t\tNbaOinkRequest aNbaOinkRequest = new NbaOinkRequest();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tlobName = (String) lobList.get(i);\n\t\t\tif (lobName.startsWith(\"A_\")) {\n\t\t\t\taNbaOinkRequest.setVariable(lobName.substring(2));\n\t\t\t} else {\n\t\t\t\taNbaOinkRequest.setVariable(lobName);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tlobValue = aNbaOinkDataAccess.getStringValueFor(aNbaOinkRequest);\n\t\t\t\tif (lobValue == null\n\t\t\t\t\t|| lobValue.trim().length() == 0\n\t\t\t\t\t|| NbaAutomatedProcess.LOB_NOT_AVAILABLE.equals(lobValue)\n\t\t\t\t\t|| \"0\".equals(lobValue)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} catch (NbaBaseException e) {\n\t\t\t\tgetLogger().logInfo(\"Could not resolve:\" + lobName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\n\t}", "private boolean isEmpty() {return first == null;}", "public static <T> void listNotNullOrEmpty(Iterable<T> list, String listName)\n\t{\n\t\tGuard.notNull(list, listName);\n\n\t\tif (!list.iterator().hasNext())\n\t\t{\n\t\t\tthrow new IllegalArgumentException(String.format(\n\t\t\t\t\"List '%1$s' can't be empty.\", listName));\n\t\t}\n\t}", "public boolean isEmpty() {\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tStudent emptyChecker;\r\n\t\tint size = sizeOfList(list);\r\n\t\twhile (i < size) {\r\n\t\t\temptyChecker = list[i];\r\n\t\t\tif (emptyChecker != null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tnumStudents = 0;\r\n\t return true;\r\n\t}", "public boolean hasList() {\n return msgCase_ == 5;\n }", "@Override\n public R visit(BlankNodePropertyList n, A argu) {\n R _ret = null;\n n.nodeToken.accept(this, argu);\n n.propertyListNotEmpty.accept(this, argu);\n n.nodeToken1.accept(this, argu);\n return _ret;\n }", "public boolean hasEmployeelist() {\n return employeelistBuilder_ != null || employeelist_ != null;\n }", "public boolean hasEmployeelist() {\n return employeelist_ != null;\n }", "public boolean isEmpty(){\n for(int i = 0; i < arrayList.length; i++) {\n if (arrayList[i] != null)\n return false;\n }\n return true;\n }", "public boolean isEmpty(){\n\t\tif(list.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public boolean isEmpty() {\n if(first == null){ //if first element does not exist, the whole is empty\n return true;\n }\n else{\n return false; //if first element exist, list is not empty\n }\n }", "public boolean isEmpty(){\n return this.listSize == 0;\n }", "public boolean isNilProductListByIdentifierMessage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.cdiscount.www.productbyidentifier.ProductListByIdentifierMessage target = null;\n target = (com.cdiscount.www.productbyidentifier.ProductListByIdentifierMessage)get_store().find_element_user(PRODUCTLISTBYIDENTIFIERMESSAGE$0, 0);\n if (target == null) return false;\n return target.isNil();\n }\n }", "public boolean isEmpty(){\n\n\t\treturn (head==null);\n\t}", "@Test\n public void testSomeValid() {\n ArrayList<Flight> someNull = new ArrayList<>();\n someNull.add(null);\n someNull.add(null);\n someNull.add(f1);\n\n // The null elements should be put at the end of the list\n sortFlights.sortFlightsBy(someNull, SortFlights.SortParameter.TIME);\n assertNotNull(someNull.get(0));\n assertEquals(f1, someNull.get(0));\n assertNull(someNull.get(1));\n assertNull(someNull.get(2));\n }", "public boolean isEmpty(){\n return this.head==null;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn first == null;\n\t}", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "public boolean isSetLocal()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(LOCAL$0) != 0;\r\n }\r\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn top==null;\r\n\t}", "public synchronized boolean isEmpty () {\n return list.isEmpty();\n }", "private void testIsEmpty() {\n init();\n assertTrue(\"empty\", FListInteger.isEmpty(l0));\n assertFalse(\"nonempty\", FListInteger.isEmpty(l1));\n }", "public static boolean listLiteralExpression(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"listLiteralExpression\")) return false;\n if (!nextTokenIs(b, \"<list literal expression>\", CONST, LBRACKET, LT)) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, LIST_LITERAL_EXPRESSION, \"<list literal expression>\");\n r = listLiteralExpression_0(b, l + 1);\n r = r && listLiteralExpression_1(b, l + 1);\n r = r && consumeToken(b, LBRACKET);\n r = r && listLiteralExpression_3(b, l + 1);\n r = r && consumeToken(b, RBRACKET);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "public boolean isEmpty(){\n return first == null;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn firstNode.equals(null);\n\t}", "public boolean isEmpty() {\n\t\t//if head is null\n\t\tif (head == null) {\n\t\t\t//return true, no items in list\n\t\t\treturn true;\n\t\t}\n\t\t//otherwise\n\t\treturn false;\n\t}", "public boolean isEmpty()\n {\n return head == null;\n }", "public boolean isEmpty() {\n\t\treturn(head == null);\t\t\n\t}", "@Test\r\n public void test_nonEmptyList_endOfExistingListNotNull()\r\n {\r\n System.out.println(\"> Test4 - test_nonEmptyList_endOfExistingListNotNull(): end of existing-list should no longer point to null\");\r\n int obj = 7;\r\n System.out.print(\"creating a non-empty list with an arbitrary number of nodes...\");\r\n int[] a = {0, 0, 0, 0, 0};\r\n LinkedList instance = new LinkedList(a);\r\n // get to and mark end of list\r\n ListNode current = instance.getHead();\r\n int nodesInList = a.length;\r\n for (int i = 1; i < nodesInList; i++)\r\n current = current.getLink();\r\n System.out.println(\"inserting a new node at end of non-empty list...\");\r\n instance.addLast(obj);\r\n // test node insertion\r\n assertNotNull(\"end of existing-list points to null\", current.getLink());\r\n System.out.println(\"As expected, the end of the existing list no longer points to null\");\r\n }", "public boolean isEmpty() {\r\n\t\treturn head == null;\r\n\t}", "public boolean isEmpty() {\r\n\t\treturn head == null;\r\n\t}", "public static boolean isValid(Location l)\n\t{\n\t\treturn l != null || Maze.isInBounds(l);\n\t}", "private boolean validateList(NodeList list, String error) {\n\t\tif (list == null || list.getLength() == 0) {\n\t\t\tCommonUITool.openErrorBox(error);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isAListEmpty(){\r\n\t\tif((programChairs.size() > 0) && (committeeMembers.size() > 0)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private Boolean checkForEmptyList() {\n Boolean emptyListAvailable = tin_perLitrePrice.getText().toString().trim().isEmpty() ||\n tin_fuelQuantityLitres.getText().toString().trim().isEmpty() ||\n tin_totalFuelPrice.getText().toString().trim().isEmpty() ||\n tin_currentKm.getText().toString().trim().isEmpty() ||\n tin_startingKm.getText().toString().trim().isEmpty() ||\n tin_distanceCovered.getText().toString().trim().isEmpty() ||\n tv_calculatedAverage_addEdit.getText().toString().trim().isEmpty() ||\n tv_coverableDistance_addEdit.getText().toString().trim().isEmpty() ||\n tv_nextFuelFill_addEdit.getText().toString().trim().isEmpty();\n\n if (emptyListAvailable) {\n validationList(); // set error messages\n }\n Log.d(TAG, \"checkForEmptyList: emptyListAvailable = \" + emptyListAvailable);\n\n\n return emptyListAvailable; //\n }", "public boolean isEmpty() {\r\n\t\t\treturn (First==null); }", "public boolean isEmpty() {\n\t\treturn head == null;\n\t}", "public boolean isEmpty() {\n\t\treturn head == null;\n\t}", "public boolean isEmpty() {\n\t\treturn head == null;\n\t}", "public boolean isEmpty() {\n\t\treturn head == null;\n\t}", "public boolean isEmpty()\n\t{\n\t\treturn (head == null);\n\t}", "public boolean isLeaf(){\n\t\treturn (childList == null || childList.size() == 0);\n\t}", "public boolean empty() {\n return list.isEmpty();\n }", "public boolean checkListIsEmpty(List<WebElement> eleList) {\n if (eleList.size() == 0) {\n return true;\n }\n return false;\n }", "protected boolean checkEmptyList(){\n boolean emptyArray = true;\n String empty= alertList.get(AppCSTR.FIRST_ELEMENT).get(AppCSTR.NAME);\n if(!empty.equals(\"null\") && !empty.equals(\"\")) {\n emptyArray = false;\n }\n return emptyArray;\n }", "public boolean isEmpty(){\n\t\treturn (head == null) && (tail == null);\n\t}", "public static <C> boolean EQUAL(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return isNull(L2);\n }\n if ( isNull( L2 ) ) {\n return isNull(L1);\n }\n return L1.list.equals( L2.list );\n }" ]
[ "0.7143222", "0.64819425", "0.64312476", "0.6243514", "0.6216216", "0.6211726", "0.60178304", "0.5992227", "0.596381", "0.59514886", "0.59409064", "0.5923334", "0.5904397", "0.5821576", "0.5809719", "0.5770501", "0.5770501", "0.5754592", "0.57461315", "0.57264525", "0.5718357", "0.57068795", "0.5701074", "0.56946754", "0.56569064", "0.56459445", "0.5645235", "0.56195474", "0.5614201", "0.5590677", "0.55885077", "0.55829906", "0.55717623", "0.5560097", "0.5529963", "0.55295974", "0.55183244", "0.55084085", "0.5506762", "0.54842174", "0.547964", "0.5465283", "0.5461277", "0.5453339", "0.54447675", "0.54429275", "0.54400754", "0.54300827", "0.5417056", "0.5413359", "0.54002887", "0.53915304", "0.53841555", "0.53807974", "0.5377095", "0.5359746", "0.53572553", "0.53383136", "0.533561", "0.5332102", "0.5331382", "0.53297836", "0.5327714", "0.53126276", "0.53119636", "0.5297148", "0.5293451", "0.52910537", "0.5277327", "0.5274644", "0.5274516", "0.526989", "0.52688026", "0.5266383", "0.5265156", "0.5257869", "0.52575886", "0.5250434", "0.5248272", "0.52477497", "0.524603", "0.52413577", "0.52375984", "0.52375984", "0.52327037", "0.52319753", "0.52220386", "0.52189", "0.52184814", "0.52181906", "0.52181906", "0.52181906", "0.52181906", "0.52038395", "0.5202647", "0.51995933", "0.519676", "0.51965517", "0.5192163", "0.5180141" ]
0.8266369
0
Is empty. Test if the list L is empty.
public static <C> boolean isEmpty(LIST<C> L) { if ( isNull( L ) || L.list.isEmpty() ) { return true; } if ( L.iter != null ) { return ! L.iter.hasNext(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean empty() {\n\t\treturn list.size() == 0;\n\t}", "public boolean isEmpty() {\r\n\t\treturn al.listSize == 0;\r\n\t}", "public boolean isEmpty() {\n\t\tif (l.getHead() == null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}", "public boolean isEmpty()\n\t{\n\t\treturn list.isEmpty();\n\t}", "public boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}", "public boolean empty() {\n return list.isEmpty();\n }", "public boolean isEmpty(){\n\n \treturn list.size() == 0;\n\n }", "public static boolean empty() {\n\n if (list.size() != 0){\n return false;\n }\n return true;\n }", "public boolean isEmpty() {\n return list.isEmpty();\n }", "public boolean isEmpty()\n {\n return ll.getSize()==0? true: false;\n }", "public /*@ pure @*/ boolean isEmpty() {\n return the_list == null;\n }", "public boolean isEmpty() // true if list is empty\r\n\t{\r\n\t\treturn (first == null);\r\n\t}", "public synchronized boolean isEmpty () {\n return list.isEmpty();\n }", "public boolean empty() {\n if (list.size() == 0) {\n return true;\n }\n else {\n return false;\n }\n }", "public boolean isEmpty() {\n\t\treturn firstNode == null; // return true if List is empty\n\t}", "public synchronized boolean isEmpty(){\n return list.isEmpty();\n }", "public boolean isEmpty(){\n return this.listSize == 0;\n }", "public boolean isEmpty(){\n\t\treturn sizeOfLinkedList() == 0;\n\t}", "public boolean isEmpty(){\n\t\treturn firstNode == null; //return true if List is empty\n\t}", "public boolean isEmpty(){\n\t\tif(list.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean isListRemainingEmpty();", "@Override\n public boolean isEmpty()\n {\n return list.size()<1;\n }", "@Override\n\tpublic boolean isEmpty()\n\t{\n if (list.isEmpty())\n {\n return true;\n } \n else\n {\n return false;\n }\n\t}", "boolean isEmpty() {\n\t\treturn m_list_nodes.size() == 0;\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn data != null && data.list != null && data.list.isEmpty();\r\n\t}", "public boolean empty() {\n\t\treturn (size() <= 0);\n\t}", "public boolean isLinkedListEmpty()\r\n {\r\n \treturn(firstNode==null);\r\n }", "public boolean isEmpty() {\n return stack.isListEmpty();\n }", "public boolean isEmpty()\n {\n //this method is used to check length\n //replacing head == null so I don't have to maintain a head\n //also error checks for null lists\n return (entryList == null || (entryList.size() == 0));\n //just doing .size() == 0 will raise a null pointer exception on occasion\n }", "protected static <C> boolean isNull(LIST<C> L) {\n if ( L == null || L.list == null ) {\n return true;\n }\n return false;\n }", "public boolean empty() { \t \n\t\t return size <= 0;\t \n }", "public boolean empty()\n {\n boolean result = (dataList.size() == 0) ? true : false;\n return result;\n }", "boolean isEmpty(int list) {\n\t\treturn m_lists.getField(list, 0) == -1;\n\t}", "boolean isEmpty() {\n return this.myArrayList.isEmpty();\n }", "private void testIsEmpty() {\n init();\n assertTrue(\"empty\", FListInteger.isEmpty(l0));\n assertFalse(\"nonempty\", FListInteger.isEmpty(l1));\n }", "public boolean isEmpty() {\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tStudent emptyChecker;\r\n\t\tint size = sizeOfList(list);\r\n\t\twhile (i < size) {\r\n\t\t\temptyChecker = list[i];\r\n\t\t\tif (emptyChecker != null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tnumStudents = 0;\r\n\t return true;\r\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn this.size == 0;\r\n\t}", "public final boolean isEmpty() {\r\n\t\treturn this.size == 0;\r\n\t}", "public boolean empty()\n {\n\treturn null == head;\n }", "public boolean isEmpty() {\n return dataList.size() <= 0 || (dataList.size() == 1 && dataList.get(0).isEmpty());\n }", "public boolean empty() {\r\n return size == 0;\r\n }", "public boolean isEmpty() {\n\t\treturn allItems.size() == 0;\n\t}", "public boolean empty() {\n return size <= 0;\n }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() {\n\t\treturn(this.size == 0);\n\t}", "public int checkEmpty() {\n\t\treturn (slist.checkEmpty());\n\n\t}", "public boolean isEmpty() {\n\t\treturn this.size == 0;\n\t}", "public boolean isEmpty()\n {\n return this.size == 0;\n }", "public boolean isEmpty() \n\t {\n\t\t return (size()==0);\n\t }", "public void testIsEmpty() {\r\n assertTrue( list.isEmpty());\r\n list.add(\"A\");\r\n assertFalse(list.isEmpty());\r\n }", "public boolean empty() {\n return size == 0;\n }", "public boolean isEmpty()\r\n {\r\n return (size() == 0);\r\n }", "public boolean isEmpty() {\n return (this.size == 0);\n }", "@Override\n public boolean isEmpty() {\n if(first == null){ //if first element does not exist, the whole is empty\n return true;\n }\n else{\n return false; //if first element exist, list is not empty\n }\n }", "public boolean isEmpty() {\n return this.size == 0;\n }", "public boolean isEmpty() {\n return this.size == 0;\n }", "public boolean isEmpty() {\r\n return (size == 0);\r\n }", "public boolean isEmpty() {\n\t\treturn (N == 0);\t\n\t}", "private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\t//if head is null\n\t\tif (head == null) {\n\t\t\t//return true, no items in list\n\t\t\treturn true;\n\t\t}\n\t\t//otherwise\n\t\treturn false;\n\t}", "public static boolean isEmpty(List list){\n\n if(list == null){\n return true;\n }\n if(list.size() == 0){\n return true;\n }\n return false;\n }", "public boolean isEmpty() {\n\t\treturn (size == 0);\n\t}", "public boolean isEmpty() {\r\n return size == 0;\r\n }", "public synchronized boolean isEmpty() {\r\n return size == 0;\r\n }", "@Override\n public boolean isEmpty() {\n return this.size == 0;\n }", "public boolean isEmpty() {\n\t return size() == 0;\n\t }", "public synchronized boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t return size == 0;\n\t }", "public boolean isEmpty() {\r\n \r\n return size == 0;\r\n }", "private boolean isEmpty() {\n\t\treturn (size == 0);\n\t}", "public boolean isEmpty() {\n if (head == null && tail == null) {\n System.out.println(\"This list is empty\");\n return true;\n } else {\n return false;\n }\n }", "public boolean isEmpty() {\n return (head == tail) && size == 0;//size==0时为空\n }", "public boolean isEmpty()\r\n\t{\r\n\t\treturn (count == 0);\r\n\t}", "public boolean empty()\n {\n boolean check;\n if(head.data == null && tail.data == null)\n check = true;\n else\n check = false;\n return check;\n }", "public boolean isEmpty() {\n return (size == 0);\n }", "public static boolean isEmpty() \r\n\t{\r\n\t\treturn m_count == 0;\r\n }", "public boolean isEmpty() {\r\n return NumItems == 0;\r\n }", "public boolean isEmpty() {\n\t\treturn size == 0;\r\n\t}", "@Override\n public boolean isEmpty() {\n return this.count() == 0;\n }", "public boolean isEmpty() {\n \t\treturn size == 0;\n \n \t}", "public boolean isEmpty() {\n\t\treturn (_items.size() == 0);\n\t}", "public boolean isEmpty(){\r\n\t\treturn size() == 0;\r\n\t}", "public boolean isEmpty() {\n return (size() == 0);\n }", "public boolean isEmpty()\n\t{\n\t\treturn (head == null);\n\t}", "public boolean isEmpty()\r\n\t{\r\n\t\treturn numItems == 0 ;\r\n\t}", "public boolean isEmpty() {\r\n return size == 0;\r\n }", "public boolean isEmpty() {\r\n return size == 0;\r\n }", "public boolean isEmpty() \r\n\t{\r\n\t\treturn size() == 0;\r\n\t}", "public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn(size() == 0);\n\t}", "public boolean isEmpty() {\n return (this.count == 0);\n }", "public boolean isEmpty() {\n return len == 0;\n }", "public boolean isEmpty()\n {\n return size <= 0;\n }", "public boolean isEmpty() {\r\n\t\treturn size == 0;\r\n\t}", "public boolean isEmpty() {\r\n return size == 0; \r\n }", "public boolean isEmpty() {\n\t\treturn numElements == 0; // Dummy return\n\t}" ]
[ "0.7741785", "0.7646552", "0.7598765", "0.7560948", "0.7560948", "0.75468314", "0.7525958", "0.7483644", "0.74823105", "0.74795204", "0.74503225", "0.7440221", "0.7438049", "0.73805964", "0.7375598", "0.73694396", "0.7368101", "0.73575157", "0.73570913", "0.73436725", "0.7321075", "0.71987927", "0.7186767", "0.7153574", "0.71231896", "0.7078631", "0.7067371", "0.7059534", "0.7030284", "0.70103407", "0.69699186", "0.696676", "0.69411033", "0.69386816", "0.6928749", "0.6891539", "0.687705", "0.687633", "0.6872195", "0.6855844", "0.685516", "0.68515325", "0.683225", "0.68317556", "0.68257", "0.6819977", "0.6819977", "0.6819977", "0.6814992", "0.68136096", "0.6806458", "0.6802524", "0.68005896", "0.680049", "0.67982423", "0.67979795", "0.6794989", "0.6787782", "0.67873657", "0.67873657", "0.6784889", "0.67726576", "0.6770371", "0.67684585", "0.67543095", "0.6749806", "0.6741418", "0.6740632", "0.6739438", "0.6738576", "0.6738221", "0.67370975", "0.67357635", "0.6730482", "0.6729515", "0.6720779", "0.67206186", "0.67168385", "0.67168057", "0.6714617", "0.6713292", "0.6712738", "0.67125636", "0.67120314", "0.67118365", "0.67115164", "0.67107254", "0.6707685", "0.67053664", "0.67023724", "0.67023724", "0.670066", "0.6700355", "0.6696104", "0.669377", "0.6693425", "0.66919214", "0.66875255", "0.6686494", "0.66797644" ]
0.82103825
0
Length. L is a list. Returns length(L).
public static <C> int LENGTH(LIST<C> L) { if ( isNull( L ) ) { return 0; } return L.list.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int length() {\n int ret_val = 1;\n LinkedList i = this;\n\n while (i.next != null) {\n i = i.next;\n ret_val++;\n }\n return ret_val;\n }", "public int length()\n {\n if(integerList == null)\n return 0;\n else\n return integerList.length;\n }", "public int length(){\r\n int counter = 0;\r\n ListNode c = head;\r\n while(c != null){\r\n c = c.getLink();\r\n counter++;\r\n }\r\n return counter;\r\n }", "@Contract(pure = true)\n public static <E> int listLength(Node<E> head) {\n Node<E> cursor;\n int answer;\n\n answer = 0;\n for (cursor = head; cursor != null; cursor = cursor.getNext()) { answer++; }\n return answer;\n }", "public int length(){\n\t\tint cnt = 0;\n\t\tNode temp = this.head;\n\t\twhile(temp != null){\n\t\t\ttemp = temp.next;\n\t\t\tcnt++;\n\t\t}\n\t\treturn cnt;\n\t}", "int length() {\n return this.myArrayList.size();\n }", "public int length(){\n\t\tint length = 0;\n\t\tListNode temp = firstNode;\n\t\twhile(temp!=null){\n\t\t\tlength++;\n\t\t\ttemp = temp.getNextNode();\n\t\t}\n\n\t\treturn length;\n\t}", "public int len() {\n\t\tint i = 0;\n\t\tif(stringList != null) {\n\t\t\tIterator iterator = stringList.iterator();\n\t\t\twhile(iterator.hasNext()) {\n\t\t\t\titerator.next();\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn i;\n\t}", "public static int LLlength(Node head) {\n\t\tint length = 0;\n\t\tNode currentNode = head;\n\t\twhile(currentNode != null) {\n\t\t\tlength++;\n\t\t\tcurrentNode = currentNode.next;\n\t\t}\n\t\treturn length;\n\t}", "public int length()\n {\n int count = 0;\n Node position = head;\n\n while(position != null)\n {\n count++;\n position = position.nLink;\n } // end while\n\n return count;\n }", "public int size() {\n int counter = 1;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n counter += 1;\n }\n return counter;\n }", "public static int length(Object value) {\n\t\tif (isList(value)) {\n\t\t\treturn Array.getLength(value);\n\t\t}\n\t\treturn 0;\n\t}", "public int size() {\n\t\tint numElements = 0;\n\t\tfor (int i = 0; i < this.size; i++) {\n\t\t\tif (list[i] != null) {\n\t\t\t\tnumElements++;\n\t\t\t}\n\t\t}\n\t\treturn numElements;\n\t}", "int size()\n\t{\n\t\t//Get the reference of the head of the Linked list\n\t\tNode ref = head;\n\t\t\n\t\t//Initialize the counter to -1\n\t\tint count = -1;\n\t\t\n\t\t//Count the number of elements of the Linked List\n\t\twhile(ref != null)\n\t\t{\n\t\t\tcount++;\n\t\t\tref = ref.next;\n\t\t}\n\t\t\n\t\t//Return the number of elements as the size of the Linked List\n\t\treturn count;\n\t}", "@Override\n public int size() {\n\n Node nodePointer = listHead;\n int size = 0;\n while (nodePointer != null) {\n size += 1;\n nodePointer = nodePointer.next;\n }\n return size;\n }", "public int size(){\n int size = 0;\n for(LinkedList<E> item : this.data){\n size += item.size();\n }\n return size;\n }", "private static int length(Node head) {\n Node current = head;\n // if list is empty simply return length zero\n if (head == null) {\n return 0;\n }\n int count = 1;\n while (current.next != head) {\n current = current.next;\n count++;\n }\n return count;\n }", "@Override\n public int size() {\n if(isEmpty()){ //if list is empty, size is 0\n return 0;\n }\n /*int size = 1; //if list is not empty, then we have at least one element in it\n DLNode<T> current = last; //a reference, pointing to the last element\n while(current.prev != null){\n current = current.prev;\n size++;\n }*/\n \n int count = 0;\n DLNode<T> p = first;\n while (p != null){\n count++;\n p = p.next;\n }\n //return size;\n return count;\n }", "static int getCapacity(List al) throws Exception {\n Field field = ArrayList.class.getDeclaredField(\"elementData\");\n field.setAccessible(true);\n return ((Object[]) field.get(al)).length;\n }", "@Test\n public void getSizeOfList() {\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n\n assertEquals(4, list.size());\n }", "public int ListLength(){\n int j = 0;\n // Get index of the first element with value\n int i = StaticLinkList[MAXSIZE-1].cur;\n while (i!=0)\n {\n i = StaticLinkList[i].cur;\n j++;\n }\n return j;\n }", "public double length() {\n\t\tdouble length = 0;\n\t\tif (isEmpty())\n\t\t\treturn 0;\n\t\tjava.util.ListIterator<PathPoint> it = listIterator();\n\t\tPathPoint current = it.next();\n\t\twhile (it.hasNext()) {\n\t\t\tPathPoint next = it.next();\n\t\t\tlength += mc.distance3d(current.getLocation(), next.getLocation());\n\t\t\tcurrent = next;\n\t\t}\n\t\treturn length;\n\t}", "public int size()\n\t{\n\t\treturn list.size();\n\t}", "public int size()\n\t{\n\t\treturn list.size();\n\t}", "public int size() {\n\t\tint size = 0;\n\t\tfor (List<?> list : lists) size += list.size();\n\t\treturn size;\n\t}", "public int length() {\n return size();\n }", "public static <AnyType> int listSize(LinkedList<AnyType> theList) {\n LinkedListIterator<AnyType> itr;\n int size = 0;\n\n for (itr = theList.first(); itr.isValid(); itr.advance()) {\n size++;\n }\n\n return size;\n }", "public int size()\n\t{\n\t\treturn listSize;\n\t}", "public int size() {\n\t return list.size();\n }", "public int size(){\n\t\tListUtilities start = this.returnToStart();\n\t\tint count = 1;\n\t\twhile(start.nextNum != null){\n\t\t\tcount++;\n\t\t\tstart = start.nextNum;\n\t\t}\n\t\treturn count;\n\t}", "public int findLength(ListNode head){\n\n int len = 0;\n ListNode curr = head;\n while(curr != null){\n curr = curr.next;\n len++;\n }\n\n return len;\n }", "public int length() \n\t//POST: FCTVAL == length of the circular linked list\n\t{\n\t\treturn length;\n\t}", "public org.python.types.Int __len__();", "public static int listLength( IntNode head ) {\r\n\t\tint answer = 0;\r\n\t\tfor (IntNode cursor = head; cursor != null; cursor = cursor.link) {\r\n\t\t\tanswer++;\r\n\t\t}\r\n\t\treturn answer;\r\n\t}", "public int length() {\n\n\t\treturn numItems;\n\n\t}", "public int size() {\n\t\treturn list.size();\n\t}", "public int size()\n { \t\n \t//initialize a counter to measure the size of the list\n int sizeVar = 0;\n //create local node variable to update in while loop\n LinkedListNode<T> localNode = getFirstNode();\n \n //update counter while there are still nodes\n while(localNode != null)\n {\n sizeVar += 1;\n localNode = localNode.getNext();\n }\n \n return sizeVar;\n }", "public int getSize(){\n\t\tint size = list.size();\n\t\treturn size;\n\n\t}", "public int size(){\n\t\treturn list.size();\n\t}", "public int size(){\n\t\treturn list.size();\n\t}", "public int size()\n {\n if(_list!=null)\n return _list.size();\n return 0;\n }", "public int size() {\n\t\t\n\t\tint count = 0;\n\t\t\n\t\t// Iterate through list and increment count until pointer cycles back to head (tail.next)\n\t\tfor (Node curr = head; curr == tail.next; curr = curr.next) {\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\treturn count;\n\t}", "public int length()\n\t{\n\t\treturn length;\n\t}", "public int length() {\n\tif (next == null) return 1;\n\telse return 1 + next.length();\n }", "private int count(int[] L, int len) {\n int sum = 0;\n for (int l : L) {\n sum += l / len; //!!! 必须是(l/len), l可以被cut成多块长度为len的木头。\n }\n return sum;\n }", "public int getLength() {\n return collection.size();\n }", "public int size()\n {\n return list.size();\n }", "public int size() {\n return list.size();\n }", "public static int length(Node input){\n int count = 0;\n while(input!=null){\n count++;\n input=input.getNextNode();\n }\n return count;\n }", "public int size() {\n return AL.length;\n }", "public int sizeOfLinkedList(){\n\t\treturn size;\n\t}", "public int size() {\n\t\tint size = 0;\n\t\tnode tmp = head;\n\t\twhile(tmp != null) {\n\t\t\tsize++;\n\t\t\ttmp = tmp.next;\n\t\t}\n\t\treturn size;\n\t}", "public int length() {\n\t\treturn length;\n\t}", "public int length() {\n\t\treturn length;\n\t}", "public int length();", "public int length();", "public int length();", "public int length();", "public int length();", "public int length() {\n \t \n \t //return the length\n \t return(len);\n }", "public int size() {\n return lists.getSize();\n }", "public int numWordsOfLength(int len){\n int n=0;\n for(int i=0;i<size();i++)\n if(get(i).length()==len)n++;\n return n;\n }", "public int size()\n {\n \tDNode<E> temp=first;\n \tint count=0;\n \twhile(temp!=null)\t\t//Iterating till the end of the list\n \t{\n \t\tcount++;\n \t\ttemp=temp.next;\n \t}\n \treturn count;\n }", "public int size() {\n return list.size();\n }", "public int length() {\n return nodeList.size();\n }", "public int size(){\n return list.size();\n }", "int length()\n\t{\n\t\treturn length;\n\t}", "public int size(){\n\n \treturn list.size();\n\n }", "private int sizeOfList(Student [] list) {\r\n\t\t\r\n\t\tint size = 0;\r\n\t\tStudent sizechecker;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\twhile (true) {\r\n\t\t\t\t\r\n\t\t\t\tsizechecker = list[size];\r\n\t\t\t\tsize++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) { \r\n\t\t \r\n\t\t}\r\n\t\t\r\n\t\treturn size;\r\n\t}", "public double length() {\n if (first.p == null) return 0;\n double distance = 0.0;\n Node n = first;\n Node n2 = first.next;\n while (!n.next.equals(first)) {\n distance += n.p.distanceTo(n2.p);\n n = n.next;\n n2 = n2.next;\n }\n distance += n.p.distanceTo(n2.p);\n return distance;\n }", "private int length() { return length; }", "public int size() {\r\n\t\tthis.size= 0;\r\n\t\tfor (DirectoryComponent item : DirectoryList){\r\n\t\t\tthis.size += item.size();\r\n\t\t}\r\n\t\treturn this.size;\r\n\t}", "@Override\n\tpublic int size() {\n\t\t\n\t\treturn list.size();\n\t}", "public long length() {\n return length;\n }", "public static <C> int EXTENT(LIST<C> L) {\n if ( isNull( L ) ) {\n return 0;\n }\n int n = 0;\n for ( C a : L.list ) {\n if ( a instanceof LIST ) {\n LIST<C> LP = null;\n try {\n LP = (LIST<C>) a; \n } catch(ClassCastException e) {\n }\n if ( isNull( LP ) ) {\n n++;\n } else {\n n += EXTENT( LP ); \n }\n } else {\n n++;\n }\n }\n return n;\n }", "public int length() {\n return length;\n }", "public int length() {\n return length;\n }", "public int length() {\n return length;\n }", "public int size() {\r\n return length;\r\n }", "public int getSize()\n\t{\n\t\t// returns n, the number of strings in the list: O(n).\n\t\tint count = 0;\n \t\tnode p = head; \n\t\twhile (p != null)\n \t\t{\n \t\tcount ++;\n \t\tp = p.next;\n \t\t}\n \t\treturn count;\n\t}", "public int length() {\n \treturn length;\n }", "public int size() {\n//\t\tint rtn = 0;\n//\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n//\t\t\trtn++;\t\n//\t\t}\n//\t\treturn rtn;\n\t\treturn mySize;\n\t}", "public int getLength()\n\t{\n\t\treturn (int) length;\n\t}", "public int getLength()\n\t{\n\t\tDNode tem=first;\n\t\tint length=0;\n\t\twhile(tem.nextDNode!=null)\n\t\t{\n\t\t\tlength=length+1;\n\t\t\ttem=tem.nextDNode;\n\t\t}\n\t\tif(first!=null)\n\t\t\tlength=length+1;\n\t\treturn length;\n\t}", "long size();", "long size();", "long size();", "long size();", "public int sizeOf() {\n BookList target = this;\n int count = 0;\n if (isEmpty()){\n count= 0;\n }\n else if (!isEmpty()){\n count = 1;\n while (target.next != null){\n target = target.next;\n if(target.next == null){\n }\n \n ++count;\n }\n \n }\n\t\treturn count;\n\t}", "public int size()\n\t{\n\t\tint count = 0;\n\t\tSinglyLinkedListNode node = head;\n\t\twhile(head != null)\n\t\t{\n\t\t\tcount++;\n\t\t\tif(node.getNext() != null)\n\t\t\t{\n\t\t\t\tnode = node.getNext();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int size(){\n if (head == null) {\n // Empty list\n return 0;\n } else {\n return head.size();\n }\n }", "public int length(){\n return pilha.size();\n }", "public int length() {\n\t\treturn value.length;\n\t}", "public int length() {\n return links.length;\n }", "public int size() {\n\t\tint count = 0;\n\t\tListNode current = front;\n\t\twhile (current != null) {\n\t\t\tcurrent = current.next;\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "public int length()\n\t{\n\t\tint total_length=0;\n\t\tfor(int iterator=0; iterator<data.length;iterator++)\n\t\t{\n\t\t\tif(data[iterator]!=0)\n\t\t\t{\n\t\t\t\ttotal_length++;\n\t\t\t}\n\t\t}\n\t\treturn total_length;\n\t}", "public int size() {\n\t\tint rtn = 0;\n\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\trtn++;\n\t\t}\n\t\tthis.mySize = rtn;\n\t\treturn rtn;\n\t}", "public int len() {\n return 1 + this.rest.len();\n }", "public int getLength()\n\t{\n\t\treturn length;\n\t}", "public int getLength()\n\t{\n\t\treturn length;\n\t}" ]
[ "0.7560005", "0.7465551", "0.722733", "0.71681535", "0.71616167", "0.71373314", "0.711873", "0.70766425", "0.70754635", "0.6964959", "0.6963664", "0.68816614", "0.6876111", "0.68549615", "0.68470615", "0.6800773", "0.67994434", "0.67808616", "0.6750099", "0.6745024", "0.67280155", "0.67270935", "0.6725839", "0.6725839", "0.67191494", "0.67169833", "0.670174", "0.67000544", "0.6686337", "0.66852045", "0.66810095", "0.6665699", "0.66636217", "0.66591066", "0.66515714", "0.66395694", "0.6632492", "0.66291934", "0.6620721", "0.6620721", "0.6618436", "0.6618271", "0.6612722", "0.6609259", "0.6578776", "0.65637815", "0.6562901", "0.6554614", "0.6554133", "0.65356535", "0.6530965", "0.652552", "0.6516711", "0.6516711", "0.65084", "0.65084", "0.65084", "0.65084", "0.65084", "0.650752", "0.6499027", "0.64898306", "0.64754105", "0.6461155", "0.64601576", "0.6457933", "0.6456961", "0.64537686", "0.6453661", "0.6453089", "0.6440966", "0.6437827", "0.643718", "0.6433996", "0.64279413", "0.6408009", "0.6408009", "0.6408009", "0.6402317", "0.63958764", "0.6381436", "0.6378069", "0.6370217", "0.63651603", "0.63618064", "0.63618064", "0.63618064", "0.63618064", "0.6353209", "0.6351973", "0.63445985", "0.634177", "0.63365525", "0.633383", "0.632504", "0.63227737", "0.63192457", "0.63172036", "0.6314593", "0.6314593" ]
0.83824116
0
First. L is a nonnull list. a is the first element of L.
public static <C> C FIRST(LIST<C> L) { if ( isNull( L ) ) { return null; } if ( L.iter != null ) { if ( L.iter.hasNext() ) { return L.iter.next(); } else { L.iter = null; return null; } } return L.list.getFirst(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public A getFirst() { return first; }", "public static <T> T getFirst(List<T> list) {\n\t\treturn list != null && !list.isEmpty() ? list.get(0) : null;\n\t}", "protected T getFirstValue(List<T> list) {\n\t\treturn list != null && !list.isEmpty() ? list.get(0) : null;\n\t}", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public E getFirst() {\r\n\t\t// element checks to see if the list is empty\r\n\t\treturn element();\r\n\t}", "public A first() {\n return first;\n }", "public Object firstElement();", "ArrayList<String> firstElements(ArrayList<String> myList);", "public void addFirst(Comparable o){\n\t\t head=new ListElement(o,head);\n\t }", "public Object getFirst() throws ListException {\r\n\t\tif (size() >= 1) {\r\n\t\t\treturn get(1);\r\n\t\t} else {\r\n\t\t\tthrow new ListException(\"getFirst on an empty list\");\r\n\t\t}\r\n\t}", "@Test\r\n\tvoid testFirst() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(3);\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\tint output = test.first();\r\n\t\tassertEquals(10, output);\r\n\t}", "public static Object first(Object o) {\n log.finer(\"getting first of list expression: \" + o);\n validateType(o, SPair.class);\n return ((SPair)o).getCar();\n }", "int getFirst(int list) {\n\t\treturn m_lists.getField(list, 0);\n\t}", "@Override\r\n\tpublic Object first(){\r\n\t\tcheck();\r\n\t\treturn head.value;\r\n\t}", "public E first() { // returns (but does not remove) the first element\n // TODO\n if (isEmpty()) return null;\n return tail.getNext().getElement();\n }", "public T first() throws EmptyCollectionException{\n if (front == null){\n throw new EmptyCollectionException(\"list\");\n }\n return front.getElement();\n }", "public Object getFirst() {\n\t\tcurrent = start;\n\t\treturn start == null ? null : start.item;\n\t}", "public E first() {\n\r\n if (head == null) {\r\n return null;\r\n } else {\r\n return head.getItem();\r\n }\r\n\r\n }", "@Override\n\tpublic Position<E> addFirst(E e) {\n\t\treturn addBetween(head, head.next, e);\n\t}", "public E first() {\n if (this.isEmpty()) return null;\r\n return this.head.getElement();\r\n }", "public void addFirst(Item item){\r\n\t\t if (item == null) throw new NullPointerException();\r\n\t\t if (n == list.length){resize(2*list.length);}\r\n\t\t if(isEmpty()){prior=0;first=0;last=0;latter=1;}\r\n\t\t list[prior--]=item;\r\n\t\t first = prior+1;\r\n\t\t if(prior==-1){prior=list.length-1;}\r\n\t\t n++;}", "int getFirstList() {\n\t\treturn m_list_of_lists;\n\t}", "public O before(O a)\r\n {\r\n int index = indexOf(a);\r\n if (index != -1 && index != 0) //is defined and not first\r\n return get(index-1);\r\n else return null;\r\n }", "public node getFirst() {\n\t\treturn head;\n\t\t//OR\n\t\t//getAt(0);\n\t}", "public E getFirst();", "public T getFirst( ){\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new NoSuchElementException(\"ChainedArrays are empty\");\r\n\t\t//first node\r\n\t\tArrayNode<T> first = beginMarker.next;\r\n\t\ttry{\r\n\t\t\t//first elem\r\n\t\t\treturn first.getFirst();\r\n\t\t}catch( IndexOutOfBoundsException e){\r\n\t\t\tthrow new NoSuchElementException(\"ChainedArrays are empty\");\r\n\t\t}\r\n\t\t\r\n\t}", "public T getFirst() {\n\t\t//if the head is not empty\n\t\tif (head!= null) {\n\t\t\t//return the data in the head node of the list\n\t\t\treturn head.getData();\n\t\t}\n\t\t//otherwise return null\n\t\telse { return null; }\n\t}", "T first();", "public Object getFirstObject()\n {\n \tcurrentObject = firstObject;\n\n if (firstObject == null)\n \treturn null;\n else\n \treturn AL.get(0);\n }", "public Item getFirst();", "public T getFirst();", "public T getFirst();", "public T first() throws EmptyCollectionException;", "public T first() throws EmptyCollectionException;", "@Override\n public void insertFirst(E e) {\n if (listHead == null) {\n listHead = new Node(e);\n listTail = listHead;\n }\n\n // In the general case, we simply add a new node at the start\n // of the list via the head pointer.\n else {\n listHead = new Node(e, listHead);\n }\n }", "public RTContainer container_element(RTContainer a, boolean first){\n\t\tif(a.getDecompGoals().size()>0 && a.getDecompPlans().size()==0){\n\t\t\tif(first)\n\t\t\t\treturn a.getDecompGoals().getFirst();\n\t\t\telse\n\t\t\t\treturn a.getDecompGoals().getLast(); \n\t\t}else{\n\t\t\tif(first)\n\t\t\t\treturn a.getDecompPlans().getFirst();\n\t\t\telse\n\t\t\t\treturn a.getDecompPlans().getLast();\n\t\t}\n\t}", "public void addFirst(T element);", "public Node<E> getFirst(){\n Node<E> toReturn = head.getNext();\n return toReturn == tail ? null: toReturn;\n }", "@Override\r\n\t\tpublic final E getFirst() {\n\t\t\treturn null;\r\n\t\t}", "public E getFirst(){\n return head.getNext().getElement();\n }", "public void addFirst(T t) {\n if (size == elements.length) // checks potential overflow\n ensureCapacity(); // increase capacity\n for (int j = size; j > 0; j--) // treat elements of list with indexes in range [1, n]\n elements[j] = elements[j - 1]; // element shifts to right\n size++; // increment size\n elements[0] = t; // store element at index 0\n }", "public E first() \n throws NoSuchElementException {\n if (entries != null && \n size > 0 ) {\n position = 0;\n E element = entries[position]; \n position++;\n return element;\n } else {\n throw new NoSuchElementException();\n }\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "public Object front() {\n ListNode p = this.l.start;\n while(p.next!=null)\n {\n p = p.next;\n }\n\t\treturn (Object) p.item;\n\t}", "public E first() {\n if (isEmpty()) return null;\n return first.item;\n }", "@Test\r\n\tvoid testFirst2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\tint output = test.first();\r\n\t\tassertEquals(-1, output);\r\n\t}", "public static IDescribable getFirst( Collection<? extends IDescribable> results )\r\n\t{\r\n\t if(( results == null ) || ( results.size() == 0 ))\r\n\t return null;\r\n\t return results.iterator().next();\r\n\t}", "public int getFirstElement() {\n\t\tif( head == null) {\n\t\t\tSystem.out.println(\"List is empty\");\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\telse {\n\t\t\treturn head.data;\n\t\t}\n\t}", "@Test\n\tpublic void testAddFirst() {\n\t\tLinkedListInterface e = new LinkedList();\n\t\te.addLast(\"JOHNSON Shawn\");\n\t\te.addLast(\"LIUKIN Anastasia\");\n\t\te.addLast(\"JIANG Yuyuan\");\n\t\te.addFirst(\"IZBASA Sandra Raluca\");\n\t\tassertEquals(e.get(0), \"IZBASA Sandra Raluca\");\n\t\tassertEquals(e.get(1), \"JOHNSON Shawn\");\n\t\te.addFirst(\"RAISMAN Alexandra\");\n\t\tassertEquals(e.get(0), \"RAISMAN Alexandra\");\n\t\tassertEquals(e.get(2), \"JOHNSON Shawn\");\n\t}", "@Override\r\n\tpublic E getFirst() {\n\t\treturn null;\r\n\t}", "public LinkedListItr first( )\n {\n return new LinkedListItr( header.next );\n }", "public E getFirst() {\n\t\t// Bitte fertig ausprogrammieren:\n\t\treturn null;\n\t}", "public void addFirst(Object value)\n {\n if(last == null && first == null)\n {\n ListNode temp = new ListNode(value, null);\n last = temp;\n first = temp;\n }\n else\n {\n first = new ListNode(value, first);\n }\n \n }", "public void addFirst(E e) { // adds element e to the front of the list\n // TODO\n if (size == 0) {\n tail = new Node<>(e, null);\n tail.setNext(tail);\n } else {\n Node<E> newest = new Node<>(e, tail.getNext());\n tail.setNext(newest);\n }\n size++;\n }", "String getFirstElementOfArrayList( ArrayList arrayList ) {\n\n \tString firstElement = new String(\"\");\n \tfor ( Object e : arrayList ) {\n \t\tfirstElement = (String) e;\n \t\tbreak;\n \t}\n \treturn firstElement;\n }", "@NotNull\n public F getFirst() {\n return first;\n }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "public void addFirst(E item);", "@Override\r\n\t\tpublic E getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "@Override\r\n\t\tpublic E getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "public static Monkey getFirstMonkey(List<Monkey> ml) {\n int listSize = ml.size();\n for (int i = 0; i < listSize; i++) {\n if (ml.get(i).getMonkeyNum() == 1) {\n return ml.get(i);\n }\n }\n return null;\n }", "public Object getFirst()\n {\n if(first == null){\n throw new NoSuchElementException();}\n \n \n \n return first.data;\n }", "public void firstOfList(List<?> instrucicones, Object n) {\n \tString m=\"\";\n \tm=instrucicones.get(1).toString();\n \t//System.out.println(m);\n \tSystem.out.println(n);\n }", "public ListaEncadeada() {\n first = null;\n }", "@Override\r\n\t\tpublic T getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "public void addFirst(E item) {\n Node<E> n = new Node<>(item, head);\n size++;\n if(head == null) {\n // The list was empty\n head = tail = n;\n } else {\n head = n;\n }\n }", "public T first(int x)throws EmptyCollectionException, \n InvalidArgumentException;", "public Item getFirst() {\n Node removed = head.next;\n head.next = removed.next;\n removed.next = null;\n size--;\n return removed.item;\n }", "@Test (timeout = 44245500)\n\tpublic void testInsertFirstIsEmptySizeAndGetFirst1() {\n\t\tassertTrue(list.isEmpty());\n\t\tassertEquals(0,list.size());\n\t\tassertEquals(list,list.insertAt(0, \"Hello\"));\n\t\tassertFalse(list.isEmpty());\n\t\tassertEquals(1,list.size());\n\t\tassertEquals(\"Hello\",list.get(0));\n\t\tlist.insertAt(1, \"world\");\n\t\tassertEquals(\"world\",list.get(1));\n\t\tassertEquals(2, list.size());\n\t\tlist.insertAt(0, \"foo\");\n\t\tassertEquals(3,list.size());\n\t\tassertEquals(\"foo\", list.get(0));\n\t\tassertEquals(\"Hello\", list.get(1));\n\t\t\n\t\t\n\t}", "private void addAsFirst(LinkedList<T>.Node<T> elementZero) {\n\t\telementZero.setPriorNode(itsFirstNode.getPriorNode());\n\t\telementZero.setNextNode(itsFirstNode);\n\t\titsFirstNode.setPriorNode(elementZero);\n\t\titsFirstNode = elementZero;\n\t}", "Union0<First> first(First single);", "protected Optional<T> getFirstValueOptional(List<T> list) {\n\t\treturn Optional.ofNullable(getFirstValue(list));\n\t}", "public static <T> T getFirstElement(final Iterable<T> elements) {\n\t\treturn elements.iterator().next();\n\t}", "public T1 getFirst() {\n\t\treturn first;\n\t}", "@Nullable\n public T firstOrNull() {\n return Query.firstOrNull(iterable);\n }", "@Override\n public int element() {\n isEmptyList();\n return first.value;\n }", "public VectorItem<O> firstVectorItem()\r\n {\r\n if (isEmpty()) return null; \r\n return first;\r\n }", "public O first()\r\n {\r\n if (isEmpty()) return null; \r\n return first.getObject();\r\n }", "String first(String collection);", "public void addFirst(Item item) {\n if (item == null) {\n throw new IllegalArgumentException();\n }\n Node node = new Node();\n node.item = item;\n node.next = first;\n if (first == null) {\n first = node;\n last = first;\n }\n else {\n first.pre = node;\n first = node;\n }\n len++;\n }", "public void addFirst(Object element)\n {\n Node newNode = new Node();\n newNode.data = element;\n newNode.next = first;\n first = newNode; \n \n }", "public void addFirst(T element) {\r\n \r\n if (element == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n \r\n Node n = new Node(element);\r\n \r\n if (size() == 0) {\r\n \r\n front = n;\r\n last = n;\r\n }\r\n \r\n else {\r\n n.next = front;\r\n front = n;\r\n }\r\n \r\n size++; \r\n }", "public Node<T> getFirst() \r\n {\r\n if (isEmpty()) return sentinel;\r\n return sentinel.next;\r\n }", "public static java.lang.Object min(java.util.Collection arg0)\n { return null; }", "@Override\n public Persona First() {\n return array.get(0);\n }", "public StringListIterator first()\n {\n\treturn new StringListIterator(head);\n }", "public LinkedListIterator<AnyType> first() {\n return new LinkedListIterator<AnyType>(header.next);\n }", "public E head() {\n E ret = (val == null\n ? null\n : val ); //@ nowarn Cast;\n //@ assume ret != null ==> \\typeof(ret) <: elementType;\n //@ assume !containsNull ==> ret != null;\n return ret;\n }", "public E first(){\n if (isEmpty()) return null;\n return arrayQueue[front];\n }", "@Override\n\tpublic Object peek() {\n\t\treturn list.getFirst();\n\t}", "public static <T> T getFirstOrNull(final Collection<T> collection) {\n\n if (isEmpty(collection)) {\n return null;\n }\n if (collection instanceof List) {\n return ((List<T>) collection).get(0);\n } else {\n return collection.iterator().next();\n }\n }", "public LinkedListNode<T> getFirstNode() {\n\t\t//return the head node of the list\n\t\treturn head;\t\t\n\t}", "public ListNode getFirstNode(){\n\t\treturn firstNode;\n\t}", "public void addFirst(E item){\r\n\r\n //checking the precondition\r\n\tif(item == null){\r\n\t\tthrow new IllegalArgumentException(\" item cannot equal null \");\r\n\t}\r\n\t\r\n\t//creating a new front of the list\r\n\tDoubleListNode<E> firstNode = new DoubleListNode<E>(end.getPrev(), item, null);\r\n\t\r\n\t//setting the front of the list to the head\r\n\tfirstNode.setNext(head);\r\n\t\r\n\t//setting the head to new first node\r\n\thead = firstNode;\r\n\t\r\n\t//setting the headData\r\n\theadData = head.getData();\r\n\t\r\n\r\n\r\n }", "public LinkListPessoa() // constructor\r\n\t{\r\n\t\tfirst = null;\r\n\t}", "public Object getFirst() {\n if (first == null)\n return null;\n return first.getInfo();\n }", "public int getFirst();", "public void addFirst (E[] e) {\n\t\thead = new Node<>(e, head);\n\t\tif (size == 0) {\n\t\t\ttail = head;\n\t\t} else {\n\t\t\t// do nothing\n\t\t}\n\t\tsize = size + 1;\n\t}" ]
[ "0.7846548", "0.68014914", "0.6682725", "0.651607", "0.64689815", "0.6391207", "0.63318765", "0.62992615", "0.6250293", "0.62256515", "0.6216466", "0.618322", "0.6130841", "0.6099694", "0.60825443", "0.60598195", "0.603255", "0.6020179", "0.59836674", "0.5973045", "0.59713507", "0.5932197", "0.5919182", "0.5894198", "0.5890329", "0.58813614", "0.58785087", "0.5867564", "0.5865471", "0.58587366", "0.5842834", "0.5834497", "0.5834497", "0.582416", "0.582416", "0.5820855", "0.57938504", "0.5785438", "0.57784647", "0.57596123", "0.5758926", "0.5753302", "0.5731071", "0.57307595", "0.5727916", "0.5726554", "0.57201374", "0.57124186", "0.568637", "0.56783587", "0.5657868", "0.56525344", "0.56519663", "0.5640548", "0.5635313", "0.55960256", "0.55838466", "0.5571384", "0.5555412", "0.5551356", "0.5551356", "0.55364037", "0.5530521", "0.5524346", "0.55232054", "0.551494", "0.55109596", "0.5510718", "0.55054915", "0.5505379", "0.5504237", "0.5500411", "0.54997855", "0.5488948", "0.5486093", "0.54836965", "0.54748374", "0.5471221", "0.5459377", "0.5450775", "0.54494464", "0.54490954", "0.5445246", "0.54362684", "0.5434192", "0.5430109", "0.54275906", "0.5417928", "0.5409017", "0.5404183", "0.5396301", "0.5387168", "0.538303", "0.5378702", "0.5372927", "0.53721935", "0.5369638", "0.5367028", "0.5360263", "0.5359808" ]
0.73293406
1
Reductum. L is a nonnull list. Returns the reductum of L.
public static <C> LIST<C> RED(LIST<C> L) { if ( isNull( L ) ) { return L; } LIST<C> LP = L; // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) ); if ( L.iter == null ) { LP = new LIST<C>( L.list ); LP.iter = LP.list.iterator(); C x = LP.iter.next(); //System.out.println("x = " + x); } // else noop return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static IntList incrListR(IntList L, int x) {\n if (L == null) {\n return null;\n }\n //each recursive run will create a new IntList until L.rest.rest.rest... = null meaning reaching the last item in\n //the original list\n return new IntList(L.first + x, incrListR(L.rest, x));\n }", "static List<MeanWithClusterProbAggregator> reduce(List<MeanWithClusterProbAggregator> l,\n List<MeanWithClusterProbAggregator> r) {\n A.ensure(l != null || r != null, \"Both partitions cannot equal to null\");\n\n if (l == null || l.isEmpty())\n return r;\n if (r == null || r.isEmpty())\n return l;\n\n A.ensure(l.size() == r.size(), \"l.size() == r.size()\");\n List<MeanWithClusterProbAggregator> res = new ArrayList<>();\n for (int i = 0; i < l.size(); i++)\n res.add(l.get(i).plus(r.get(i)));\n\n return res;\n }", "public static IntList dincrList(IntList L, int x) { //iteratively\n /* Your code here. */\n IntList p = L;\n while (p != null) {\n p.first = p.first + x; //this mutate the L.first since p.first and l.first are the same\n p = p.rest; //until p = null then it point to another list\n }\n return L; //not p because P is null at this point and it point to the rest not the original list\n }", "@CallSuper\n public long multiplyAndGet(final long l) {\n long currentValue;\n\n for (; ; ) {\n currentValue = get();\n if (compareAndSet(currentValue, currentValue * l)) {\n return currentValue;\n }\n ii(this, mOrigin, \"Collision in concurrent add, will try again: \" + currentValue);\n }\n }", "public int rangeSum(int L, int R)\r\n {\r\n int sum;\r\n return sum = rangeSum(root, L, R);\r\n\r\n }", "public double sum() {\n double sum = x;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n sum += iter.next.x;\n iter = iter.next;\n }\n return sum;\n }", "public long getSum()\n {\n long sum = 0;\n\n for(int i = 0; i < integerList.length; i++)\n {\n sum = sum + integerList[i];\n }\n\n return sum;\n }", "@Override\n public int evaluate(int[] l) {\n int s = 0;\n HashSet<Integer> map = new HashSet<Integer>();\n for (int i = 0; i < l.length; ++i) {\n int elmt = l[i];\n if (map.add(elmt))\n s += this.getValue(elmt);\n if (i != 0)\n s -= neighbourCheck[l[i - 1]][l[i]];\n }\n return s;\n }", "public void visitLREM(LREM o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "public int RMQ(int l, int r) {\r\n\t\treturn computeRMQ(0, l, r, 0, arr.length - 1);\r\n\t}", "public void reduce( T mrt ) { }", "public void reduce( T mrt ) { }", "public int loadAccumulatorImmediateZeroRegisterInstructionCollapse(LinkedList<Assembly> ll, int reductionLevel)\n\t{\n\t\tint reductionCounter = 0;\n\t\t\n\t\tfor (Iterator<Assembly> i = ll.iterator(); i.hasNext(); )\n\t\t{\n\t\t\tAssembly as = i.next();\n\t\t\t\n\t\t\tfor (int h = 0; h < as.size(); h++)\n\t\t\t{\n\t\t\t\tAsmLine l1 = as.get(h);\n\t\t\t\tif (l1.opcode == \"\") continue;\n\t\t\t\t\n\t\t\t\t// look for ld[abefdw] #0\n\t\t\t\tif (l1.opcode.substring(0,2).equals(\"ld\") && l1.operand.substring(0,1).equals(\"#\"))\n\t\t\t\t{\n\t\t\t\t\tStringBuffer error = new StringBuffer();\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tint value = as.evaluate(l1, l1.expression);\n\t\t\t\t\t\tif (error.toString().equals(\"\") && value == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString reg = l1.opcode.substring(2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (reg.equals(\"a\") ||\n\t\t\t\t\t\t\t\treg.equals(\"b\") ||\n\t\t\t\t\t\t\t\treg.equals(\"e\") ||\n\t\t\t\t\t\t\t\treg.equals(\"f\") ||\n\t\t\t\t\t\t\t\treg.equals(\"d\") ||\n\t\t\t\t\t\t\t\treg.equals(\"w\")\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBoolean applyTheReduction = false;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// replacing ld? with clr? means that the carry bit will always be cleared\n\t\t\t\t\t\t\t\t// we can only apply this reduction if we find a subsequent instruction that affects the carry BEFORE any instruction reads the carry\n\t\t\t\t\t\t\t\t// this loop goes through subsequent lines searching for instructions that will either read the carry bit (which invalidates the reduction)\n\t\t\t\t\t\t\t\t// or sets the carry bit (which affirms the reduction, thus we apply it)\n\t\t\t\t\t\t\t\tfor (int j = h + 1; j < as.size(); j++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// l2 holds the subsequent line\n\t\t\t\t\t\t\t\t\tAsmLine l2 = as.get(j);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// if we encounter a blank or comment line, continue on...\n\t\t\t\t\t\t\t\t\tif (l2.isBlankLine() == true || l2.isCommentLine() == true || l2.opcode.equals(\"\")) continue;\n\t\t\n\t\t\t\t\t\t\t\t\t// if we encounter a pseudo instruction, abandon since we don't know how it will affect the subsequent code\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString instructionClass = l2.instruction.getClass().getName();\n\t\t\t\t\t\t\t\t\tinstructionClass = instructionClass.substring(instructionClass.lastIndexOf('.') + 1);\n\t\t\t\t\t\t\t\t\tif (instructionClass.equals(\"CPU$H6309Instruction\") == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this is probably a pseudo instruction; abort the reduction attempt\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\t\t// if the instruction can alter flow (branch, swi, etc), we don't attempt to follow\n\t\t\t\t\t\t\t\t\tCPU.H6309Instruction ins = (CPU.H6309Instruction)l2.instruction;\n\t\t\t\t\t\t\t\t\tif (ins.canAlterFlow == true)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this instruction is a control altering instruction (branch, etc); abort the reduction attempt\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (reductionLevel == 1 && ins.read != null && ins.read.contains(CPU.CCF.C))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this instruction may read the carry bit; abort the reduction attempt \n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\t\tif (reductionLevel > 1 || ins.set != null && ins.set.contains(CPU.CCF.C))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this instruction alters the carry bit; allow the reduction to proceed\n\t\t\t\t\t\t\t\t\t\tapplyTheReduction = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (applyTheReduction == true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tl1.replaceLine(l1.label + \" \" + \"clr\" + reg + l1.comment + \" * ECOAS REDUCTION *\", CPU.instructionTable);\n\t\t\t\t\t\t\t\t\tas.loadAccumulatorImmediateZeroRegisterInstructionCollapseCount++;\n\t\t\t\t\t\t\t\t\treductionCounter++;\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\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn reductionCounter;\n\t}", "protected int sumRow(Label l){\n\t\tint sum = 0;\n\n\t\tint rowIx = resolveIndex(l);\n\n\t\t//iterate all cells in the column\n\t\tfor(int i = 0;i<size();i++){\n\t\t\tInteger cell = matrix.get(rowIx).get(i);\n\t\t\tsum+=cell;\n\t\t}\n\t\treturn sum;\n\t}", "public long sum() {\n\t\tlong result = 0;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult += theElements[i];\n\t\t}\n\t\treturn result;\n\t}", "long sum(long[] a, int l, int r) {\n return l <= 0 ? a[r] : (a[r] + mod - a[l - 1]) % mod;\n }", "public static int computeTimeFinish(ArrayList<Integer> l) {\n\n int sum = 0;\n Collections.sort(l);\n int[] peoples = new int[3];\n peoples[0] = l.size() / 3;\n peoples[1] = (l.size() - peoples[0]) / 2;\n peoples[2] = (l.size() - peoples[0]) / 2;\n int position = 0;\n\n while (l.size() > 0){\n int count = 0;\n int total = 0;\n\n while (peoples[position] > 0){\n\n if (l.size() == 0){\n break;\n }\n\n if (count % 2 == 0) {\n total += l.get(l.size() - 1);\n l.remove(l.size() - 1);\n } else {\n total += l.get(0);\n l.remove(0);\n }\n peoples[position]--;\n count++;\n }\n if (total > sum){\n sum = total;\n }\n position++;\n }\n\n return sum;\n }", "private void reduce(String[] arguments) {\n\t\ttry { \n\t\t\tlastDeletedNode = null;\n\t\t\tint ID = Integer.parseInt(arguments[1]);\n\t int m = Integer.parseInt(arguments[2]);\n\t Node curr = searchID(root, ID);\n\t if(curr != null)\n\t {\n\t \tcurr.count -= m;\n\t \tif(curr.count > 0)\n\t \t\tSystem.out.printf(\"%d\\n\", curr.count);\n\t \telse\n\t \t{\n\t \t\tdelete(root, ID);\n\t \t\tSystem.out.println(\"0\");\n\t \t}\n\t }\n\t else\n\t \tSystem.out.println(\"0\");\n\t } catch(NumberFormatException e) { \n\t System.out.println(\"Argument not an Integer\");\n\t }\n\t}", "public Integer rollAndSum() {\n return null;\n }", "public long product() {\n\t\tlong result = 1;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult *= theElements[i];\n\t\t}\n\t\treturn result;\n\t}", "protected Expression getLumpedReactionRate() throws ExpressionException, PropertyVetoException {\n\t\t// lumped kinetics always have same units (molecules/s) or (pA) whether used in a FluxReaction or a SimpleReaction\r\n\t\t//\r\n\t\t// RateMagnitude = inwardCurrent / (valence*F) * unitFactor\r\n\t\t//\r\n\t\t// for FluxReaction, we are using the flux Carrier\r\n\t\t//\r\n\t\tModel model = getReactionStep().getModel();\r\n\t\tExpression F = getSymbolExpression(model.getFARADAY_CONSTANT());\r\n\t\tExpression lumpedInwardCurrent = getSymbolExpression(getLumpedCurrentParameter());\r\n\t\tExpression z = getSymbolExpression(getChargeValenceParameter());\r\n\t\tExpression tempRateExpression = Expression.div(lumpedInwardCurrent, Expression.mult(z, F));\r\n\t\t\r\n\t\tVCUnitDefinition tempRateUnit = getLumpedCurrentParameter().getUnitDefinition().divideBy(model.getFARADAY_CONSTANT().getUnitDefinition()).divideBy(getChargeValenceParameter().getUnitDefinition());\r\n\t\tVCUnitDefinition desiredUnit = getLumpedReactionRateParameter().getUnitDefinition();\r\n\t\tExpression unitFactorExp = getElectricalUnitFactor(desiredUnit.divideBy(tempRateUnit));\r\n\t\tif (unitFactorExp != null){\r\n\t\t\ttempRateExpression = Expression.mult(tempRateExpression,unitFactorExp);\r\n\t\t}\r\n\t\t\r\n\t\tif (hasOutwardFlux()){\r\n\t\t\ttempRateExpression = Expression.negate(tempRateExpression);\r\n\t\t}\r\n\t\treturn tempRateExpression;\r\n\t}", "public int getSumofElements(ArrayList<Integer> input)\n\t\t\tthrows RemoteException;", "protected int sumList(ArrayList<Integer> list){\r\n\t\tint result =0;\r\n\t\tfor(int i: list){\r\n\t\t\tresult = result + i;\r\n\t\t}\r\n\t\treturn result;\r\n\t\t\r\n\t}", "public static int product(List<Integer> in) {\n return in.stream()\n .reduce((i1, i2) -> i1 * i2) // Multiply each element together to get the product\n .orElse(0); // Ensure an empty list results in 0\n }", "public static IntList incrList(IntList L, int x) {\n /* Your code here. */\n IntList newList = null;\n for (int i = L.size() - 1; i > -1; i--) { //construct the newList backwardly, iteratively\n newList = new IntList(L.get(i) + x, newList);\n }\n return newList;\n }", "public int product() {\n // You'll need to replace this code with something\n // else to make product() work; this is just to make\n // things compile while you work on sum()\n return 1;\n }", "public int sum2() {\n\t\tint ans = 0;\n\t\tfor (ListNode<T> p = this; p != null; p = p.next) {\n\t\t\tans = ans + p.value; // fail!\n\t\t}\n\t}", "public long query(int l, int r) {\n long res = UNIQUE;\n for (l += N, r += N; l < r; l >>= 1, r >>= 1) {\n if ((l & 1) != 0) res = function(res, tree[l++]);\n if ((r & 1) != 0) res = function(res, tree[--r]);\n }\n if (res == UNIQUE) {\n throw new IllegalStateException(\"UNIQUE should not be the return value.\");\n }\n return res;\n }", "public int sumRange(int l, int r) {\n l += n;\n // get leaf with value 'r'\n r += n;\n int sum = 0;\n while (l <= r) {\n if ((l % 2) == 1) {\n sum += tree[l];\n l++;\n }\n if ((r % 2) == 0) {\n sum += tree[r];\n r--;\n }\n l /= 2;\n r /= 2;\n }\n return sum;\n }", "@CallSuper\n public long addAndGet(final long l) {\n long currentValue;\n\n for (; ; ) {\n currentValue = get();\n if (compareAndSet(currentValue, currentValue + l)) {\n return currentValue;\n }\n ii(this, mOrigin, \"Collision in concurrent add, will try again: \" + currentValue);\n }\n }", "public LMUL() {\n super(InstructionOpCodes.LMUL, 1);\n }", "public RegexNode ReduceRep()\n\t{\n\t\tRegexNode u;\n\t\tRegexNode child;\n\t\tint type;\n\t\tint min;\n\t\tint max;\n\n\t\tu = this;\n\t\ttype = Type();\n\t\tmin = _m;\n\t\tmax = _n;\n\n\t\tfor (;;)\n\t\t{\n\t\t\tif (u.ChildCount() == 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchild = u.Child(0);\n\n\t\t\t// multiply reps of the same type only\n\t\t\tif (child.Type() != type)\n\t\t\t{\n\t\t\t\tint childType = child.Type();\n\n\t\t\t\tif (!(childType >= Oneloop && childType <= Setloop && type == Loop || childType >= Onelazy && childType <= Setlazy && type == Lazyloop))\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// child can be too lumpy to blur, e.g., (a {100,105}) {3} or (a {2,})?\n\t\t\t// [but things like (a {2,})+ are not too lumpy...]\n\t\t\tif (u._m == 0 && child._m > 1 || child._n < child._m * 2)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tu = child;\n\t\t\tif (u._m > 0)\n\t\t\t{\n\t\t\t\tu._m = min = ((Integer.MAX_VALUE - 1) / u._m < min) ? Integer.MAX_VALUE : u._m * min;\n\t\t\t}\n\t\t\tif (u._n > 0)\n\t\t\t{\n\t\t\t\tu._n = max = ((Integer.MAX_VALUE - 1) / u._n < max) ? Integer.MAX_VALUE : u._n * max;\n\t\t\t}\n\t\t}\n\n\t\treturn min == Integer.MAX_VALUE ? new RegexNode(Nothing, _options) : u;\n\t}", "public static <C> int EXTENT(LIST<C> L) {\n if ( isNull( L ) ) {\n return 0;\n }\n int n = 0;\n for ( C a : L.list ) {\n if ( a instanceof LIST ) {\n LIST<C> LP = null;\n try {\n LP = (LIST<C>) a; \n } catch(ClassCastException e) {\n }\n if ( isNull( LP ) ) {\n n++;\n } else {\n n += EXTENT( LP ); \n }\n } else {\n n++;\n }\n }\n return n;\n }", "public void reduce(List<T> list) {\n\t\tfor(int i = 1; i < list.size(); i++) {\n\t\t\tif(list.get(i) == null || list.get(i-1) == null) continue;\n\t\t\tint hash = list.get(i-1).hashCode();\n\t\t\tif(!rule.containsKey(hash)) continue;\n\t\t\tif(rule.get(hash).contains(list.get(i))) {\n\t\t\t\tlist.remove(i);\ti--;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "public int calculSum(DoublyLinkedListHeader list) {\n\t\tif(list.getHeader().getFirst() == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tint sum =0;\r\n\t\t\tDNode current = list.getHeader().getFirst();\r\n\t\t\twhile(current!= null) {\r\n\t\t\t\tsum += ((Integer)current.getInfo()).intValue();\r\n\t\t\t\tcurrent = current.getNext();\r\n\t\t\t}\r\n\t\t\treturn sum;\r\n\t\t}\r\n\t}", "double getSum();", "double getSum();", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "private int syuneri_gumar(ArrayList<Integer> syun) {\n int summa = 0;\n for (int i = 0; i < syun.size(); i++)\n summa += syun.get(i);\n return summa;\n }", "public int cumulativeSum() {\n int sum = 0;\n EquationList p_eqn = eqn;\n while (p_eqn != null) {\n sum = sum + p_eqn.result;\n p_eqn = p_eqn.next;\n }\n if (p_eqn == null) {\n sum = sum;\n }\n return sum;\n }", "public static int getSum(List<Object>list){\n\t\tint c=0;\n\t\tfor(int i=0;i<list.size();i++){\n\t\t\tif(list.get(i) instanceof Integer){\n\t\t\t\tc+=(int)list.get(i);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn c;\n\t}", "public int sumListeForEach(ArrayList<Integer> list) {\r\n int resultat = 0;\r\n for (int tal : list) {\r\n resultat = resultat + tal;\r\n }\r\n return resultat;\r\n }", "public void reduct() {\n\t\tint divider = bunmo;\n\t\tif(bunja < bunmo){\n\t\t\tdivider = bunja;\n\t\t}\n\t\twhile(divider > 1){\n//\t\twhile(!util.Uitl.isPrime(bunmo)||!util.Uitl.isPrime(bunja)){\n\t\t\tboolean canDivide = (bunmo%divider==0)&&(bunja%divider==0);\n\t\t\tif(canDivide){\n\t\t\t\tbunja/=divider;\n\t\t\t\tbunmo/=divider;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdivider--;\n\t\t\t}\n\t\t}\n\t}", "public float getPurchasedListSum()\r\n\t{\r\n\t\tfloat fTempSum = 0;\r\n\t\tfor(int i = 0 ; i < m_purechaseList.size() ; i++)\r\n\t\t{\r\n\t\t\tfTempSum += m_purechaseList.get(i).getPurchasItemCost();\r\n\t\t}\r\n\t\treturn fTempSum;\t\t\r\n\t}", "public int getSum() {\n\t\t\treturn 0;\r\n\t\t}", "@Override\n public BinaryOperator<List<Integer>> combiner() {\n return (resultList1, resultList2) -> {\n Integer currentTotal1 = resultList1.get(0);\n Integer currentTotal2 = resultList2.get(0);\n currentTotal1 += currentTotal2;\n resultList1.set(0, currentTotal1);\n return resultList1;\n };\n }", "public static int divideRecursion(List<List<Integer>> R) {\r\n\t\tList<Integer> seq = new ArrayList<Integer>();\r\n\t\tseq.add(0);\r\n\t\tseq.add(1);\r\n\t\tif(R.size() != 0) {\r\n\t\t\treturn divideRecursion(R, R.size(), seq);\r\n\t\t} else {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "private static Integer deductOne(Integer element) {\n return element - 1;\n }", "public T sum();", "public abstract T accumulate(T left, T right);", "@Override\n public void reduce() {\n if(null != getState())\n switch(getState()) {\n case OPERATOR:\n if (getDispenser().tokenIsOperator() && numOpNumOnStack())\n priorityReduce();\n break;\n case RIGHT_PAREN:\n if (getDispenser().tokenIsRightParen()) {\n if (!getStack().contains('('))\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n while ((char)getStack().get(getStack().size() - 2) != '(')\n reduceNumOpNum();\n double aNum = (double)getStack().pop();\n getStack().pop();\n getStack().push(aNum);\n }\n break;\n case END:\n if (getDispenser().tokenIsEOF()) {\n if(getStack().contains('('))\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n while(numOpNumOnStack())\n reduceNumOpNum();\n if(getStack().size() != 1)\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n }\n break;\n }\n }", "public int calcSum() {\n\t\tint sum = 0;\n\t\tfor (int count = 0; count < data.size(); count++)\n\t\t\tsum += (int)data.get(count);\n\t\treturn sum;\n\t}", "int query(int l, int r) {\n l += n;\n r += n;\n int resl = identity;\n int resr = identity;\n while (l < r) {\n if ((l & 1) > 0) resl = combine(resl, st[l++]);\n if ((r & 1) > 0) resr = combine(st[--r], resr);\n l /= 2;\n r /= 2;\n }\n return combine(resl, resr);\n }", "public Double darCostoRuteo(List<Ruta>r){\n\t\tDouble respuesta=0.0;\n\t\tfor(int i=0;i<r.size();i++){\n\t\t\trespuesta+=r.get(i).costosTotales;\n\t\t}\n\t\treturn respuesta;\n\t}", "public int sumListeFor(ArrayList<Integer> list) {\r\n int resultat = 0;\r\n for (int i = 0; i < list.size(); i++) {\r\n resultat = resultat + list.get(i);\r\n }\r\n return resultat;\r\n }", "public double get(){\n sum = 0;\n if(hasFilled){\n for(int j=0; j<list.length; j++)\n {\n sum += list[j];\n }\n \n return sum/(double)list.length;\n }\n else{\n for(int j = 0; j < index;j++){\n sum += list[j];\n }\n return sum/(double)index;\n }\n }", "public static Expression reduce(Expression expression) { throw Extensions.todo(); }", "public int cumulativeProduct() {\n int product = 1;\n EquationList p_eqn = eqn;\n while (p_eqn != null) {\n product = product * p_eqn.result;\n p_eqn = p_eqn.next;\n }\n if (p_eqn == null) {\n product = product;\n }\n return product;\n }", "public int sumOfElements(){\n\t\tint sum = 0;\n\t\tNode temp = this.head;\n\t\twhile(temp != null){\n\t\t\tsum += temp.data;\n\t\t\ttemp = temp.next;\n\t\t}\n\t\treturn sum;\n\t}", "public int Rear() {\n if(isEmpty()) return -1;\n return l.get(tail);\n }", "static int sumLinkedList(LinkedListProblems.Node head){\n int sum=0;\n if(head==null){\n return sum;\n }\n sum=sumLinkedList(head.next);// head recursion will to top to recursive stack first before processing\n sum+=head.val; //process Same as one line sum+= head.val+sumLinkedList(head.next);\n return sum;\n }", "public Node findSumOfNumbers(Node l1, Node l2) {\n\t\tint carry =0;\n \n\t\tNode newHead = null;\n\t\tNode tempNodeForIteration=null;\n\t\tint sum=0;\n \n\t\tint count=0;\n\t\twhile(l1!=null || l2!=null)\n\t\t{\n\t\t\tcount++;\n\t\t\tsum=carry;\n\t\t\tif(l1!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l1.value;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n \n\t\t\tif(l2!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l2.value;\n\t\t\t\tl2=l2.next;\n\t\t\t}\n \n \n\t\t\tcarry=sum/10;\n\t\t\tsum=sum%10;\n\t\t\t// Check if it first node for the result\n\t\t\tif(count==1)\n\t\t\t{ \n\t\t\t\ttempNodeForIteration = new Node(sum);\n\t\t\t\tnewHead=tempNodeForIteration;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 1-->5 -->7\n\t\t\t\t//tempNodeForIteration first node is =1\n\t\t\t\tNode tempSumNode=new Node(sum);\n\t\t\t\t//tempNodeForIteration second node is =5\n\t\t\t\ttempNodeForIteration.next=tempSumNode;\n\t\t\t\t//tempNodeForIteration node holding last node =5\n\t\t\t\ttempNodeForIteration=tempNodeForIteration.next;\n\t\t\t}\n \n\t\t}\n\t\tif(carry!=0)\n\t\t{\n\t\t\tNode tempNode=new Node(carry);\n\t\t\ttempNodeForIteration.next=tempNode;\n\t\t}\n\t\treturn newHead;\n\t}", "public LLNode solveAddLinkedList(LLNode l0, LLNode l1) {\n\t\tint carry = 0;\n\t\tLLNode head = null;\n\t\tLLNode node = null;\n\n\t\tint sum = l0.val + l1.val + carry;\n\t\tcarry = sum / 10;\n\t\tsum = sum % 10;\n\t\thead = new LLNode();\n\t\thead.val = sum;\n\t\tnode = head;\n\n\t\tl0 = l0.next;\n\t\tl1 = l1.next;\n\n\t\twhile (l0 != null || l1 != null) {\n\t\t\tsum = (l0 != null ? l0.val : 0) + (l1 != null ? l1.val : 0) + carry;\n\t\t\tcarry = sum / 10;\n\t\t\tsum = sum % 10;\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = sum;\n\n\t\t\tif (l0 != null)\n\t\t\t\tl0 = l0.next;\n\t\t\tif (l1 != null)\n\t\t\t\tl1 = l1.next;\n\t\t}\n\n\t\tif (carry > 0) {\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = carry;\n\t\t}\n\n\t\treturn node;\n\t}", "static IntListList naturalRuns(IntList L) {\n if (L.tail == null) {\n return new IntListList(L, null);\n }\n else {\n IntList store = L;\n while (L.tail.head > L.head) {\n L = L.tail;\n if (L.tail == null) {\n return new IntListList(store, null);\n }\n }\n IntList help = L;\n L = L.tail;\n help.tail = null;\n return new IntListList(store, naturalRuns(L));\n }\n }", "public void update(L l);", "public long shiftTilLwm() {\n while ((list.size() > 1) && (!isHeadLwm())) {\n list.remove(0);\n }\n return list.get(0);\n }", "private static int sum(List<Integer> L, int i,int j) {\n\t\tSystem.out.println(L+\"\\n\"+\"index i = \"+i+\"\\n\"+\"index j = \"+j);\n\t\tList<Integer> subListToSum = new ArrayList<Integer>();\n\t\t\n\t\tif (i <= j) { //make sure that i is less than j so we have a sublist of at least one\n\t\t\tsubListToSum.addAll(L.subList(i, j));\n\t\t\t\n\t\t}\n\t\t\n\t\telse if (i > j) { //print out a error so the user knows what they did wrong\n\t\t\tSystem.out.println(\"index 'i' is more than index 'j'\");\n\t\t}\n\t\t\n\t\tint sizeList = L.size(); //only reaches here if i <= j\n\t\tSystem.out.println(\"size of list is: \" + sizeList);\n\t\tif (j <= sizeList & i <= sizeList) { //check to account for out of bounds and negatives\n\t\t\tint result = 0;\n\t\t\t\n\t\t\tfor (int allInts : subListToSum) {\n\t\t\t\tresult += allInts;\n\t\t\t};\n\t\t\t\n\t\t\tSystem.out.println(\"Sum(\" + i + \", \" + j + \")\" + \" = \" + result);\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "protected int sumColumn(Label l){\n\t\tint sum = 0;\n\n\t\tint colIx = resolveIndex(l);\n\n\t\t//iterate all cells in the column\n\t\tfor(int i = 0;i<size();i++){\n\t\t\tInteger cell = matrix.get(i).get(colIx);\n\t\t\tsum+=cell;\n\t\t}\n\t\treturn sum;\n\t}", "public void visitLMUL(LMUL o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "@Override\r\n\tpublic int umul(int a,int b) {\n\t\treturn a/b;\r\n\t}", "public int getRan(int H, int L)\t\n\t{\t//start of getRan method\n\t\trandomNum = L * (int)(Math.random()*H);\n\t\treturn randomNum;\n\t\t\n\t}", "private static List<Integer> addOne(List<Integer> input) {\n\n\t\tList<Integer> copy = new ArrayList<>();\n\t\tcopy.addAll(input);\n\n\t\tint size = copy.size();\n\t\tcopy.set(size-1, input.get(size-1)+1);//last element of input is updated/replaced by (original value + 1)\n\n\t\tfor(int i=size-1; i>0 && copy.get(i)==10; i--) {\n\t\t\tcopy.set(i, 0);\n\t\t\tcopy.set(i-1, copy.get(i-1)+1);\n\t\t}\n\n\t\tif(copy.get(0) == 10) {\n\t\t\tcopy.set(0, 0);\n\t\t\tcopy.add(0, 1);//add 1 at index0 ,shift all elements after to right\n\t\t}\n\n\t\treturn copy;//this NOT modifies the original input\n\t}", "public Matrix rref() {\n\t\tMatrix m = ref();\n\t\tint pivotRow = m.M - 1;\n\t\tArrayList<Integer> pivotColumns = m.pivotColumns();\n\t\tCollections.reverse(pivotColumns);\n\t\tfor (int i = 0; i < pivotColumns.size(); i++) {\n\t\t\tint pivotCol = pivotColumns.get(i);\n\t\t\twhile (pivotRow >= 0 && m.ROWS[pivotRow][pivotCol].equals(new ComplexNumber(0))) {\n\t\t\t\tpivotRow--;\n\t\t\t}\n\t\t\tfor (int upperRow = pivotRow - 1; upperRow > -1; upperRow--) {\n\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\tComplexNumber factor2 = m.ROWS[upperRow][pivotCol];\n\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][pivotCol];\n\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\tm = m.rowAdd(upperRow, pivotRow, weight);\n\t\t\t}\n\t\t\tpivotRow--;\n\t\t}\n\t\treturn m;\n\t}", "public int sum()\n {\n return sum(0,0,size);\n }", "@Nonnull\n @ReturnsMutableCopy\n public Matrix getL ()\n {\n final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);\n final double [] [] aNewArray = aNewMatrix.internalGetArray ();\n for (int nRow = 0; nRow < m_nRows; nRow++)\n {\n final double [] aSrcRow = m_aLU[nRow];\n final double [] aDstRow = aNewArray[nRow];\n for (int nCol = 0; nCol < m_nCols; nCol++)\n if (nRow > nCol)\n aDstRow[nCol] = aSrcRow[nCol];\n else\n if (nRow == nCol)\n aDstRow[nCol] = 1.0;\n else\n aDstRow[nCol] = 0.0;\n }\n return aNewMatrix;\n }", "public Number getTotalRolls() {\n return (Number)getAttributeInternal(TOTALROLLS);\n }", "private void doubleDemoteLeft (WAVLNode z) {\n\t z.rank--;\r\n\t z.right.rank--;\r\n }", "abstract List<T> getReuslt();", "public Integer getSum() {\n return sum;\n }", "@Override\n public BiConsumer<List<Integer>, Employee> accumulator() {\n return (resultList, employee) -> {\n if (resultList.isEmpty()) resultList.add(employee.getSalary());\n else {\n Integer currentTotal = resultList.get(0);\n currentTotal += employee.getSalary();\n resultList.set(0, currentTotal);\n }\n };\n }", "public double calPriceListReferenceBook(ReferenceBook[] listRB, int numOfReBook) {\n double totalPrice = 0;\n\n for (int i = 0; i < numOfReBook; i++) {\n totalPrice += listRB[i].calPriceReferenceBook();\n }\n return totalPrice;\n }", "public void calculeReduction(Produit p) {\r\n\t\tdouble res=0;\r\n\t\tres=p.getPrix()*taux;\r\n\t\tp.ajoutReduction(res);\r\n\t}", "private void updateLuts() {\r\n\t\tint luts = 0;\r\n\r\n\t\t// We get the Luts of each module and add them together.\r\n\t\tfor (int i = 0; i < helperInstMod.model.size(); i++) {\r\n\t\t\tluts += Integer.valueOf(helperInstMod.model.getElementAt(i).getLuts());\r\n\t\t}\r\n\r\n\t\tlabelLuts.setText(\"Total Luts: \" + String.valueOf(luts));\r\n\t}", "public static <C> LIST<C> CINV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LinkedList<C> list = new LinkedList<C>(L.list);\n Collections.reverse( list );\n return new LIST<C>( list );\n }", "private static int sumIntegerList(List<Integer> superGrowingList) {\r\n\t\tint sum = 0;\r\n\t\tIterator<Integer> iterator = superGrowingList.iterator();\r\n\t\twhile (iterator.hasNext()) {\r\n\t\t\tInteger integer = (Integer) iterator.next();\r\n\t\t\tsum += (int)integer;\r\n\t\t}\r\n\t\treturn sum;\r\n\t}", "private int count(int[] L, int len) {\n int sum = 0;\n for (int l : L) {\n sum += l / len; //!!! 必须是(l/len), l可以被cut成多块长度为len的木头。\n }\n return sum;\n }", "public static <C> int LENGTH(LIST<C> L) {\n if ( isNull( L ) ) {\n return 0;\n }\n return L.list.size();\n }", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "Sum getMultiplier();", "public static boolean UnaryExpr(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"UnaryExpr\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _COLLAPSE_, UNARY_EXPR, \"<unary expr>\");\n r = UnaryExpr_0(b, l + 1);\n r = r && ValueExpr(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "private E unlinkLast(Node<E> l){\r\n \tfinal E element = l.item;\r\n \tfinal Node<E> next = l.next;\r\n \tl.item = null;\r\n \tl.next = null; // help GC\r\n \tlast = next;\r\n \tif(last == null)\r\n \t\tfirst = null;\r\n \telse\r\n \t\tnext.prev = null;\r\n \tsize--;\r\n \tmodCount++;\r\n \treturn element;\r\n }", "static long countTriplets(List<Long> arr, long r) {\n long result = 0L;\n long size = arr.size();\n\n ArrayList<long[]> duoList = new ArrayList<>();\n\n // triplet 이 될 수 있는 duo를 선발\n for (int i = 0; i < (size - 1); i++) {\n long firstItem = arr.get(i);\n\n for (int j = i + 1; j < size; j++) {\n long secondItem = arr.get(j);\n if (j >= (size - 1)) continue;\n if (secondItem / (float) firstItem == r) {\n long[] tripletAble = {i, j};\n // System.out.println(\"tripletAble : \" + Arrays.toString(tripletAble));\n if (duoList.contains(tripletAble)) {\n continue;\n } else {\n duoList.add(tripletAble);\n }\n }\n }\n }\n\n // duo인 int[] 의 두 번째 item (int[1]) 의 다음 index부터 탐색해서\n // 해당 수가 triplet이 될 수 있다면 result + 1\n // 판단 기준은 thirdItem / secondItem 이 r이 되는 경우\n int listSize = duoList.size();\n for (int k = 0; k < listSize; k++) {\n long[] targetArr = duoList.get(k);\n long secondIdx = targetArr[1];\n for (int l = (int) secondIdx + 1; l < size; l++) {\n\n long secondItem = arr.get((int) targetArr[1]);\n long thirdItem = arr.get(l);\n\n if (thirdItem / (float) secondItem == r) {\n result += 1L;\n }\n }\n }\n\n return result;\n }", "public final AstValidator.rel_list_return rel_list() throws RecognitionException {\n AstValidator.rel_list_return retval = new AstValidator.rel_list_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n AstValidator.rel_return rel323 =null;\n\n\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:507:10: ( ( rel )+ )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:507:12: ( rel )+\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:507:12: ( rel )+\n int cnt91=0;\n loop91:\n do {\n int alt91=2;\n int LA91_0 = input.LA(1);\n\n if ( (LA91_0==ARROBA||LA91_0==ASSERT||LA91_0==COGROUP||(LA91_0 >= CROSS && LA91_0 <= CUBE)||LA91_0==DEFINE||LA91_0==DISTINCT||LA91_0==FILTER||LA91_0==FOREACH||LA91_0==GROUP||LA91_0==IDENTIFIER||LA91_0==JOIN||(LA91_0 >= LIMIT && LA91_0 <= LOAD)||LA91_0==MAPREDUCE||LA91_0==ORDER||LA91_0==RANK||LA91_0==SAMPLE||LA91_0==SPLIT||(LA91_0 >= STORE && LA91_0 <= STREAM)||LA91_0==UNION) ) {\n alt91=1;\n }\n\n\n switch (alt91) {\n \tcase 1 :\n \t // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:507:12: rel\n \t {\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_rel_in_rel_list2714);\n \t rel323=rel();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) \n \t adaptor.addChild(root_0, rel323.getTree());\n\n\n \t if ( state.backtracking==0 ) {\n \t }\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt91 >= 1 ) break loop91;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(91, input);\n throw eee;\n }\n cnt91++;\n } while (true);\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "long getLsum(int n, int i, int k){ \r\n return (i-k+1)>=0 ? (i-k+1) + ssum(k) : ssum(k) - ssum(k-i-1);\r\n }", "Integer total();", "@Override\n\tpublic Object reduce( final ReduceFn fn, final Object initial )\n\t\t\tthrows AccessDeniedException, EmptyListException,\n\t\t\tListIndexException, InvalidListException;", "public String getSum();", "static void compute(List<Integer> slate, int[] input) {\n if (input.length == 0)\n System.out.println(slate);\n else {\n int[] copy = Arrays.copyOfRange(input, 1, input.length);\n compute(slate, copy);\n slate.add(input[0]);\n compute(slate, copy);\n slate.remove(slate.size() - 1);\n }\n }" ]
[ "0.56394637", "0.5558543", "0.55196357", "0.52432096", "0.5226929", "0.5212463", "0.51823825", "0.5172757", "0.5156533", "0.51019496", "0.5070165", "0.5063125", "0.5063125", "0.5021543", "0.5001901", "0.49995425", "0.49880746", "0.49601316", "0.49587783", "0.4945828", "0.49213475", "0.49098462", "0.4895649", "0.48752892", "0.48401418", "0.48303455", "0.48114705", "0.48028365", "0.48023608", "0.47995195", "0.47987357", "0.47863746", "0.4758433", "0.47577694", "0.47558048", "0.47552407", "0.4747453", "0.47473568", "0.47473568", "0.47274444", "0.4725141", "0.47220802", "0.47181988", "0.47151172", "0.47116598", "0.4699084", "0.46973792", "0.46771064", "0.46693358", "0.46630597", "0.4659465", "0.4656029", "0.46484384", "0.46414262", "0.46323273", "0.46305645", "0.46301594", "0.46216324", "0.46215516", "0.46113524", "0.4610469", "0.46103528", "0.46091747", "0.4599813", "0.45967302", "0.4589577", "0.45823285", "0.4573389", "0.45659676", "0.45616868", "0.45615637", "0.45553172", "0.45473698", "0.4538889", "0.4537307", "0.45306617", "0.45224714", "0.45223188", "0.4500048", "0.4499926", "0.44966453", "0.4493334", "0.44886523", "0.448158", "0.44682452", "0.44662046", "0.44648495", "0.44641513", "0.4458304", "0.44568205", "0.4452801", "0.4452491", "0.44445604", "0.44426006", "0.44422635", "0.4441716", "0.44414926", "0.444068", "0.44322956", "0.44320354" ]
0.544393
3
Set first. L is a nonnull list. a is a list. The first element of L is changed to a.
public static <C> void SFIRST(LIST<C> L, C a) { if ( ! isNull( L ) ) { L.list.set(0,a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addFirst(Comparable o){\n\t\t head=new ListElement(o,head);\n\t }", "@Override\r\n\t\tpublic E setFirst(E first) {\n\t\t\treturn pair.setFirst(first);\r\n\t\t}", "public void addFirst(T t) {\n if (size == elements.length) // checks potential overflow\n ensureCapacity(); // increase capacity\n for (int j = size; j > 0; j--) // treat elements of list with indexes in range [1, n]\n elements[j] = elements[j - 1]; // element shifts to right\n size++; // increment size\n elements[0] = t; // store element at index 0\n }", "public void setFirst(Node first)\n {\n this.first = first;\n }", "public static <C> C FIRST(LIST<C> L) {\n if ( isNull( L ) ) {\n return null;\n }\n if ( L.iter != null ) {\n if ( L.iter.hasNext() ) {\n return L.iter.next();\n } else {\n L.iter = null;\n return null;\n }\n }\n return L.list.getFirst();\n }", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public void setFirst(List<List<Seat>> first) {\n\t\tthis.first = first;\n\t}", "public Item setFront(Item item) {\n // check if list is not empty:\n if(isEmpty()) throw new NoSuchElementException(\"Failed to setFront, because DList is empty!\");\n // update the data of the first actual node (first itself is a sentinel node)\n Item oldValue = first.next.data;\n first.next.data = item;\n return oldValue;\n }", "@Override\r\n\t\tpublic T setFirst(T first) {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.setFirst(first);\r\n\t\t\t}\r\n\t\t}", "public void setFirst(@NotNull F first) {\n Condition.argNotNull(\"first\", first);\n this.first = first;\n }", "void setFirst(Node node) {\n this.first = node;\n }", "public void addFirst(Item item){\r\n\t\t if (item == null) throw new NullPointerException();\r\n\t\t if (n == list.length){resize(2*list.length);}\r\n\t\t if(isEmpty()){prior=0;first=0;last=0;latter=1;}\r\n\t\t list[prior--]=item;\r\n\t\t first = prior+1;\r\n\t\t if(prior==-1){prior=list.length-1;}\r\n\t\t n++;}", "public void deleteFirst() {\r\n\t\t// Can't delete from an empty list\r\n\t\tif (isEmpty()) {\r\n\t\t\tSystem.out.println(\"Error in List.deleteFirst() \"\r\n\t\t\t\t\t+ \"Attempted delete from Empty List \");\r\n\t\t}\r\n\r\n\t\t// Special case: list has only one element\r\n\t\telse if (length == 1) {\r\n\t\t\tfirstNode = null;\r\n\t\t\tlastNode = null;\r\n\t\t\tlength = 0;\r\n\t\t}\r\n\t\t// All other lists: Only first pointer changes. Last doesn't\r\n\t\telse {\r\n\t\t\tfirstNode = firstNode.getNextNode();\r\n\t\t\tlength--;\r\n\t\t}\r\n\t}", "@Override\n public void insertFirst(E e) {\n if (listHead == null) {\n listHead = new Node(e);\n listTail = listHead;\n }\n\n // In the general case, we simply add a new node at the start\n // of the list via the head pointer.\n else {\n listHead = new Node(e, listHead);\n }\n }", "public void updateFirstNode()\n {\n firstNode = (lastNode.getNext() == null) ? lastNode : lastNode.getNext();\n }", "public void addFirst(Object value)\n {\n if(last == null && first == null)\n {\n ListNode temp = new ListNode(value, null);\n last = temp;\n first = temp;\n }\n else\n {\n first = new ListNode(value, first);\n }\n \n }", "public A getFirst() { return first; }", "private void addAsFirst(LinkedList<T>.Node<T> elementZero) {\n\t\telementZero.setPriorNode(itsFirstNode.getPriorNode());\n\t\telementZero.setNextNode(itsFirstNode);\n\t\titsFirstNode.setPriorNode(elementZero);\n\t\titsFirstNode = elementZero;\n\t}", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "public void addFirst(E item) {\n Node<E> n = new Node<>(item, head);\n size++;\n if(head == null) {\n // The list was empty\n head = tail = n;\n } else {\n head = n;\n }\n }", "void removeNodeFirst(ANode<T> a) {\n this.next.removeNode(a);\n }", "public final void setFirst(Node n) {\n set(n);\n }", "public void addFirst(Object e) {\n if(head == null) {\n tail = head = new Node(e, null, null);\n return;\n }\n\n Node n = new Node(e, null, head);\n head.setPrevious(n);\n head = n;\n }", "private void linkFirst(final T element) {\r\n\t\tfinal int f = first;\r\n\t\tfinal int newNode = setFirstFree(element);\r\n\r\n\t\tsetNextPointer(newNode, f);\r\n\t\tsetPrevPointer(newNode, -1); // undefined\r\n\t\tfirst = newNode;\r\n\r\n\t\tif (f == -1) {\r\n\t\t\tlast = newNode;\r\n\t\t} else {\r\n\t\t\tsetPrevPointer(f, newNode);\r\n\t\t}\r\n\t\tsize++;\r\n\t\tmodCount++;\r\n\t}", "public void addFirst(E e) { // adds element e to the front of the list\n // TODO\n if (size == 0) {\n tail = new Node<>(e, null);\n tail.setNext(tail);\n } else {\n Node<E> newest = new Node<>(e, tail.getNext());\n tail.setNext(newest);\n }\n size++;\n }", "protected T getFirstValue(List<T> list) {\n\t\treturn list != null && !list.isEmpty() ? list.get(0) : null;\n\t}", "public static native void SetFirst(long lpjFbxArrayVector2, long pElement);", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "@Override\r\n\tpublic Object first(){\r\n\t\tcheck();\r\n\t\treturn head.value;\r\n\t}", "public void addFirst(Object element)\n {\n Node newNode = new Node();\n newNode.data = element;\n newNode.next = first;\n first = newNode; \n \n }", "public void addFirst(Item item) {\n if (item == null) {\n throw new IllegalArgumentException(\"Item must not be null.\");\n }\n\n Node<Item> oldFirst = first;\n first = new Node<>();\n first.item = item;\n first.next = oldFirst;\n if (oldFirst == null) {\n last = first;\n } else {\n oldFirst.previous = first;\n }\n size++;\n assert check();\n }", "public void addFirst(E x) {\n\t\taddBefore(mHead.next, x);\n\n\t\tmSize++;\n\t\tmodCount++;\n\t}", "@Override\r\n public ListADT<T> toMutable() {\r\n return new ListADTImpl<T>(this.head);\r\n }", "public static <T> T getFirst(List<T> list) {\n\t\treturn list != null && !list.isEmpty() ? list.get(0) : null;\n\t}", "public ListaEncadeada() {\n first = null;\n }", "@Override\n public void prepend(T elem) {\n if(isEmpty()) { //if list is empty\n first = new DLNode(elem, null, null);//new element created, there's nothing before and after it yet\n last = first;\n }\n else{ //list in not empty\n \n first = new DLNode(elem, null, first); //new element goes to the front, there nothing before it, the old first element is after it\n \n first.next.prev = first; //ensure that reference to our first element is pointing to the new first element\n }\n \n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "@Override\n\tpublic Position<E> addFirst(E e) {\n\t\treturn addBetween(head, head.next, e);\n\t}", "public A first() {\n return first;\n }", "public void addFirst (E[] e) {\n\t\thead = new Node<>(e, head);\n\t\tif (size == 0) {\n\t\t\ttail = head;\n\t\t} else {\n\t\t\t// do nothing\n\t\t}\n\t\tsize = size + 1;\n\t}", "public void addFirst(Item item) {\n if (item == null) {\n throw new IllegalArgumentException();\n }\n Node node = new Node();\n node.item = item;\n node.next = first;\n if (first == null) {\n first = node;\n last = first;\n }\n else {\n first.pre = node;\n first = node;\n }\n len++;\n }", "public void setFirst(V vv) {\n\t\t\tthis.v = vv;\n\t\t}", "public void addFirst(Item item) {\n Node oldFirst = first;\n first = new Node(null, item, oldFirst);\n if (oldFirst == null)\n last = first;\n else\n oldFirst.prev = first;\n size++;\n }", "public void firstElement() {\r\n \t\tcurrentObject = 0;\r\n \t}", "private void linkFirst(E e) {\r\n \tfinal Node<E> f= first;\r\n \tfinal Node<E> newNode = new Node<>(null, e, f);\r\n \tfirst = newNode;\r\n \tif (f == null)\r\n \t\tlast = newNode;\r\n \telse\r\n \t\tf.prev = newNode;\r\n \tsize++;\r\n \tmodCount++;\r\n }", "public ListADTImpl(ImmutableListADTImpl<T> listToMakeMutable) {\r\n this.head = new GenericEmptyNode();\r\n for (int i = 0; i < listToMakeMutable.getSize(); i++) {\r\n T value = listToMakeMutable.get(i);\r\n this.head = this.head.addBack(value);\r\n }\r\n }", "public static void m1(ArrayList<String> al)\n\t{\n\t\tal.add(\"Marshal Mathers\");\n\t\tal.add(\"Slim Shady\");\n\t\tal.add(\"Bad Meets Evil\");\t\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "@Override\n public void addFirst(E element) {\n Node<E> newNodeList = new Node<>(element, head);\n\n head = newNodeList;\n cursor = newNodeList;\n size++;\n }", "public void addFirst(Item item) {\n if (item != null) {\n if (size == 0) { // initiation for the first adding\n first = new Node();\n last = new Node();\n first.item = item;\n first.front = null;\n first.back = null;\n last = first;\n } else { // normal front adding\n Node oldfirst = first;\n first = new Node();\n first.front = null;\n first.item = item;\n first.back = oldfirst;\n oldfirst.front = first;\n }\n size++;\n } else throw new IllegalArgumentException(\"?\");\n }", "public void addFirst(Item item) throws NullPointerException {\n checkItemNotNull(item);\n\n Node oldfirst = first;\n first = new Node(item);\n\n if (isEmpty()) {\n last = first;\n } else {\n oldfirst.prev = first;\n first.next = oldfirst;\n }\n size++;\n }", "public void addFirst(Item item) {\n if (item == null) {\n throw new IllegalArgumentException(\"Can not call addFirst() with a null argument\");\n }\n Node<Item> oldFirst = first;\n first = new Node<Item>();\n first.item = item;\n first.next = oldFirst;\n if (isEmpty()) {\n last = first;\n }\n else {\n // first.prev = oldFirst;\n oldFirst.prev = first;\n }\n n++;\n }", "public void addFirst(Item item) {\n if (item == null) {\n throw new IllegalArgumentException();\n }\n\n this.first = new Node(item, this.first, null);\n\n if (this.size == 0) {\n this.last = this.first;\n } else {\n this.first.next.prev = this.first;\n }\n\n this.size++;\n }", "default SELF setFirstIf(T first, LBiPredicate<T,T> predicate) {\n if (predicate.test(first, this.first())) {\n return this.first(first);\n }\n return (SELF) this;\n }", "public SinglyLinkedList(){\n this.first = null;\n }", "public void addFirst(E e) {\n this.head = new Node<>(e, head);\t// create and link a new node\r\n if (this.size == 0)\r\n this.tail = this.head;\r\n this.size ++;\r\n }", "public void addFirst(T element);", "public void addFirst(Item item) {\n if (item == null) {\n throw new NullPointerException(\"Item Null\");\n } else {\n\n if (isEmpty()) {\n first = new Node<Item>();\n first.item = item;\n last = first;\n } else {\n Node<Item> oldFrist = first;\n first = new Node<Item>();\n first.item = item;\n first.next = oldFrist;\n oldFrist.prev = first;\n }\n N++;\n }\n }", "public static void fill(java.util.List arg0, java.lang.Object arg1)\n { return; }", "public void addFirst(E item){\r\n\r\n //checking the precondition\r\n\tif(item == null){\r\n\t\tthrow new IllegalArgumentException(\" item cannot equal null \");\r\n\t}\r\n\t\r\n\t//creating a new front of the list\r\n\tDoubleListNode<E> firstNode = new DoubleListNode<E>(end.getPrev(), item, null);\r\n\t\r\n\t//setting the front of the list to the head\r\n\tfirstNode.setNext(head);\r\n\t\r\n\t//setting the head to new first node\r\n\thead = firstNode;\r\n\t\r\n\t//setting the headData\r\n\theadData = head.getData();\r\n\t\r\n\r\n\r\n }", "public void addFirst(Item item) {\n if (item == null)\n throw new IllegalArgumentException();\n \n final Node<Item> f = first;\n final Node<Item> newNode = new Node<>(null, item, f);\n first = newNode;\n if (f == null)\n last = newNode;\n else\n f.prev = newNode;\n size++;\n }", "public void addFirst(Item item) {\n if (item == null) throw new IllegalArgumentException(\"argument is null\");\n if (!isEmpty()) {\n Node a = new Node();\n a.item = item;\n a.prev = null;\n a.next = first;\n first.prev = a;\n first = a;\n }\n else {\n Node a = new Node();\n a.item = item;\n a.next = null;\n a.prev = null;\n first = a;\n last = a;\n }\n size++;\n }", "private static Node deleteFirst(Node head) {\n if (head == null) {\n return null;\n }\n Node current = head;\n\n // only one element\n if (current.next == head) {\n head.next = null; // or head = null is fine for GC\n return null;\n }\n\n while(current.next != head) {\n current = current.next;\n }\n // removing head from list\n current.next = head.next;\n // prevent memory leak\n head.next = null;\n head = current.next;\n return head;\n }", "public void addFirst(Item item) {\n if (item == null)\n throw new IllegalArgumentException();\n\n if (this.first == null) {\n this.first = new Node();\n this.first.item = item;\n this.last = this.first;\n } else {\n Node newfirst = new Node();\n newfirst.item = item;\n newfirst.next = this.first;\n this.first.prev = newfirst;\n this.first = newfirst;\n }\n this.n++;\n }", "public void setFirst(StringNode first) {\n this.first = first;\n }", "public void setFirst(K first) {\r\n\t\tthis.first = first;\r\n\t}", "public void addFirst(T element) {\r\n \r\n if (element == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n \r\n Node n = new Node(element);\r\n \r\n if (size() == 0) {\r\n \r\n front = n;\r\n last = n;\r\n }\r\n \r\n else {\r\n n.next = front;\r\n front = n;\r\n }\r\n \r\n size++; \r\n }", "public void addFirst(Item item) {\n\t\tif (item == null) throw new NullPointerException();\n\t\t\n\t\tcount++;\n\t\t\n\t\tNode firstNode = new Node();\n\t\tfirstNode.item = item;\n\t\tif (count > 1) {\n\t\t\tfirstNode.next = first;\n\t\t\tfirst.previous = firstNode;\n\t\t} else {\n\t\t\tlast = firstNode;\n\t\t}\n\t\tfirst = firstNode;\n\t}", "public Object getFirst() {\n\t\tcurrent = start;\n\t\treturn start == null ? null : start.item;\n\t}", "default SELF setFirstIf(T first, LPredicate<T> predicate) {\n if (predicate.test(this.first())) {\n return this.first(first);\n }\n return (SELF) this;\n }", "public static Linkedlist insertAtFirst(Linkedlist list,int d)\r\n\t {\r\n\t\t Node newNode = new Node(d);\r\n\t\t newNode.data=d;\r\n\t\t if(head==null)\r\n\t\t {\r\n\t\t\t list.head=newNode;\r\n\t\t\t return list;\r\n\t\t }\r\n\t\t \r\n\t Node temp = list.head;\r\n\t head = newNode;\r\n\t head.next = temp;\r\n\t \t \r\n\t\t return list;\r\n\t }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "private E unlinkFirst(Node<E> f) {\r\n // assert f == first && f != null;\r\n final E element = f.item;\r\n final Node<E> next = f.next;\r\n f.item = null;\r\n f.next = null; // help GC\r\n first = next;\r\n if (next == null)\r\n last = null;\r\n else\r\n next.prev = null;\r\n size--;\r\n modCount++;\r\n return element;\r\n }", "public void setFirst(boolean b) {\n first = b;\n }", "public void addFirst(Item item) {\n if (item == null) throw new NullPointerException(\"Item is null\");\n if (isEmpty()) {\n first = new Node<Item>(item);\n last = first;\n } else {\n Node<Item> newFirst = new Node<Item>(item);\n newFirst.next = first;\n first.prev = newFirst;\n first = newFirst;\n }\n size++;\n }", "public void addFirst(String element) {\n\t\tslist.addFirst(element);\n\t}", "public E getFirst() {\r\n\t\t// element checks to see if the list is empty\r\n\t\treturn element();\r\n\t}", "public void setAs(ElementList<E> list) {\r\n\t\tthis.makeEmpty();\r\n\t\theader.next = list.first();\r\n\t\tlast = list.last;\r\n\t}", "public void addFrontNode(T a) {\r\n head = new ListNode(a, head);\r\n }", "public void insertFirst(int data) { // insert at front of list\n\t\tNode newNode = new Node(data); // creation of new node.\n\t\tif (first == null) // means LinkedList is empty.\n\t\t\tlast = newNode; // newNode <--- last\n\t\telse\n\t\t\tfirst.previous = newNode; // newNode <-- old first\n\t\tnewNode.next = first; // newNode --> old first\n\t\tfirst = newNode; // first --> newNode\n\t}", "public O before(O a)\r\n {\r\n int index = indexOf(a);\r\n if (index != -1 && index != 0) //is defined and not first\r\n return get(index-1);\r\n else return null;\r\n }", "public void removeFirst(){\r\n\t\tNode removedHead = head;\r\n\t\thead = head.next;\r\n\t\tremovedHead = null;\r\n\t}", "public static Object first(Object o) {\n log.finer(\"getting first of list expression: \" + o);\n validateType(o, SPair.class);\n return ((SPair)o).getCar();\n }", "public void addFirst(T item) {\n\t\tNode nn = new Node();\n\t\tnn.data = item;\n\t\tnn.next = null;\n\n\t\t// linking\n\t\tnn.next = head;\n\t\thead = nn;\n\n\t}", "public void addFirst(E s) {// 0(1)\r\n\t\t//checks if there is any space left in the array\r\n\t\tif (size>=capacity)\r\n\t\t\tresize(this.capacity*2);\t//increases size of the array\r\n\t\tlist[size]=s;\t//adds element to the array\r\n\t\tsize++;\t//increases size\r\n\t}", "default SELF setFirstIf(LBiPredicate<T,T> predicate, T first) {\n if (predicate.test(this.first(), first)) {\n return this.first(first);\n }\n return (SELF) this;\n }", "@Test\n\tpublic void testAddFirst() {\n\t\tLinkedListInterface e = new LinkedList();\n\t\te.addLast(\"JOHNSON Shawn\");\n\t\te.addLast(\"LIUKIN Anastasia\");\n\t\te.addLast(\"JIANG Yuyuan\");\n\t\te.addFirst(\"IZBASA Sandra Raluca\");\n\t\tassertEquals(e.get(0), \"IZBASA Sandra Raluca\");\n\t\tassertEquals(e.get(1), \"JOHNSON Shawn\");\n\t\te.addFirst(\"RAISMAN Alexandra\");\n\t\tassertEquals(e.get(0), \"RAISMAN Alexandra\");\n\t\tassertEquals(e.get(2), \"JOHNSON Shawn\");\n\t}", "public ListIterator() {current=first.next;}", "public Item getFirst() {\n Node removed = head.next;\n head.next = removed.next;\n removed.next = null;\n size--;\n return removed.item;\n }", "@Override\n public void setBeforeFirst(Wrapper beforeFirst)\n {\n\n }", "public void removeFirst() {\n\t\t\thead = head.next;\n\t\t}", "public void removeFirst() throws ListException {\r\n\t\t//This will check if the user is trying to remove from an empty list\r\n\t\tif(isEmpty()){\r\n\t\t\tthrow new ListException(\"Remove from empty list exception\");\r\n\t\t}\r\n\t\t//Set the nextNode pointer past the first element in the list\r\n\t\tDoublyNode nextNode;\r\n\t\tnextNode = head.getNext().getNext();\r\n\r\n\t\tnextNode.setPrev(head);//Set the next nodes previous pointer\r\n\t\thead.setNext(nextNode);//Set the heads next pointer\r\n\t\tnumItems--;//Decrement number of items\r\n\t}", "public void addFirst(Item item) {\n if (item == null) {\n throw new NullPointerException(\"Element cannot be null.\");\n }\n Node node = new Node(item);\n node.next = head.next;\n node.prev = head;\n head.next.prev = node;\n head.next = node;\n size++;\n }", "public void listForPixyFront(LinkedList list) {\n\n\t\tthis.listFront = list;\n\n \t}", "void pushFront(T value) throws ListException;", "public node getFirst() {\n\t\treturn head;\n\t\t//OR\n\t\t//getAt(0);\n\t}", "public void addFirst(Object x)\r\n {\r\n if ( x != null )\r\n {\r\n Node p = new Node(x, frente);\r\n frente = p;\r\n }\r\n }", "int getFirst(int list) {\n\t\treturn m_lists.getField(list, 0);\n\t}", "public L removeFromFront(){\n\t\tif(isEmpty())//throw exception if List is empty\n\t\tthrow new IllegalStateException(\"List \" + name + \" is empty\");\n\n\t\tL removedItem = (L) firstNode.data; //retrieve data being removed\n\n\t\t//update references firstNode and lastNode\n\t\tif(firstNode == lastNode)\n\t\tfirstNode = lastNode = null;\n\t\telse\n\t\tfirstNode = firstNode.getNext();\n\n\t\treturn removedItem; //return removed node data\n\t}", "public LinkedList() {\n\t\tfirst = null;\n\t}", "public E first() { // returns (but does not remove) the first element\n // TODO\n if (isEmpty()) return null;\n return tail.getNext().getElement();\n }" ]
[ "0.62781423", "0.6132157", "0.6093037", "0.6055526", "0.6041971", "0.5942738", "0.59338295", "0.591775", "0.5865389", "0.5807783", "0.57773554", "0.57515025", "0.5741566", "0.57402855", "0.5728336", "0.57217056", "0.56890744", "0.56616724", "0.5657371", "0.5549167", "0.55276406", "0.54635054", "0.54632866", "0.54593784", "0.5456744", "0.54022294", "0.5389682", "0.5383392", "0.53747505", "0.5353411", "0.53520936", "0.5350241", "0.5336348", "0.5332976", "0.5329363", "0.53290766", "0.53267884", "0.5320875", "0.5310337", "0.5307869", "0.5305377", "0.52999794", "0.52950513", "0.52935594", "0.52909493", "0.5289635", "0.52878624", "0.5275812", "0.5275302", "0.52752125", "0.5268818", "0.5257798", "0.5254285", "0.5253416", "0.5247574", "0.5242852", "0.5236594", "0.5219022", "0.5217989", "0.5212746", "0.51988345", "0.5186821", "0.51684827", "0.51618403", "0.5160783", "0.5156118", "0.515387", "0.5146944", "0.51417255", "0.513747", "0.51289886", "0.51197684", "0.5114557", "0.5110161", "0.51092887", "0.5102725", "0.5096367", "0.5095375", "0.5082143", "0.50811225", "0.50810456", "0.5076667", "0.507311", "0.5069324", "0.5067854", "0.50676477", "0.506432", "0.50581825", "0.5053488", "0.5049374", "0.50492144", "0.50447685", "0.50397366", "0.50348455", "0.5024233", "0.5011931", "0.5010648", "0.5002981", "0.50021464", "0.50020635" ]
0.8328525
0
Set reductum. L is a nonnull list. LP is a list. The reductum of L is changed to LP.
public static <C> void SRED(LIST<C> L, LIST<C> LP) { if ( ! isNull( L ) ) { L.list.subList(1,L.list.size()).clear(); if ( ! isEmpty( LP ) ) { L.list.addAll( LP.list ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void opration(){ \n System.out.println(\"Final veriable value l:\"+l+\"\\nj:\"+j);\n // l=l+2; erorr it can't change it's value\n \n }", "public static IntList dincrList(IntList L, int x) { //iteratively\n /* Your code here. */\n IntList p = L;\n while (p != null) {\n p.first = p.first + x; //this mutate the L.first since p.first and l.first are the same\n p = p.rest; //until p = null then it point to another list\n }\n return L; //not p because P is null at this point and it point to the rest not the original list\n }", "public void update(L l);", "@Test\n public void testSetLrs() {\n System.out.println(\"setLrs\");\n Set<LineaDeReceta> aux = new HashSet();\n aux.add(new LineaDeReceta(new Alimento(\"nom2\", \"inst2\", \"tempC2\"), \"u2\", 4.0F));\n Receta instance = new Receta();\n instance.getLrs().add(new LineaDeReceta(new Alimento(\"nom1\", \"inst1\", \"tempC1\"), \"u1\", 3.0F));\n instance.setLrs(aux);\n Set<LineaDeReceta> expResult = aux;\n Set<LineaDeReceta> result = instance.getLrs();\n assertEquals(expResult, result);\n }", "public void setL(double value) {\n this.l = value;\n }", "public static IntList incrListR(IntList L, int x) {\n if (L == null) {\n return null;\n }\n //each recursive run will create a new IntList until L.rest.rest.rest... = null meaning reaching the last item in\n //the original list\n return new IntList(L.first + x, incrListR(L.rest, x));\n }", "@CallSuper\n public long multiplyAndGet(final long l) {\n long currentValue;\n\n for (; ; ) {\n currentValue = get();\n if (compareAndSet(currentValue, currentValue * l)) {\n return currentValue;\n }\n ii(this, mOrigin, \"Collision in concurrent add, will try again: \" + currentValue);\n }\n }", "public void visitLREM(LREM o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public Set<V> getL() {\n\t\treturn L;\n\t}", "public void setLUC(long LUC) {\r\n/* 394 */ this._LUC = LUC;\r\n/* 395 */ this._has_LUC = true;\r\n/* */ }", "private void permutation(int[] ans, int l, int r) {\n if (l == r)\n perm.add(ans.clone());\n else {\n for (int i = l; i <= r; i++) {\n ans = swap(ans, l, i);\n permutation(ans, l + 1, r);\n ans = swap(ans, l, i);\n }\n }\n }", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "LP getLp();", "public double getL() {\n return l;\n }", "private void plant(int l) {\n if (l >= empties.size()) {\n if (currentMines > bestMines) {\n copyField(current, best);\n bestMines = currentMines;\n }\n //geval 2: we zijn nog niet alle lege vakjes afgegaan, en we kunnen misschien nog beter doen dan de huidige oplossing\n } else if(currentMines + (empties.size() - l) > bestMines ) {\n //recursief verder uitwerken, met eerst de berekening van welk vakje we na (i,j) zullen behandelen\n int i = empties.get(l).getI();\n int j = empties.get(l).getJ();\n\n //probeer een mijn te leggen op positie i,j\n if (canPlace(i,j)) {\n placeMine(i, j);\n currentMines++;\n\n\n //recursie\n plant(l + 1);\n\n //hersteloperatie\n removeMine(i, j);\n currentMines--;\n\n }\n //recursief verder werken zonder mijn op positie i,j\n plant(l +1);\n }\n }", "public void setLow(int L)\t\n\t{\t//start of setLow method\n\t\tLOW_NUM = L;\n\t}", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "public static void setPrepositionLength(long l){\n\t\tprepositionLength = l;\n\t}", "public void setLongueur(int l) {\n\t\tthis.longueur = l;\n\t}", "public static IntList incrList(IntList L, int x) {\n /* Your code here. */\n IntList newList = null;\n for (int i = L.size() - 1; i > -1; i--) { //construct the newList backwardly, iteratively\n newList = new IntList(L.get(i) + x, newList);\n }\n return newList;\n }", "public void setLeaserule(java.lang.Integer newLeaserule) {\n\tleaserule = newLeaserule;\n}", "public void changeLeuchtmittel(int id, Leuchtmittel l) {\n Lamp toBeChanged = this.getLamp(id);\n if (toBeChanged != null)\n toBeChanged.changeLeuchtmittel(l);\n }", "static void insAuxR(){\r\n\t\tObj aux2=aux;\r\n\t\twhile(aux2.next!=null){\r\n\t\t\taux2=aux2.next;\r\n\t\t}\r\n\t\taux2.next=lt.link;\r\n\t\tlt.link=aux;\r\n\t\t//aux=null; //Reseteamos la lista de variables!!\r\n\t}", "private void update_auxlist(ArrayList<Line> auxlist, Line workingSet) {\n\t\tLine new_working_set = new Line(workingSet);\n\n\t\t// Add the working set copy to the set of maximal lines\n\t\tauxlist.add(new_working_set);\n\t}", "public Builder clearL() {\n \n l_ = getDefaultInstance().getL();\n onChanged();\n return this;\n }", "static void consumer(List<Integer> l) {\n\t\tConsumer<List<Integer>> modify = (list) -> {\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tlist.set(i, 2 * list.get(i));\n\t\t\t}\n\t\t};\n\t\tmodify.accept(l);\n\t}", "public void setL(boolean l) {\n\tthis.l = l;\n }", "public final void reset$$dsl$guidsl$ltms() {\n userSet = false;\n value = variable.U;\n // to be extended by later layers\n }", "public void unlinkLR()\n {\n this.L.R = this.R;\n this.R.L = this.L;\n }", "private void addNodes(TreeNode root, int l, List<Integer> res) {\r\n if (l < 0 || root == null) return;\r\n\r\n if (l == 0) {\r\n res.add(root.val);\r\n return;\r\n }\r\n\r\n // l > 0\r\n addNodes(root.left, l - 1, res);\r\n addNodes(root.right, l - 1, res);\r\n return;\r\n }", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "public void setLenghtPop (int value) {\r\n long_poblacion = value; }", "static void set_sl_rr(FM_OPL OPL, int slot, int v) {\n OPL_CH CH = OPL.P_CH[slot / 2];\n OPL_SLOT SLOT = CH.SLOT[slot & 1];\n int sl = v >> 4;\n int rr = v & 0x0f;\n\n SLOT.SL = SL_TABLE[sl];\n if (SLOT.evm == ENV_MOD_DR) {\n SLOT.eve = SLOT.SL;\n }\n SLOT.RR = new IntArray(OPL.DR_TABLE, rr << 2);\n SLOT.evsr = SLOT.RR.read(SLOT.ksr);\n if (SLOT.evm == ENV_MOD_RR) {\n SLOT.evs = SLOT.evsr;\n }\n }", "public int rangeSum(int L, int R)\r\n {\r\n int sum;\r\n return sum = rangeSum(root, L, R);\r\n\r\n }", "public void plum() {\n plum = true;\n }", "public void setLA(long value) {\n this.la = value;\n }", "public void setLowerLip(EditableParametrisedCylinder lowerLip) {\n\t\tremoveSceneObject(this.lowerLip);\n\t\t\n\t\t// ... and add the new one\n\t\tthis.lowerLip = lowerLip;\n\t\taddSceneObject(lowerLip);\n\t}", "public void relinkLR()\n {\n this.L.R = this.R.L = this;\n }", "public void setLeft(BinNode<E> l)\n {\n left = l;\n }", "public void actualizar(List<EquipoCompetencia> l) {\n\t\tfor (Iterator i = l.iterator(); i.hasNext();) {\r\n\t\t\tEquipoCompetencia id = (EquipoCompetencia) i.next();\r\n\t\t\tif (id.getCodigoEquipoCompetencia()==0){\r\n\t\t\t\tint codEquipoCompetencia = daoEquipoCompetencia.listar(EquipoCompetencia.class).size() + 1;\r\n\t\t\t\tid.setCodigoEquipoCompetencia(codEquipoCompetencia);\r\n\t\t\t}\r\n\t\t\tdaoEquipoCompetencia.actualizar(id);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public void resetListId( )\n {\n _listIdRefCertificationLevels = new ArrayList<>( );\n }", "public void setLeft (Node l) {\r\n\t\tleft = l;\r\n\t}", "public ResetLevel_args(ResetLevel_args other) {\r\n if (other.isSetField()) {\r\n List<List<List<List<Short>>>> __this__field = new ArrayList<List<List<List<Short>>>>(other.field.size());\r\n for (List<List<List<Short>>> other_element : other.field) {\r\n List<List<List<Short>>> __this__field_copy = new ArrayList<List<List<Short>>>(other_element.size());\r\n for (List<List<Short>> other_element_element : other_element) {\r\n List<List<Short>> __this__field_copy_copy = new ArrayList<List<Short>>(other_element_element.size());\r\n for (List<Short> other_element_element_element : other_element_element) {\r\n List<Short> __this__field_copy_copy_copy = new ArrayList<Short>(other_element_element_element);\r\n __this__field_copy_copy.add(__this__field_copy_copy_copy);\r\n }\r\n __this__field_copy.add(__this__field_copy_copy);\r\n }\r\n __this__field.add(__this__field_copy);\r\n }\r\n this.field = __this__field;\r\n }\r\n }", "@CallSuper\n public long addAndGet(final long l) {\n long currentValue;\n\n for (; ; ) {\n currentValue = get();\n if (compareAndSet(currentValue, currentValue + l)) {\n return currentValue;\n }\n ii(this, mOrigin, \"Collision in concurrent add, will try again: \" + currentValue);\n }\n }", "public abstract void setLOD(int lod);", "private void updateLuts() {\r\n\t\tint luts = 0;\r\n\r\n\t\t// We get the Luts of each module and add them together.\r\n\t\tfor (int i = 0; i < helperInstMod.model.size(); i++) {\r\n\t\t\tluts += Integer.valueOf(helperInstMod.model.getElementAt(i).getLuts());\r\n\t\t}\r\n\r\n\t\tlabelLuts.setText(\"Total Luts: \" + String.valueOf(luts));\r\n\t}", "public void setLEL_PERCENTAGE(BigDecimal LEL_PERCENTAGE) {\r\n this.LEL_PERCENTAGE = LEL_PERCENTAGE;\r\n }", "public void setP(List<Production> p);", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "@Nonnull\n @ReturnsMutableCopy\n public Matrix getL ()\n {\n final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);\n final double [] [] aNewArray = aNewMatrix.internalGetArray ();\n for (int nRow = 0; nRow < m_nRows; nRow++)\n {\n final double [] aSrcRow = m_aLU[nRow];\n final double [] aDstRow = aNewArray[nRow];\n for (int nCol = 0; nCol < m_nCols; nCol++)\n if (nRow > nCol)\n aDstRow[nCol] = aSrcRow[nCol];\n else\n if (nRow == nCol)\n aDstRow[nCol] = 1.0;\n else\n aDstRow[nCol] = 0.0;\n }\n return aNewMatrix;\n }", "public LLNode solveAddLinkedList(LLNode l0, LLNode l1) {\n\t\tint carry = 0;\n\t\tLLNode head = null;\n\t\tLLNode node = null;\n\n\t\tint sum = l0.val + l1.val + carry;\n\t\tcarry = sum / 10;\n\t\tsum = sum % 10;\n\t\thead = new LLNode();\n\t\thead.val = sum;\n\t\tnode = head;\n\n\t\tl0 = l0.next;\n\t\tl1 = l1.next;\n\n\t\twhile (l0 != null || l1 != null) {\n\t\t\tsum = (l0 != null ? l0.val : 0) + (l1 != null ? l1.val : 0) + carry;\n\t\t\tcarry = sum / 10;\n\t\t\tsum = sum % 10;\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = sum;\n\n\t\t\tif (l0 != null)\n\t\t\t\tl0 = l0.next;\n\t\t\tif (l1 != null)\n\t\t\t\tl1 = l1.next;\n\t\t}\n\n\t\tif (carry > 0) {\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = carry;\n\t\t}\n\n\t\treturn node;\n\t}", "public final void accept(l lVar) {\n this.dlr.dlo.setValue(lVar);\n }", "public static int ruolette(ArrayList<Integer> fitvalores, ArrayList<int[]> poblacion, int semilla){ \n int totalfitnes = 0;\n int totalfitnesnuevo = 0;\n int indtablero = 0;\n int semi=semilla;\n int tpoblacion=poblacion.size();\n int []nuevofitness = new int [fitvalores.size()];\n double []nproporcion = new double [fitvalores.size()];\n ArrayList <Double> proporcion = new ArrayList<>();//proporcion j la ruleta\n ArrayList <Double> ruleta = new ArrayList<>();\n //obtener el max fitnes\n for(int i=0;i<fitvalores.size();i++){ //total de fitnes\n totalfitnes=totalfitnes+fitvalores.get(i);\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el nuevo fittnes inverso\n double pro=(tpoblacion*tpoblacion-tpoblacion)-fitvalores.get(i);\n nuevofitness[i]= (int) pro;\n // System.out.println(\"nuevo fitnes\"+nuevofitness[i]);\n } \n for(int i=0;i<fitvalores.size();i++){ //total de fitnes nuevo o inverso\n totalfitnesnuevo=(totalfitnesnuevo+nuevofitness[i]);//para que los mejores casos usen mas espacio\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n double var1=nuevofitness[i];\n double var2=totalfitnesnuevo;\n double pro=var1/var2;\n nproporcion[i]=pro;\n //System.out.println(\"nueva proporcion \"+nproporcion[i]);\n } \n ruleta.add(nproporcion[0]);\n // System.out.println(\"primera propporniaso \"+nproporcion[0]);\n for(int i=1;i<fitvalores.size();i++){ //poner datos en la ruleta\n double var1=ruleta.get(i-1);\n double var2=nproporcion[i];\n ruleta.add(var1+var2);\n //System.out.println(\"ruleta \"+ruleta.get(i));\n }\n double num=randomadec(0,1,semi);\n // System.out.println(\"numero random dec \"+num); \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n // System.out.println(ruleta.get(i));\n if(num<ruleta.get(i)){\n indtablero=i;\n //System.out.println(\"se guardo el tablero \"+indtablero);\n break;\n }\n }\n return indtablero;//esto devuelve el indice del tablero ganador en la ruleta\n }", "@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.List, java.util.AbstractList\n public final /* synthetic */ Long set(int i, Long l) {\n long longValue = l.longValue();\n zzpu();\n zzci(i);\n long[] jArr = this.zzbqi;\n long j = jArr[i];\n jArr[i] = longValue;\n return Long.valueOf(j);\n }", "public void visitLMUL(LMUL o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public void setLenCalcType(int ltype){\n // Verify the ttype and ltype\n if (ltype != LENGTH_LAZY && ltype != LENGTH_LAZY_GOOD &&\n ltype != LENGTH_NEAR_OPT) {\n throw new IllegalArgumentException(\"Unrecognized length \"+\n \"calculation type code: \"+ltype);\n }\n\n if(ltype == LENGTH_NEAR_OPT){\n\t if(savedC==null)\n\t\tsavedC = new int[SAVED_LEN];\n\t if(savedCT==null)\n\t\tsavedCT = new int[SAVED_LEN];\n\t if(savedA==null)\n\t\tsavedA = new int[SAVED_LEN];\n\t if(savedB==null)\n\t\tsavedB = new int[SAVED_LEN];\n\t if(savedDelFF==null)\n\t\tsavedDelFF = new boolean[SAVED_LEN];\n }\n\n this.ltype = ltype;\n }", "public final void setLuchtd(java.math.BigDecimal luchtd)\n\t{\n\t\tsetLuchtd(getContext(), luchtd);\n\t}", "public static void ExpressionReplace ( Expression E, List<PortParameter> LPortParameter, List<List<Variable>>LLVariable)\n\t{\n\t\tif(E instanceof RequiredDataParameterReference)\n\t\t{\n\t\t\tRequiredDataParameterReference rdr = (RequiredDataParameterReference) E;\n\t\t\tint indexPortPara = LPortParameter.indexOf(rdr.getPortReference().getTarget());\n\t\t\tint indexVarPara = LPortParameter.get(indexPortPara).getType().getDataParameter().indexOf(rdr.getTargetParameter());\n\t\t\t\n\t\t\tVariableReference VarRef = expressionFactory.createVariableReference();\n\t\t\tVariable Var = LLVariable.get(indexPortPara).get(indexVarPara);\n\t\t\tVarRef.setTargetVariable(Var);\n\t\t\tEObject eo = E;\n\t\t\tif (eo.eContainer() instanceof FunctionCallExpression)\n\t\t\t{\n\t\t\t\tFunctionCallExpression fcall = (FunctionCallExpression) eo.eContainer();\n\t\t\t\tfcall.getActualData().set(fcall.getActualData().indexOf(E), VarRef);\n\t\t\t}\n\t\t\telse if (eo.eContainer() instanceof BinaryExpression)\n\t\t\t{\n\t\t\t\tBinaryExpression bexp = (BinaryExpression) eo.eContainer(); \n\t\t\t\tif(bexp.getLeftOperand().equals(E))\n\t\t\t\t\tbexp.setLeftOperand(VarRef);\n\t\t\t\tif(bexp.getRightOperand().equals(E))\n\t\t\t\t\tbexp.setRightOperand(VarRef);\n\t\t\t}\n\t\t\telse if (eo.eContainer() instanceof AssignmentAction)\n\t\t\t{\n\t\t\t\tAssignmentAction aa = (AssignmentAction)eo.eContainer();\n\t\t\t\tif(aa.getAssignedTarget().equals(E))\n\t\t\t\t\taa.setAssignedTarget(VarRef);\n\t\t\t\tif(aa.getAssignedValue().equals(E))\n\t\t\t\t\taa.setAssignedValue(VarRef);\n\t\t\t}\n\t\t\telse if(eo.eContainer() instanceof UnaryExpression)\n\t\t\t{\n\t\t\t\tUnaryExpression UE = (UnaryExpression)eo.eContainer();\n\t\t\t\tUE.setOperand(VarRef);\n\t\t\t}\n\t\t\telse if(eo.eContainer() instanceof InteractionSpecification)\n\t\t\t{\n\t\t\t\tInteractionSpecification ispectmp = (InteractionSpecification)eo.eContainer();\n\t\t\t\tispectmp.setGuard(VarRef);\n\t\t\t}\n\t\t}\t\t\n\t\telse if(E instanceof FunctionCallExpression)\n\t\t{\n\t\t\tFunctionCallExpression Fcall = (FunctionCallExpression) E;\n\t\t\tfor (Object o : Fcall.getActualData())\n\t\t\t{\n\t\t\t\tExpression E1 = (Expression) o;\n\t\t\t\tExpressionReplace(E1, LPortParameter,LLVariable);\n\t\t\t}\n\t\t}\n\t\telse if(E instanceof BinaryExpression)\n\t\t{\n\t\t\tBinaryExpression BE = (BinaryExpression) E;\t\n\t\t\tExpressionReplace(BE.getRightOperand(), LPortParameter,LLVariable);\n\t\t\tExpressionReplace(BE.getLeftOperand(), LPortParameter,LLVariable);\n\t\t}\n\t\telse if(E instanceof UnaryExpression)\n\t\t{\n\t\t\tUnaryExpression UE = (UnaryExpression)E;\n\t\t\tExpressionReplace(UE.getOperand(), LPortParameter,LLVariable);\n\t\t}\n\t\telse if(E instanceof IfAction)\n\t\t{\n\t\t\t//TODO\n\t\t}\t\t\t\n\t}", "void prepBattle(final Land l) {\r\n instantDmg = BASE_DMG + DMG_LVL * getLVL();\r\n instdotDmg = BASE_INST_DOT + INST_DOT_LVL * getLVL();\r\n dotDmg = BASE_DOT + DOT_LVL * getLVL();\r\n\r\n if (l == Land.Lava) {\r\n landMult();\r\n }\r\n }", "public void setPubliQtyLmitEx(String publiQtyLmitEx) {\n\n if (PromotionPubliQtyLmitCd.UNLMIT.toString().equals(publiQtyLmitEx)) {\n setAllPubliQty(PromotionUnlimitNumber.UNLIMIT_NUM.toLong());\n }\n setPubliQtyLmitCd(publiQtyLmitEx);\n }", "private void makeDeductionsfromPayments(int walletid, int due,int bal,ArrayList<Integer> l) {\n\t\tArrayList<Integer> l1=l;\n\t\tint toPay=due;\n\t\tint pocket=bal;\n\t\tint id=walletid;\n\t\tint deduction=pocket-toPay;\n\t\tString str=\"update wallet set balance=\"+deduction+\" where walletId=\"+id;\n\t\ttry {\n\t\t\tint count=stmt.executeUpdate(str);\n\t\t\n\t\t\t\tupdateOrders(id,l1);\n\t\t\t\tupdatePayments(id,toPay);\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public int evaluate(int[] l) {\n int s = 0;\n HashSet<Integer> map = new HashSet<Integer>();\n for (int i = 0; i < l.length; ++i) {\n int elmt = l[i];\n if (map.add(elmt))\n s += this.getValue(elmt);\n if (i != 0)\n s -= neighbourCheck[l[i - 1]][l[i]];\n }\n return s;\n }", "public int RMQ(int l, int r) {\r\n\t\treturn computeRMQ(0, l, r, 0, arr.length - 1);\r\n\t}", "private void privateUnsynchSetP(Bug1815013 p) {\n p.x = get()[0];\n }", "public void setFils(LinkedList<Noeud> l) {\n\t\t\tthis.fils = l;\n\t\t}", "private int doublon(String s,MainJoueur l){\n\t\tint compteur=0;\n\t\tArrayList<String> l1 = new ArrayList<String>(l.getValeur());\n\t\twhile(l1.contains(s)){\n\t\t\tcompteur++;\n\t\t\tl1.remove(s);\n\t\t}\n\t\treturn compteur;\n\t}", "public void setLEL_AMOUNT(BigDecimal LEL_AMOUNT) {\r\n this.LEL_AMOUNT = LEL_AMOUNT;\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic BasicSet LpClosure(BasicSet x){\r\n\r\n\t\tint used_imps=0;\r\n\t\tBasicSet old_closure = null;\r\n\t\tBasicSet new_closure;\r\n\t\tBasicSet T;\r\n\t\tint usable_imps;\r\n\t\tint use_now_imps;\r\n\t\tVector<String> att=context.getAttributes();\r\n\t\tBasicSet M = new BasicSet();\r\n\t\tM.addAll(att);\r\n\r\n\r\n\t\tint [] avoid=new int[M.size()];\r\n\t\tif(getImp().isEmpty())\r\n\t\t\treturn x;\r\n\t\tfor(int i=0;i<M.size();i++){\r\n\t\t\t//int a=(int)Math.pow(6,4);\r\n\t\t\tint entier =( 1 << getImp().size())-1;\r\n\r\n\t\t\tavoid[i]= entier;\r\n\t\t\t//System.out.println(\"L size \"+Limps.size()+\" entier \"+entier+\" i \"+i+ \" avoid \"+avoid[i]);\r\n\t\t\tfor(int k=0;k<getImp().size();k++){\r\n\t\t\t\tVector<Rule> rrr=(Vector<Rule>) getImp().clone();\r\n\r\n\t\t\t\tRule r=rrr.get(k);\r\n\r\n\t\t\t\tObject [] tt= M.toArray();\r\n\t\t\t\tString ite=(String) tt[i];\r\n\t\t\t\tBasicSet xx=new BasicSet();\r\n\t\t\t\txx.add(ite);\r\n\r\n\t\t\t\tBasicSet ant= (BasicSet) r.getAntecedent().clone();\r\n\r\n\t\t\t\tif(ant.contains(ite)){\r\n\r\n\t\t\t\t\tint bin=1 << k;\r\n\t\t\t\t\tavoid[i] &= ~bin;\t\t\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tused_imps=0;\r\n\t\told_closure=new BasicSet();\r\n\t\told_closure.add(\"-1\");\r\n\t\tnew_closure=x;\r\n\t\tint inter;\r\n\t\tint union;\r\n\r\n\t\twhile(!new_closure.equals(old_closure)){\r\n\t\t\told_closure=(BasicSet) new_closure.clone();\r\n\r\n\t\t\tT=M.difference(new_closure);\r\n\t\t\tint ent=1 << (getImp().size());\r\n\t\t\tinter=ent-1;\r\n\t\t\tunion =0;\r\n\r\n\t\t\tfor(int ii=0; ii<M.size(); ii++){\r\n\r\n\t\t\t\tObject[] tt=M.toArray();\r\n\t\t\t\tString ite=(String) tt[ii];\r\n\t\t\t\tif(T.contains(ite))\r\n\t\t\t\t\tinter &= avoid[ii];\r\n\t\t\t\tif(new_closure.contains(ite))\r\n\t\t\t\t\tunion |= avoid[ii];\r\n\t\t\t}\r\n\r\n\t\t\tusable_imps = inter & union;\r\n\r\n\t\t\tuse_now_imps = usable_imps & (~used_imps);\r\n\t\t\tused_imps = usable_imps;\r\n\r\n\t\t\tfor(int ii=0;ii<getImp().size();ii++){\r\n\r\n\t\t\t\tint enti=use_now_imps & (1 << ii);\r\n\r\n\t\t\t\t//System.out.println(\"enti \"+enti+\"basicset \"+old_closure);\r\n\t\t\t\tif( enti!= 0){\r\n\t\t\t\t\tVector<Rule> rrr=(Vector<Rule>) getImp().clone();\r\n\t\t\t\t\tRule r=rrr.get(ii);\r\n\t\t\t\t\tnew_closure=new_closure.union(r.getConsequence());\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn new_closure;\r\n\r\n\t}", "public void setUpperLip(EditableParametrisedCylinder upperLip) {\n\t\tremoveSceneObject(this.upperLip);\n\t\t\n\t\t// ... and add the new one\n\t\tthis.upperLip = upperLip;\n\t\taddSceneObject(upperLip);\n\t}", "private void atualizarPalitos() {\n Jogador jogador = servidor.getJogador(nomeJogador);\n LugarModelo lugarModelo = listaLugares.get(jogador.lugar - 1);\n lugarModelo.getMao().setText(jogador.quantidadePalitosApostados + \" Palitos\");\n lugarModelo.getQuantidadePalitosRestantes().setText(\"Palitos Restante: \" + jogador.quantidadePalitosRestantes + \"\");\n }", "public void revolver() {\n this.lista = Lista.escojerAleatorio(this, this.size()).lista;\n }", "static void set_ksl_tl(FM_OPL OPL, int slot, int v) {\n OPL_CH CH = OPL.P_CH[slot / 2];\n OPL_SLOT SLOT = CH.SLOT[slot & 1];\n int ksl = v >> 6;\n /* 0 / 1.5 / 3 / 6 db/OCT */\n\n /*RECHECK*/\n SLOT.ksl = (ksl != 0 ? 3 - ksl : 31);\n SLOT.TL = (int) ((v & 0x3f) * (0.75 / EG_STEP));\n /* 0.75db step */\n\n if ((OPL.mode & 0x80) == 0) {\n /* not CSM latch total level */\n\n SLOT.TLL = (int) (SLOT.TL + (CH.ksl_base >> SLOT.ksl));\n }\n }", "public static void main(String[] args) {\n\n\nList<List<Integer>> list=new ArrayList<List<Integer>>();\nList<Integer> l1=new ArrayList<Integer>();\nList<Integer> l2=new ArrayList<Integer>();\nList<Integer> l3=new ArrayList<Integer>();\nList<Integer> l4=new ArrayList<Integer>();\nl1.add(1);\nl1.add(2);\nl1.add(3);\nl2.add(4);\nl2.add(5);\nl2.add(5);\nl2.add(6);\nl3.add(7);\nl3.add(8);\nl4.add(9);\nlist.add(l1);\nlist.add(l2);\nlist.add(l3);\nlist.add(l4);\nSolution solution=new Solution();\nsolution.nP(list);\n\n}", "public void visitLSUB(LSUB o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public IncrementableAssignment(final Collection<? extends Literal> lits) {\n super(lits, false);\n lits.stream().map(Literal::variable).collect(Collectors.toCollection(() -> variableOrdering));\n }", "public void init() {\n l0 = new EmptyList();\n l1 = FListInteger.add(l0, new Integer(5));\n l2 = FListInteger.add(l1, new Integer(4));\n l3 = FListInteger.add(l2, new Integer(7));\n l4 = new EmptyList();\n l5 = FListInteger.add(l2, new Integer(7));\n }", "public ListVisualiser(SLList l) { \n // Assign SLList pum with argument SLList l\n pum = l;\n }", "protected void salvarLotofacil(Lotofacil l) {\r\n\t\tLotofacilListagemResultados.repositorio.Salvar(l);\r\n\t}", "private void doubleDemoteLeft (WAVLNode z) {\n\t z.rank--;\r\n\t z.right.rank--;\r\n }", "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }", "public void fjernAlle() {\n listehode.neste = null;\n antall = 0;\n }", "public final void setLv(java.math.BigDecimal lv)\n\t{\n\t\tsetLv(getContext(), lv);\n\t}", "public static List<Integer> replace(List<Integer> list){\n\t\tList<Integer> r= new ArrayList<Integer>();\n\t\tr.add(7);\n\t\tr.add(-4);\n\t\tr.add(0);\n\t\tr.add(7);\n\t\tr.add(7);\n\t\t\n\t\treturn r;\n\t}", "public void setLives(int l) {\r\n\t\tlives = l;\r\n\t}", "public void appendInPlace (List l) {\n\t\tif (this.isEmpty()) {\n\t\t\tmyHead = l.myHead;\n\t\t\tmySize = l.mySize;\n\t\t\tmyTail = l.myTail;\n\t\t}\n\t\telse if (l.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tmyTail.myNext = l.myHead;\n\t\t\tmyTail = l.myTail;\n\t\t\tmySize += l.mySize;\n\t\t}\n\t}", "@Override\n public final Value call(final State state, final List<Expr> args, final Expr listArg) throws SetlException {\n SetlList listArguments = null;\n if (listArg != null) {\n Value listArgument = listArg.eval(state);\n if (listArgument.getClass() != SetlList.class) {\n throw new UndefinedOperationException(\"List argument '\" + listArg.toString(state) + \"' is not a list.\");\n }\n listArguments = (SetlList) listArgument;\n }\n\n int nArguments = args.size();\n if (listArguments != null) {\n nArguments += listArguments.size();\n }\n\n if (! parameters.isAssignableWithThisManyActualArguments(nArguments)) {\n final StringBuilder error = new StringBuilder();\n error.append(\"'\");\n error.append(getName());\n error.append(\"(\");\n parameters.appendString(state, error);\n error.append(\")'\");\n parameters.appendIncorrectNumberOfParametersErrorMessage(error, nArguments);\n throw new IncorrectNumberOfParametersException(error.toString());\n }\n\n // evaluate arguments\n final ArrayList<Value> values = new ArrayList<Value>(nArguments);\n for (final Expr arg : args) {\n values.add(arg.eval(state).clone());\n }\n if (listArguments != null) {\n for (Value listArgument : listArguments) {\n values.add(listArgument);\n }\n }\n\n // assign parameters\n HashMap<ParameterDef, Value> assignments = parameters.putParameterValuesIntoMap(state, values);\n\n // call predefined function (which may add writeBack-values to List)\n final Value result = this.execute(state, assignments);\n\n // extract 'rw' arguments from writeBackVars list and store them into WriteBackAgent\n final WriteBackAgent wba = parameters.extractRwParametersFromMap(assignments, args);\n if (wba != null) {\n // assign variables\n wba.writeBack(state, FUNCTIONAL_CHARACTER);\n }\n\n return result;\n }", "public void setLiterAllocation (BigDecimal LiterAllocation);", "public void setRlDetail(HashMap<String, String> d, String rl, String prev, int type) {\n if(rl.equals(prev)){\n\t rlD.remove(prev);\n rlD.put(rl, d);\n db.createRole(rl,rlD.get(rl),rlGrps.get(rl));\n }else{\n rlD.put(rl, d);\n rlD.remove(prev);\n List li = (List) rlGrps.get(prev);\n rlGrps.remove(prev);\n rlGrps.put(rl, li);\n for (Label l : allRls) {\n if (prev.equals((String) l.getValue())) {\n l.setContentMode(Label.CONTENT_TEXT);\n l.setValue(rl);\n\n }\n\n }\n db.createRole(rl,rlD.get(rl),rlGrps.get(rl));\n db.removeRole(prev);\n }\n updateAllGrps();\n\n comapp1.rlListBuild();\n }", "public void reduct() {\n\t\tint divider = bunmo;\n\t\tif(bunja < bunmo){\n\t\t\tdivider = bunja;\n\t\t}\n\t\twhile(divider > 1){\n//\t\twhile(!util.Uitl.isPrime(bunmo)||!util.Uitl.isPrime(bunja)){\n\t\t\tboolean canDivide = (bunmo%divider==0)&&(bunja%divider==0);\n\t\t\tif(canDivide){\n\t\t\t\tbunja/=divider;\n\t\t\t\tbunmo/=divider;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdivider--;\n\t\t\t}\n\t\t}\n\t}", "PlusExpr (Expr l, Expr r) {\n leftOperand = l;\n rightOperand = r;\n }", "void setNilMaximum();", "private void updatePrice() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tfor(int i = first;i<last;i++){\r\n\t\t\tProduct product = products.get(i);\r\n\t\t\tproduct.setPrivce(product.getPrivce()*(1+increment));\r\n\t\t}\r\n\t\t\r\n\t}", "public void setAllP(){\n\t\tAllP=(AllR%PerR==0)?(AllR/PerR):(AllR/PerR+1);\n\t}", "public void removerFinal() {\n switch (totalElementos()) {\n case 0:\n System.out.println(\"lista esta vazia\");\n break;\n case 1:\n this.primeiro = this.ultimo = null;\n this.total--;\n break;\n default:\n ElementoLista elementoTemporarioAnteriorAtual = this.primeiro;\n ElementoLista elementoTemporarioAtual = this.primeiro.irParaProximo();\n for (int i = 1; i < totalElementos(); i++) {\n elementoTemporarioAnteriorAtual = elementoTemporarioAtual;\n elementoTemporarioAtual = elementoTemporarioAtual.irParaProximo();\n }\n\n this.ultimo = elementoTemporarioAnteriorAtual;\n this.ultimo.definirProximo(null);\n this.total--;\n }\n //this.ultimo = this.ultimo.irParaAnterior();\n //this.ultimo.definirProximo(null);\n }", "@Test\r\n\tpublic void testSet() {\r\n\t\tll.add(0, t3);\r\n\t\tll.add(0, t2);\r\n\t\tll.add(2, t4);\r\n\t\t// order of list: [0: t2, 1: t3, 2: t4]\r\n\r\n\t\t// valid sets\r\n\t\tll.set(0, t1);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t1, ll.get(0));\r\n\t\tassertEquals(t3, ll.get(1));\r\n\r\n\t\tll.set(1, t2);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t1, ll.get(0));\r\n\t\tassertEquals(t2, ll.get(1));\r\n\t\tassertEquals(t4, ll.get(2));\r\n\r\n\t\tll.set(2, t3);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t3, ll.get(2));\r\n\t\tassertEquals(t2, ll.get(1));\r\n\t\t// order of list: [0: t1, 1: t2, 2: t3]\r\n\r\n\t\t// invalid sets\r\n\t\ttry {\r\n\t\t\tll.set(-1, t4);\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(3, ll.size());\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.set(3, t4);\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(3, ll.size());\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.set(0, null);\r\n\t\t\tfail();\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tassertEquals(t1, ll.get(0));\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.set(0, t3);\r\n\t\t\tfail();\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\tassertEquals(t1, ll.get(0));\r\n\t\t}\r\n\t}", "public void setLBR_LatePaymentPenaltyAP (BigDecimal LBR_LatePaymentPenaltyAP);", "private void updateProductQnt(List<Product> productList) {\n if (productList != null) {\n productList.forEach(product -> {\n Product productToSave = productService.findOne(product.getId());\n productToSave.setQuantity(productToSave.getQuantity() - product.getQuantity());\n productService.save(productToSave);\n });\n }\n }", "public void cpl() {\n\t\tint op = registers.getRegister(Register.A);\n\t\tint result = invert(op);\n\t\tregisters.setRegister(Register.A, result);\n\n\t\tregisters.setFlag(Flag.H, true);\n\t\tregisters.setFlag(Flag.N, true);\n\t}", "public void refuel() {\n fuelAmount = type.fuelCapacity;\n }", "public void limpar() {\n\t\talunosMilitarPraca.setId(null);\n\t\talunosMilitarPraca.setMasculino(null);\n\t\talunosMilitarPraca.setFeminino(null);\n\t\t\n\t\talunosMilitarOficial.setId(null);\n\t\talunosMilitarOficial.setMasculino(null);\n\t\talunosMilitarOficial.setFeminino(null);\n\t}" ]
[ "0.5922759", "0.585279", "0.57712793", "0.5437019", "0.54314846", "0.53938997", "0.53141844", "0.5282478", "0.5275923", "0.523078", "0.5199114", "0.5195297", "0.5170128", "0.5159032", "0.5138073", "0.5137042", "0.5126499", "0.5094191", "0.50859815", "0.5068944", "0.50663465", "0.50168276", "0.5012933", "0.49877483", "0.49562657", "0.49521893", "0.4938218", "0.49354538", "0.49273795", "0.49220747", "0.4918225", "0.49168354", "0.49064755", "0.4896533", "0.4887444", "0.48762506", "0.48749143", "0.48715788", "0.48571965", "0.48538688", "0.48389813", "0.4834002", "0.48323706", "0.48141664", "0.48121983", "0.48077068", "0.48061475", "0.4803603", "0.47979766", "0.47956884", "0.4795549", "0.47589445", "0.47443986", "0.4739227", "0.47295588", "0.47216642", "0.4712657", "0.4707521", "0.47068256", "0.47027126", "0.46947542", "0.4692857", "0.46909535", "0.4689928", "0.46831924", "0.46825802", "0.46800062", "0.46719664", "0.46697047", "0.4666331", "0.46579957", "0.46479315", "0.46392626", "0.46371856", "0.4629535", "0.46274686", "0.46200532", "0.46185333", "0.46154684", "0.46134478", "0.46040845", "0.46020833", "0.46013543", "0.4598809", "0.45987856", "0.45985004", "0.45950267", "0.45909423", "0.45847476", "0.45845938", "0.45827755", "0.45803696", "0.457861", "0.4573613", "0.45714164", "0.45626697", "0.45480138", "0.45443276", "0.45421594", "0.45421246" ]
0.62285423
0
Composition. a is an object. L is a list. Returns the composition of a and L.
public static <C> LIST<C> COMP(C a, LIST<C> L) { LIST<C> LP = L; if ( L == null ) { LP = new LIST<C>(); } LP.list.addFirst( a ); return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "T compose(AbsonObject abson);", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "public interface AbsonComposer<T extends AbsonDecomposable> {\n\t/**\n\t * Composes an object of type T, given the AbsonObject which \n\t * was presumably created from the same classes' decompose\n\t * function.\n\t * @param abson The AbsonObject which contains the data to compose.\n\t * @return The composed object.\n\t */\n\tT compose(AbsonObject abson);\n}", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "boolean isComposite();", "boolean isComposite();", "public tc a(List<lc> list) {\n long j2;\n LinkedList linkedList = new LinkedList(list);\n Collections.sort(linkedList);\n linkedList.add(new lc(-1, -1, -1));\n ArrayList arrayList = new ArrayList();\n long j3 = 0;\n int i2 = 0;\n while (true) {\n j2 = -9223372036854775807L;\n if (i2 >= a()) {\n break;\n }\n if (((lc) linkedList.peek()).a != i2) {\n long b2 = b(i2);\n if (b2 != -9223372036854775807L) {\n j3 += b2;\n }\n } else {\n ov a2 = a(i2);\n ov ovVar = new ov(a2.a, a2.b - j3, a(a2.c, linkedList), a2.d);\n arrayList.add(ovVar);\n }\n i2++;\n }\n long j4 = this.b;\n if (j4 != -9223372036854775807L) {\n j2 = j4 - j3;\n }\n tc tcVar = new tc(this.a, j2, this.c, this.d, this.e, this.f, this.g, this.h, this.k, this.i, this.j, arrayList);\n return tcVar;\n }", "public boolean isComposite();", "public static <C> LIST<C> LIST3(C a, C b, C c) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public Composite multiply(Composite comp) {\n\t\tif(comp.isUnit()){\n\t\t\treturn this;\n\t\t}\n\t\tif(this.isUnit()){\n\t\t\treturn comp;\n\t\t}\n\t\tNode head = comp.head;\n\t\tNode current_node = this.head;\n\t\t//long product = 1;\n\t\tBigInteger product = BigInteger.ONE;\n\t\twhile (current_node != null){\n\t\t\tlong factor = (long) Math.pow(current_node.factor, current_node.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\twhile (comp.head != null){\n\t\t\tlong factor = (long)Math.pow(comp.head.factor, comp.head.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n\t\tComposite p = new Composite();\n\t\tNode n = new Node(product.longValue(), 1);\n\t\tp.head = n;\n\t\tcomp.head = head;\n\t\treturn p;\n\t}", "Component deepClone();", "public static ImmutableGraph compose( final ImmutableGraph g0, final ImmutableGraph g1 ) {\n\t\treturn new ComposedGraph( g0, g1 );\n\t}", "public Composite add(Composite comp) {\n\t\t// REPLACE WITH WORKING CODE\n\t\t//do last\n//\t\tComposite common_factor = new Composite();\n//\t\tcommon_factor = this.lcm(comp);\n//\t\tlong factor = 0;\n//\t\twhile(common_factor != null){\n//\t\t\tfactor *= Math.pow(common_factor.head.factor, common_factor.head.power);\n//\t\t\tcommon_factor.head = common_factor.head.next;\n//\t\t}\n\t\tlong t = 1;\n\t\twhile(this.head != null){\n\t\t\tt *= Math.pow(this.head.factor, this.head.power);\n\t\t\tthis.head = this.head.next;\n\t\t}\n//\t\tt = t - factor;\n\t\tlong c = 1;\n\t\twhile(comp.head != null){\n\t\t\tc *= Math.pow(comp.head.factor, comp.head.power);\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n//\t\tc = c - factor;\n//\t\tlong remainder = c + t;\n\t\tlong sum = c + t;\n\t\t\n\t\treturn new Composite(BigInteger.valueOf(sum));\n\t}", "private HashMap<ComparableExpression, HashSet<ComparableExpression>> composition(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rel1,\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rel2) {\n\n HashMap<ComparableExpression, HashSet<ComparableExpression>> newRel = new HashMap<>();\n // (a,b) in rel1, (b,c) in rel2 => put (a,c) into newRel\n for (Map.Entry<ComparableExpression, HashSet<ComparableExpression>> r1 : rel1.entrySet()) {\n ComparableExpression key = r1.getKey();\n for (ComparableExpression oldValue : r1.getValue()) {\n // transitive relation?\n if (rel2.containsKey(oldValue)) {\n HashSet<ComparableExpression> newValues = rel2.get(oldValue);\n newRel.putIfAbsent(key, new HashSet<>());\n newRel.get(key).addAll(newValues);\n }\n }\n }\n return newRel;\n }", "public static Composition createComposition(Patient patient, Practitioner practitioner, String date,\n ArrayList<Immunization> ArrayListYellowFever,\n ArrayList<Immunization> ArrayListStandardVaccinations,\n ArrayList<Immunization> ArrayListOtherVaccinations,\n ArrayList<Immunization> ArrayListInfluenza,\n ArrayList<Immunization> ArrayListTuberculosis,\n ArrayList<Observation> ArrayListTuberculinTests,\n ArrayList<Observation> ArrayListAntibodyAssays,\n ArrayList<Observation> ArrayListHepatitisB,\n ArrayList<Observation> ArrayListRubella,\n ArrayList<Immunization> ArrayListPassiveImmunizations,\n ArrayList<Immunization> ArrayListSerumInjection,\n ArrayList<Condition> ArrayListCondition,\n ArrayList<Observation> ArrayListBlood){\n // Create a new Composition object\n Composition composition = new Composition();\n\n // Set Identifier of the composition object\n composition.setIdentifier(new Identifier()\n .setSystem(\"http://www.kh-uzl.de/fhir/composition\")\n .setValue(UUID.randomUUID().toString()));\n\n // Set status of composition\n composition.setStatus(Composition.CompositionStatus.FINAL);\n\n // Set kind of composition\n composition.setType(new CodeableConcept()\n .addCoding(new Coding()\n .setCode(\"11369-6\")\n .setSystem(\"http://loinc.org\")\n .setDisplay(\"History of Immunization Narrative\")));\n\n // Set reference to a patient, all the data in the composition belongs to\n composition.setSubject(new Reference()\n .setIdentifier(patient.getIdentifierFirstRep())\n .setReference(patient.fhirType() + \"/\" + patient.getId()));\n\n // Set composition editing time\n composition.setDateElement(new DateTimeType(date));\n\n // Set author of the composition\n composition.addAuthor(new Reference()\n .setIdentifier(practitioner.getIdentifierFirstRep())\n .setReference(practitioner.fhirType() + \"/\" + practitioner.getId()));\n\n // Set title of the composition\n composition.setTitle(\"Internationale Bescheinigungen über Impfungen und Impfbuch\");\n\n\n // Section for the owner of the certificate of vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Impfausweisinhaber\")\n .addEntry(new Reference()\n .setIdentifier(patient.getIdentifierFirstRep())\n .setReference(patient.fhirType() + \"/\" + patient.getId())));\n\n\n // Section for yellow fever\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Gelbfieber\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Internationale Bescheinigung über Impfung oder Wiederimpfung gegen Gelbfieber\"))));\n\n for(int i = 0; i < ArrayListYellowFever.size(); i++){\n composition.getSection().get(1).addEntry(new Reference()\n .setIdentifier(ArrayListYellowFever.get(i).getIdentifierFirstRep())\n .setReference(ArrayListYellowFever.get(i).fhirType() + \"/\" + ArrayListYellowFever.get(i).getId()));\n }\n\n\n // Section for standard vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Standardimpfungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Bescheinigung über Satndardimpfungen\"))));\n\n for(int i = 0; i < ArrayListStandardVaccinations.size(); i++){\n composition.getSection().get(2).addEntry(new Reference()\n .setIdentifier(ArrayListStandardVaccinations.get(i).getIdentifierFirstRep())\n .setReference(ArrayListStandardVaccinations.get(i).fhirType() + \"/\" + ArrayListStandardVaccinations.get(i).getId()));\n }\n\n\n // Section for other vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Sonstige Schutzimpfungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Sonstige Schutzimpfungen, z.B. gegen Cholera, FSME, Hepatits A, Meningokokken, Pneumokokken, Typhus, Varizellen\"))));\n\n for(int i = 0; i < ArrayListOtherVaccinations.size(); i++){\n composition.getSection().get(3).addEntry(new Reference()\n .setIdentifier(ArrayListOtherVaccinations.get(i).getIdentifierFirstRep())\n .setReference(ArrayListOtherVaccinations.get(i).fhirType() + \"/\" + ArrayListOtherVaccinations.get(i).getId()));\n }\n\n\n // Section for vaccinations against influenza\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Schutzimpfungen gegen Influenza\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Schutzimpfungen gegen Influenza (Virusgrippe)\"))));\n\n for(int i = 0; i < ArrayListInfluenza.size(); i++){\n composition.getSection().get(4).addEntry(new Reference()\n .setIdentifier(ArrayListInfluenza.get(i).getIdentifierFirstRep())\n .setReference(ArrayListInfluenza.get(i).fhirType() + \"/\" + ArrayListInfluenza.get(i).getId()));\n }\n\n\n // Section for vaccinations against tuberculosis\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Bescheinigung über Tuberkulose-Schutzimpfungen (BCG)\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Bescheinigung über Tuberkulose-Schutzimpfungen (BCG)\"))));\n\n for(int i = 0; i < ArrayListTuberculosis.size(); i++){\n composition.getSection().get(5).addEntry(new Reference()\n .setIdentifier(ArrayListTuberculosis.get(i).getIdentifierFirstRep())\n .setReference(ArrayListTuberculosis.get(i).fhirType() + \"/\" + ArrayListTuberculosis.get(i).getId()));\n }\n\n\n // Section for Tuberculin-tests\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Ergebnis von Tuberkulinproben\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Ergebnis von Tuberkulinproben\"))));\n\n for(int i = 0; i < ArrayListTuberculinTests.size(); i++){\n composition.getSection().get(6).addEntry(new Reference()\n .setIdentifier(ArrayListTuberculinTests.get(i).getIdentifierFirstRep())\n .setReference(ArrayListTuberculinTests.get(i).fhirType() + \"/\" + ArrayListTuberculinTests.get(i).getId()));\n }\n\n\n // Section for antibody assays\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Ergebnisse von Antikörperuntersuchungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Ergebnisse von Antikörperuntersuchungen, z.B. Tatanus, Virushepatitis A u. a.\"))));\n\n for(int i = 0; i < ArrayListAntibodyAssays.size(); i++){\n composition.getSection().get(7).addEntry(new Reference()\n .setIdentifier(ArrayListAntibodyAssays.get(i).getIdentifierFirstRep())\n .setReference(ArrayListAntibodyAssays.get(i).fhirType() + \"/\" + ArrayListAntibodyAssays.get(i).getId()));\n }\n\n\n // Section for Hepatitis B\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Virushepatitis B\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Virushepatitis B: Ergebnis von Antikörper-Untersuchungen (Anti-HBs)\"))));\n\n for(int i = 0; i < ArrayListHepatitisB.size(); i++){\n composition.getSection().get(8).addEntry(new Reference()\n .setIdentifier(ArrayListHepatitisB.get(i).getIdentifierFirstRep())\n .setReference(ArrayListHepatitisB.get(i).fhirType() + \"/\" + ArrayListHepatitisB.get(i).getId()));\n }\n\n\n // Section for Rubella antibody assays\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Röteln-Antikörper-Bestimmungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Röteln-Antikörper-Bestimmungen\"))));\n\n for(int i = 0; i < ArrayListRubella.size(); i++){\n composition.getSection().get(9).addEntry(new Reference()\n .setIdentifier(ArrayListRubella.get(i).getIdentifierFirstRep())\n .setReference(ArrayListRubella.get(i).fhirType() + \"/\" + ArrayListRubella.get(i).getId()));\n }\n\n\n // Section for Passive immunizations with human immunoglobulins\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Passive Immunisierungen mit humanen Immunoglobulinen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Passive Immunisierungen mit humanen Immunoglobulinen (z.B Standard-Immunoglobulin, Tetanus- oder andere spezielle Immunoglobuline)\"))));\n\n for(int i = 0; i < ArrayListPassiveImmunizations.size(); i++){\n composition.getSection().get(10).addEntry(new Reference()\n .setIdentifier(ArrayListPassiveImmunizations.get(i).getIdentifierFirstRep())\n .setReference(ArrayListPassiveImmunizations.get(i).fhirType() + \"/\" + ArrayListPassiveImmunizations.get(i).getId()));\n }\n\n\n // Section for serum injections\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Serum-Injektion\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Serum-Injektion: Heterologe Sera (z.B. vom Pferd)\"))));\n\n for(int i = 0; i < ArrayListSerumInjection.size(); i++){\n composition.getSection().get(11).addEntry(new Reference()\n .setIdentifier(ArrayListSerumInjection.get(i).getIdentifierFirstRep())\n .setReference(ArrayListSerumInjection.get(i).fhirType() + \"/\" + ArrayListSerumInjection.get(i).getId()));\n }\n\n\n // Section for medical comments on risk factors concerning vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Ärztliche Vermerke über medizinische Risikofaktoren bei Impfungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Ärztliche Vermerke über medizinische Risikofaktoren bei Impfungen\"))));\n\n for(int i = 0; i < ArrayListCondition.size(); i++){\n composition.getSection().get(12).addEntry(new Reference()\n .setIdentifier(ArrayListCondition.get(i).getIdentifierFirstRep())\n .setReference(ArrayListCondition.get(i).fhirType() + \"/\" + ArrayListCondition.get(i).getId()));\n }\n\n\n // Section for blood group and rhesus factor\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Blutgruppe und Rh-Faktor\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Blutgruppe und Rh-Faktor\"))));\n\n for(int i = 0; i < ArrayListBlood.size(); i++){\n composition.getSection().get(13).addEntry(new Reference()\n .setIdentifier(ArrayListBlood.get(i).getIdentifierFirstRep())\n .setReference(ArrayListBlood.get(i).fhirType() + \"/\" + ArrayListBlood.get(i).getId()));\n }\n\n\n return composition;\n }", "static AggregateOperation compose(Iterable<AggregateOperation> operations) {\n // NOTE(user): It's possible to replace the following two sets with a single map.\n Set<SegmentId> segmentsToRemove = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToAdd = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToEndModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToStartModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<ParticipantId> participantsToRemove = new TreeSet<ParticipantId>(participantComparator);\n Set<ParticipantId> participantsToAdd = new TreeSet<ParticipantId>(participantComparator);\n Map<String, DocOpList> docOps = new TreeMap<String, DocOpList>();\n for (AggregateOperation operation : operations) {\n composeIds(operation.segmentsToRemove, segmentsToRemove, segmentsToAdd);\n composeIds(operation.segmentsToAdd, segmentsToAdd, segmentsToRemove);\n composeIds(operation.segmentsToEndModifying, segmentsToEndModifying, segmentsToStartModifying);\n composeIds(operation.segmentsToStartModifying, segmentsToStartModifying, segmentsToEndModifying);\n composeIds(operation.participantsToRemove, participantsToRemove, participantsToAdd);\n composeIds(operation.participantsToAdd, participantsToAdd, participantsToRemove);\n for (DocumentOperations documentOps : operation.docOps) {\n DocOpList docOpList = docOps.get(documentOps.id);\n if (docOpList != null) {\n docOps.put(documentOps.id, docOpList.concatenateWith(documentOps.operations));\n } else {\n docOps.put(documentOps.id, documentOps.operations);\n }\n }\n }\n return new AggregateOperation(\n new ArrayList<SegmentId>(segmentsToRemove),\n new ArrayList<SegmentId>(segmentsToAdd),\n new ArrayList<SegmentId>(segmentsToEndModifying),\n new ArrayList<SegmentId>(segmentsToStartModifying),\n new ArrayList<ParticipantId>(participantsToRemove),\n new ArrayList<ParticipantId>(participantsToAdd),\n mapToList(docOps));\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "public String getComposite() {\n\t\treturn _composite == Utils.LIST ? \"list\":\n\t\t\t_composite == Utils.MAP ? \"map\": \"none\";\n\t}", "public String getComposite() {\n\t\treturn _composite == Utils.LIST ? \"list\":\n\t\t\t_composite == Utils.MAP ? \"map\": \"none\";\n\t}", "public static <C> LIST<C> LIST2(C a, C b) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "protected Score compose() {\r\n // Simple example composition\r\n Phrase phrase = new Phrase();\r\n Score s = new Score(new Part(phrase));\r\n //for(int i = 0; i < 8; i++) {\r\n Note n = new Note (48 + (int)(Math.random() * variableA), 0.5 + variableB * 0.25);\r\n phrase.addNote(n);\r\n //}\r\n \r\n //Instrument[] tempInsts = {new SineInst(44100)};\r\n //insts = tempInsts;\r\n return s;\r\n }", "Collection<? extends Object> getSameAs();", "public static Vector3 add(Vector3 a, Vector3 b){return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);}", "public CompositeNut(final List<Nut> composition, final String prefixName) {\n super(composition.get(0));\n compositionList = composition;\n nutName = prefixName + nutName;\n\n // Eventually add each referenced nut in the composition (excluding first element taken in consideration by super constructor)\n for (int i = 1; i < composition.size(); i++) {\n final Nut nut = composition.get(i);\n\n if (nut.getReferencedNuts() != null) {\n for (final Nut ref : nut.getReferencedNuts()) {\n addReferencedNut(ref);\n }\n }\n }\n }", "public boolean isComposite()\n {\n return (this instanceof VComposite); \n }", "public ArrayList<Object> product(ArrayList<Object> list1, ArrayList<Object> list2)\r\n {\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n retList.addAll(list1);\r\n retList.addAll(list2);\r\n return retList;\r\n }", "public Object func_27063_c(Object p_27063_1_) {\n return this.func_27068_b((List)p_27063_1_);\n }", "ArrayList deepCopyShapeList(List aShapeList){\n ArrayList newList = new ArrayList();\r\n\r\n if (aShapeList.size() > 0) {\r\n Iterator iter = aShapeList.iterator();\r\n\r\n while (iter.hasNext())\r\n newList.add(((TShape)iter.next()).copy());\r\n }\r\n return\r\n newList;\r\n}", "@Test\n public void testCyclicalIdentity() {\n Vector a = Vector.of(Variable.of(\"a1\"), Variable.of(\"a2\"), Variable.of(\"a3\"));\n Vector b = Vector.of(Variable.of(\"b1\"), Variable.of(\"b2\"), Variable.of(\"b3\"));\n Vector c = Vector.of(Variable.of(\"c1\"), Variable.of(\"c2\"), Variable.of(\"c3\"));\n Vector lhs = a.cross(b).cross(c);\n lhs = lhs.simplify();\n Vector rhs = b.times(a.dot(c)).plus(a.times(b.dot(c)).times(Constant.MINUS_ONE));\n rhs = rhs.simplify();\n Assert.assertEquals(lhs.getValues()[0], rhs.getValues()[0]);\n Assert.assertEquals(lhs.getValues()[1], rhs.getValues()[1]);\n Assert.assertEquals(lhs.getValues()[2], rhs.getValues()[2]);\n Assert.assertEquals(lhs, rhs);\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public Transformation mult(Transformation a) {\n\t\tTransformation result = new Transformation();\n\t\tsuper.mult(a, result);\n\t\treturn result;\n\t}", "public interface Composition{\n\n}", "public static void compose() {\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n source.subscribe(new MyObserver<>());\n return source;\n });\n\n System.out.println(\"# 2\");\n\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n Observable<String> observable = Observable.just(\"composed\");\n observable.subscribe(new MyObserver<>());\n return observable;\n });\n }", "public static <C> LIST<C> CCONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n LinkedList<C> list = new LinkedList<C>( L1.list );\n list.addAll( L2.list );\n return new LIST<C>( list );\n }", "private Proof contra(Expression a, Expression b) {\n return new Proof(Reconstructor.reconstructProof(Reconstructor.contraProof, a, b, null));\n }", "public Complex suma(Complex c){\n return this;\n }", "public void compose( AstNode etree ) {\n\n ESList e = ( ESList ) etree;\n\n add( e ); // formerly addHead -- original definitions come first\n }", "public Polynomial operate(){\n Polynomial result = a.multiplyPolynomial(b);\n return result;\n }", "static void m11180a(List<Component<?>> list) {\n Set<C3246b> c = m11182c(list);\n Set<C3246b> b = m11181b(c);\n int i = 0;\n while (!b.isEmpty()) {\n C3246b next = b.iterator().next();\n b.remove(next);\n i++;\n for (C3246b next2 : next.mo20820d()) {\n next2.mo20823g(next);\n if (next2.mo20822f()) {\n b.add(next2);\n }\n }\n }\n if (i != list.size()) {\n ArrayList arrayList = new ArrayList();\n for (C3246b next3 : c) {\n if (!next3.mo20822f() && !next3.mo20821e()) {\n arrayList.add(next3.mo20819c());\n }\n }\n throw new DependencyCycleException(arrayList);\n }\n }", "public Complex plus(Complex a){\n float real = this.re + a.re;\n float imag = this.im + a.im;\n return new Complex(real, imag);\n }", "public Complex Plus (Complex z) {\nreturn new Complex(u+z.u,v+z.v);\n\n}", "private ArrayList<ArrayList<Course>> semiPermutationOfCourseList(ArrayList<Course> originalCourseList) {\n ArrayList<ArrayList<Course>> results = new ArrayList<ArrayList<Course>>();\n if (originalCourseList == null || originalCourseList.size() == 0) {\n return results;\n }\n\n for (int i = 0; i < originalCourseList.size(); i++) {\n ArrayList<Course> tempList = new ArrayList<>();\n tempList = new ArrayList<>(originalCourseList.subList(i, originalCourseList.size()));\n for (int j = 0; j < i; j++) {\n tempList.add(originalCourseList.get(j));\n }\n results.add(tempList);\n }\n\n return results;\n }", "@Override\n public void combineCons(ArrayList<Note> list) {\n }", "@Override\n\t\tpublic ImmutableSequentialGraph copy() {\n\t\t\treturn new ComposedGraph( g0, g1.copy() );\n\t\t}", "public MultiList<R,S> copy(){\n MultiList<R,S> retVal = new MultiList<R,S>();\n retVal.putAll_forCopy(this);\n return retVal;\n }", "public static <C> LIST<C> CONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n L1.list.addAll( L2.list );\n return L1;\n }", "interface a {\n Object a();\n\n boolean b();\n\n List<Object> c();\n}", "interface cl {\n void b(List<a> list, List<String> list2);\n}", "public static <E, F, G> Function<E, G> composition(final Function<? super F, ? extends G> f2, final Function<? super E, ? extends F> f1) {\r\n\t\treturn new Function<E, G>() {\r\n\t\t\tprivate static final long serialVersionUID = 3725675651261795247L;\r\n\t\t\t@Override\r\n\t\t\tpublic G apply(E v) {\r\n\t\t\t\treturn f2.apply(f1.apply(v));\n\t\t\t}\r\n\t\t};\n\t}", "private static SearchFilter compose(Vector<? extends SearchFilter> filters) {\n //As a minor optimization, we avoid a few method calls in\n //special cases.\n if (filters.size() == 0) {\n return new AllowFilter();\n } else if (filters.size() == 1) {\n return filters.get(0);\n } else {\n SearchFilter[] delegates = new SearchFilter[filters.size()];\n filters.copyInto(delegates);\n return new CompositeFilter(delegates);\n }\n }", "public Composite lcm(Composite comp) {\n\t\tif(this.head.factor == 1){\n\t\t\treturn comp;\n\t\t}\n\t\tif(comp.head.factor == 1){\n\t\t\treturn this;\n\t\t}\n\t\tComposite multiple = new Composite();\n\t\tmultiple = this.multiply(comp);\n\t\tlong num = multiple.head.factor;\n\t\tlong d = 1;\n\t\tComposite com_divisor = this.gcd(comp);\n\t\twhile(com_divisor.head != null){\n\t\t\td *= Math.pow(com_divisor.head.factor, com_divisor.head.power);\n\t\t\tcom_divisor.head = com_divisor.head.next;\n\t\t}\n\t\tlong ans = num / d;\n\t\tBigInteger ans_b = BigInteger.valueOf(ans);\n\t\t\n\t\treturn new Composite(ans_b);\n\t}", "public Vector clone()\r\n {\r\n Vector<O> v = new Vector<O>();\r\n \r\n VectorItem<O> vi = first;\r\n while (vi != null)\r\n {\r\n v.pushBack (vi.getObject());\r\n vi = vi.getNext();\r\n }\r\n \r\n return v;\r\n }", "public Callback compose() {\n\t\tif ( isEmpty() ) return DefaultCallback.getInstance();\n\t\tif ( size() == 1 ) return callbacks.get( 0 );\n\n\t\treturn new ComposedCallback( callbacks );\n\t}", "public CMObject copyOf();", "public ArrayList<Object> naturalJoin(ArrayList<Movie> list1, ArrayList<Person> list2)\r\n {\n return new ArrayList<Object>();\r\n }", "public abstract Combinacion elegirCombinacionOculta();", "public static <C> LIST<C> CINV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LinkedList<C> list = new LinkedList<C>(L.list);\n Collections.reverse( list );\n return new LIST<C>( list );\n }", "public interface CompositeExpression extends Expression {\n\n\t/**\n\t * Returns the list of current subexpressions; null if none\n\t */\n\tArrayList<Expression> getChildren();\n\n\t/**\n\t * Adds a subexpression\n\t */\n\tExpression addChild(boolean composite);\n\n\t/**\n\t * Removes a subexpression\n\t */\n\tvoid removeChild(Expression e);\n}", "Proof contraConvert(Proof p) {\n Expression a = ((Implication) p.lastExpr()).statement;\n Expression b = ((Implication) p.lastExpr()).consequence;\n return mpBack(contra(a, b), p);\n }", "public List<Variant> getCompositions() {\n return compositions;\n }", "protected ByteBuf compose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next)\r\n/* 41: */ {\r\n/* 42:75 */ if ((cumulation instanceof CompositeByteBuf))\r\n/* 43: */ {\r\n/* 44:76 */ CompositeByteBuf composite = (CompositeByteBuf)cumulation;\r\n/* 45:77 */ composite.addComponent(true, next);\r\n/* 46:78 */ return composite;\r\n/* 47: */ }\r\n/* 48:80 */ return composeIntoComposite(alloc, cumulation, next);\r\n/* 49: */ }", "@Override\n public boolean equals (final Object o) {\n return\n (o instanceof Composition)\n &&\n super.equals(o)\n &&\n Arrays.equals(\n _reversedTerms, \n ((Composition) o)._reversedTerms); }", "public List<Stave> getCompositions() {\n\n return compositions;\n }", "public static <T> List<T> clone(List<T> a) {\n\t\tList<T> newList = new ArrayList<T>();\n\t\t\n\t\tfor (T elt : a)\n\t\t\tnewList.add(elt);\n\t\t\n\t\treturn newList;\n\t}", "Object clone();", "Object clone();", "protected Multiset<E> c() {\n return a();\n }", "public static void main(String[] args) {\n IComplex a = new Complex(5.0, 6.0);\n\n IComplex b = new Complex(-3.0, 4.0);\n\n System.out.println(\"a = \" + a);\n System.out.println(\"b = \" + b);\n System.out.println(\"Re(a) = \" + a.re());\n System.out.println(\"Im(a) = \" + a.im());\n System.out.println(\"b + a = \" + b.plus(a));\n System.out.println(\"a - b = \" + a.minus(b));\n System.out.println(\"a * b = \" + a.times(b));\n System.out.println(\"b * a = \" + b.times(a));\n System.out.println(\"a / b = \" + a.divides(b));\n System.out.println(\"(a / b) * b = \" + a.divides(b).times(b));\n System.out.println(\"conj(a) = \" + a.conjugate());\n System.out.println(\"|a| = \" + a.abs());\n System.out.println(\"tan(a) = \" + a.tan());\n System.out.println(\"b + a = \" + Complex.plus(a,b));\n }", "public boolean isCloneable()\n {\n return leftOperand.isCloneable() && rightOperand.isCloneable();\n }", "public Composite getComposite()\r\n\t{\r\n\t\treturn _g2.getComposite();\r\n\t}", "public Cartesiana polar_cartesiano (Polar p){\n \n return polar_cartesiano (p.getRadio(),p.getAngulo()); // implementar procedimiento correcto\n}", "public ArrayList<ArrayList<Course>> permutationOfCourseList(ArrayList<Course> originalCourseList) {\n ArrayList<ArrayList<Course>> results = new ArrayList<ArrayList<Course>>();\n if (originalCourseList == null || originalCourseList.size() == 0) {\n return results;\n }\n ArrayList<Course> result = new ArrayList<>();\n recursivePermuter(originalCourseList, results, result);\n return results;\n }", "public List<Composite> getComposites() {\r\n\t\treturn _composites;\r\n\t}", "public static <T> Comparator<T> chain(final List<Comparator<? super T>> c) {\n return new Comparator<T>() {\n public int compare(T o1, T o2) {\n int x = 0;\n Iterator<Comparator<? super T>> it = c.iterator();\n while (x == 0 && it.hasNext()) {\n x = it.next().compare(o1, o2);\n }\n return x;\n }\n };\n }", "public Point mult(Point a) {\n\t\tPoint result = new Point();\n\t\tsuper.mult(a, result);\n\t\treturn result;\n\t}", "public void setCompositions(List<Stave> compositions) {\n this.compositions = compositions;\n }", "public MultiCube cloneAndCast() {\r\n\t\tMultiCube multi = new MultiCube(itemID, x, y, z);\r\n\t\tLinkedList<Cube> cubes = new LinkedList<>();\r\n\r\n\t\tfor (Cube cube : list) {\r\n\t\t\tCube newCube = new Cube(cube);\r\n\t\t\t// TODO [Warning] onGrid=true is forced here\r\n\t\t\tnewCube.onGrid = true;\r\n\t\t\tnewCube.multicube = multi;\r\n\t\t\tcubes.add(newCube);\r\n\t\t}\r\n\t\tmulti.list = cubes;\r\n\r\n\t\treturn multi;\r\n\t}", "private static final <R, C extends Collection<? super R>> C m64428a(@C6003d Object[] objArr, C c) {\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n c.add(obj);\n }\n }\n return c;\n }", "Chain createChain();", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tPilaVector p = new PilaVector();\n\t\tfor(int i = 0; i < this.vector.size(); i++) {\n\t\t\tp.vector.add(this.vector.get(i));\n\t\t}\n\t\treturn p;\n\t}", "public void setcomponenten(ArrayList<Componenten> a){\r\n this.database= a;\r\n }", "public MovableObject lightClone()\n\t\t{\n\t\t\tfinal MovableObject clone = new MovableObject();\n\t\t\tclone.assCount = this.assCount;\n\t\t\tclone.associatable = this.associatable;\n\t\t\tclone.bound = this.bound;\n\t\t\tclone.coords = new int[this.coords.length];\n\t\t\tfor(int i=0; i < this.coords.length; i++)\n\t\t\t\tclone.coords[i] = this.coords[i];\n\t\t\tclone.highlighted = this.highlighted;\n\t\t\tclone.hotSpotLabel = this.hotSpotLabel;\n\t\t\tclone.keyCode = this.keyCode;\n\t\t\tclone.label = this.label;\n\t\t\tclone.maxAssociations = this.maxAssociations;\n\t\t\tif(shape.equals(\"rect\"))\n\t\t\t{\n\t\t\t\tclone.obj = new Rectangle(coords[0]-3,coords[1]-3,coords[2]+6,coords[3]+6);\n\t\t\t}\n\t\t\tif(shape.equals(\"circle\"))\n\t\t\t{\n\t\t\t\tclone.obj = new Ellipse2D.Double((coords[0]-coords[2])-4,(coords[1]-coords[2])-4,(coords[2]+2)*2,(coords[2]+2)*2);\n\t\t\t}\n\t\t\tif(shape.equals(\"ellipse\"))\n\t\t\t{\n\t\t\t\tclone.obj = new Ellipse2D.Double((coords[0]-coords[2])-4,(coords[1]-coords[2])-4,(coords[2]+2)*2,(coords[3]+2)*2);\n\t\t\t}\n\t\t\tif(shape.equals(\"poly\"))\n\t\t\t{\n\t\t\t\tfinal int xArr[] = new int[coords.length/2];\n\t\t\t\tfinal int yArr[] = new int[coords.length/2];\n\t\t\t\tint xCount = 0;\n\t\t\t\tint yCount = 0;\n\t\t\t\tfor(int i=0; i < coords.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif((i%2) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\txArr[xCount] = coords[i];\n\t\t\t\t\t\txCount++;\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tyArr[yCount] = coords[i];\n\t\t\t\t\t\tyCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//TODO calculate the centre of mass\n\n\t\t\t\tclone.obj = new Polygon(xArr,yArr,xArr.length);\n\t\t\t}\n\t\t\tclone.pos = new Point(this.pos.x,this.pos.y);\n\t\t\tclone.shape = this.shape;\n\t\t\tclone.startPos = this.startPos;\n\t\t\tclone.value = this.value;\n\n\t\t\treturn clone;\n\t\t}", "@Override\n\tpublic ChatComponentTranslation createCopy() {\n\t\tfinal Object[] var1 = new Object[formatArgs.length];\n\n\t\tfor (int var2 = 0; var2 < formatArgs.length; ++var2) {\n\t\t\tif (formatArgs[var2] instanceof IChatComponent) {\n\t\t\t\tvar1[var2] = ((IChatComponent) formatArgs[var2]).createCopy();\n\t\t\t} else {\n\t\t\t\tvar1[var2] = formatArgs[var2];\n\t\t\t}\n\t\t}\n\n\t\tfinal ChatComponentTranslation var5 = new ChatComponentTranslation(key,\n\t\t\t\tvar1);\n\t\tvar5.setChatStyle(getChatStyle().createShallowCopy());\n\t\tfinal Iterator var3 = getSiblings().iterator();\n\n\t\twhile (var3.hasNext()) {\n\t\t\tfinal IChatComponent var4 = (IChatComponent) var3.next();\n\t\t\tvar5.appendSibling(var4.createCopy());\n\t\t}\n\n\t\treturn var5;\n\t}", "public Carta clone(){\n\t\treturn new Carta(palo, numero);\n\t}", "@Test\n\tvoid test4AddComponentToList() {\n\t\tlistItems.add(comp1);\n\t\tlistItems.add(comp2);\n\t\tvc = new VerticalComponentList(x, y, listItems,0);\n\t\tvc.addComponent(comp3);\n\t\tassertEquals(comp3.hashCode(), vc.getComponentsList().get(vc.getComponentsList().size() - 1).hashCode());\n\t}", "public boolean isComposite() {\n return false;\n }", "public static <A> CompositeProcedure<A> procedure(Procedure<? super A> procedure) {\n return new CompositeProcedure<A>(procedure);\n }", "public List<E> clone();", "@Override\n public Forme symetrieAxiale(final Ligne l) {\n double coeficient = (l.getPointB().getY() - l.getPointA().getY()) / (l.getPointB().getX() - l.getPointA().getX());\n double b = l.getPointA().getY() - (coeficient * l.getPointA().getX());\n /* Calcul de l'equation de la deuxieme droite (entre le centre et le centre symetrique) :\n * coefficient = 1 / coefficientPremiereDroite\n * donc yCentre = xCentre * coefficient + b\n * */\n\n double coefficientBis = -1 / coeficient;\n\n double bBis = this.centre.getY() - (this.centre.getX() * coefficientBis);\n double bpCercle =this.pCercle.getY() - (this.pCercle.getX() * coefficientBis);\n\n /*\n Soit les droites dont les équations sont y = x – 4 et y = –2x + 5, alors : x – 4 = –2x + 5. On représente ces droites dans un plan cartésien.\n Donc : 3x = 9 et x = 3\n Puis : y = –1\n Les coordonnées du point d’intersection de ces droites sont (3, –1).\n\n */\n double xCentre = (bBis - b) / (coeficient - coefficientBis);\n double yCentre = coefficientBis * xCentre + bBis;\n\n double xPCercle = (bpCercle - b) / (coeficient - coefficientBis);\n double yPCercle = coefficientBis * xPCercle + bpCercle;\n\n Point newCentre = new Point(Math.floor((2*xCentre - this.centre.getX())*100)/100,Math.floor((2*yCentre - this.centre.getY())*100)/100);\n Point newPoint = new Point(Math.floor((2*xPCercle - this.pCercle.getX())*100)/100,Math.floor((2*yPCercle - this.pCercle.getY())*100)/100);\n return new Cercle(newCentre,newPoint);\n }", "Composite() {\n\n\t}", "public static void main(String[] args) {\n\r\n\t\tList<Integer> l = new ArrayList<Integer>();\r\n\t\t//List<Integer> l = new ArrayList<Integer>(Collection c); is also valid\r\n\t\t\r\n\t\tfor(int i=1;i<=10;i++){\r\n\t\t\tl.add(i);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(l);//[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\t//index based operations\r\n\t\t\r\n\t\tSystem.out.println(l.get(1));//2(element at position 1)\r\n\t\tSystem.out.println(l.set(1,12));//2(returns and replaces the element at position 1)\r\n\t\tSystem.out.println(l);//[1, 12, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\tl.add(1,11);//inserts 11 at position 1\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\tList<Integer> l1 = Arrays.asList(97,23,34);\r\n\t\tl.addAll(4,l1);//inserts collection elements at position 4\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 97, 23, 34, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\tSystem.out.println(l.remove(new Integer(4)));//true ( removes the first occurrence of object 4 )\r\n\t\tSystem.out.println(l.remove(4));//97 (removes the object at position 4)\r\n\t\r\n\t\tSystem.out.println(l.add(11));\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 23, 34, 5, 6, 7, 8, 9, 10,11]\r\n\t\t\r\n\t\tSystem.out.println(l.indexOf(new Integer(11)));//1\r\n\t\tSystem.out.println(l.lastIndexOf(new Integer(11)));//12\r\n\t\t\r\n\t\tSystem.out.println(l.subList(3, 8));//[3, 23, 34, 5, 6]\r\n\t\r\n\t\t\r\n\t}", "public ArrayList<Competitor> copyCompetitors(ArrayList<Competitor> competitors){\r\n ArrayList<Competitor> copy = new ArrayList<Competitor>();\r\n Iterator<Competitor> iteration = competitors.iterator();\r\n while (iteration.hasNext())\r\n {\r\n copy.add(iteration.next());\r\n }\r\n return copy;\r\n }", "@Override\r\n\t\tpublic final boolean combinePropertyLists()\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}", "private static <R, I, T> SerializableFunction<R, T> compose(\n SerializableFunction<R, I> f1, SerializableFunction<I, T> f2) {\n return r -> f2.apply(f1.apply(r));\n }", "public interface Duplo<T> {\n default Merge<T> merge() {\n return Merge.empty();\n }\n\n /** return the element stored in this instance; */\n T self();\n\n /**\n * do not override\n *\n * @return a stream representation of the element stored in this instance\n */\n default Stream<T> selfStream() {\n return self() == null ? Stream.empty() : Stream.of(self());\n }\n\n /**\n * return a stream of elements encapsulated by in this instance\n *\n * @return a stream representation of the element stored in this instance\n */\n default Stream<T> fullStream() {\n return Stream.empty();\n }\n\n /**\n * A {@link Duplo} which has no neighbors\n *\n * @param <T>\n * @author Yossi Gil\n * @since 2017-03-30\n */\n interface Atomic<T> extends Duplo<T> {\n @Override default Stream<T> fullStream() {\n return selfStream();\n }\n }\n\n interface Compound<T> extends Duplo<T> {\n Iterable<? extends Duplo<T>> components();\n\n @Override default Stream<T> fullStream() {\n return merge().append(self(), components());\n }\n }\n\n @FunctionalInterface interface Merge<T> {\n static <T> Merge<T> empty() {\n return (self, others) -> Stream.empty();\n }\n\n Stream<T> append(T self, Iterable<? extends Duplo<T>> others);\n }\n}", "public c(Object obj) {\n super(1);\n this.a = obj;\n }", "LComprehensionable translate(HComprehensionable c) {\n if (c == null) {\n \treturn null;\n }\n if (c instanceof HExprComp) {\n HExprComp d = (HExprComp) c;\n LExp expr = (LExp) d.expr.accept(this);\n LComprehensionable comp = translate(d.next);\n return new LExprComp(expr, comp);\n } else if (c instanceof HForComp) {\n HForComp d = (HForComp) c;\n LName name = new LName(d.name.toString());\n LExp expr = (LExp) d.expr.accept(this);\n LComprehensionable comp = translate(d.comp);\n return new LForComp(name, expr, comp);\n } else if (c instanceof HIfComp) {\n HIfComp d = (HIfComp) c;\n LExp expr = (LExp) d.cond.accept(this);\n LComprehensionable comp = translate(d.comp);\n return new LIfComp(expr, comp);\n } else {\n System.out.println(\"Error translating comprehensionable to LIR\");\n return null;\n }\n }" ]
[ "0.6243726", "0.58172107", "0.5556377", "0.5490528", "0.52791566", "0.5025056", "0.4994038", "0.4918212", "0.4918212", "0.49003032", "0.48715198", "0.48396274", "0.48327363", "0.48236364", "0.47565156", "0.47477186", "0.46774486", "0.46326098", "0.46198252", "0.46181813", "0.461287", "0.461287", "0.45955414", "0.45931527", "0.4586006", "0.45845947", "0.45788914", "0.45595917", "0.45563895", "0.45435953", "0.45240554", "0.45235026", "0.45179164", "0.4513429", "0.45129225", "0.45038673", "0.45011", "0.4499291", "0.44908804", "0.44881266", "0.44738293", "0.44688323", "0.44567302", "0.445608", "0.44325715", "0.44321924", "0.44180724", "0.44015366", "0.4401062", "0.43984336", "0.43900117", "0.4385378", "0.4380222", "0.4376597", "0.43643183", "0.43594006", "0.4349267", "0.43452343", "0.43221673", "0.432038", "0.4316726", "0.4285328", "0.42843074", "0.42819077", "0.4273942", "0.4268263", "0.42672944", "0.42672488", "0.42672488", "0.426679", "0.42535353", "0.42511433", "0.4239664", "0.42327183", "0.42314732", "0.422427", "0.42240325", "0.42211264", "0.42201635", "0.4208852", "0.4203202", "0.42017487", "0.41987363", "0.41985223", "0.4185733", "0.41849998", "0.41812855", "0.41804808", "0.4172393", "0.4172203", "0.41720542", "0.41699976", "0.41666234", "0.41608286", "0.41513833", "0.4151108", "0.4146787", "0.41463047", "0.41419885", "0.41333443" ]
0.5914617
1
Reductum. A is a list. i is a nonnegative betainteger not less than LENGTH(A). B=A, if i=0. Otherwise, B is the ith reductum of A.
public static <C> LIST<C> REDUCT(LIST<C> L, int i) { LIST<C> LP = null; if ( ! isNull( L ) ) { LP = new LIST<C>( L.list.subList(i,L.list.size()) ); } return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Integer> repeatedNumber(final List<Integer> a) {\n long sum = 0, ssum = 0;\n for(int i = 0 ; i < a.size(); i++){\n long curi = i+1; // importnt to prevent overflow.\n long curn = a.get(i); // importnt to prevent overflow.\n sum += curn - curi;\n ssum +=curn*curn - curi*curi ;\n }\n ssum /= sum; // A + B \n long first = (sum + ssum)/2;\n long second = (ssum - first); \n ArrayList<Integer> result = new ArrayList<>();\n result.add((int)first);\n result.add((int)second);\n return result;\n }", "public int getSum(List<Integer> a){\n\n int sum = 0;\n\n for(int i = 0; i<a.size(); i++){\n if(a.get(i)<0){\n continue;\n } else{\n sum +=a.get(i);\n }\n }\n return sum;\n }", "public static List<Integer> multiply(List<Integer> a1, List<Integer> a2) {\n if (a1.size() == 1 && a1.get(0) == 0\n || a2.size() == 1 && a2.get(0) == 0) {return Arrays.asList(0);}\n\n Integer[] arr = new Integer[a1.size() + a2.size()];\n Arrays.fill(arr, 0);\n List<Integer> res = Arrays.asList(arr);\n List<Integer> res2 = new ArrayList<>();\n\n Collections.reverse(a1);\n Collections.reverse(a2);\n\n for (int i = 0; i < a1.size(); i++) {\n for (int j = 0; j < a2.size(); j++) {\n res.set(i + j, res.get(i + j) + a1.get(i) * a2.get(i));\n res.set(i + j + 1, res.get(i + j + 1) + res.get(i + j) / 10);\n res.set(i + j, res.get(i + j) % 10);\n }\n }\n\n Collections.reverse(res);\n\n for (int i = 0; i < res.size(); i++) {\n if (res.get(i) != 0) {\n res2.add(res.get(i));\n }\n }\n\n return res2;\n }", "public int singleNumber(final List<Integer> A) {\n int a=0, b=0;\n for(int i=0;i<A.size();i++){\n int n = (a & ~A.get(i)) | (b & A.get(i));\n b = (b & ~A.get(i)) | (~a & ~b & A.get(i));\n a = n;\n }\n return a|b;\n }", "private static Integer deductOne(Integer element) {\n return element - 1;\n }", "public ArrayList<Integer> repeatedNumber(final List<Integer> A) {\n ArrayList<Integer> res = new ArrayList<>();\n long n = A.size();\n int a = 0, b = 0;\n long sum = 0;\n long sum_of_n = n*(n+1)/2;\n HashSet<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < n; i++){\n if(set.contains(A.get(i))){\n a = A.get(i);\n }\n else{\n set.add(A.get(i));\n }\n sum += A.get(i);\n }\n b = (int)(sum_of_n - sum) + a;\n res.add(a);\n res.add(b);\n return res;\n }", "protected int sumIterative(int a, int b){\n int result = a;\n while (b != 0){\n if (b > 0){\n result++;\n b--;\n } else {\n result--;\n b++;\n }\n }\n return result;\n }", "public int repeatedNumber(final List<Integer> a) {\n\t List<Integer> B = new ArrayList<Integer>(a);\n\t ArrayList<Integer> result=new ArrayList<Integer>();\n int len = B.size();\n \n int repeated = -1;\n //int indexOfMissing = -1;\n for (int i = 0; i < len; i++) {\n // until B[i] stores the right number (i.e. i + 1)\n // or we meet the duplicated number\n while (B.get(i) != i + 1) {\n int num = B.get(i);\n if (num == B.get(B.get(i) -1)) {\n // met with duplicated number\n repeated = B.get(num - 1);\n //indexOfMissing = i;\n break;\n }\n // swap B[i] with B[num - 1]\n int temp = B.get(i);\n B.set(i, B.get(num - 1));\n B.set(num - 1, temp);\n }\n }\n \n //result.add(repeated);\n //result.add(indexOfMissing + 1);\n return repeated;\n\t}", "public int solution(int[] A) {\n int l = A.length;\r\n int largest = 0;\r\n\r\n //first we sort the array using count sort\r\n //get largest\r\n for (int i : A) {\r\n if (i > largest) {\r\n largest = i;\r\n }\r\n }\r\n //set all elements of c to 0\r\n int c[] = new int[largest + 1];\r\n int b[] = new int[A.length];\r\n for (int i = 0; i < c.length; i++) {\r\n c[i] = 0;\r\n }\r\n printc(c, \"c\");\r\n // set occurences of each element in c\r\n for (int i : A) {\r\n c[i] += 1;\r\n }\r\n printc(c, \"c\");\r\n // add \r\n for (int i = 1; i < c.length; i++) {\r\n c[i] = c[i - 1] + c[i];\r\n }\r\n printc(c, \"c\");\r\n\r\n for (int i = A.length-1; i >= 0; i--) {\r\n int value = A[i];\r\n int cvalue = c[value] - 1;\r\n b[cvalue] = value;\r\n c[value] = cvalue;\r\n }\r\n printc(b, \"b\");\r\n\r\n \r\n \r\n return 0;\r\n }", "public static void a2v2(int[] A)\n {\n Map<Integer, List<Integer>> hashMap = new HashMap<>();\n\n insert(hashMap, 0, -1);\n\n int sum = 0;\n\n for (int i = 0; i < A.length; i++)\n {\n sum += A[i];\n\n if (hashMap.containsKey(sum))\n {\n List<Integer> list = hashMap.get(sum);\n\n // find all subarrays with the same sum\n for (Integer value: list)\n {\n System.out.println(\"Subarray [\" + (value + 1) + \"…\" +\n i + \"]\");\n }\n }\n\n // insert (sum so far, current index) pair into the hashmap\n insert(hashMap, sum, i);\n }\n }", "public int iterativeGet(int i) {\n int val = 0;\n val = this.first;\n IntList p = this.rest;\n while (i > 0) {\n val = p.first;\n p = p.rest;\n i--;\n }\n return val;\n }", "public int lis(final List<Integer> A) {\n int size = A.size();\n int max = 0;\n int[] lis = new int[size];\n for ( int i = 0; i < size; i++ ) \n lis[i] = 1;\n for ( int i = 1; i < size; i++ ){ \n for (int j = 0; j < i; j++ ) {\n if ( A.get(i) > A.get(j) && lis[i] < lis[j] + 1){ \n lis[i] = lis[j] + 1; \n }\n }\n }\n \n for (int i = 0; i < size; i++ ) \n if ( max < lis[i] ) \n max = lis[i]; \n return max;\n }", "public List<Integer> singleNumberIII(int[] A) {\n List<Integer> result = new ArrayList<>();\n if (A == null || A.length == 0) {\n return result;\n }\n\n int oxr = 0;\n\n for (int a : A) {\n oxr ^= a;\n }\n\n //2. 查看OXR 1的位置\n int indexOfOne = getIndexOfOne(oxr);\n\n //3. 根据indexOfOne的位置进行分组\n int ra = 0, rb = 0;\n\n for (int a : A) {\n\n if (isBit1(a, indexOfOne)) {\n ra ^= a;\n } else {\n rb ^= a;\n }\n\n }\n\n result.add(ra);\n result.add(rb);\n return result;\n }", "public ArrayList<Integer> continuousSubarraySum(int[] A) {\n ArrayList<Integer> result = new ArrayList<>();\n\n int temp = A[0];\n for (int i = 0; i<A.length;i++) {\n int val = A[i];\n for (int j = i + 1; j<A.length; j++) {\n val += A[j];\n if (temp < val) {\n result.clear();\n result.add(i);\n result.add(j);\n \n }\n else { continue;}\n temp = val;\n }\n \n }\n return result;\n \n }", "public int solution(int[] A) {\n int sumRange = 0;\n for (int i = 1; i <= A.length+1; i++){\n sumRange+=i;\n }\n \n int sumArray = 0;\n for(int a : A) {\n sumArray+=a;\n }\n\n\t//Take the total without the missing number, and subtract the total with the missing number\n return sumRange-sumArray;\n }", "public int maxProfit(final List<Integer> A) {\n \n int max = 0;\n \n for(int i=1;i<A.size();i++){\n max += A.get(i) > A.get(i-1) ? A.get(i) - A.get(i-1) : 0; \n }\n return max;\n }", "private static int sum(List<Integer> L, int i,int j) {\n\t\tSystem.out.println(L+\"\\n\"+\"index i = \"+i+\"\\n\"+\"index j = \"+j);\n\t\tList<Integer> subListToSum = new ArrayList<Integer>();\n\t\t\n\t\tif (i <= j) { //make sure that i is less than j so we have a sublist of at least one\n\t\t\tsubListToSum.addAll(L.subList(i, j));\n\t\t\t\n\t\t}\n\t\t\n\t\telse if (i > j) { //print out a error so the user knows what they did wrong\n\t\t\tSystem.out.println(\"index 'i' is more than index 'j'\");\n\t\t}\n\t\t\n\t\tint sizeList = L.size(); //only reaches here if i <= j\n\t\tSystem.out.println(\"size of list is: \" + sizeList);\n\t\tif (j <= sizeList & i <= sizeList) { //check to account for out of bounds and negatives\n\t\t\tint result = 0;\n\t\t\t\n\t\t\tfor (int allInts : subListToSum) {\n\t\t\t\tresult += allInts;\n\t\t\t};\n\t\t\t\n\t\t\tSystem.out.println(\"Sum(\" + i + \", \" + j + \")\" + \" = \" + result);\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public static void debucketize(Integer[] A)\n\t{int i = 0;//Index of next element in A\n\t //Inv: elements in buckets[0..bucket[ctr]] are debucketized && ctr = bucket.size() \n\t //&& A[i] = elements in vector \n\t for(int ctr = 0; ctr < buckets.size(); ctr++)\n\t\t{//Inv: elements in buckets[0..bucket[ctr]-1] are debucketized && ctr < bucket.size() \n\t\t //&& A[i]-1 = elements in vector\n\t\t i += buckets.get(ctr).toArray(A, i);\n\t\t//Inv: elements in buckets[0..bucket[ctr]] are debucketized && ctr = bucket.size() \n\t\t//&& A[i] = elements in vector\t \n\t\t}\n\t //Termination: the counter begins at 0 and increments every time by 1 until it finally reaches \n\t //the size of the buckets and it finally terminates. \n\t}", "private static List<Integer> addOne(List<Integer> input) {\n\n\t\tList<Integer> copy = new ArrayList<>();\n\t\tcopy.addAll(input);\n\n\t\tint size = copy.size();\n\t\tcopy.set(size-1, input.get(size-1)+1);//last element of input is updated/replaced by (original value + 1)\n\n\t\tfor(int i=size-1; i>0 && copy.get(i)==10; i--) {\n\t\t\tcopy.set(i, 0);\n\t\t\tcopy.set(i-1, copy.get(i-1)+1);\n\t\t}\n\n\t\tif(copy.get(0) == 10) {\n\t\t\tcopy.set(0, 0);\n\t\t\tcopy.add(0, 1);//add 1 at index0 ,shift all elements after to right\n\t\t}\n\n\t\treturn copy;//this NOT modifies the original input\n\t}", "private int minusOne(int i) {\n return (i - 1 + capacity) % capacity;\n }", "public static int solution(int[] A) {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tString one;\n\t\tfor(int num : A) {\n\t\t\tone = num+\"\";\n\t\t\tint splitedSum = 0;\n\t\t\tfor(String n : one.split(\"\")) {\n\t\t\t\tsplitedSum += Integer.parseInt(n);\n\t\t\t}\n\t\t\tlist.add(splitedSum);\n\t\t}\n\t\t\n\t\tList<Integer> sumList = new ArrayList<>();\n\t\t\n\t\tfor(int i =0; i < list.size(); i++) {\n\t\t\tfor(int j=0; j < list.size(); j++) {\n\t\t\t\tif( i!=j && list.get(i) == list.get(j) ) {\n\t\t\t\t\tsumList.add(A[i] + A[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( sumList.size()==0 ) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn Collections.max(sumList);\n\t\t}\n }", "public Inatnum multiply(Inatnum a) {\n Inatnum zero = new zeronatnum(); // we need a new zero natural number for our res\n Inatnum res = zero;// this is our res value where we store our information, it needs to start at 0\n //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1)\n for(int i = this.getVal(); i>0;i--) {// setting our i value to our this and if its greater than zero decrement by 1\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()\n\t\t\tres = res.add(a);//now we save our res value as the previous res value plus a. we do this as many times as we are multiplying by. So if it is 3 times\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()-1) \n \t\t\t//i-- => i = this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1) \n\t\t\t // 4 then we are adding 4 3 times\n }\n\t\t\t //INV: i<0 && i-1 < this.getval() ==> i ==0 && res = a^i ==> i=this.getval()\n //Termination Argument: i starts at this.getval(), i decrements each time through the loop\n\t\t\t\t\t\t return res;// we need to return our res value that holds our current value.\n }", "public void reduct() {\n\t\tint divider = bunmo;\n\t\tif(bunja < bunmo){\n\t\t\tdivider = bunja;\n\t\t}\n\t\twhile(divider > 1){\n//\t\twhile(!util.Uitl.isPrime(bunmo)||!util.Uitl.isPrime(bunja)){\n\t\t\tboolean canDivide = (bunmo%divider==0)&&(bunja%divider==0);\n\t\t\tif(canDivide){\n\t\t\t\tbunja/=divider;\n\t\t\t\tbunmo/=divider;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdivider--;\n\t\t\t}\n\t\t}\n\t}", "public int maxProduct(final List<Integer> A) {\n if (A.size() == 0) {\n return 0;\n }\n int[] posProduct = new int[A.size()];\n int[] negProduct = new int[A.size()];\n int[] maxProduct = new int[A.size()];\n posProduct[0] = negProduct[0] = maxProduct[0] = A.get(0);\n for (int i = 1;i < A.size();i++) {\n int a = posProduct[i-1] * A.get(i);\n int b = negProduct[i-1] * A.get(i);\n posProduct[i] = Math.max(Math.max(a, b), A.get(i));\n negProduct[i] = Math.min(Math.min(a, b), A.get(i));\n maxProduct[i] = Math.max(posProduct[i], maxProduct[i-1]);\n }\n // for(int i=0;i<A.size();i++)\n // {\n // System.out.print(\" |\"+posProduct[i]);\n // }\n // System.out.println();\n // for(int i=0;i<A.size();i++)\n // {\n // System.out.print(\" |\"+negProduct[i]);\n // }\n // System.out.println();\n return maxProduct[A.size()-1];\n }", "public static int sum(int[] a) {\n int sum = 0;\n for (int i = 0; i < a.length; i = i + 1) {\n sum = sum + a[i];\n }\n return sum;\n }", "public static int backPack(int T, int[] A) {\n\t\tif (A == null || A.length == 0 || T == 0)\n\t\t\treturn 0;\n\n\t\tint n = A.length;\n\n\t\tint[] f = new int[T + 1];\n\t\tf[0] = 1;\n\t\tfor (int i = 1; i < T; i++) {\n\t\t\tf[i] = 0;\n\t\t}\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = T; j >= 0; j--) {\n\t\t\t\tif (j >= A[i - 1]) {\n\t\t\t\t\tf[j] += f[j - A[i - 1]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn f[T];\n\t}", "public static int sumArray( int [] A ) {\n\tint sum = 0;\n\tfor( int a : A ) sum +=a;\n\treturn sum;\n }", "public int maxSubArray(final List<Integer> A) {\n int n = A.size();\n int ans = A.get(0),curr = A.get(0);\n \n for(int i=1;i<n;i++){\n curr = Math.max(A.get(i),A.get(i)+curr);\n ans = Math.max(curr,ans);\n }\n return ans;\n }", "public ArrayList<Integer> twoSum(final List<Integer> A, int B) {\n HashMap<Integer, List<Integer>> hm = new HashMap<>();\n ArrayList<Integer> solution = new ArrayList<Integer>();\n int smallestIndex2 = A.size() - 1;\n int smallestIndex1 = A.size() - 1;\n boolean containsPair = false;\n \n for (int i = 0; i < A.size(); i++) {\n if (hm.containsKey(A.get(i))) {\n List<Integer> entry = hm.get(A.get(i));\n entry.add(i);\n hm.put(A.get(i), entry);\n } else {\n List<Integer> entry = new ArrayList<>();\n entry.add(i);\n hm.put(A.get(i), entry);\n }\n }\n \n for (Map.Entry<Integer, List<Integer>> entry : hm.entrySet()) {\n int number = entry.getKey();\n List<Integer> list = entry.getValue();\n int desiredNum = B - number;\n \n if (hm.containsKey(desiredNum)) {\n List<Integer> desiredList = hm.get(desiredNum);\n Collections.sort(desiredList); // grab minimum indices\n Collections.sort(list);\n \n int desIndex = desiredList.get(0);\n int listIndex = list.get(0);\n \n if (list.size() == 1 && number*2 == B) {\n continue;\n } else {\n if (desIndex == listIndex) { // if both refer to the same index\n desIndex = desiredList.get(1);\n }\n }\n \n if (desIndex > listIndex) {\n if (desIndex < smallestIndex2) {\n smallestIndex2 = desIndex;\n smallestIndex1 = listIndex;\n } else if (desIndex == smallestIndex2) {\n if (listIndex < smallestIndex1) {\n smallestIndex1 = listIndex;\n smallestIndex2 = desIndex;\n }\n }\n } else {\n if (listIndex < smallestIndex2) {\n smallestIndex2 = listIndex;\n smallestIndex1 = desIndex;\n } else if (listIndex == smallestIndex2) {\n if (desIndex < smallestIndex1) {\n smallestIndex1 = desIndex;\n smallestIndex2 = listIndex;\n }\n }\n }\n \n containsPair = true;\n }\n }\n \n if (containsPair) {\n solution.add(smallestIndex1 + 1);\n solution.add(smallestIndex2 + 1);\n }\n \n return solution;\n }", "public static int simpleArraySum() { //(List<Integer> ar)\n \n Integer []ar = {1,2,3}; \n\n Integer sum =0;\n for(Integer i : ar){\n sum +=i;\n }\n return sum; \n }", "public static IntList dincrList(IntList L, int x) { //iteratively\n /* Your code here. */\n IntList p = L;\n while (p != null) {\n p.first = p.first + x; //this mutate the L.first since p.first and l.first are the same\n p = p.rest; //until p = null then it point to another list\n }\n return L; //not p because P is null at this point and it point to the rest not the original list\n }", "@Override\n <T> void applyPermutation(@NotNull List<Integer> perm, @NotNull List<T> A) {\n Preconditions.checkArgument(perm.size() == A.size(), \"The sizes of A and P (the permutation array) differ.\");\n int n = perm.size();\n for (int i = 0; i < n; ++i) {\n // Checks if the element at index i has not been moved already\n // by checking if perm.get(i) is nonnegative\n int currPos = i;\n while(perm.get(currPos) >= 0) {\n Collections.swap(A, i, perm.get(currPos));\n int next = perm.get(currPos);\n // Subtracts perm.size() from an entry in perm to make it negative,\n // which indicates that the corresponding move has been performed.\n perm.set(currPos, perm.get(currPos) - n);\n currPos = next;\n }\n }\n }", "private int plusOne(int i) {\n return (i + 1) % capacity;\n }", "private static int[] removeElement(int[] a, int i) {\n\t\tint[] b = new int[a.length-1];\n\t\tint k = 0;\n\t\tfor (int j = 0; j < a.length; j++) {\n\t\t\tif (j != i) {\n\t\t\t\tb[k++] = a[j];\n\t\t\t}\n\t\t}\n\t\treturn b;\n\t}", "public int repeatedNTimes(int[] A) {\n List<Integer> visited = new ArrayList<>();\n int result = A[0];\n for (int i = 0; i < A.length; i++) {\n if (!visited.contains(A[i])) {\n visited.add(A[i]);\n } else {\n result = A[i];\n break;\n }\n }\n return result;\n }", "public List<List<Integer>> subsets2(int[] A){\n\n int res = 0;\n int diff = Integer.MIN_VALUE;\n int count = 0;\n int start = 0;\n for (int i = 1; i < A.length; i++){\n int curDiff = A[i] - A[i - 1];\n if (diff == curDiff){\n count += i - start - 1 > 0 ? i - start - 1 : 0;\n } else {\n start = i - 1;\n diff = currDiff;\n res += count;\n count = 0;\n }\n }\n res += count;\n System.out.println(res);\n return new ArrayList<List<Integer>>();\n }", "static List<Integer> unique(List<Integer> a, List<Integer> b) {\n\t\t\n\t\t// Base case 01:\n\t\tif (a.isEmpty()) {\n\t\t\t\n\t\t\treturn b;\n\t\t\n\t\t // Base case 02:\n\t\t} else if (b.isEmpty()) {\n\t\t\t\n\t\t\treturn a;\n\t\t\n\t\t // Recursive step:\n\t\t} else if (a.getHead() < b.getHead()) {\n\t\t\t\n\t\t\treturn new List<>(a.getHead(), unique(a.getTail(), b));\n\t\t\t\n\t\t} else if (a.getHead() > b.getHead()) {\n\t\t\t\n\t\t\treturn new List<>(b.getHead(), unique(a, b.getTail()));\n\t\t\t\n\t\t} else { // a.getHead() == b.getHead()\n\t\t\t\n\t\t\treturn unique(a.getTail(), b.getTail());\n\t\t}\n\t}", "public int addValue(int i) {\n return foldIn(i);\n }", "public void sum(int a, int b)\n {\n int index = a + 1;\n int sum = 0;\n \n while (index < b) {\n sum += index;\n index++;\n }\n System.out.println(sum);\n }", "public int solution(int[] A) {\n // write your code in Java SE 8\n List<Integer> a = new ArrayList<>();\n for(int i = 0 ; i < A.length ; i++) {\n if(A[i] > 0) a.add(A[i]);\n }\n\n if(a.size() == 0) {\n return 1;\n }\n\n Collections.sort(a);\n int result = 1;\n for(Integer number : a) {\n if(number == result)\n result++;\n }\n return result;\n }", "public static void main(String[] args){\n int[] a = new int[10];\n for(int i = 0; i < a.length; i++){\n a[i] = i;\n }\n\n int[] b = new int[a.length];\n\n for(int i=1; i <= b.length; i++){\n b[i-1] = a[a.length-1-i];\n }\n\n System.out.println(b);\n }", "private static List<Integer> reverseFibonnaci(int a, int b){\n List<Integer> res = new ArrayList<Integer>();\n Deque<Integer> stack = new ArrayDeque<Integer>();\n\n int prev2 = a;\n int prev1 = b;\n stack.push(prev2);\n stack.push(prev1);\n for(int i = 0; i < 10; i++){\n int sum = prev1 + prev2;\n stack.push(sum);\n prev2 = prev1;\n prev1 = sum;\n }\n\n while(!stack.isEmpty()){\n res.add(stack.pop());\n }\n\n\n return res;\n }", "private int[] inc(int[] a)\n {\n int tI = a.length - 1;\n long m = 0;\n\n m = (((long)a[tI]) & IMASK) + 1L;\n a[tI--] = (int)m;\n m >>>= 32;\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }", "private int[] inc(int[] a)\n {\n int tI = a.length - 1;\n long m = 0;\n\n m = (((long)a[tI]) & IMASK) + 1L;\n a[tI--] = (int)m;\n m >>>= 32;\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }", "public int maxProduct(final List<Integer> A) {\n\t\t int maxTillNow = A.get(0);\n\t\t int minArrSumAtCurrPos = A.get(0);\n\t\t int maxArrSumAtCurrPos = A.get(0);\n\t\t \n\t\t for(int i=1;i<A.size();i++){\n\t\t\t int tmpMin = Math.min(A.get(i), Math.min(minArrSumAtCurrPos*A.get(i), maxArrSumAtCurrPos*A.get(i)));\n\t\t\t int tmpMax = Math.max(minArrSumAtCurrPos*A.get(i),Math.max(maxArrSumAtCurrPos*A.get(i),A.get(i)));\n\t\t\t \n\t\t\t minArrSumAtCurrPos = tmpMin;\n\t\t\t maxArrSumAtCurrPos = tmpMax;\n\t\t\t \n\t\t\t if(maxArrSumAtCurrPos > maxTillNow){\n\t\t\t\t maxTillNow = maxArrSumAtCurrPos;\n\t\t\t }\n\t\t }\n\t\t \n\t\t return maxTillNow;\n\t }", "public static int getMissingNum(int[] A) {\r\n\tif (A == null || A.length == 0)\r\n\t return (Integer) null;\r\n\r\n\tint res = 0;\r\n\tfor (int i = 0; i < A.length; i++) {\r\n\t res ^= A[i];\r\n\t}\r\n\treturn res;\r\n\r\n }", "public Integer substractNumbers(List<Integer> numbers) throws Exception;", "private static int sumIntegerList(List<Integer> superGrowingList) {\r\n\t\tint sum = 0;\r\n\t\tIterator<Integer> iterator = superGrowingList.iterator();\r\n\t\twhile (iterator.hasNext()) {\r\n\t\t\tInteger integer = (Integer) iterator.next();\r\n\t\t\tsum += (int)integer;\r\n\t\t}\r\n\t\treturn sum;\r\n\t}", "public static int sum1( int[][] a )\n {\n int sum = 0; //initialize sum\n for (int[] i : a) { //for each array a, turn into an array called i\n\t for (int j : i) { //and then for each value in i...\n\t sum += j; //add the value of it to the sum\n\t }\n }\n return sum; //return the sum, an int\n }", "protected void m9195a(int i, int i2) {\n int i3 = this.this$0.b.m1514i();\n int j = this.this$0.b.m1515j();\n if (j != i || i3 != i2) {\n Iterator it = this.a.iterator();\n while (it.hasNext()) {\n ((gc) it.next()).ancrer(i - j, i2 - i3, 0, 0, 15);\n }\n }\n }", "@Override\r\n\tpublic int umul(int a,int b) {\n\t\treturn a/b;\r\n\t}", "public static int[] reduce (int []n1) {\n\t\tfor (int i = 0; i < n1.length; i++) {\n\t\t\tif (n1[i] != 0) {\n\t\t\t\tif (i == 0) return copy(n1);\n\t\t\t\t\n\t\t\t\tint []newVal = new int[n1.length-i];\n\t\t\t\textract(newVal,0,n1,i,n1.length-i);\n\t\t\t\treturn newVal;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// just zero.\n\t\treturn new int[]{0};\n\t}", "public static int tapeEquilibrium(int[] A) {\n\t\tif (A.length == 1)\n\t\t\treturn Math.abs(A[0]);\n\n\t\tint result = Integer.MAX_VALUE;\n\t\tint sumLeft = 0, sumRight = 0;\n\t\tint sumAll = 0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsumAll = sumAll + A[i];\n\t\t}\n\n\t\tfor (int i = 0; i < A.length - 1; i++) {\n\t\t\tsumLeft = sumLeft + A[i];\n\t\t\tsumRight = sumAll - sumLeft;\n\t\t\tint difference = Math.abs(sumLeft - sumRight);\n\t\t\tSystem.out.println(i + \" \" + difference);\n\t\t\tresult = Math.min(difference, result);\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic void run() {\n\t\tresult =\n\t\t\tStream.iterate(new int[]{0, 1}, s -> new int[]{s[1], s[0] + s[1]})\n\t\t\t\t.limit(limit)\n\t\t\t\t.map(n -> n[0])\n\t\t\t\t.collect(toList());\n\n\t}", "public static int fetch(ArrayList<Integer> a, int i, int j){\n\t\treturn a.get(i)/(int)Math.pow(10,j) & 1;\n\t}", "public int solution(int[] A) {\n Set<Integer> set = new HashSet<>();\n\n for(int i=1; i < A.length+1; i++)\n set.add(i);\n\n for(int i=0; i < A.length; i++)\n {\n if(set.contains(A[i]))\n set.remove(A[i]);\n\n else\n set.add(A[i]); \n }\n\n if(set.isEmpty())\n return 1;\n\n return 0;\n }", "public static int productSum(List<Object> array, int factor) {\n int sum=0;\n for(Object o1: array){\n if(o1 instanceof Integer){// This is not a Base case so no return stmt as used in loop as well\n sum = sum + (Integer)o1;\n }\n else if(o1 instanceof List){\n sum=sum+ productSum((List)o1,factor+1);\n }\n\n }\n\n return sum*factor;// This is the base case at the end of the loop\n }", "public static int longIncrSubsq(int[] A) {\n int[] L = new int[A.length];\n // init\n for (int i = 0; i < A.length; i++) {\n boolean hasGreaterItem = false;\n for (int j = i + 1; j < A.length; j++) {\n if (A[j] > A[i]) {\n hasGreaterItem = true;\n break;\n }\n }\n if (!hasGreaterItem) {\n L[i] = 1;\n }\n }\n // recursive\n int maxL = 0;\n for (int i = A.length - 1; i >= 0; i--) {\n if (L[i] != 1) {\n int maxGreaterL = 0;\n for (int j = i + 1; j < A.length; j++) {\n if (A[j] > A[i]) {\n if (L[j] > maxGreaterL) {\n maxGreaterL = L[j];\n }\n }\n }\n L[i] = 1 + maxGreaterL;\n }\n if (L[i] > maxL)\n maxL = L[i];\n }\n return maxL;\n }", "static void compute(List<Integer> slate, int[] input) {\n if (input.length == 0)\n System.out.println(slate);\n else {\n int[] copy = Arrays.copyOfRange(input, 1, input.length);\n compute(slate, copy);\n slate.add(input[0]);\n compute(slate, copy);\n slate.remove(slate.size() - 1);\n }\n }", "public long product() {\n\t\tlong result = 1;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult *= theElements[i];\n\t\t}\n\t\treturn result;\n\t}", "@Override\n public void sort(int[] a) {\n int total = 0;\n for (int i = 0; i < a.length; i++) {\n total += a[i];\n }\n a[a.length - 1] = total;\n }", "public int sum()\n {\n return sum(0,0,size);\n }", "public long sum() {\n\t\tlong result = 0;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult += theElements[i];\n\t\t}\n\t\treturn result;\n\t}", "public int getSumofElements(ArrayList<Integer> input)\n\t\t\tthrows RemoteException;", "public final synchronized void a(int i) {\n while (this.a != null && this.a.a == i) {\n SyncQueueItem syncQueueItem = this.a;\n this.a = this.a.j;\n syncQueueItem.a();\n }\n if (this.a != null) {\n SyncQueueItem syncQueueItem2 = this.a;\n SyncQueueItem a2 = syncQueueItem2.j;\n while (a2 != null) {\n SyncQueueItem a3 = a2.j;\n if (a2.a == i) {\n syncQueueItem2.j = a3;\n a2.a();\n } else {\n syncQueueItem2 = a2;\n }\n a2 = a3;\n }\n }\n }", "public static IntList incrListR(IntList L, int x) {\n if (L == null) {\n return null;\n }\n //each recursive run will create a new IntList until L.rest.rest.rest... = null meaning reaching the last item in\n //the original list\n return new IntList(L.first + x, incrListR(L.rest, x));\n }", "private static List<Integer> addOnePlus(List<Integer> input) {\n\n\t\tint size = input.size();\n\t\tinput.set(size-1, input.get(size-1)+1);//last element of input is updated/replaced by (original value + 1)\n\n\t\tfor(int i=size-1; i>0 && input.get(i)==10; i--) {\n\t\t\tinput.set(i, 0);\n\t\t\tinput.set(i-1, input.get(i-1)+1);\n\t\t}\n\n\t\tif(input.get(0) == 10) {\n\t\t\tinput.set(0, 0);\n\t\t\tinput.add(0, 1);//add 1 at index0 ,shift all elements after to right\n\t\t}\n\n\t\treturn input;//this modifies the original input\n\t}", "public static List<Integer> reverseArray(List<Integer> a) {\n int s=a.size();\n List<Integer> list=new ArrayList<Integer>(s);\n for(int i=s-1;i>=0;i--)\n {\n list.add(a.get(i));\n }\n return list;\n }", "@Override\n <T> void applyPermutation(List<Integer> perm, List<T> A) {\n Preconditions.checkArgument(perm.size() == A.size(), \"The sizes of A and P (the permutation array) differ.\");\n int n = A.size();\n for (int i = 0; i < n; ++i) {\n boolean isMin = true;\n int nextPos = perm.get(i);\n // Check if A.get(i) is the leftmost element for some some cyclic permutation in perm\n while(nextPos != i) {\n if(nextPos < i) {\n isMin = false; break;\n }\n nextPos = perm.get(nextPos);\n }\n if (isMin) {\n cyclicPermutation(A, perm, i);\n }\n }\n }", "private int m4019b() {\n Integer num = this.f4077a.get();\n if (num == null) {\n num = 0;\n }\n int intValue = num.intValue() - 1;\n if (intValue == 0) {\n this.f4077a.remove();\n } else {\n this.f4077a.set(Integer.valueOf(intValue));\n }\n return intValue;\n }", "public int removeDuplicates1(int[] A) {\n\t\tif (A == null || A.length == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tint size = 0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tif (A[i] != A[size]) {\n\t\t\t\tA[++size] = A[i];\n\t\t\t} else {\n\t\t\t\t// 其实就是等于的时候, i 接着往前跑\n\t\t\t}\n\t\t}\n\t\treturn size + 1;\n\t}", "public static int divideRecursion(List<List<Integer>> R) {\r\n\t\tList<Integer> seq = new ArrayList<Integer>();\r\n\t\tseq.add(0);\r\n\t\tseq.add(1);\r\n\t\tif(R.size() != 0) {\r\n\t\t\treturn divideRecursion(R, R.size(), seq);\r\n\t\t} else {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public static int product(List<Integer> in) {\n return in.stream()\n .reduce((i1, i2) -> i1 * i2) // Multiply each element together to get the product\n .orElse(0); // Ensure an empty list results in 0\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] a = {1,2,4,1,2};//4 = 100, 1 = 001{1^0 =1, 0^0=0, 0^1=1, 1^1=0}\r\n\t\tint result = a[0];\r\n\t\tfor(int i =1; i<a.length;i++)\r\n\t\t{\r\n\t\t\tresult=result^a[i];\r\n\t\t}\r\n\t\tSystem.out.println(\"single repeated elements is: \"+result);\r\n\t}", "public static int ombyttinger(int[] a) {\n int count=0;\n for (int i = 0; i < a.length-1; i++) {\n if (a[i] > a[i+1]) {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n count++;\n\n }\n }\n return count;\n }", "public ArrayList<ArrayList<Integer>> fourSum_02(ArrayList<Integer> a, int b) {\n\t\t//List to store the result\n\t\tArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n \tint len = a.size();\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = a.get(i) + a.get(j);\n \t\t\tif(h.containsKey(b-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(b-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add( a.get(i));\n\t \t\t\t\tl.add( a.get(j));\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != a.get(i)) && (exJ != a.get(j))) {\n\t \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(a.get(i));\n\t\t \t\t\t\tl.add(a.get(j));\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tboolean flag = true;\n\t\t \t\t\t\t\n\t\t \t\t\t\tfor(ArrayList<Integer> ll : res) {\n\t\t \t\t\t\t\tif(ll.equals(l)) {\n\t\t \t\t\t\t\t\tflag = false;\n\t\t \t\t\t\t\t\tbreak;\n\t\t \t\t\t\t\t}\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(flag == true)\n\t\t \t\t\t\t\tres.add(l);\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\th.put(sum, new Index(a.get(i), a.get(j)));\n \t\t}\n \t}\n \treturn res;\n\t}", "public void removeDuplitcate(List<Integer> a)\n\t{\n\t\tif(a==null ||a.size()==0 ) return ;\n\t\t\n\t\tHashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();\n\t\t\n\t\tfor(int i=a.size()-1;i>=0;i--)\n\t\t{\n\t\t\tif(hm.containsKey(a.get(i)))\n\t\t\t{\n\t\t\t\ta.remove(i);\n\t\t\t}\n\t\t\telse hm.put(a.get(i), 1);\n\t\t}\n\t}", "public static List<Integer> rotateArray(List<Integer> A, int B) {\n\t\tList<Integer> ret = new ArrayList<Integer>();\n\t\tint j = 0;\n\t\tint k = 0;\n\t\tint gap = B;\n\t\tif (B > A.size()) {\n\t\t\tgap = gap - A.size();\n\t\t\twhile (gap > A.size()) {\n\t\t\t\tgap = gap - A.size();\n\t\t\t}\n\t\t}\n\t\t// logger.info(\"A.size() =\" + A.size() + \", gap=\" + gap);\n\t\tfor (int i = 0; i < A.size(); i++) {\n\t\t\tk = i + gap;\n\t\t\tif (k > (A.size() - 1)) {\n\t\t\t\tk = j++;\n\t\t\t}\n\t\t\tret.add(A.get(k));\n\t\t}\n\t\treturn ret;\n\t}", "public static void stepOne(ArrayList<Integer> list) {\n\t\t\n\t\t//keep track of number of times list is passed through\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint newNum = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//for every other number beginning with second from the right\n\t\t\t//double number -- if two digit number results, add digits together\n\t\t\tif (passNumber % 2 == 0) {\n\t\t\t\n\t\t\t\tnewNum *= 2;\n\t\t\t\t\n\t\t\t\t//add digits together if two digit number \n\t\t\t\tif (newNum > 9) {\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\n\t\t\t\t\twhile(newNum > 0) {\n\t\t\t\t\t\tsum = sum + newNum % 10;\n\t\t\t\t\t\tnewNum = newNum / 10;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tnewNum = sum;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//replace number in list with new number\n\t\t\t\tlist.set(i, newNum);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public double get(){\n sum = 0;\n if(hasFilled){\n for(int j=0; j<list.length; j++)\n {\n sum += list[j];\n }\n \n return sum/(double)list.length;\n }\n else{\n for(int j = 0; j < index;j++){\n sum += list[j];\n }\n return sum/(double)index;\n }\n }", "public static void rearrange(int[] A)\r\n\t{\r\n\t\t// create an empty map to store frequency of each element\r\n\t\t// present in the input array\r\n\t\tMap<Integer, Integer> freq = new HashMap<>();\r\n\r\n\t\t// traverse the input array and update frequency of each element\r\n\t\tfor (int i: A) {\r\n\t\t\tfreq.putIfAbsent(i, 0);\r\n\t\t\tfreq.put(i, freq.get(i) + 1);\r\n\t\t}\r\n\r\n\t\tfor (int i: A)\r\n\t\t{\r\n\t\t\t// if i exists in the map (first occurrence of i)\r\n\t\t\tif (freq.containsKey(i))\r\n\t\t\t{\r\n\t\t\t\t// print i n times where n = freq[i]\r\n\t\t\t\tint n = freq.get(i);\r\n\t\t\t\twhile (n-- != 0) {\r\n\t\t\t\t\tSystem.out.print(i + \" \");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// delete the element from the map so it would not\r\n\t\t\t\t// get processed again\r\n\t\t\t\tfreq.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static int foo(int a, int b) {\n int i;\n\n //for(i = 0; i < c.length; i++ ) {\n // c[i] = 0;\n //}\n\n if(a < 0) { \n return a+b;\n } else {\n return 0;\n }\n }", "private static void missRepeat1(int[] a) {\n\t\tint miss = -1;\n\t\tint repeat = -1;\n\t\tint[] b = new int[a.length];\n\t\t\n\t\tfor(int x : a) {\n\t\t\tif(b[x-1] != 0) {\n\t\t\t\trepeat = x;\n\t\t\t}\n\t\t\tb[x-1]++;\n\t\t}\n\t\t\n\t\tfor(int i=0; i<b.length; i++) {\n\t\t\tif(b[i]==0) {\n\t\t\t\tmiss = i+1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(repeat + \" \" + miss);\n\t}", "public Integer mutate(int index);", "private int syuneri_gumar(ArrayList<Integer> syun) {\n int summa = 0;\n for (int i = 0; i < syun.size(); i++)\n summa += syun.get(i);\n return summa;\n }", "public static int sum(int[] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tsum += a[i];\r\n\t\t}\r\n\t\treturn sum;\r\n\t}", "public long getSum()\n {\n long sum = 0;\n\n for(int i = 0; i < integerList.length; i++)\n {\n sum = sum + integerList[i];\n }\n\n return sum;\n }", "private static void __exercise36(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = i + StdRandom.uniform(N - i);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public int add(int... i) {\n\t\tint ret = 0;\n\t\tfor(int x : i) {\n\t\t\tret += x;\n\t\t}\n\t\treturn ret;\n\t}", "public static List<List<Integer>> findMatrix(List<List<Integer>> a) {\n List<List<Integer>> res = new ArrayList<>();\n for (int i = 0; i < a.size(); i++) {\n List<Integer> rowi = a.get(i);\n List<Integer> temp = new ArrayList<>();\n int prev = 0;\n for (int j = 0; j < rowi.size(); j++) {\n if (i == 0) {\n int curr = rowi.get(j);\n temp.add(prev + curr);\n prev += curr;\n } else {\n int curr = rowi.get(j);\n int lastSum = res.get(i - 1).get(j);\n temp.add(prev + curr + lastSum);\n prev += curr;\n }\n }\n res.add(temp);\n }\n return res;\n }", "public void exercise_4_31()\n {\n int index = 0;\n int sum = 0;\n \n while (index < 10) {\n index++;\n sum += index;\n }\n System.out.println(sum);\n }", "public static int sumNumberRec(int i)\r\n\t{\n\t\tif (i == 0){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn (i % 10) + sumNumberRec( i / 10);\r\n\t\t}\r\n\t}", "public static IntList incrList(IntList L, int x) {\n /* Your code here. */\n IntList newList = null;\n for (int i = L.size() - 1; i > -1; i--) { //construct the newList backwardly, iteratively\n newList = new IntList(L.get(i) + x, newList);\n }\n return newList;\n }", "public static int stepThree(ArrayList<Integer> list) {\n\t\t\n\t\tint sum = 0;\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint num = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//sum every other number beginning with first from the right\n\t\t\tif (passNumber % 2 == 1) {\n\t\t\t\tsum += num;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public final void mod() {\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (topMostValue > 0) {\n\t\t\t\tpush(secondTopMostValue % topMostValue);\n\t\t\t}\n\t\t}\n\t}", "@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.List, java.util.AbstractList\n public final /* synthetic */ Long remove(int i) {\n zzpu();\n zzci(i);\n long[] jArr = this.zzbqi;\n long j = jArr[i];\n int i2 = this.size;\n if (i < i2 - 1) {\n System.arraycopy(jArr, i + 1, jArr, i, (i2 - i) - 1);\n }\n this.size--;\n ((AbstractList) this).modCount++;\n return Long.valueOf(j);\n }", "public int trap(final int[] A) \n {\n int res = 0;\n for(int i=1; i<A.length-1; i++)\n {\n int left = A[i];\n for(int j=0; j<i; j++)\n {\n left = Math.max(A[j], left);\n }\n \n int right = A[i];\n for(int j=i+1; j<A.length; j++)\n {\n right = Math.max(A[j], right);\n }\n \n res+=Math.min(left, right)- A[i];\n }\n return res;\n }", "public long reversePairs(int[] A) {\n // write your code here\n if(A == null || A.length < 2){\n return 0;\n }\n long p = 0L;\n\n for(int i = 0; i < A.length; i++){\n for(int j = i+1; j < A.length; j++){\n if(A[i] > A[j]){\n p++;\n }\n }\n }\n return p;\n }", "public int Rear() {\n if(isEmpty()) return -1;\n return l.get(tail);\n }", "public int product() {\n // You'll need to replace this code with something\n // else to make product() work; this is just to make\n // things compile while you work on sum()\n return 1;\n }" ]
[ "0.6037224", "0.54052216", "0.53711635", "0.5364657", "0.5350913", "0.5340524", "0.5289646", "0.5247846", "0.5184684", "0.5115846", "0.509741", "0.5080157", "0.50783485", "0.4998411", "0.49600595", "0.48838308", "0.48704815", "0.48451123", "0.4824658", "0.48144388", "0.47977772", "0.47744605", "0.47681266", "0.4764753", "0.4763657", "0.47587982", "0.47542042", "0.47518402", "0.47480002", "0.47475892", "0.47415", "0.47384045", "0.4730831", "0.47240674", "0.47170612", "0.4703972", "0.46907312", "0.46897358", "0.46885395", "0.46866563", "0.46811935", "0.4670823", "0.46684524", "0.46684524", "0.46662453", "0.4659065", "0.46562743", "0.46412197", "0.46392643", "0.46365473", "0.46347302", "0.46323645", "0.463043", "0.4621179", "0.4620564", "0.46133536", "0.45996392", "0.45981193", "0.45944405", "0.45903623", "0.45894003", "0.4587746", "0.45809665", "0.45806864", "0.4569635", "0.4565045", "0.4564682", "0.45611486", "0.4559845", "0.45501393", "0.45495972", "0.45385006", "0.45370013", "0.45332366", "0.45313558", "0.45163995", "0.45149004", "0.45109868", "0.45023438", "0.45011166", "0.45001563", "0.44994262", "0.4494821", "0.44927093", "0.44867134", "0.44841698", "0.44806677", "0.44802597", "0.4479339", "0.44757655", "0.4470198", "0.4463888", "0.44620287", "0.44568253", "0.4455698", "0.4444375", "0.44441912", "0.444407", "0.44383025", "0.44278035" ]
0.5256041
7
Reductum 2. L is a list of length 2 or more. LP=RED(RED(L)).
public static <C> LIST<C> RED2(LIST<C> L, int i) { LIST<C> LP = null; if ( ! isNull( L ) ) { LP = new LIST<C>( L.list.subList(2,L.list.size()) ); } return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public static <C> LIST<C> RED3(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(3,L.list.size()) );\n }\n return LP;\n }", "public static void setColor(ArrayList<LaverieButton> L){\n int n = LABEL.size();\n for (int i=0; i<n; i++){\n switch (LABEL.get(i)){\n case \"empty\":\n L.get(i).setBackgroundColor(Color.GREEN);\n break;\n case \"full\":\n L.get(i).setBackgroundColor(Color.RED);\n break;\n case \"reserved\":\n L.get(i).setBackgroundColor(Color.GRAY);\n break;\n }\n }\n }", "private void changeColor(List<Node> listToColor, Color red) {\n\t\t\tfor(Node n: listToColor)\n\t\t\t\tn.color = red;\n\t }", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "public abstract HSLColor toHSLColor();", "public int colorVertices();", "public int getRed() {\n\t\treturn 100;\n\t}", "public abstract void tellColorList(ArrayList<String> colors);", "private Color calcDiffusiveComp(double kd, Vector normal, Vector l, Color lightIntensity){\n double kdNdotL = kd * Math.abs(normal.dotProduct(l));\n\n int red = Math.min(255,(int)(kdNdotL * lightIntensity.getRed()));\n\n int green = Math.min(255,(int)(kdNdotL* lightIntensity.getGreen()));\n\n int blue = Math.min(255,(int)(kdNdotL * lightIntensity.getBlue()));\n\n return new Color(red, green, blue);\n }", "public int getColor();", "public int getColor();", "int getRed(int x, int y);", "public void changeEvenToBlack()\n {\n for (int i = 0; i < sqList.size(); i += 2)\n {\n sqList.get(i).setColor(\"black\");\n }\n }", "public String getColorString() {\n return left.toString() + \", \" + right.toString();\n }", "public HSLColor(float h, float s, float l) {\n\t\tthis.color = toColorObject(h, s, l);\n\t}", "@Override\r\n public Llama.Color getColor() {\r\n return color;\r\n }", "public void init_colors_red(){\t\n\t\tColor c1 = new Color(0,0,0);\t\t// BLACK\t\t\n\t\tColor c2 = new Color(255,0,0);\t// RED\n\t\tColor c3 = new Color(255,170,0);\t// ORANGE\n\t\tColor c4 = new Color(255,255,255);\t// WHITE\n\t\t\n\t\tinit_colors(c1,c2,c3,c4);\n\t}", "public ListVisualiser(SLList l) { \n // Assign SLList pum with argument SLList l\n pum = l;\n }", "String getColor();", "public void changeEvenToBlack(){\r\n for(int i = 0; i<sqList.size(); i++){\r\n if(i % 2==0){\r\n sqList.get(i).setColor(\"black\");\r\n } \r\n }\r\n }", "private void red(){\n\t\tthis.arretes_fR();\n\t\tthis.coins_fR();\n\t\tthis.coins_a1R();\n\t\tthis.coins_a2R();\n\t\tthis.aretes_aR();\n\t\tthis.cube[13] = \"R\";\n\t}", "public ArrayList<String> getColorList()\n {\n \treturn colors;\n }", "@Override\n\tpublic String howtocolor() {\n\t\treturn \"Color all four sides\";\n\t}", "private static List<Ansi>colorSquare(List<String> squareOfStrings, SquareLM squareLM) throws IllegalArgumentException{\n List<Ansi> squareAnsi = new ArrayList<>();\n Ansi.Color background;\n if(squareLM == null){\n background = BLACK;\n }\n else{\n if(squareLM.getIdRoom() == GeneralInfo.RED_ROOM_ID){\n background = RED;\n }\n else if(squareLM.getIdRoom() == GeneralInfo.BLUE_ROOM_ID){\n background = BLUE;\n }\n else if(squareLM.getIdRoom() == GeneralInfo.YELLOW_ROOM_ID){\n background = YELLOW;\n }\n else if(squareLM.getIdRoom() == GeneralInfo.GRAY_ROOM_ID){\n background = WHITE;\n }\n else if(squareLM.getIdRoom() == GeneralInfo.PURPLE_ROOM_ID){\n background = MAGENTA;\n }\n else if(squareLM.getIdRoom() == GeneralInfo.GREEN_ROOM_ID){\n background = GREEN;\n }\n else {\n throw new IllegalArgumentException(\"The idRoom does not correspond to the ones considered available for the map.\");\n }\n }\n for(String string : squareOfStrings){\n squareAnsi.add(ansi().fg(BLACK).bg(background).a(string).reset());\n }\n return squareAnsi;\n }", "@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}", "RGB getNewColor();", "public int getHslColor()\n {\n return _hslColor;\n }", "private void resolveRed(Position<Entry<K, V>> p) {\n Position<Entry<K, V>> parent = parent(p);\n if (isRed(parent)) {\n Position<Entry<K, V>> uncle = sibling(parent);\n if (isBlack(uncle)) { // Case 1: mis-shaped 4-node\n Position<Entry<K, V>> middle = restructure(p); // trinode restructuring\n makeBlack(middle);\n makeRed(left(middle));\n makeRed(right(middle));\n } else { // Case 2: overfill 5-node\n makeBlack(parent);\n makeBlack(uncle);\n Position<Entry<K, V>> grand = parent(parent);\n if (!isRoot(grand)) {\n makeRed(grand);\n resolveRed(grand);\n }\n }\n }\n }", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "public void changeOddToBlack()\n {\n for (int i = 1; i < sqList.size(); i += 2)\n {\n sqList.get(i).setColor(\"black\");\n }\n }", "public final int getR() {\n\t\treturn red;\n\t}", "RGB getOldColor();", "private static <K, V> Node<K, V> makeRightRed(@Var Node<K, V> current) {\n\n current = colorFlip(current);\n if (Node.isRed(current.left.left)) {\n current = rotateClockwise(current);\n current = colorFlip(current);\n }\n return current;\n }", "@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }", "public RegionCreator lore(List<String> lore)\n\t{\n\t\tfor(String str : lore)\n\t\t{\n\t\t\tthis.lore.add(StringUtil.colorize(str));\n\t\t}\n\t\treturn this;\n\t}", "public LightBulb(int red, int green,int blue){\r\n _switchedOn=false;\r\n\t\tif ((red < 0)||(red > 255)||(green < 0)||(green > 255)||(blue < 0)\r\n\t\t\t\t||(blue > 255)){\r\n\t\t\t_color = new RGBColor();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t_color = new RGBColor(red, green, blue);\r\n\t\t}\r\n\t\r\n }", "public LinkedList<Integer> getNextColorList() {\n\t\treturn nextColorList;\n\t}", "private Color generateColor() {\r\n\t\tint length = nameColor.size();\r\n\t\tif(length == 0) return colorArray[0];\r\n\t\t\r\n\t\tColor lastColor = nameColor.get(length-1);\r\n\t\tint lastColorIndex = 0;\r\n\t\tfor(int i = 0; i<colorArray.length; i++) {\r\n\t\t\tif(lastColor == colorArray[i]) {\r\n\t\t\t\tlastColorIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tColor curColor = colorArray[(lastColorIndex+1)%3];\r\n\t\treturn curColor;\r\n\t}", "public static String red(String warning){\n return ANSI_RED + warning + ANSI_RED;\n }", "private void lineColor() {\n\n\t}", "public String toStringPrologFormatListLo()\r\n\t{\n\t\t\r\n\t\tString output = \"[\";\r\n\r\n\t\tfor (Location lo : this.listLocation)\r\n\t\t{\r\n\t\t\toutput += lo.LocationToStringPrologFormat();\r\n\t\t\toutput += \",\";\r\n\t\t}\r\n\t\toutput = output.substring(0, output.length()-1);\r\n\t\toutput += \"]\";\r\n\t\treturn output;\t\r\n\t}", "public Color recupColor(int nb){\r\n\t\tColor color;\r\n\t\tif(nb == 1){\r\n\t\t\tcolor = Config.colorJ1;\r\n\t\t}\r\n\t\telse if(nb == 2){\r\n\t\t\tcolor = Config.colorJ2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tcolor =\tConfig.colorVide;\r\n\t\t}\r\n\t\treturn color;\r\n\t}", "public abstract BossColor getColor();", "private ArrayList<Colours> setColour(){\n\t\tArrayList<Colours> list = new ArrayList<Colours>();\n\t\tlist.add(Colours.RED);\n\t\tlist.add(Colours.BLUE);\n\t\tlist.add(Colours.YELLOW);\n\t\tlist.add(Colours.PINK);\n\t\tlist.add(Colours.GREEN);\n\t\tlist.add(Colours.PURPLE);\n\t\treturn list;\n\t}", "public static void main(String[] args) {\n\n\t\tLinkedList<String> color = new LinkedList<String>();\n\t color.add(\"red\");\n\t color.add(\"green\");\n\t color.add(\"blue\");\n\t color.add(\"orange\");\n\t System.out.println(color);\n\t \n\t//1 color.addFirst(\"purple\"); adding First \n\t//1 System.out.println(color);\n\t \n\t//2 color.addLast(\"yellow\"); adding last\n\t //2 System.out.println(color);\n\t \n\t /* 3 color.removeFirst();\n\t System.out.println(color); remove first\n\t color.removeLast();\n\t System.out.println(color); remove last*/\n\t \n\t \n\t}", "private static int changeEven(int colorRed) {\n if (colorRed % 2 != 0)\n --colorRed;\n return colorRed;\n }", "default Color getColor() {\r\n\t\treturn Color.RED;\r\n\t}", "private Color calcDiffusive(double kd, Vector l, Vector n, Color lightIntensity)\r\n\r\n\t{\r\n\t\treturn lightIntensity.scale(Math.abs(l.dotProduct(n)) * kd);\r\n\t}", "public void colorRedLastLevel(Node root,int level){\n\t\tif(level==1){\n\t\t\troot.colour = \"Red\";\n\t\t}else if(level>1){\n\t\t\tcolorRedLastLevel(root.left,level-1);\n\t\t\tcolorRedLastLevel(root.right,level-1);\n\t\t}\n\t\t\n\t}", "private static Color modulateLuminanace(Color c, int lumMod, int lumOff) {\n Color color;\n if (lumOff > 0) {\n color = new Color(\n (int) (Math.round((255 - c.getRed()) * (100.0 - lumMod) / 100.0 + c.getRed())),\n (int) (Math.round((255 - c.getGreen()) * lumOff / 100.0 + c.getGreen())),\n (int) (Math.round((255 - c.getBlue()) * lumOff / 100.0 + c.getBlue())),\n c.getAlpha()\n );\n } else {\n color = new Color(\n (int) (Math.round(c.getRed() * lumMod / 100.0)),\n (int) (Math.round(c.getGreen() * lumMod / 100.0)),\n (int) (Math.round(c.getBlue() * lumMod / 100.0)),\n c.getAlpha()\n );\n }\n return color;\n }", "public static List<Integer> createColors(Resources r, int[] colors) {\n\n\t\tList<Integer> result = new ArrayList<Integer>();\n\n\t\tfor (int i : colors) {\n\t\t\tresult.add(r.getColor(i));\n\t\t}\n\n\t\treturn result;\n\t}", "public Color4 getEffectColorAdd();", "public String listOfColors() {\r\n\t\t StringBuilder sb = new StringBuilder();\r\n for (Iterator<Color> it = colors.iterator(); it.hasNext();){\r\n\t\t\t Color c = (Color) it.next();\r\n \t sb.append(c.toString() + NL);\r\n }\r\n return sb.toString();\r\n }", "@Override\r\n\tpublic void tellColorList(ArrayList<String> colors) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t\tsuper.setColorList(colors);\r\n\t}", "public MyRenderer(List<Integer> list){\n\t\tcorrectList = list;\n\t}", "public static void main(String[] args) {\n\t\tArrayList<String> list1=new ArrayList<String> ();\r\n\t\tlist1.add(\"Black\");\r\n\t\tlist1.add(\"White\");\r\n\t\tlist1.add(\"Red\");\r\n\t\tlist1.add(\"yellow\");\r\n\tSystem.out.println(list1.get(2));\r\n\r\n\t}", "@Override\r\n public final void draw(final Line l, final BufferedImage paper) {\n int x1 = l.getxStart();\r\n int x2 = l.getxFinish();\r\n int y1 = l.getyStart();\r\n int y2 = l.getyFinis();\r\n\r\n if (x1 == x2) {\r\n if (y1 < y2) {\r\n for (int i = y1; i <= y2; i++) {\r\n if (checkBorder(x1, i, paper)) {\r\n paper.setRGB(x1, i, l.getColor().getRGB());\r\n }\r\n }\r\n } else {\r\n for (int i = y2; i <= y1; i++) {\r\n if (checkBorder(x1, i, paper)) {\r\n paper.setRGB(x1, i, l.getColor().getRGB());\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n \r\n int deltaX = Math.abs(x2 - x1);\r\n int deltaY = Math.abs(y2 - y1);\r\n int s1 = (int) (Math.signum(x2 - x1) * 1);\r\n int s2 = (int) (Math.signum(y2 - y1) * 1);\r\n\r\n boolean interchanged = false;\r\n if (deltaY > deltaX) {\r\n int aux = deltaX;\r\n deltaX = deltaY;\r\n deltaY = aux;\r\n interchanged = true;\r\n }\r\n\r\n int error = 2 * deltaY - deltaX;\r\n\r\n for (int i = 0; i <= deltaX; i++) {\r\n if (x1 >= 0 && y1 >= 0 && x1 < paper.getWidth() && y1 < paper.getHeight()) {\r\n\r\n paper.setRGB(x1, y1, l.getColor().getRGB());\r\n }\r\n while (error > 0) {\r\n if (interchanged) {\r\n x1 = x1 + s1;\r\n } else {\r\n y1 = y1 + s2;\r\n }\r\n error = error - 2 * deltaX;\r\n }\r\n\r\n if (interchanged) {\r\n y1 = y1 + s2;\r\n } else {\r\n x1 = x1 + s1;\r\n }\r\n\r\n error = error + 2 * deltaY;\r\n }\r\n }", "ExprListRule createExprListRule();", "public String getRedArrows() {\n return \" \\n\" +\n \" \\n\" +\n \" RRRRRRRR \\n\" +\n \" RRRRRRRR \\n\" +\n \" RRRRRRRR \\n\" +\n \" RR RRRRRRRR RR \\n\" +\n \" RRRRRRRRRRRRRR \\n\" +\n \" RRRRRRRRRRRR \\n\" +\n \" RRRRRRRRRR \\n\" +\n \" RRRRRRRR \\n\" +\n \" RRRRRR \\n\" +\n \" RRRR \\n\";\n\n }", "abstract Color linkColor(String link);", "private List<String> getToolTipColour(ItemStack stack) {\n List<String> list = removeEmptyLines(getTooltip(this.mc.player, stack));\n\n for (int i = 0; i < list.size(); ++i)\n {\n if (i == 0) {\n list.set(i, stack.getRarity().rarityColor + list.get(i));\n } else if (i == ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows - 1 && list.size() > ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows && ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsDots) {\n list.set(i, TextFormatting.GRAY + \"...\" + TextFormatting.RESET);\n } else if (stack.getItem() instanceof ItemShulkerBox && list.size() == 7 && i == ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows - 1) {\n list.set(i, TextFormatting.GRAY + \"\" + TextFormatting.ITALIC + TextFormatting.getTextWithoutFormattingCodes(new TextComponentTranslation(\"container.shulkerBox.more\", list.size() - ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows + getShulkerBoxExcess(list.get(6))).getFormattedText()) + TextFormatting.RESET);\n } else if (i == ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows - 1 && list.size() > ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows) {\n list.set(i, TextFormatting.GRAY + \"\" + TextFormatting.ITALIC + TextFormatting.getTextWithoutFormattingCodes(new TextComponentTranslation(\"container.shulkerBox.more\", list.size() - ConfigHandler.heldItemTooltipsConfig.heldItemTooltipsRows + 1).getFormattedText()) + TextFormatting.RESET);\n } else {\n list.set(i, TextFormatting.GRAY + list.get(i) + TextFormatting.RESET);\n }\n }\n\n return list;\n }", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "public int getRed() {\n return this.red;\n }", "java.awt.Color getColor();", "Rule ConstList() {\n return Sequence(\n \"[ \",\n // We can't use the ConstValue definition here because that definition\n // uses a FirstOf expression (which is the proper method), but we cannot\n // pass Rules with potentially empty values (like FirstOf...) to the\n // ZeroOrMore matcher\n Sequence(\n ZeroOrMore(Sequence(IntConstant(), Optional(ListSeparator()),\n actions.pushConstListItemNode(IntConstNode.class))),\n ZeroOrMore(Sequence(DoubleConstant(), Optional(ListSeparator()),\n actions.pushConstListItemNode(DoubleConstNode.class))),\n ZeroOrMore(Sequence(Literal(), Optional(ListSeparator()),\n actions.pushConstListItemNode(LiteralNode.class))),\n ZeroOrMore(Sequence(Identifier(), Optional(ListSeparator()),\n actions.pushConstListItemNode(IdentifierNode.class))),\n ZeroOrMore(Sequence(ConstList(), Optional(ListSeparator()),\n actions.pushConstListItemNode(ConstListNode.class))),\n ZeroOrMore(Sequence(ConstMap(), Optional(ListSeparator()),\n actions.pushConstListItemNode(ConstMapNode.class)))\n //ZeroOrMore(Sequence(DoubleConstant(), Optional(ListSeparator()))),\n ),\n \"] \",\n actions.pushConstListNode());\n }", "public ColorList () { \n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint[] nums = {1, 0, 1};\r\n\t\tsortColors(nums);\r\n\t\tfor ( int i : nums) {\r\n\t\t\tSystem.out.print(i + \" \");\r\n\t\t}\r\n\t}", "public String getColorString();", "public void Color() {\n\t\t\r\n\t}", "@Override\n\tpublic void Red() {\n\t\tSystem.out.println(\"Red Light\");\n\t\t\n\t}", "public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}", "Color decodeColor(String p) {\n StringTokenizer st = new StringTokenizer(p, \",\");\n if (st.countTokens() > 4) {\n return null;\n }\n int[] d = new int[4];\n int tokens = 0;\n while (st.hasMoreTokens()) {\n d[tokens] = Integer.parseInt(st.nextToken().trim());\n tokens++;\n }\n if (tokens == 4) {\n return new Color(d[0], d[1], d[2], d[3]);\n } else {\n return new Color(d[0], d[1], d[2]);\n }\n }", "protected void whatColorOfArrows()\n\t{\n\t}", "public Color getColor(){\r\n return color_rey;\r\n }", "public void setRed(final int red) {\n\t\tthis.r = red;\n\t}", "public LightBulb(RGBColor color){\r\n _color = new RGBColor(color);\r\n }", "public int getColor(){\r\n\t\treturn color;\r\n\t}", "Rule ConstListItem() {\n return Sequence(\n ConstValue(),\n Optional(ListSeparator()));\n }", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "protected void updateColorList(LinkedList<Integer> clonedList, int color) {\n\t\t// Update Color List in vertex\n\t\tif (this.getFamilyColorList().contains(color)) {\n\t\t\tthis.getFamilyColorList().remove((Object) color);\n\t\t\tfor (Integer i : clonedList) {\n\t\t\t\tthis.getFamilyColorList().add(i);\n\t\t\t}\n\t\t\tif (this.getFamily() != null) {\n\t\t\t\tthis.getFamily().updateFamilyColorList(clonedList, color);\n\t\t\t}\n\t\t}\n\t}", "public int getColor() {\n \t\treturn color;\n \t}", "private static android.content.res.ColorStateList inflate(android.content.res.Resources r21, org.xmlpull.v1.XmlPullParser r22, android.util.AttributeSet r23, android.content.res.Resources.Theme r24) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {\n /*\n r0 = r23\n int r1 = r22.getDepth()\n r2 = 1\n int r1 = r1 + r2\n r3 = 20\n int[][] r3 = new int[r3][]\n int r4 = r3.length\n int[] r4 = new int[r4]\n r5 = 0\n L_0x0010:\n int r6 = r22.next()\n r7 = r6\n if (r6 == r2) goto L_0x00de\n int r6 = r22.getDepth()\n r9 = r6\n if (r6 >= r1) goto L_0x002a\n r6 = 3\n if (r7 == r6) goto L_0x0022\n goto L_0x002a\n L_0x0022:\n r10 = r21\n r11 = r24\n r17 = r1\n goto L_0x00e4\n L_0x002a:\n r6 = 2\n if (r7 != r6) goto L_0x00d3\n if (r9 > r1) goto L_0x00d3\n java.lang.String r6 = r22.getName()\n java.lang.String r10 = \"item\"\n boolean r6 = r6.equals(r10)\n if (r6 != 0) goto L_0x0043\n r10 = r21\n r11 = r24\n r17 = r1\n goto L_0x00d9\n L_0x0043:\n int[] r6 = androidx.core.R.styleable.ColorStateListItem\n r10 = r21\n r11 = r24\n android.content.res.TypedArray r6 = obtainAttributes(r10, r11, r0, r6)\n int r12 = androidx.core.R.styleable.ColorStateListItem_android_color\n r13 = -65281(0xffffffffffff00ff, float:NaN)\n int r12 = r6.getColor(r12, r13)\n r13 = 1065353216(0x3f800000, float:1.0)\n int r14 = androidx.core.R.styleable.ColorStateListItem_android_alpha\n boolean r14 = r6.hasValue(r14)\n if (r14 == 0) goto L_0x0067\n int r14 = androidx.core.R.styleable.ColorStateListItem_android_alpha\n float r13 = r6.getFloat(r14, r13)\n goto L_0x0075\n L_0x0067:\n int r14 = androidx.core.R.styleable.ColorStateListItem_alpha\n boolean r14 = r6.hasValue(r14)\n if (r14 == 0) goto L_0x0075\n int r14 = androidx.core.R.styleable.ColorStateListItem_alpha\n float r13 = r6.getFloat(r14, r13)\n L_0x0075:\n r6.recycle()\n r14 = 0\n int r15 = r23.getAttributeCount()\n int[] r2 = new int[r15]\n r16 = 0\n r8 = r16\n L_0x0083:\n if (r8 >= r15) goto L_0x00b4\n r17 = r1\n int r1 = r0.getAttributeNameResource(r8)\n r18 = r6\n r6 = 16843173(0x10101a5, float:2.3694738E-38)\n if (r1 == r6) goto L_0x00ad\n r6 = 16843551(0x101031f, float:2.3695797E-38)\n if (r1 == r6) goto L_0x00ad\n int r6 = androidx.core.R.attr.alpha\n if (r1 == r6) goto L_0x00ad\n int r6 = r14 + 1\n r19 = r6\n r6 = 0\n boolean r20 = r0.getAttributeBooleanValue(r8, r6)\n if (r20 == 0) goto L_0x00a8\n r6 = r1\n goto L_0x00a9\n L_0x00a8:\n int r6 = -r1\n L_0x00a9:\n r2[r14] = r6\n r14 = r19\n L_0x00ad:\n int r8 = r8 + 1\n r1 = r17\n r6 = r18\n goto L_0x0083\n L_0x00b4:\n r17 = r1\n r18 = r6\n int[] r1 = android.util.StateSet.trimStateSet(r2, r14)\n int r2 = modulateColorAlpha(r12, r13)\n int[] r4 = androidx.core.content.res.GrowingArrayUtils.append((int[]) r4, (int) r5, (int) r2)\n java.lang.Object[] r6 = androidx.core.content.res.GrowingArrayUtils.append((T[]) r3, (int) r5, r1)\n r3 = r6\n int[][] r3 = (int[][]) r3\n int r5 = r5 + 1\n r1 = r17\n r2 = 1\n goto L_0x0010\n L_0x00d3:\n r10 = r21\n r11 = r24\n r17 = r1\n L_0x00d9:\n r1 = r17\n r2 = 1\n goto L_0x0010\n L_0x00de:\n r10 = r21\n r11 = r24\n r17 = r1\n L_0x00e4:\n int[] r1 = new int[r5]\n int[][] r2 = new int[r5][]\n r6 = 0\n java.lang.System.arraycopy(r4, r6, r1, r6, r5)\n java.lang.System.arraycopy(r3, r6, r2, r6, r5)\n android.content.res.ColorStateList r6 = new android.content.res.ColorStateList\n r6.<init>(r2, r1)\n return r6\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.core.content.res.ColorStateListInflaterCompat.inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources$Theme):android.content.res.ColorStateList\");\n }", "public void red() {\n g2.setPaint(Color.red);\r\n }", "public static void main(String[] args) {\n String []str={\"A\",\"B\",\"C\"};\r\n \r\n String [][]str1={{\"A\",\"B\",\"3\"},{\"B\",\"C\",\"4\"},{\"A\",\"C\",\"5\"}};\r\n\t\tListUDirected lud=new ListUDirected(str,str1);\r\n\t\tSystem.out.println(\"以下是有向图的邻接表\");\r\n\t\tlud.printList();\r\n\t\t\r\n\t\t\r\n\t\t String [][]str2={{\"A\",\"B\",\"2\"},{\"B\",\"A\",\"2\"},{\"B\",\"C\",\"3\"},{\"C\",\"B\",\"3\"},{\"A\",\"C\",\"4\"},{\"C\",\"A\",\"4\"}};\r\n\t\tListUDirected lud2=new ListUDirected(str,str2);\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"以下是无向图的邻接表\");\r\n\t\tlud2.printList();\r\n\t\t\r\n\t\t \r\n\t}", "public Color getLineColor();", "public static void main(String[] args) {\n\t\tint[] nums = {1,0,2};\n\t\tsortColors(nums);\n\t\tfor(int j : nums){\n\t\t\tSystem.out.print(j + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\n public String getTokenColorLetter() {\n return \"R\";\n }", "@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}", "private void initRelationsColors() {\n for (int i=0;i<20;i++) {\n int r = 255-(i*12);\n int gb = 38-(i*2);\n relationsC[i] = newColor(r,gb,gb);\n }\n // do green.. 20-39, dark to bright\n for (int i=0;i<20;i++) {\n int g = 17+(i*12);\n int rb = i*2;\n relationsC[20+i] = newColor(rb,g,rb);\n }\n }", "private static void printColor() {\n\t\tfor (int i = 0; i < colors.length; i++) {\n\t\t\tSystem.out.print(String.format(\"%d for %s\", i + 1, colors[i]));\n\t\t\tif (i != colors.length - 1) {\n\t\t\t\tSystem.out.print(\", \"); // Separate colors with comma\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\")\"); // Print a new line for the last color option\n\t\t\t}\n\t\t}\n\t}", "public float getRed() {\n return red;\n }", "public void alternateRGB(int min, int number, int r1, int g1, int b1, int r2, int g2, int b2) {\n int max = min + number;\n for (int i = min; i < (max); i = i + 2) {\n m_ledBuffer.setRGB(i, r1, g1, b1);\n }\n\n for (int j = min + 1; j < (max); j = j + 2) {\n m_ledBuffer.setRGB(j, r2, g2, b2);\n }\n m_led.setData(m_ledBuffer);\n }", "private static IndependentValidator createColorListValidator() {\n HashMap messageKeyMappings = new HashMap(1);\n messageKeyMappings.put(FaultTypes.INVALID_COLOR,\n \"ColorListSelectionDialog.invalidColor\");\n ValidationMessageBuilder builder =\n new ValidationMessageBuilder(\n ControlsMessages.getResourceBundle(),\n messageKeyMappings,\n null);\n Validator validator = new ColorValidator(NamedColor.getAllColors());\n return new IndependentValidator(validator, builder);\n }", "private static <K, V> Node<K, V> makeLeftRed(@Var Node<K, V> current) {\n\n current = colorFlip(current);\n if (Node.isRed(current.right.left)) {\n Node<K, V> newRight = rotateClockwise(current.right);\n current =\n new Node<>(\n current.getKey(), current.getValue(), current.left, newRight, current.getColor());\n\n current = rotateCounterclockwise(current);\n current = colorFlip(current);\n }\n return current;\n }" ]
[ "0.6483622", "0.62686694", "0.6068899", "0.5727168", "0.5691414", "0.5511055", "0.54217637", "0.53945816", "0.53456753", "0.526925", "0.5266473", "0.52168024", "0.52168024", "0.52144957", "0.5169757", "0.51426494", "0.5140016", "0.51361877", "0.51347154", "0.51258534", "0.5120564", "0.5101752", "0.50778645", "0.50775987", "0.5064449", "0.5055111", "0.50501424", "0.50456816", "0.50414664", "0.5036662", "0.50067794", "0.49878582", "0.49870586", "0.4985229", "0.49807867", "0.49766535", "0.49755675", "0.49747914", "0.49703136", "0.49651784", "0.49618772", "0.49596965", "0.49529812", "0.49524963", "0.49461627", "0.49270365", "0.4923722", "0.4922058", "0.49108455", "0.4906571", "0.48897186", "0.4882819", "0.48820737", "0.48818803", "0.48740277", "0.48668745", "0.485878", "0.48551568", "0.48488212", "0.4846594", "0.48409042", "0.4838176", "0.48212078", "0.48150796", "0.48150796", "0.48150796", "0.48150796", "0.48150796", "0.48146597", "0.48122522", "0.48079836", "0.4803797", "0.4794038", "0.47905833", "0.47894642", "0.47853762", "0.4783935", "0.47759584", "0.47749278", "0.47699878", "0.47698164", "0.47506958", "0.4743853", "0.47424868", "0.47415757", "0.4739154", "0.47339943", "0.4730633", "0.4729397", "0.4724471", "0.47239503", "0.47236958", "0.47223818", "0.47192052", "0.47076038", "0.46990407", "0.46857926", "0.46857613", "0.4683976", "0.4683123" ]
0.67684364
0
Reductum 3. L is a list of length 3 or more. M is the third reductum of L.
public static <C> LIST<C> RED3(LIST<C> L, int i) { LIST<C> LP = null; if ( ! isNull( L ) ) { LP = new LIST<C>( L.list.subList(3,L.list.size()) ); } return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int stepThree(ArrayList<Integer> list) {\n\t\t\n\t\tint sum = 0;\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint num = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//sum every other number beginning with first from the right\n\t\t\tif (passNumber % 2 == 1) {\n\t\t\t\tsum += num;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public void int3_m() {\n\t\t\n\t}", "public static int solution(int[] l) {\n // remainder 1 mod 3\n final List<Integer> r1 = new ArrayList<>();\n // remainder 2 mod 3\n final List<Integer> r2 = new ArrayList<>();\n // remainder 0 mod 3;\n final List<Integer> r0 = new ArrayList<>();\n int total = 0;\n for (int num : l) {\n if (num % 3 == 0) {\n r0.add(num);\n } else if (num % 3 == 1) {\n r1.add(num);\n } else {\n r2.add(num);\n }\n total = (total + num) % 3;\n }\n final List<Integer> ok = new ArrayList<>(r0);\n if (total == 0) {\n ok.addAll(r1);\n ok.addAll(r2);\n } else if (total == 1) {\n Collections.sort(r1);\n Collections.sort(r2);\n if (!r1.isEmpty()) {\n for (int i = 1; i < r1.size(); i++) { ok.add(r1.get(i)); }\n ok.addAll(r2);\n } else {\n for (int i = 2; i < r2.size(); i++) { ok.add(r2.get(i)); }\n }\n } else if (total == 2) {\n Collections.sort(r1);\n Collections.sort(r2);\n if (!r2.isEmpty()) {\n for (int i = 1; i < r2.size(); i++) { ok.add(r2.get(i)); }\n ok.addAll(r1);\n } else {\n for (int i = 2; i < r1.size(); i++) { ok.add(r1.get(i)); }\n }\n }\n ok.sort(Collections.reverseOrder());\n int res = 0;\n for (int num : ok) {\n res = res * 10 + num;\n }\n return res;\n }", "public List<List<Integer>> threeSum(int[] nums) {\n HashMap<Integer, Integer> new_nums = new HashMap<Integer, Integer>();\n for (int i = 0; i < nums.length; i++) {\n new_nums.put(nums[i], i);\n }\n \n // find triplets\n HashSet<List<Integer>> product = new HashSet<List<Integer>>();\n for (int i = 0; i < nums.length; i++) {\n int nums_i = nums[i];\n for (int j = i + 1; j < nums.length; j++) {\n int target = 0 - (nums_i + nums[j]);\n int index = new_nums.get(target) != null ? new_nums.get(target) : -1;\n if (index != -1 && index > j) {\n List<Integer> triplet = new ArrayList<Integer>();\n int[] list = findOrder(nums_i, nums[j], target);\n triplet.add(list[0]);\n triplet.add(list[1]);\n triplet.add(list[2]);\n product.add(triplet);\n }\n }\n }\n return new ArrayList<List<Integer>>(product);\n \n }", "public List<List<Integer>> threeSum3(int[] nums) {\n List<List<Integer>> result = new ArrayList<>();\n Arrays.sort(nums);\n int n = nums.length;\n for (int i = 0; i < n - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) continue; // Bypass duplicate!\n for (int l = i + 1, r = n - 1; l < r; ) {\n if (nums[i] + nums[l] + nums[r] < 0) l++;\n else if (nums[i] + nums[l] + nums[r] > 0) r--;\n else {\n result.add(Arrays.asList(nums[i], nums[l++], nums[r--]));\n while (l < r && nums[l] == nums[l - 1]) l++; // Bypass duplicate!\n while (l < r && nums[r] == nums[r + 1]) r--;\n }\n }\n }\n return result;\n }", "public void dormr3_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,INTEGER L,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);", "public ArrayList<ArrayList<Integer>> threeSum(int[] num) {\n // Start typing your Java solution below\n // DO NOT write main() function\n\n // A three pointer solution\n ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n if (num.length < 3) return res;\n Arrays.sort(num);\n HashSet hashSet = new HashSet();\n\n for (int i = 0; i < num.length - 2; i++) {\n int leftP = i + 1;\n int rightP = num.length - 1;\n\n while (leftP < rightP) {\n if (num[i] + num[leftP] + num[rightP] > 0) rightP--;\n else if (num[i] + num[leftP] + num[rightP] < 0) leftP++;\n else {\n ArrayList<Integer> temp = new ArrayList<Integer>();\n temp.add(num[i]);\n temp.add(num[leftP]);\n temp.add(num[rightP]);\n if (hashSet.add(temp)) res.add(temp);\n rightP--;\n leftP++;\n }\n }\n }\n return res;\n }", "public static void main(String[] args) {\n\t\tint []nums = {0,0,0};\n\t\tList<List<Integer>> res = threeSum(nums);\n\t\tfor(List list : res) {\n\t\t\tfor(int i=0; i<list.size(); i++) {\n\t\t\t\tSystem.out.print(list.get(i));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "List<List<Integer>> threeSum(int[] numbers) {\n\n final List<List<Integer>> lists = threeSumSubSets(numbers);\n final List<List<Integer>> threes = lists.stream().filter(x -> x.size() == 3).distinct().collect(Collectors.toList());\n final List<List<Integer>> three = new ArrayList<>();\n if (threes.isEmpty()) return new ArrayList<>();\n for (List<Integer> list : threes\n ) {\n Collections.sort(list);\n three.add(list);\n }\n return three;\n }", "public List<List<Integer>> threeSum(int[] nums) {\r\n\r\n\t\treturn null;\r\n\t}", "public void multL(TransformationMatrix m) {\n\t\tdouble b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34;\n\t\tb11 = m.a11*a11 + m.a12*a21 + m.a13*a31;\n\t\tb12 = m.a11*a12 + m.a12*a22 + m.a13*a32;\n\t\tb13 = m.a11*a13 + m.a12*a23 + m.a13*a33;\n\t\tb14 = m.a11*a14 + m.a12*a24 + m.a13*a34 + m.a14;\n\t\tb21 = m.a21*a11 + m.a22*a21 + m.a23*a31;\n\t\tb22 = m.a21*a12 + m.a22*a22 + m.a23*a32;\n\t\tb23 = m.a21*a13 + m.a22*a23 + m.a23*a33;\n\t\tb24 = m.a21*a14 + m.a22*a24 + m.a23*a34 + m.a24;\n\n\t\tb31 = m.a31*a11 + m.a32*a21 + m.a33*a31;\n\t\tb32 = m.a31*a12 + m.a32*a22 + m.a33*a32;\n\t\tb33 = m.a31*a13 + m.a32*a23 + m.a33*a33;\n\t\tb34 = m.a31*a14 + m.a32*a24 + m.a33*a34 + m.a34;\n\n\t\ta11 = b11; a12 = b12; a13 = b13; a14 = b14;\n\t\ta21 = b21; a22 = b22; a23 = b23; a24 = b24;\n\t\ta31 = b31; a32 = b32; a33 = b33; a34 = b34;\n\t}", "public List<List<Integer>> threeSum(int[] nums) {\n\n if (nums.length < 3) {\n return new ArrayList<>();\n }\n\n Arrays.sort(nums);\n\n // ex. [-1, 0, 1, 2,-1,-4] =>\n // [-4,-1,-1, 0, 1, 2]\n\n // ex. [ 3, 0,-2,-1, 1, 2] =>\n // [-2,-1, 0, 1, 2, 3]\n\n // ex. [-1, 0, 1, 2,-1,-4] =>\n // [-4,-1,-1, 0, 1, 2]\n\n List<List<Integer>> list = new ArrayList<List<Integer>>();\n\n // Loop throught the array\n for (int i = 0; i < nums.length - 2; i++) {\n\n if (i > 0 && nums[i] == nums[i - 1]) {\n continue;\n }\n\n // Index of first number\n int first = i;\n\n // Indices of second and third numbers\n int left = i + 1;\n int right = nums.length - 1;\n\n // Find nums[left] and nums[right] that add up to -firstNum\n // (Implies that the 3 numbers add up to 0)\n while (left < right) {\n int leftNum = nums[left];\n int rightNum = nums[right];\n int firstNumComplement = -nums[first];\n if (nums[left] + nums[right] == firstNumComplement) {\n List<Integer> triplet = new ArrayList<Integer>(3);\n triplet.add(nums[first]);\n triplet.add(nums[left]);\n triplet.add(nums[right]);\n list.add(triplet);\n left++;\n right--;\n while (left < right && nums[left] == leftNum) {\n left++;\n }\n while (left < right && nums[right] == rightNum) {\n right--;\n }\n } else if (nums[left] + nums[right] > firstNumComplement) {\n right--;\n } else {\n left++;\n }\n }\n }\n\n return list;\n }", "public static List<Integer> icecreamParlor(int m, List<Integer> arr) {\n\t\tInteger[] res = new Integer[2];\n\t\tHashtable<Integer, Integer> price_index = new Hashtable<>();\n\t\tfor (int i = 0; i < arr.size(); i++) {\n\t\t\tint p1 = arr.get(i);\n\t\t\tint p2 = m - p1;\n\n\t\t\tInteger j = price_index.get(p2);\n\t\t\tif (j != null) {\n\t\t\t\tres[0] = j + 1;\n\t\t\t\tres[1] = i + 1;\n\t\t\t}\n\t\t\tprice_index.put(p1, i);\n\t\t}\n\t\treturn Arrays.asList(res);\n\t}", "public static void mult(TransformationMatrix l, TransformationMatrix r, TransformationMatrix m) {\n\t\tm.a11 = l.a11*r.a11 + l.a12*r.a21 + l.a13*r.a31;\n\t\tm.a12 = l.a11*r.a12 + l.a12*r.a22 + l.a13*r.a32;\n\t\tm.a13 = l.a11*r.a13 + l.a12*r.a23 + l.a13*r.a33;\n\t\tm.a14 = l.a11*r.a14 + l.a12*r.a24 + l.a13*r.a34 + l.a14;\n\t\tm.a21 = l.a21*r.a11 + l.a22*r.a21 + l.a23*r.a31;\n\t\tm.a22 = l.a21*r.a12 + l.a22*r.a22 + l.a23*r.a32;\n\t\tm.a23 = l.a21*r.a13 + l.a22*r.a23 + l.a23*r.a33;\n\t\tm.a24 = l.a21*r.a14 + l.a22*r.a24 + l.a23*r.a34 + l.a24;\n\t\tm.a31 = l.a31*r.a11 + l.a32*r.a21 + l.a33*r.a31;\n\t\tm.a32 = l.a31*r.a12 + l.a32*r.a22 + l.a33*r.a32;\n\t\tm.a33 = l.a31*r.a13 + l.a32*r.a23 + l.a33*r.a33;\n\t\tm.a34 = l.a31*r.a14 + l.a32*r.a24 + l.a33*r.a34 + l.a34;\n\t}", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "public Object lambda3() {\n return frame.lambda2recur(C1259lists.cdr.apply1(this.lis));\n }", "public int RMQ(int l, int r) {\r\n\t\treturn computeRMQ(0, l, r, 0, arr.length - 1);\r\n\t}", "public static void m3(ArrayList<? extends Number> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "int main()\n{\n int n;\n cin >>n;\n int m = 11;\n for(int i=0; i<n; i++){\n cout << m*m << \" \";\n m += 4;\n }\n}", "public void receiveResultmultiply3(\n loadbalance.LoadBalanceStub.Multiply3Response result\n ) {\n }", "public static <C> C THIRD(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(3);\n }\n return x;\n }", "public static ArrayList<ArrayList<Integer>> threeSum(int[] num) {\n // Start typing your Java solution below\n // DO NOT write main() function\n ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();\n int[] aux = Arrays.copyOf(num, num.length);\n Arrays.sort(aux);\n \n int j = 0, k =num.length - 1, oldA = -9999999, oldB = -9999999, oldC = -9999999;\n int oldStart = aux[0]; // keep track of start value\n for (int i = 0; i < aux.length - 2; i++) {\n \n if (i != 0 && aux[i] == oldStart) {\n continue;\n }\n \n\n j = i + 1; // next to the start\n k = num.length - 1; // last index\n \n while (j != k) {\n if (aux[i] + aux[j] + aux[k] == 0) {\n if (aux[i] != oldA || aux[j] != oldB || aux[k] != oldC) {\n // add it into array list\n ArrayList<Integer> newArray = new ArrayList<Integer>();\n newArray.add(aux[i]);newArray.add(aux[j]);newArray.add(aux[k]);\n result.add(newArray);\n oldA = aux[i]; oldB = aux[j]; oldC = aux[k];\n \n }\n k--;\n } else if (aux[i] + aux[j] + aux[k] > 0) k--;\n else if (aux[i] + aux[j] + aux[k] < 0) j++;\n }\n \n oldStart = aux[i];\n\n }\n \n return result;\n }", "private void Perform_LPM_III()\n {\n int zindex = get_z();\n int d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n int wordlocation = zindex >> 1;\n\n try\n {\n if (Utils.bit0(zindex))\n set_reg(d,(program_memory[wordlocation] & 0xff00) >> 8);\n else\n set_reg(d,program_memory[wordlocation] & 0x00ff);\n }\n catch (RuntimeException e) { } \n inc_z();\n clockTick();\n clockTick();\n return;\n }", "List<List<Integer>> threeSumSubSets(int[] numbers) {\n List<List<Integer>> lists = new ArrayList<>();\n if (numbers.length == 0) {\n lists.add(Collections.emptyList());\n return lists;\n }\n int head = numbers[0];\n final int[] rest = new int[numbers.length - 1];\n System.arraycopy(numbers, 1, rest, 0, numbers.length - 1);\n\n for (List<Integer> list : threeSumSubSets(rest)) {\n int sum = head;\n for (int i = 0; i < list.size(); i++) {\n sum += list.get(i);\n }\n if (sum == 0) {\n final List<Integer> newList = new ArrayList<>();\n newList.add(head);\n newList.addAll(list);\n lists.add(newList);\n }\n }\n return lists;\n }", "private BigInteger squareToomCook3() {\n int len = mag.length;\n\n // k is the size (in ints) of the lower-order slices.\n int k = (len+2)/3; // Equal to ceil(largest/3)\n\n // r is the size (in ints) of the highest-order slice.\n int r = len - 2*k;\n\n // Obtain slices of the numbers. a2 is the most significant\n // bits of the number, and a0 the least significant.\n BigInteger a0, a1, a2;\n a2 = getToomSlice(k, r, 0, len);\n a1 = getToomSlice(k, r, 1, len);\n a0 = getToomSlice(k, r, 2, len);\n BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1;\n\n v0 = a0.square();\n da1 = a2.add(a0);\n vm1 = da1.subtract(a1).square();\n da1 = da1.add(a1);\n v1 = da1.square();\n vinf = a2.square();\n v2 = da1.add(a2).shiftLeft(1).subtract(a0).square();\n\n // The algorithm requires two divisions by 2 and one by 3.\n // All divisions are known to be exact, that is, they do not produce\n // remainders, and all results are positive. The divisions by 2 are\n // implemented as right shifts which are relatively efficient, leaving\n // only a division by 3.\n // The division by 3 is done by an optimized algorithm for this case.\n t2 = v2.subtract(vm1).exactDivideBy3();\n tm1 = v1.subtract(vm1).shiftRight(1);\n t1 = v1.subtract(v0);\n t2 = t2.subtract(t1).shiftRight(1);\n t1 = t1.subtract(tm1).subtract(vinf);\n t2 = t2.subtract(vinf.shiftLeft(1));\n tm1 = tm1.subtract(t2);\n\n // Number of bits to shift left.\n int ss = k*32;\n\n return vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0);\n }", "public List<List<Integer>> threeSum22(int[] nums) {\n List<List<Integer>> result = new ArrayList<>();\n Arrays.sort(nums);\n doThreeSum(result, new ArrayList<>(), nums, 0, 0);\n return result;\n }", "public static <T> int m28125a(@C6003d List<? extends T> list) {\n C14445h0.m62478f(list, \"$receiver\");\n return list.size() - 1;\n }", "public List<List<Integer>> threeSum(int[] nums) {\n Arrays.sort(nums);\n List<List<Integer>> ret = new ArrayList<>();\n int n = nums.length;\n for (int i = 0; i < n - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) continue;\n for (int j = i + 1, k = n - 1; j < k; ) {\n int sum = nums[i] + nums[j] + nums[k];\n if (j > i + 1 && nums[j - 1] == nums[j]) j++;\n else if (sum < 0) j++;\n else if (sum > 0) k--;\n else ret.add(Arrays.asList(nums[i], nums[j++], nums[k--]));\n }\n }\n return ret;\n }", "private static int[] montReduce(int[] n, int[] mod, int mlen, int inv) {\n int c=0;\n int len = mlen;\n int offset=0;\n\n do {\n int nEnd = n[n.length-1-offset];\n int carry = mulAdd(n, mod, offset, mlen, inv * nEnd);\n c += addOne(n, offset, mlen, carry);\n offset++;\n } while (--len > 0);\n\n while (c > 0)\n c += subN(n, mod, mlen);\n\n while (intArrayCmpToLen(n, mod, mlen) >= 0)\n subN(n, mod, mlen);\n\n return n;\n }", "private static List<List<Integer>> threeSum(int[] nums) {\n int len = nums.length;\n int start = 0;\n List<List<Integer>> result = new LinkedList<>();\n\n Arrays.sort(nums);\n\n while (start < len - 2) {\n if (start > 0 && nums[start] == nums[start - 1]) {\n start++;\n continue;\n }\n findPair(nums, -nums[start], start + 1, result);\n start++;\n }\n return result;\n }", "public R3Mult(int rdIndex, int rsIndex, int id) {\n\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public List<List<Integer>> threeSum(int[] nums) {\n \n Arrays.sort(nums);\n Set<List<Integer>> set = new HashSet<>();\n for (int i = 0; i < nums.length; i++) {\n int left = i + 1, right = nums.length - 1;\n // two sum sorted list\n while (left < right) {\n int currentSum = nums[i] + nums[left] + nums[right];\n if (currentSum > 0) {\n right--;\n } else if (currentSum < 0) {\n left++;\n } else {\n set.add(Arrays.asList(nums[i], nums[left], nums[right]));\n left++;// keep going for other pairs\n right--;\n }\n }\n }\n \n return new ArrayList<>(set);\n }", "private static <T> int med3(List<T> x, Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x.get(a),x.get(b))<0 ?\n\t\t\t\t(comp.compare(x.get(b),x.get(c))<0 ? b : comp.compare(x.get(a),x.get(c))<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x.get(b),x.get(c))>0 ? b : comp.compare(x.get(a),x.get(c))>0 ? c : a));\n\t}", "@Override\n\tprotected Integer compute() {\n\t\treturn 3;\n\t}", "public Matrix3 multiplySelf(Matrix3 m)\n {\n Matrix3 temp = Matrix3.REUSABLE_STACK.pop().initZero();\n\n for (int r = 0; r < 3; r++)\n {\n for (int c = 0; c < 3; c++)\n {\n for (int k = 0; k < 3; k++)\n temp.set(c, r, temp.get(c, r) + this.m[k][r] * m.get(c, k));\n }\n }\n\n this.set(temp);\n Matrix3.REUSABLE_STACK.push(temp);\n\n return this;\n }", "private void reduce(String[] arguments) {\n\t\ttry { \n\t\t\tlastDeletedNode = null;\n\t\t\tint ID = Integer.parseInt(arguments[1]);\n\t int m = Integer.parseInt(arguments[2]);\n\t Node curr = searchID(root, ID);\n\t if(curr != null)\n\t {\n\t \tcurr.count -= m;\n\t \tif(curr.count > 0)\n\t \t\tSystem.out.printf(\"%d\\n\", curr.count);\n\t \telse\n\t \t{\n\t \t\tdelete(root, ID);\n\t \t\tSystem.out.println(\"0\");\n\t \t}\n\t }\n\t else\n\t \tSystem.out.println(\"0\");\n\t } catch(NumberFormatException e) { \n\t System.out.println(\"Argument not an Integer\");\n\t }\n\t}", "public static void main(String[] args)\n\t{\n\t\tint n = 3;\n\t\tint m = 8;\n\t\t\n\t\tint tmp = m;\n\t\t\n\t\tif( (tmp >> (n-1) & 1) == 1)\n\t\t\ttmp &=~(1 << (n-1)) ;\n\t\telse\n\t\t\ttmp |=(1 << (n-1)) ;\n\t\t\n\t\tSystem.out.println(tmp);\n\t\t\n\t\tSystem.out.println(m ^= (1<<n-1));\n\t}", "static List<MeanWithClusterProbAggregator> reduce(List<MeanWithClusterProbAggregator> l,\n List<MeanWithClusterProbAggregator> r) {\n A.ensure(l != null || r != null, \"Both partitions cannot equal to null\");\n\n if (l == null || l.isEmpty())\n return r;\n if (r == null || r.isEmpty())\n return l;\n\n A.ensure(l.size() == r.size(), \"l.size() == r.size()\");\n List<MeanWithClusterProbAggregator> res = new ArrayList<>();\n for (int i = 0; i < l.size(); i++)\n res.add(l.get(i).plus(r.get(i)));\n\n return res;\n }", "@CallSuper\n public long multiplyAndGet(final long l) {\n long currentValue;\n\n for (; ; ) {\n currentValue = get();\n if (compareAndSet(currentValue, currentValue * l)) {\n return currentValue;\n }\n ii(this, mOrigin, \"Collision in concurrent add, will try again: \" + currentValue);\n }\n }", "public static void main(String[] args) {\n \tint n = 3;\r\n perm(n);\r\n }", "private int A(int n, int m) {\n int res = 1;\n for (int i = 0; i < m; n++)\n res *= n;\n return res;\n }", "public static /* synthetic */ int m28127a(List list, int i, int i2, C6080l lVar, int i3, Object obj) {\n if ((i3 & 1) != 0) {\n i = 0;\n }\n if ((i3 & 2) != 0) {\n i2 = list.size();\n }\n return m28126a(list, i, i2, lVar);\n }", "private static void reduceMonty(int[] x, int[] m, int mDash) // mDash = -m^(-1) mod b\n {\n\n int n = m.length;\n\n for (int i = n - 1; i >= 0; --i)\n {\n int x0 = x[n - 1];\n\n long t = (x0 * mDash) & IMASK;\n\n long carry = t * (m[n - 1] & IMASK) + (x0 & IMASK);\n// assert (int)carry == 0;\n carry >>>= 32;\n\n for (int j = n - 2; j >= 0; --j)\n {\n carry += t * (m[j] & IMASK) + (x[j] & IMASK);\n x[j + 1] = (int)carry;\n carry >>>= 32;\n }\n\n x[0] = (int)carry;\n// assert carry >>> 32 == 0;\n }\n\n if (compareTo(0, x, 0, m) >= 0)\n {\n subtract(0, x, 0, m);\n }\n }", "private static void countRiddle(int[][] a, int m) {\n for (int i=0; i<9; ++i) {\n for (int j=0; j<9; ++j) {\n a[i][j] = ( a[i][j] * m ) % 9 + 1;\n }\n }\n }", "public LMUL() {\n super(InstructionOpCodes.LMUL, 1);\n }", "public static int computeTimeFinish(ArrayList<Integer> l) {\n\n int sum = 0;\n Collections.sort(l);\n int[] peoples = new int[3];\n peoples[0] = l.size() / 3;\n peoples[1] = (l.size() - peoples[0]) / 2;\n peoples[2] = (l.size() - peoples[0]) / 2;\n int position = 0;\n\n while (l.size() > 0){\n int count = 0;\n int total = 0;\n\n while (peoples[position] > 0){\n\n if (l.size() == 0){\n break;\n }\n\n if (count % 2 == 0) {\n total += l.get(l.size() - 1);\n l.remove(l.size() - 1);\n } else {\n total += l.get(0);\n l.remove(0);\n }\n peoples[position]--;\n count++;\n }\n if (total > sum){\n sum = total;\n }\n position++;\n }\n\n return sum;\n }", "public final void add(Matrix3f m1) {\n\tm00 += m1.m00; m01 += m1.m01; m02 += m1.m02;\n\tm10 += m1.m10; m11 += m1.m11; m12 += m1.m12;\n\tm20 += m1.m20; m21 += m1.m21; m22 += m1.m22;\n }", "public int getThirdL() {\n/* 72 */ return this.thirdL;\n/* */ }", "public static void main(String[] args) {\n\t\tint[] num = {-1, 0, 1, 2, -1, 4};\n\t\tThreeSum ts = new ThreeSum();\n\t\tList<List<Integer>> result = ts.threeSum(num);\n\t\tfor(List<Integer> l : result) {\n\t\t\tfor(int i : l) {\n\t\t\t\tSystem.out.print(i + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "static float[] mulMV(float[] m, float[] v, float v3){ 0\n // 1\n // 2\n // 3\n\t // 0 1 2 3 \n\t // 4 5 6 7\n\t // 8 9 10 11\n\t // 12 13 14 15\n\t // \n \n return new float[]{\n \t m[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v3,\n \t m[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v3,\n \t m[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v3,\n \t m[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v3};\n }", "public List<List<Integer>> threeSum(int[] nums) {\n\t\tList<List<Integer>> res = new ArrayList<>();\n\t\tArrays.sort(nums);\n\t\tfor (int i = 0; i + 2 < nums.length; i++) {\n\t\t\tif (i > 0 && nums[i] == nums[i - 1]) { // skip same result\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tint j = i + 1, k = nums.length - 1;\n\t\t\tint target = -nums[i];\n\t\t\twhile (j < k) {\n\t\t\t\tif (nums[j] + nums[k] == target) {\n\t\t\t\t\tres.add(Arrays.asList(nums[i], nums[j], nums[k]));\n\t\t\t\t\tj++;\n\t\t\t\t\tk--;\n\t\t\t\t\twhile (j < k && nums[j] == nums[j - 1])\n\t\t\t\t\t\tj++; // skip same result\n\t\t\t\t\twhile (j < k && nums[k] == nums[k + 1])\n\t\t\t\t\t\tk--; // skip same result\n\t\t\t\t} else if (nums[j] + nums[k] > target) {\n\t\t\t\t\tk--;\n\t\t\t\t} else {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "public List<List<Integer>> threeSum(int[] nums) {\n Arrays.sort(nums);\n\n Set<List<Integer>> triplets = new HashSet<List<Integer>>();\n\n for (int i = 0; i < nums.length; i++) {\n // we choose the number at index i to pinpoint\n int a = nums[i];\n int deficit = 0 - a;\n\n // initialize our two pointers such that they're at either end of the\n // array and that they're not i\n int b = i == 0 ? 1 : 0;\n int c = i == nums.length - 1 ? nums.length - 2 : nums.length - 1;\n\n while (b < c) {\n // check if b and c add up to the deficit\n if (nums[b] + nums[c] == deficit) {\n // add it to the list\n List<Integer> triplet = new ArrayList<Integer>();\n\n triplet.add(a);\n triplet.add(nums[b]);\n triplet.add(nums[c]);\n\n Collections.sort(triplet);\n if (!triplets.contains(triplet)) {\n triplets.add(triplet);\n }\n\n\n // move pointer up and down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n\n b += 1;\n if (b == i) {\n b += 1;\n }\n } else if (nums[b] + nums[c] > deficit) {\n // if it's too large, bring top pointer down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n } else {\n // if it's too small, bring bottom pointer up\n b += 1;\n if (b == i) {\n b += 1;\n }\n }\n }\n }\n\n List<List<Integer>> last = new ArrayList<List<Integer>>(triplets);\n return last;\n }", "public static int wayToArrange3N(int n) {\n\t\treturn 0;\n\t}", "private static long f(long m) {\n\t\tlong k = 1;\r\n\t\tfor (long i=1; i<=m; i++){\r\n\t\t\tk *= i;\r\n\t\t}\r\n\t\treturn k;\r\n\t}", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public void reduce4( T mrt ) {\n // Reduce any AppendableVecs\n for( int i=0; i<_fr._vecs.length; i++ )\n if( _fr._vecs[i] instanceof AppendableVec )\n ((AppendableVec)_fr._vecs[i]).reduce((AppendableVec)mrt._fr._vecs[i]);\n // User's reduction\n reduce(mrt);\n }", "@Override\n\tpublic void m3() {\n\t\t\n\t}", "private static int med3(long x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "private void permutation(int[] ans, int l, int r) {\n if (l == r)\n perm.add(ans.clone());\n else {\n for (int i = l; i <= r; i++) {\n ans = swap(ans, l, i);\n permutation(ans, l + 1, r);\n ans = swap(ans, l, i);\n }\n }\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "protected void reduce4( T mrt ) {\n // Reduce any AppendableVecs\n if( _noutputs > 0 )\n for( int i=0; i<_appendables.length; i++ )\n _appendables[i].reduce(mrt._appendables[i]);\n // User's reduction\n reduce(mrt);\n }", "public void visitLREM(LREM o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public static List<List<Integer>> threeSum(int[] nums) {\n\n\t\tList<List<Integer>> list = new ArrayList<List<Integer>>();\n\n\t\tif (nums == null || nums.length < 3) {\n\t\t\treturn list;\n\t\t}\n\n\t\tArrays.sort(nums);\n\n\t\tfor (int i = 0; i < nums.length - 2; i++) {\n\n\t\t\tif (i == 0 || (i > 0 && nums[i] != nums[i - 1])) {\n\n\t\t\t\tint left = i + 1;\n\t\t\t\tint right = nums.length - 1;\n\t\t\t\t// setting target sum to two sum sweep\n\t\t\t\tint targetSum = 0 - nums[i];\n\n\t\t\t\t// binary search for targetSum\n\t\t\t\twhile (left < right) { \n\t\t\t\t\tint sum = nums[left] + nums[right];\n\n\t\t\t\t\tif (sum < targetSum) { \n\t\t\t\t\t\tleft++;\n\t\t\t\t\t} else if (sum > targetSum) {\n\t\t\t\t\t\tright--;\n\t\t\t\t\t} else {\n ArrayList<Integer> l = new ArrayList<Integer>();\n\t\t\t\t\t\tl.add(nums[i]);\n\t\t\t\t\t\tl.add(nums[left]);\n\t\t\t\t\t\tl.add(nums[right]);\n\t\t\t\t\t\tlist.add(l);\n \n // to avoid duplicate triplets to be added\n while (left < right && nums[left] == nums[left + 1]) {\n left++;\n }\n \n while (left < right && nums[right] == nums[right - 1]) {\n right--;\n }\n \n left++;\n right--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "public ArrayList<Integer> repeatedNumber(final List<Integer> a) {\n long sum = 0, ssum = 0;\n for(int i = 0 ; i < a.size(); i++){\n long curi = i+1; // importnt to prevent overflow.\n long curn = a.get(i); // importnt to prevent overflow.\n sum += curn - curi;\n ssum +=curn*curn - curi*curi ;\n }\n ssum /= sum; // A + B \n long first = (sum + ssum)/2;\n long second = (ssum - first); \n ArrayList<Integer> result = new ArrayList<>();\n result.add((int)first);\n result.add((int)second);\n return result;\n }", "public void visitLMUL(LMUL o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public static IntList dincrList(IntList L, int x) { //iteratively\n /* Your code here. */\n IntList p = L;\n while (p != null) {\n p.first = p.first + x; //this mutate the L.first since p.first and l.first are the same\n p = p.rest; //until p = null then it point to another list\n }\n return L; //not p because P is null at this point and it point to the rest not the original list\n }", "public List<List<Integer>> combinationSum3(int k, int n) {\n List<List<Integer>> ans = new ArrayList<>();\n backtack(ans, new LinkedList<>(), k, n, 1);\n return ans;\n }", "public void MatrixChainMultiply(int[] p) {\n n = p.length - 1;\t// how many matrices are in the chain\n m = new int[n + 1][n + 1];\t// overallocate m, so that we don't use index 0\n s = new int[n + 1][n + 1];\t// same for s\n matrixChainOrder(p);\t// run the dynamic-programming algorithm\n }", "private static <T> int med3(@Nonnull List<T> x, Comparator<? super T> comparator, int a, int b, int c) {\n return comparator.compare(x.get(a), x.get(b)) < 0\n ? comparator.compare(x.get(b), x.get(c)) < 0 ? b : comparator.compare(x.get(a), x.get(c)) < 0 ? c : a\n : comparator.compare(x.get(c), x.get(b)) < 0 ? b : comparator.compare(x.get(c), x.get(a)) < 0 ? c : a;\n }", "public int thirdMax(int[] nums) {\n List<Integer> list = new ArrayList<>();\n for (int num : nums) {\n helper(list, num);\n }\n if (list.size() < 3) {\n return list.get(0);\n } else {\n return list.get(2);\n }\n }", "public int getM () {\n\t\treturn M;\n\t}", "public ArrayList<ArrayList<Integer>> permuteUnique(int[] num) {\n HashMap<Integer, Integer> count = new HashMap<Integer, Integer>();\n for(int i = 0; i < num.length; i++) {\n \tif(!count.containsKey(num[i])) count.put(num[i], 1);\n \telse count.put(num[i], count.get(num[i])+1); \t\n }\n \n ArrayList<Integer> numUni = new ArrayList<Integer>(count.size());\n ArrayList<Integer> numCount = new ArrayList<Integer>(count.size());\n for(int e: count.keySet()) {\n \tnumUni.add(e);\n \tnumCount.add(count.get(e)); \t\n }\n \n return permuteUnique(numUni, numCount);\n }", "public static void main(String[] args) {\n\t\tMath3 m3 = new Math3();\r\n\t\tSystem.out.println(m3.add(3,3));\r\n\t\tSystem.out.println(m3.add(3L,3));\r\n\t\tSystem.out.println(m3.add(3,3L));\r\n\t\tSystem.out.println(m3.add(3L,3L));\r\n\t\tSystem.out.println(m3.add(new int[]{10,20,30}));\r\n\t}", "int query(int l, int r) {\n l += n;\n r += n;\n int resl = identity;\n int resr = identity;\n while (l < r) {\n if ((l & 1) > 0) resl = combine(resl, st[l++]);\n if ((r & 1) > 0) resr = combine(st[--r], resr);\n l /= 2;\n r /= 2;\n }\n return combine(resl, resr);\n }", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "public static void main(String[] args)\n {\n int[] arr = new int[]{1,2,3};\n List<List<Integer>> result = new ArrayList<>();\n Permutation permutation = new Permutation();\n permutation.permuteInteger(arr,result, 0, arr.length);\n\n System.out.println(result);\n }", "static void consumer(List<Integer> l) {\n\t\tConsumer<List<Integer>> modify = (list) -> {\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tlist.set(i, 2 * list.get(i));\n\t\t\t}\n\t\t};\n\t\tmodify.accept(l);\n\t}", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "static ArrayList<Integer> getMajortiy(int arr[]){\n int num1=-1, num2=-1, count1=0, count2=0;\n for(int i:arr){\n if(i==num1) count1++;\n else if(i ==num2) count2++;\n else if(count1==0){\n num1=i;\n count1=1;\n }\n else if(count2==0){\n num2=i;\n count2=1;\n }\n else{\n count1--;\n count2--;\n }\n }\n count1=0; count2=0;\n for(int i:arr){\n if(i==num1) count1++;\n if(i==num2) count2++;\n }\n ArrayList<Integer>res= new ArrayList<>();\n if(count1>arr.length/3) res.add(num1);\n if(count2>arr.length/3) res.add(num2);\n return res;\n\n }", "private void add3(int[] x3, int[] z3, int[] x2, int[] z2, int[] x1, int[] z1, int[] x, int[] z) {\r\n\t\tint[] t = fieldTX;\r\n\t\tint[] u = fieldTZ;\r\n\t\tint[] v = fieldUX;\r\n\t\tint[] w = fieldUZ;\r\n\t\tSubtractBigNbrModN(x2, z2, v, TestNbr, NumberLength); // v = x2-z2\r\n\t\tAddBigNbrModN(x1, z1, w, TestNbr, NumberLength); // w = x1+z1\r\n\t\tMontgomeryMult(v, w, u); // u = (x2-z2)*(x1+z1)\r\n\t\tAddBigNbrModN(x2, z2, w, TestNbr, NumberLength); // w = x2+z2\r\n\t\tSubtractBigNbrModN(x1, z1, t, TestNbr, NumberLength); // t = x1-z1\r\n\t\tMontgomeryMult(t, w, v); // v = (x2+z2)*(x1-z1)\r\n\t\tAddBigNbrModN(u, v, t, TestNbr, NumberLength); // t = 2*(x1*x2-z1*z2)\r\n\t\tMontgomeryMult(t, t, w); // w = 4*(x1*x2-z1*z2)^2\r\n\t\tSubtractBigNbrModN(u, v, t, TestNbr, NumberLength); // t =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2*(x2*z1-x1*z2)\r\n\t\tMontgomeryMult(t, t, v); // v = 4*(x2*z1-x1*z2)^2\r\n\t\tif (BigNbrAreEqual(x, x3)) {\r\n\t\t\tSystem.arraycopy(x, 0, u, 0, NumberLength);\r\n\t\t\tSystem.arraycopy(w, 0, t, 0, NumberLength);\r\n\t\t\tMontgomeryMult(z, t, w);\r\n\t\t\tMontgomeryMult(v, u, z3);\r\n\t\t\tSystem.arraycopy(w, 0, x3, 0, NumberLength);\r\n\t\t} else {\r\n\t\t\tMontgomeryMult(w, z, x3); // x3 = 4*z*(x1*x2-z1*z2)^2\r\n\t\t\tMontgomeryMult(x, v, z3); // z3 = 4*x*(x2*z1-x1*z2)^2\r\n\t\t}\r\n\t}", "public ArrayList<ArrayList<Integer>> permuteUnique(int[] num) {\n HashMap<Integer, Integer> count = new HashMap<Integer, Integer>();\n for(int i = 0; i < num.length; i++) {\n \tif(!count.containsKey(num[i])) count.put(num[i], 1);\n \telse count.put(num[i], count.get(num[i])+1); \t\n }\n \n ArrayList<Integer> numUni = new ArrayList<Integer>(count.size());\n ArrayList<Integer> numCount = new ArrayList<Integer>(count.size());\n for(int e: count.keySet()) {\n \tnumUni.add(e);\n \tnumCount.add(count.get(e)); \t\n }\n \n ArrayList<ArrayList<Integer>> results = new ArrayList<ArrayList<Integer>>();\n ArrayList<Integer> result = new ArrayList<Integer>(num.length);\n permuteUnique(numUni, numCount, result, results);\n return results;\n }", "public Matrix3f(Matrix3f m1) {\n\t\n \tm00 = m1.m00; m01 = m1.m01; m02 = m1.m02;\n \tm10 = m1.m10; m11 = m1.m11; m12 = m1.m12;\n \tm20 = m1.m20; m21 = m1.m21; m22 = m1.m22;\n }", "public int m3(int a,int b){\r\n\t\tint c=a+b;\r\n\t\treturn c;\r\n\t}", "public static List<List<Integer>> threeSum(int[] arr) {\n Set<List<Integer>> solutionSet = new HashSet<>();\n\n if (arr == null || arr.length < 3) {\n return new ArrayList<>(solutionSet);\n }\n\n Arrays.sort(arr);\n\n for (int i = 0; i < arr.length - 2; i++) {\n int j = i+1;\n int k = arr.length - 1;\n\n while (j < k) {\n int threeSum = arr[i] + arr[j] + arr[k];\n if (threeSum == 0) {\n List<Integer> solution = new ArrayList<>();\n solution.add(arr[i]);\n solution.add(arr[j]);\n solution.add(arr[k]);\n solutionSet.add(solution);\n\n j++;\n k--;\n\n while (j<k && arr[j] == arr[j+1]) {\n j++;\n }\n while (j<k && arr[k] == arr[k-1]) {\n k--;\n }\n } else if (threeSum < 0) {\n j++;\n } else {\n k--;\n }\n }\n }\n return new ArrayList<>(solutionSet);\n }", "public List<List<Integer>> threeSum2(int[] nums) {\n Arrays.sort(nums);\n\n List<List<Integer>> result = new ArrayList<>();\n for (int i = 0; i < nums.length - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) { // Common trick to bypass duplicate. Better than a nested while loop!\n continue; // But it's quite annoying to bypass in nested loop. eg.[-2,0,0,2,2]\n }\n int target = 0 - nums[i];\n int left = i + 1, right = nums.length - 1;\n while (left < right) {\n if (nums[left] + nums[right] < target || (left > i + 1 && nums[left - 1] == nums[left])) {\n left++;\n } else if (nums[left] + nums[right] > target || (right < nums.length - 1 && nums[right] == nums[right + 1])) {\n right--;\n } else {\n result.add(Arrays.asList(nums[i], nums[left], nums[right]));\n left++;\n right--;\n }\n }\n }\n return result;\n }", "static long countTriplets(List<Long> arr, long r) {\n Map<Long, Integer> map=new HashMap<Long, Integer>();\n int l = arr.size();\n long triplets = 0;\n //Create a map with unique numbers in arr as key and its frequency as value\n for(int i = 0; i < l; i++) {\n if (map.containsKey(arr.get(i))) {\n map.put(arr.get(i), map.get(arr.get(i)) + 1);\n } else {\n map.put(arr.get(i), 1);\n }\n }\n \n /*\n If ratio is 1, arr is {2,2,2,2,2,2,2,2,2,2}.. 2 is 10 times than map will be \n {(2, 10)}, where 2 is key and 10 is value than answer will be Nc3 (10c3), using permutations and combinations.. select '2' three times from 10 items which can be done in 10c3 ways\n */\n if (r == 1) {\n for (Map.Entry<Long, Integer> entry : map.entrySet()) {\n long key = entry.getKey();\n long val = entry.getValue();\n System.out.println(\"Key is: \" + key);\n System.out.println(\"Value is: \" + val);\n if (val > 2) {\n //here applying formula for Nc3\n triplets = triplets + (val * (val - 1) * (val - 2))/6;\n }\n } \n } else {\n /*\n eg. 2,4,4,8,8,16,24,24,24 and r is 2\n map will be {(2,1), (4,2), (8,2), (16,1), (24,3)}\n iterate for every key,value pair in the map\n first time (2,1), key is 2.. now check for 2*r(4) and 2*r*r(8) in map\n if present means triplet found.. now we need to calculate how many triplets can be formed with these 3 values.. that will be multiplication of values of these 3 keys in map... 2 is 1 time, 4 is 2 times, 8 is 2 times... no. of triplets = 1*2*2=4\n */\n for (Map.Entry<Long, Integer> entry : map.entrySet()) {\n long key1 = entry.getKey();\n long val = entry.getValue();\n long key2 = key1 * r;\n long key3 = key2 * r;\n\n if(map.containsKey(key2) && map.containsKey(key3)) {\n triplets = triplets + (val * map.get(key2) * map.get(key3));\n }\n } \n }\n return triplets;\n }", "static long countTriplets(List<Long> arr, long r) {\n long result = 0L;\n long size = arr.size();\n\n ArrayList<long[]> duoList = new ArrayList<>();\n\n // triplet 이 될 수 있는 duo를 선발\n for (int i = 0; i < (size - 1); i++) {\n long firstItem = arr.get(i);\n\n for (int j = i + 1; j < size; j++) {\n long secondItem = arr.get(j);\n if (j >= (size - 1)) continue;\n if (secondItem / (float) firstItem == r) {\n long[] tripletAble = {i, j};\n // System.out.println(\"tripletAble : \" + Arrays.toString(tripletAble));\n if (duoList.contains(tripletAble)) {\n continue;\n } else {\n duoList.add(tripletAble);\n }\n }\n }\n }\n\n // duo인 int[] 의 두 번째 item (int[1]) 의 다음 index부터 탐색해서\n // 해당 수가 triplet이 될 수 있다면 result + 1\n // 판단 기준은 thirdItem / secondItem 이 r이 되는 경우\n int listSize = duoList.size();\n for (int k = 0; k < listSize; k++) {\n long[] targetArr = duoList.get(k);\n long secondIdx = targetArr[1];\n for (int l = (int) secondIdx + 1; l < size; l++) {\n\n long secondItem = arr.get((int) targetArr[1]);\n long thirdItem = arr.get(l);\n\n if (thirdItem / (float) secondItem == r) {\n result += 1L;\n }\n }\n }\n\n return result;\n }", "public static void primePermutationsHM(List<Integer> primes) {\n HashMap<String, List<Integer>> map = new HashMap<>();\n for (int p : primes) {\n int[] nums = new int[4];\n int num = p;\n int i = 0;\n\n while (num > 0) {\n nums[i++] = num % 10;\n num /= 10;\n }\n\n // save the number (p) in a key hashed from the lowest permutation (s) of the number \n Arrays.sort(nums);\n String s = Arrays.toString(nums);\n\n List<Integer> ll = map.getOrDefault(s, new LinkedList<>());\n ll.add(p);\n map.put(s, ll);\n }\n\n // loop through map entries; if at least 3 numbers are found, check for common difference\n for (Map.Entry mEntry : map.entrySet()) {\n List<Integer> numbers = (List<Integer>) mEntry.getValue();\n\n if (numbers.size() >= 3) {\n int[] res = findTripletWithCommonDifference(numbers);\n\n if (res.length == 3) {\n System.out.println(Arrays.toString(res));\n }\n }\n }\n }", "public static void permute(char[] arr, int l, int r) {\n if (l == r) {\n System.out.println(String.valueOf(arr));\n } else {\n for (int i = l; i <= r; i++) {\n swap(arr, l, i);\n permute(arr, l + 1, r);\n swap(arr, l, i); // backtrack\n }\n }\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> res = new ArrayList<>();\n Arrays.sort(nums);\n for (int i = 0; i < nums.length - 2; i++) {\n if (nums[i] > 0) break;\n if (i > 0 && nums[i] == nums[i - 1]) {\n continue;\n }\n int low = i + 1;\n int high = nums.length - 1;\n int sum = -nums[i];\n while (low < high) {\n if (nums[low] + nums[high] == sum) {\n res.add(Arrays.asList(nums[i], nums[low], nums[high]));\n while (low < high && nums[low] == nums[low + 1]) low++;\n low++;\n while (low < high && nums[high] == nums[high - 1]) high--;\n high--;\n } else if (nums[low] + nums[high] > sum) {\n while (low < high && nums[high] == nums[high - 1]) high--;\n high--;\n } else {\n while (low < high && nums[low] == nums[low + 1]) low++;\n low++;\n }\n\n }\n }\n return res;\n }", "public boolean large_num(SLList pum) \n {\n // SLList for storing pum \n SLList pum_temp = new SLList(pum.first(), pum.rest());\n // For loop to iterate temporary list \n for (int i = 0; i < pum_temp.length(); i++)\n {\n // Conditional if statement to check length of string \n if(pum_temp.first.toString().length() > 3)\n {\n // Return true statement\n return true;\n }\n }\n // Set the pum_temp to the rest of pum_temp\n pum_temp = pum_temp.rest();\n // Return false statement\n return false;\n }", "public String rollMill(int mult){\r\n\t\tString out = \"\";\r\n\t\tif(myBuildings.getMill()){\r\n\t\t\tout = dieClass.rollWood(mult, this);\r\n\t\t}\r\n\t\treturn out;\r\n\t}", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "public List<List<GenPolynomial<C>>> \n normalizeMatrix(int flen, List<List<GenPolynomial<C>>> M) { \n if ( M == null ) {\n return M;\n }\n if ( M.size() == 0 ) {\n return M;\n }\n List<List<GenPolynomial<C>>> N = new ArrayList<List<GenPolynomial<C>>>();\n List<List<GenPolynomial<C>>> K = new ArrayList<List<GenPolynomial<C>>>();\n int len = M.get( M.size()-1 ).size(); // longest row\n // pad / extend rows\n for ( List<GenPolynomial<C>> row : M ) {\n List<GenPolynomial<C>> nrow = new ArrayList<GenPolynomial<C>>( row );\n for ( int i = row.size(); i < len; i++ ) {\n nrow.add( null );\n }\n N.add( nrow );\n }\n // System.out.println(\"norm N fill = \" + N);\n // make zero columns\n int k = flen;\n for ( int i = 0; i < N.size(); i++ ) { // 0\n List<GenPolynomial<C>> row = N.get( i );\n if ( debug ) {\n logger.info(\"row = \" + row);\n }\n K.add( row );\n if ( i < flen ) { // skip identity part\n continue;\n }\n List<GenPolynomial<C>> xrow;\n GenPolynomial<C> a;\n //System.out.println(\"norm i = \" + i);\n for ( int j = i+1; j < N.size(); j++ ) {\n List<GenPolynomial<C>> nrow = N.get( j );\n //System.out.println(\"nrow j = \" +j + \", \" + nrow);\n if ( k < nrow.size() ) { // always true\n a = nrow.get( k );\n //System.out.println(\"k, a = \" + k + \", \" + a);\n if ( a != null && !a.isZERO() ) {\n xrow = blas.scalarProduct( a, row);\n xrow = blas.vectorAdd(xrow,nrow);\n //System.out.println(\"xrow = \" + xrow);\n N.set( j, xrow );\n }\n }\n }\n k++;\n }\n //System.out.println(\"norm K reduc = \" + K);\n // truncate \n N.clear();\n for ( List<GenPolynomial<C>> row: K ) {\n List<GenPolynomial<C>> tr = new ArrayList<GenPolynomial<C>>();\n for ( int i = 0; i < flen; i++ ) {\n tr.add( row.get(i) );\n }\n N.add( tr );\n }\n K = N;\n //System.out.println(\"norm K trunc = \" + K);\n return K;\n }", "@Override\n\tpublic void m3() {\n\t\t\n\t\tSystem.out.println(\"m3\");\n\t\t\n\t}", "public static long encrypt3(int[] numList){\n \t long totalCheck = 0;\n \t long total = 1;\n \n \t for (int r=0; r < numList.length; r++){\n \t\tif (numList[r] < 1 || numList[r] > 1000){\n \t\t System.out.println(\"Number Error; Integer x must follow: -1000 <= x <= 1000\");\n \t\t return 0;\n \t }\n \t }\n \t \n \t if (numList.length > 10){\n \t\tSystem.out.println(\"Number List Error; List length must be less than 10 inclusive\");\n \t\treturn 0;\n \t }\n \t \n \t for (int i=0; i < numList.length; i++){\n \t\tif (i%2 == 0) {\n \t\ttotalCheck += (numList[i] + i*i);\n \t\t}\n \t\telse {\n \t\t totalCheck -= (numList[i] + i*i);\n \t\t}\n \t }\n \t \n \t return totalCheck;\n \t}", "public String solution(int U, int L, int [] C) {\n int totalSum = Arrays.stream(C).reduce(Integer::sum).orElse(0);\n\n if (totalSum != U + L) {\n return \"IMPOSSIBLE\";\n }\n\n StringBuilder u = new StringBuilder(C.length);\n StringBuilder l = new StringBuilder(C.length);\n\n int uOccupied = 0;\n\n for (int i = 0; i < C.length; i++) {\n int colSum = C[i];\n\n if (colSum == 2) {\n u.append(\"1\");\n l.append(\"1\");\n uOccupied += 1;\n } else if (colSum == 1) {\n if (uOccupied >= U) {\n l.append(\"1\");\n u.append(\"0\");\n } else {\n u.append(\"1\");\n l.append(\"0\");\n uOccupied += 1;\n }\n } else {\n u.append(\"0\");\n l.append(\"0\");\n }\n }\n\n return u.toString().concat(\",\").concat(l.toString());\n }", "static long countTriplets(List<Long> arr, long r) {\n\n long count=0;\n long l = arr.size();\n \n Map <Long,Integer> m = new HashMap<Long,Integer>();\n \n for(int i=0;i<arr.size();i++)\n {\n //Map with Uniqe numbers and their frequency.\n if(m.containsValue(arr.get(i)))\n m.put(arr.get(i), m.get(arr.get(i)) + 1);\n else\n m.put(arr.get(i),1);\n }\n \n \n long n = arr.size();\n if(r==1)\n {\n for(Map.Entry<Long,Integer> entry : m.entrySet())\n {\n long k1 = entry.getKey();\n long val = entry.getValue();\n if(val>2)\n {\n count = count + val*(val-1)*(val-2)/6;\n }\n }\n }\n else\n {\n for(Map.Entry<Long,Integer> entry : m.entrySet())\n {\n long k1 = entry.getKey();\n long val = entry.getValue();\n long k2 = k1*r;\n long k3 = k1*r*r;\n if(m.containsKey(k2) && m.containsKey(k3))\n {\n count = count + val*m.get(k2)*m.get(k3);\n }\n }\n }\n\n return count;\n }", "IVec3 mult(IVec3 v);" ]
[ "0.5882034", "0.56357807", "0.55846566", "0.55714077", "0.55136466", "0.5422189", "0.5341031", "0.5320821", "0.5303391", "0.52888006", "0.52437246", "0.5215795", "0.52127576", "0.52093107", "0.51563114", "0.51339304", "0.509821", "0.5068483", "0.50513566", "0.5045004", "0.5040751", "0.50397235", "0.50102276", "0.5002703", "0.49972156", "0.49970108", "0.49894428", "0.4984866", "0.49832577", "0.49808502", "0.49776456", "0.4977071", "0.4961894", "0.49517596", "0.49443212", "0.4938601", "0.49348572", "0.49303496", "0.49229094", "0.4921183", "0.49144357", "0.4897454", "0.488286", "0.48739988", "0.4872207", "0.48710644", "0.48668113", "0.48666826", "0.4861063", "0.48601267", "0.4850133", "0.4835266", "0.48315153", "0.48198074", "0.48153827", "0.478791", "0.4787606", "0.47856367", "0.4782627", "0.47814047", "0.47687015", "0.4763069", "0.47572663", "0.4743704", "0.4742625", "0.47344047", "0.47312832", "0.47181514", "0.4705962", "0.47045028", "0.46998176", "0.46915987", "0.46866825", "0.46807605", "0.4676254", "0.46633142", "0.46555066", "0.46441644", "0.4641559", "0.4639105", "0.4637655", "0.46285942", "0.4627472", "0.46162796", "0.46146217", "0.46141106", "0.46123835", "0.46088198", "0.46086538", "0.4608493", "0.46037742", "0.46005175", "0.45810252", "0.45749974", "0.45685184", "0.45637375", "0.45602795", "0.45534304", "0.45501855", "0.4538272" ]
0.555088
4
Reductum 4. L is a list of length 4 or more. M is the fourth reductum of L.
public static <C> LIST<C> RED4(LIST<C> L, int i) { LIST<C> LP = null; if ( ! isNull( L ) ) { LP = new LIST<C>( L.list.subList(42,L.list.size()) ); } return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void reduce4( T mrt ) {\n // Reduce any AppendableVecs\n if( _noutputs > 0 )\n for( int i=0; i<_appendables.length; i++ )\n _appendables[i].reduce(mrt._appendables[i]);\n // User's reduction\n reduce(mrt);\n }", "int main()\n{\n int n;\n cin >>n;\n int m = 11;\n for(int i=0; i<n; i++){\n cout << m*m << \" \";\n m += 4;\n }\n}", "public void reduce4( T mrt ) {\n // Reduce any AppendableVecs\n for( int i=0; i<_fr._vecs.length; i++ )\n if( _fr._vecs[i] instanceof AppendableVec )\n ((AppendableVec)_fr._vecs[i]).reduce((AppendableVec)mrt._fr._vecs[i]);\n // User's reduction\n reduce(mrt);\n }", "public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n int temp = 0;\n Arrays.sort(num);\n\n ArrayList<ArrayList<Integer>> a = new ArrayList<ArrayList<Integer>>();\n int [] s = new int [4];\n int total = 0;\n int current = -1;\n int i = 0;\n Arrays.fill(s, 0);\n HashMap<Long, Integer> m = new HashMap<Long, Integer>();\n \n \n if (num.length < 4) return a;\n \n while (i!=-1) {\n //increase the current pointer\n ++current;\n if (current > num.length-1) {\n --i;\n if (i >= 0) \n {\n current = s[i];\n total -= num[current];\n }\n }\n else if (total + num[current] > target || total + (4-i)*num[num.length-1] < target) {\n --i;\n if (i >= 0) \n {\n current = s[i];\n total -= num[current];\n }\n }\n else {\n //check if current number will work\n /*if (current == 0)\n {\n */\n if (i < 3) {s[i] = current; total += num[current]; ++i;}\n else if (num[current] + total == target) {\n //bingo one answer\n ArrayList<Integer> b = new ArrayList<Integer>();\n long c = num[s[0]]*num[s[1]]*num[s[2]]*num[current];\n long d = Math.abs((long)num[s[0]]*1000000000) \n + Math.abs((long)num[s[1]]*1000000)\n + Math.abs((long)num[s[2]]*1000)\n + Math.abs((long)num[current]);\n if (c < 0) d *= -1;\n if (!m.containsKey(d))\n {\n b.add(num[s[0]]);\n b.add(num[s[1]]);\n b.add(num[s[2]]);\n b.add(num[current]);\n a.add(b);\n m.put(d, 1);\n }\n }\n /*\n } \n else if (num[current] != num[current-1])\n {\n if (i < 2) {s[i] = current; total += num[current]; ++i;}\n else if (num[current] + total == 0) {\n //bingo one answer\n ArrayList<Integer> b = new ArrayList<Integer>();\n b.add(num[s[0]]);\n b.add(num[s[1]]);\n b.add(num[s[2]]);\n a.add(b);\n }\n }\n */\n }\n }\n return a;\n }", "private static void countRiddle(int[][] a, int m) {\n for (int i=0; i<9; ++i) {\n for (int j=0; j<9; ++j) {\n a[i][j] = ( a[i][j] * m ) % 9 + 1;\n }\n }\n }", "public int RMQ(int l, int r) {\r\n\t\treturn computeRMQ(0, l, r, 0, arr.length - 1);\r\n\t}", "public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n\t\tint n = num.length;\n\t\tArrays.sort(num);\n\t\tSet<String> set = new HashSet<String>();\n\t\tfor (int i = 0; i < n - 3; i++) {\n\t\t\tfor (int j = i + 1; j < n - 2; j++) {\n\t\t\t\tint expect = target - num[i] - num[j];\n\t\t\t\tint l = j + 1;\n\t\t\t\tint r = n - 1;\n\t\t\t\twhile (l < r) {\n\t\t\t\t\tint tmp = num[l] + num[r];\n\t\t\t\t\tif (tmp == expect) {\n\t\t\t\t\t\tset.add(String.valueOf(num[i]) + \"|\"\n\t\t\t\t\t\t\t\t+ String.valueOf(num[j])\n\t\t\t\t\t\t\t\t+ \"|\"\n\t\t\t\t\t\t\t\t+ String.valueOf(num[l])\n\t\t\t\t\t\t\t\t+ \"|\"\n\t\t\t\t\t\t\t\t+ String.valueOf(num[r]));\n\t\t\t\t\t\tl++;\n\t\t\t\t\t\tr--;\n\t\t\t\t\t} else if (tmp < expect) {\n\t\t\t\t\t\tl++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tr--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tArrayList<ArrayList<Integer>> array = new ArrayList<ArrayList<Integer>>();\n\t\tfor (String s : set) {\n\t\t\tString[] arr = s.split(\"\\\\|\");\n\t\t\tArrayList<Integer> tmp = new ArrayList<Integer>();\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\ttmp.add(Integer.parseInt(arr[i]));\n\t\t\t}\n\t\t\tarray.add(tmp);\n\t\t}\n\t\treturn array;\n\t}", "public static void m4(ArrayList<? super Integer> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t\tal.add(345);\n\t}", "public void multL(TransformationMatrix m) {\n\t\tdouble b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34;\n\t\tb11 = m.a11*a11 + m.a12*a21 + m.a13*a31;\n\t\tb12 = m.a11*a12 + m.a12*a22 + m.a13*a32;\n\t\tb13 = m.a11*a13 + m.a12*a23 + m.a13*a33;\n\t\tb14 = m.a11*a14 + m.a12*a24 + m.a13*a34 + m.a14;\n\t\tb21 = m.a21*a11 + m.a22*a21 + m.a23*a31;\n\t\tb22 = m.a21*a12 + m.a22*a22 + m.a23*a32;\n\t\tb23 = m.a21*a13 + m.a22*a23 + m.a23*a33;\n\t\tb24 = m.a21*a14 + m.a22*a24 + m.a23*a34 + m.a24;\n\n\t\tb31 = m.a31*a11 + m.a32*a21 + m.a33*a31;\n\t\tb32 = m.a31*a12 + m.a32*a22 + m.a33*a32;\n\t\tb33 = m.a31*a13 + m.a32*a23 + m.a33*a33;\n\t\tb34 = m.a31*a14 + m.a32*a24 + m.a33*a34 + m.a34;\n\n\t\ta11 = b11; a12 = b12; a13 = b13; a14 = b14;\n\t\ta21 = b21; a22 = b22; a23 = b23; a24 = b24;\n\t\ta31 = b31; a32 = b32; a33 = b33; a34 = b34;\n\t}", "public static void mult(TransformationMatrix l, TransformationMatrix r, TransformationMatrix m) {\n\t\tm.a11 = l.a11*r.a11 + l.a12*r.a21 + l.a13*r.a31;\n\t\tm.a12 = l.a11*r.a12 + l.a12*r.a22 + l.a13*r.a32;\n\t\tm.a13 = l.a11*r.a13 + l.a12*r.a23 + l.a13*r.a33;\n\t\tm.a14 = l.a11*r.a14 + l.a12*r.a24 + l.a13*r.a34 + l.a14;\n\t\tm.a21 = l.a21*r.a11 + l.a22*r.a21 + l.a23*r.a31;\n\t\tm.a22 = l.a21*r.a12 + l.a22*r.a22 + l.a23*r.a32;\n\t\tm.a23 = l.a21*r.a13 + l.a22*r.a23 + l.a23*r.a33;\n\t\tm.a24 = l.a21*r.a14 + l.a22*r.a24 + l.a23*r.a34 + l.a24;\n\t\tm.a31 = l.a31*r.a11 + l.a32*r.a21 + l.a33*r.a31;\n\t\tm.a32 = l.a31*r.a12 + l.a32*r.a22 + l.a33*r.a32;\n\t\tm.a33 = l.a31*r.a13 + l.a32*r.a23 + l.a33*r.a33;\n\t\tm.a34 = l.a31*r.a14 + l.a32*r.a24 + l.a33*r.a34 + l.a34;\n\t}", "public int getM () {\n\t\treturn M;\n\t}", "private void Perform_LPM_III()\n {\n int zindex = get_z();\n int d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n int wordlocation = zindex >> 1;\n\n try\n {\n if (Utils.bit0(zindex))\n set_reg(d,(program_memory[wordlocation] & 0xff00) >> 8);\n else\n set_reg(d,program_memory[wordlocation] & 0x00ff);\n }\n catch (RuntimeException e) { } \n inc_z();\n clockTick();\n clockTick();\n return;\n }", "public static int stepThree(ArrayList<Integer> list) {\n\t\t\n\t\tint sum = 0;\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint num = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//sum every other number beginning with first from the right\n\t\t\tif (passNumber % 2 == 1) {\n\t\t\t\tsum += num;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public static IntList dincrList(IntList L, int x) { //iteratively\n /* Your code here. */\n IntList p = L;\n while (p != null) {\n p.first = p.first + x; //this mutate the L.first since p.first and l.first are the same\n p = p.rest; //until p = null then it point to another list\n }\n return L; //not p because P is null at this point and it point to the rest not the original list\n }", "private void m3935R() {\n int i;\n int i2;\n if (mo4322L() == 1) {\n i2 = mo4758r() - mo4756p();\n i = mo4754o();\n } else {\n i2 = mo4741h() - mo4752n();\n i = mo4757q();\n }\n m3945n(i2 - i);\n }", "public String rollMill(int mult){\r\n\t\tString out = \"\";\r\n\t\tif(myBuildings.getMill()){\r\n\t\t\tout = dieClass.rollWood(mult, this);\r\n\t\t}\r\n\t\treturn out;\r\n\t}", "public static void main(String[] args) {\n\n int oldCapacity = 4;\n System.out.println(oldCapacity + (oldCapacity >> 1));\n\n /*Solution solution = new Solution();\n// System.out.println(solution.numRollsToTarget(2, 6, 7));\n\n int[] ints = solution.loudAndRich(new int[][]{\n *//* {1, 0},\n {2, 1},\n {3, 1},\n {3, 7},\n {4, 3},\n {5, 3},\n {6, 3}\n }, new int[]{3, 2, 5, 4, 6, 1, 7, 0});*//*\n\n }, new int[]{0, 1});\n Printer.print(ints);*/\n }", "public int GetM()\r\n\t{\r\n\t\treturn M;\r\n\t}", "public LMUL() {\n super(InstructionOpCodes.LMUL, 1);\n }", "public List<List<Integer>> fourSum(int[] nums, int target) {\n\t\tArrayList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\tint len = nums.length;\n\t\tif (nums == null || len < 4)\n\t\t\treturn res;\n\n\t\tArrays.sort(nums);\n\n\t\tint max = nums[len - 1];\n\t\tif (4 * nums[0] > target || 4 * max < target)\n\t\t\treturn res;\n\n\t\tint i, z;\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tz = nums[i];\n\t\t\tif (i > 0 && z == nums[i - 1])// avoid duplicate\n\t\t\t\tcontinue;\n\t\t\tif (z + 3 * max < target) // z is too small\n\t\t\t\tcontinue;\n\t\t\tif (4 * z > target) // z is too large\n\t\t\t\tbreak;\n\t\t\tif (4 * z == target) { // z is the boundary\n\t\t\t\tif (i + 3 < len && nums[i + 3] == z)\n\t\t\t\t\tres.add(Arrays.asList(z, z, z, z));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tthreeSumForFourSum(nums, target - z, i + 1, len - 1, res, z);\n\t\t}\n\n\t\treturn res;\n\t}", "int query(int l, int r) {\n l += n;\n r += n;\n int resl = identity;\n int resr = identity;\n while (l < r) {\n if ((l & 1) > 0) resl = combine(resl, st[l++]);\n if ((r & 1) > 0) resr = combine(st[--r], resr);\n l /= 2;\n r /= 2;\n }\n return combine(resl, resr);\n }", "public List <List <Integer>> generate (int numRows) {\n List <List <Integer>> result = new ArrayList <> ();\n if (numRows == 1) {\n List <Integer> aList = Arrays.asList (1);\n result.add (aList);\n return result;\n }\n List <List <Integer>> re1 = generate (numRows - 1);\n result.addAll (re1);\n List <Integer> bList = re1.get (re1.size () - 1);\n List <Integer> aList = new ArrayList <> ();\n aList.add (1);\n for (int i = 0; i < bList.size () - 1; i++) {\n aList.add (bList.get (i) + bList.get (i + 1));\n }\n aList.add (1);\n result.add (aList);\n return result;\n }", "private void permutation(int[] ans, int l, int r) {\n if (l == r)\n perm.add(ans.clone());\n else {\n for (int i = l; i <= r; i++) {\n ans = swap(ans, l, i);\n permutation(ans, l + 1, r);\n ans = swap(ans, l, i);\n }\n }\n }", "public Matrix4f mult(Matrix4f r) {\r\n\t\tMatrix4f ret = new Matrix4f();\r\n\t\t\t\r\n\t\tfor(int i=0; i<4; i++) {\r\n\t\t\tfor(int j=0; j<4; j++) {\r\n\t\t\t\tret.m[i][j] = m[i][0] * r.m[0][j] +\r\n\t\t\t\t\t\t m[i][1] * r.m[1][j] +\r\n\t\t\t\t\t\t m[i][2] * r.m[2][j] +\r\n\t\t\t\t\t\t m[i][3] * r.m[3][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn ret;\r\n\t}", "public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n //Create the dictionary of sum and list of pairs of indexes\n HashMap<Integer, ArrayList<ArrayList<Integer>>> dict = new HashMap<>();\n for (int i = 0; i < num.length - 1; i++) {\n for (int j = i + 1; j < num.length; j++) {\n int sum = num[i] + num[j];\n ArrayList<Integer> pair = new ArrayList<>();\n pair.add(i);\n pair.add(j);\n if (!dict.containsKey(sum)) {\n ArrayList<ArrayList<Integer>> value = new ArrayList<ArrayList<Integer>>();\n value.add(pair);\n dict.put(sum, value);\n } else {\n ArrayList<ArrayList<Integer>> value = dict.get(sum);\n value.add(pair);\n }\n }\n }\n //Use HashSet to prevent duplicate result.\n HashSet<ArrayList<Integer>> set = new HashSet<>();\n for (Integer sumA : dict.keySet()) {\n if (dict.containsKey(target - sumA)) {\n \n ArrayList<ArrayList<Integer>> pairsA = dict.get(sumA);\n ArrayList<ArrayList<Integer>> pairsB = dict.get(target - sumA);\n \n \n for (ArrayList<Integer> pair1 : pairsA) {\n for (ArrayList<Integer> pair2 : pairsB) {\n \n //Make sure there is no same element in two pairs.\n if (pair1.contains(pair2.get(0)) || pair1.contains(pair2.get(1)))\n continue;\n \n ArrayList<Integer> tmpResult = new ArrayList<>(4);\n tmpResult.add(num[pair1.get(0)]);\n tmpResult.add(num[pair1.get(1)]);\n tmpResult.add(num[pair2.get(0)]);\n tmpResult.add(num[pair2.get(1)]);\n //Sort the list and add it into the set.\n Collections.sort(tmpResult);\n set.add(tmpResult);\n }\n }\n }\n }\n ArrayList<ArrayList<Integer>> ret = new ArrayList<ArrayList<Integer>>();\n ret.addAll(set); // from hashset to arraylist \n return ret;\n }", "@Test\n public void test_4() {\n long expected = 805;\n List<List<Integer>> possibleRoads = List.of(\n List.of(8, 2),\n List.of(2, 9)\n );\n long result = roadsAndLibraries(9, 91, 84, possibleRoads);\n Assertions.assertEquals(expected, result);\n }", "public static int solution(int[] l) {\n // remainder 1 mod 3\n final List<Integer> r1 = new ArrayList<>();\n // remainder 2 mod 3\n final List<Integer> r2 = new ArrayList<>();\n // remainder 0 mod 3;\n final List<Integer> r0 = new ArrayList<>();\n int total = 0;\n for (int num : l) {\n if (num % 3 == 0) {\n r0.add(num);\n } else if (num % 3 == 1) {\n r1.add(num);\n } else {\n r2.add(num);\n }\n total = (total + num) % 3;\n }\n final List<Integer> ok = new ArrayList<>(r0);\n if (total == 0) {\n ok.addAll(r1);\n ok.addAll(r2);\n } else if (total == 1) {\n Collections.sort(r1);\n Collections.sort(r2);\n if (!r1.isEmpty()) {\n for (int i = 1; i < r1.size(); i++) { ok.add(r1.get(i)); }\n ok.addAll(r2);\n } else {\n for (int i = 2; i < r2.size(); i++) { ok.add(r2.get(i)); }\n }\n } else if (total == 2) {\n Collections.sort(r1);\n Collections.sort(r2);\n if (!r2.isEmpty()) {\n for (int i = 1; i < r2.size(); i++) { ok.add(r2.get(i)); }\n ok.addAll(r1);\n } else {\n for (int i = 2; i < r1.size(); i++) { ok.add(r1.get(i)); }\n }\n }\n ok.sort(Collections.reverseOrder());\n int res = 0;\n for (int num : ok) {\n res = res * 10 + num;\n }\n return res;\n }", "int mo1635a(long j, List list);", "public List<List<Integer>> fourSum(int[] nums, int target) {\n\t\tList<List<Integer>> result = new ArrayList<List<Integer>>();\n\t\tif (nums == null || nums.length < 4) return result;\n\n\t\tArrays.sort(nums);\n\n\t\tfor (int w = 0; w < nums.length - 3; w++) { // < size - 3\n\t\t\tif (w == 0 || nums[w] != nums[w - 1]) {\n\t\t\t\tfor (int i = w + 1; i < nums.length - 2; i++) { // < size - 2\n\t\t\t\t\t// Enter in first iteration or no duplication.\n\t\t\t\t\tif (i == w + 1 || nums[i] != nums[i - 1]) { \n\t\t\t\t\t\tint j = i + 1;\n\t\t\t\t\t\tint k = nums.length - 1;\n\n\t\t\t\t\t\twhile (j < k) {\n\n\t\t\t\t\t\t\tif (nums[w] + nums[i] + nums[j] + nums[k] == target) {\n\t\t\t\t\t\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\t\t\t\t\t\tlist.add(nums[w]);\n\t\t\t\t\t\t\t\tlist.add(nums[i]);\n\t\t\t\t\t\t\t\tlist.add(nums[j]);\n\t\t\t\t\t\t\t\tlist.add(nums[k]);\n\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\tk--;\n\n\t\t\t\t\t\t\t\twhile (j < k && nums[j] == nums[j - 1])\n\t\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\twhile (j < k && nums[k] == nums[k + 1])\n\t\t\t\t\t\t\t\t\tk--;\n\n\t\t\t\t\t\t\t\tresult.add(list);\n\t\t\t\t\t\t\t} else if (nums[w] + nums[i] + nums[j] + nums[k] < target) {\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t} else { // >.\n\t\t\t\t\t\t\t\tk--;\n\t\t\t\t\t\t\t}\n\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\treturn result;\n\t}", "public abstract long mo9748m();", "private ArrayList<Integer> repPattern(Dimension newSize,\n ArrayList<Integer> list, RepType rtype) {\n ArrayList<Integer> newNList = new ArrayList<Integer>();\n\n if (rtype != RepType.CLEAR) { // if rtype is clear, we just clear the\n // list\n int newX = newSize.width;\n int newY = newSize.height;\n Dimension size = layoutPanel.getLayoutSize();\n int sizeX = size.width;\n int sizeY = size.height;\n\n Iterator<Integer> iter = list.iterator();\n while (iter.hasNext()) {\n int index = iter.next();\n int x = index % sizeX;\n int y = index / sizeX;\n for (int i = 0; i <= (newY / sizeY); i++) {\n for (int j = 0; j <= (newX / sizeX); j++) {\n if (rtype == RepType.REPEAT) {\n if ((y + sizeY * i) < newY\n && (x + sizeX * j) < newX) {\n newNList.add((y + sizeY * i) * newX\n + (x + sizeX * j));\n }\n } else if (rtype == RepType.ALT) {\n int tx, ty;\n if (j % 2 == 0) {\n tx = x;\n } else {\n tx = sizeX - x - 1;\n }\n if (i % 2 == 0) {\n ty = y;\n } else {\n ty = sizeY - y - 1;\n }\n if ((ty + sizeY * i) < newY\n && (tx + sizeX * j) < newX) {\n newNList.add((ty + sizeY * i) * newX\n + (tx + sizeX * j));\n }\n }\n }\n }\n }\n }\n\n return newNList;\n }", "public static List<Integer> rotLeft(List<Integer> a, int d) {\n\t\tint len = a.size();\n\t\t// 1,2,3,4,5\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\tresult.addAll(a);\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\t// i = 0 , 1, 2, 3, 4\n\t\t\t// j = 1 , 2, 3, 4, 0\n\t\t\tint j = (i + (len - d)) % len;\n\t\t\tresult.set(j, a.get(i));\n\t\t}\n\t\treturn result;\n\t}", "public void dormrz_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,INTEGER L,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);", "public List<List<Integer>> fourSum_optimization(int[] nums, int target) {\n int len = nums.length;\n Arrays.sort(nums);\n if (len < 4)\n return Collections.emptyList();\n List<List<Integer>> arr = new ArrayList<>();\n\n for (int i = 0; i < len - 1; i++) {\n for (int j = i + 1; j < len - 1; j++) {\n int Left = j + 1;\n int Right = len - 1;\n int left_target_sum = target - nums[i] + nums[j];\n\n while (Left < Right) {\n int two_sum = nums[Left] + nums[Right];\n if (two_sum < left_target_sum)\n Left++;\n else if (two_sum > left_target_sum)\n Right--;\n else {\n List<Integer> arr2 = new ArrayList<>();\n if (left_target_sum + two_sum == target) {\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[Left]);\n arr2.add(nums[Right]);\n arr.add(arr2);\n }\n while (Left < Right && nums[Left] == arr2.get(2))\n ++Left;\n while (Left < Right && nums[Right] == arr2.get(3))\n --Right;\n }\n }\n while (i + 1 < len && nums[i + 1] == nums[i])\n ++i;\n while (j + 1 < len && nums[j + 1] == nums[j])\n ++j;\n }\n }\n\n return arr;\n }", "int getM();", "@Override\n\tpublic void m4() {\n\t\t\n\t\tSystem.out.println(\"m4\");\n\t\t\n\t}", "public void visitLMUL(LMUL o){\n\t\tif (stack().peek() != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'long', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.LONG){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'long', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "public int normalizedLength(List<String> sequence);", "public static IntList incrListR(IntList L, int x) {\n if (L == null) {\n return null;\n }\n //each recursive run will create a new IntList until L.rest.rest.rest... = null meaning reaching the last item in\n //the original list\n return new IntList(L.first + x, incrListR(L.rest, x));\n }", "public void int3_m() {\n\t\t\n\t}", "public static void main(String args[])\r\n\t{\r\n\t\t/*int r1 = m+n;\r\n\t\tint r2 = m-n;\r\n\t\tint r3 = m*n;\r\n\t\tdouble r4 = (double)m/n; // to get quotient\r\n\t\t\r\n\t\tint r5 = m%n; // to get remainder\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(r1);\r\n\t\tSystem.out.println(r2);\r\n\t\tSystem.out.println(r3);\r\n\t\tSystem.out.println(r4);\r\n\t\tSystem.out.println(r5);\r\n\t\t \r\n\t\t */\r\n\t\tint x = 4;\r\n\t\tx &= 3;\r\n\t\tSystem.out.println(x);\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint sum =0;\n\t\tint dSum = 100;\n\t\tint tSum=0;\n\t\tint count = 4;\n\t\tRandom random = new Random();\n\t\tboolean flag=true;\n\t\tfor(int i=0;i<count;i++){\n\t\t\ta = random.nextInt(dSum);\n\t\t\tSystem.out.println(\"Generated number :\"+ a);\n\t\t\tif((!l.contains(a)) && l.size()<4 && (sum+a)<=100){\n\t\t\t\tl.add(a);\n\t\t\t\tsum=sum+a;\n\t\t\t}else{\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tSystem.out.println(\"Sum value is :\"+sum);\n\t\t\tif(l.size()==4 && sum!=100){\n\t\t\t\tSystem.out.println(\"Before remove\"+sum);\n\t\t\t\tl.remove(l.size()-1);\n\t\t\t\tsum=sum-a;\n\t\t\t\tSystem.out.println(\"After remove\"+sum);\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif(l.size()==4 && sum==dSum){\n\t\t\t\tSystem.out.println(\"The generated random number are\");\n\t\t\t\tSystem.out.println(l.get(0));\n\t\t\t\tSystem.out.println(l.get(1));\n\t\t\t\tSystem.out.println(l.get(2));\n\t\t\t\tSystem.out.println(l.get(3));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"*******************\");\n\t\tSystem.out.println(\"Final Size :\"+l.size());\n\t\tSystem.out.println(\"Sum :\"+sum);\n\t\tfor(int j=0;j<l.size();j++){\n\t\t\tSystem.out.println(\"i th/st number :\"+l.get(j));\n\t\t}\n\t}", "public static void permute(char[] arr, int l, int r) {\n if (l == r) {\n System.out.println(String.valueOf(arr));\n } else {\n for (int i = l; i <= r; i++) {\n swap(arr, l, i);\n permute(arr, l + 1, r);\n swap(arr, l, i); // backtrack\n }\n }\n }", "public static <T> int m28125a(@C6003d List<? extends T> list) {\n C14445h0.m62478f(list, \"$receiver\");\n return list.size() - 1;\n }", "public static int AmChainLen(int[] d, int m) //length of chain, if not in chain then -1\n\t{\n\t\tint s =m;\n\t\tint c =0;\n\t\tArrayList<Long> ch = new ArrayList<Long>(0);\n\t\twhile(s > 0 && s<d.length)\n\t\t{\n\t\t\t\n\t\t\ts = d[s];\n\t\t\tc++;\n\t\t\tif(s == m) return c;\n\t\t\tif(ch.contains((long)s)) break;\n\t\t\tch.add((long)s);\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "public List<List<Integer>> fourSum(int[] nums, int target) {\n HashSet<List<Integer>> set = new HashSet<>();\n Arrays.sort(nums);\n if (nums.length < 4)\n Collections.emptyList();\n for (int i = 0; i < nums.length - 1; i++) {\n for (int j = i + 1; j < nums.length - 1; j++) {\n\n int mid = j + 1;\n int high = nums.length - 1;\n\n while (mid < high) {\n int sum = nums[i] + nums[j] + nums[mid] + nums[high];\n if (sum == target) {\n List<Integer> arr2 = new ArrayList<>();\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[mid]);\n arr2.add(nums[high]);\n set.add(arr2);\n }\n if (sum < target)\n mid++;\n else\n high--;\n }\n }\n\n }\n // return new ArrayList(set);\n return Collections.emptyList();\n }", "public static <C> C FOURTH(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(4);\n }\n return x;\n }", "public static void main(String[] args) {\r\n RotateList rl = new RotateList();\r\n // test list : 1->2->3->4->5->NULL.\r\n ListNode testList = new ListNode(0);\r\n for (int i = 1; i < 6; i++) {\r\n testList.addNodeTail(new ListNode(i));\r\n }\r\n System.out.println(\"The input list is the following:\");\r\n testList.printList();\r\n ListNode result = rl.rotateRight(testList, 3);\r\n System.out.println(\"And the output is the following:\");\r\n result.printList();\r\n }", "public static List<Integer> rotLeft(List<Integer> a, int d) {\n for(int count = 0; count < d; count++) {\n shiftElements(a);\n }\n return a;\n }", "public static void threeSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n int z1) {\n if (low + 1 >= high)\n return;\n\n int max = nums[high];\n if (3 * nums[low] > target || 3 * max < target)\n return;\n\n int i, z;\n for (i = low; i < high - 1; i++) {\n z = nums[i];\n if (i > low && z == nums[i - 1]) // avoid duplicate\n continue;\n if (z + 2 * max < target) // z is too small\n continue;\n\n if (3 * z > target) // z is too large\n break;\n\n if (3 * z == target) { // z is the boundary\n if (i + 1 < high && nums[i + 2] == z)\n fourSumList.add(Arrays.asList(z1, z, z, z));\n break;\n }\n\n twoSumForFourSum(nums, target - z, i + 1, high, fourSumList, z1, z);\n }\n\n}", "public List<List<Integer>> foursum(int[] nums, int target) {\n List<List<Integer>> result = new ArrayList<>();\n if(nums == null || nums.length < 4) {\n return result;\n }\n Arrays.sort(nums);\n for(int idx1=0; idx1<nums.length-3; idx1++) {\n if(idx1 != 0 && nums[idx1] == nums[idx1-1]) {continue;}\n for(int idx2=idx1+1; idx2 < nums.length -2; idx2++) {\n if(idx2 != idx1+1 && nums[idx2] == nums[idx2-1]) {continue;}\n int lp=idx2+1, rp = nums.length-1;\n while(lp < rp) {\n int sum = nums[idx1] + nums[idx2] + nums[lp] + nums[rp];\n if(sum == target) {\n result.add(Arrays.asList(nums[idx1],nums[idx2],nums[lp],nums[rp]));\n lp++; rp--;\n while(lp < rp && (nums[lp] == nums[lp-1])) {lp++;}\n while(lp < rp && (nums[rp] == nums[rp+1])) {rp--;}\n } else if(sum < target) {\n lp++;\n } else {\n rp--;\n }\n }\n }\n }\n return result;\n }", "public static IntList incrList(IntList L, int x) {\n /* Your code here. */\n IntList newList = null;\n for (int i = L.size() - 1; i > -1; i--) { //construct the newList backwardly, iteratively\n newList = new IntList(L.get(i) + x, newList);\n }\n return newList;\n }", "public List<List<Integer>> generateRec(int numRows) {\n if(numRows==1) return new ArrayList(Arrays.asList(new ArrayList(Arrays.asList(1))));\n List<List<Integer>> ans = generateRec(numRows-1);\n List<Integer> prev = ans.get(ans.size()-1);\n List<Integer> cur = new ArrayList(Arrays.asList(1));\n for(int j=1;j<prev.size();j++)\n cur.add(prev.get(j-1)+prev.get(j));\n cur.add(1);\n ans.add(cur);\n return ans;\n }", "public static List<List<Integer>> generate(int numRows){\r\n\t\tList<List<Integer>> list = new ArrayList<List<Integer>>();\r\n\t\tArrayList<Integer> row = new ArrayList<Integer>();\r\n\t\tfor( int i = 0; i < numRows ; ++i ){\r\n\t\t\trow.add(0, 1);\r\n\t\t\tfor( int j = 1; j < row.size()-1; ++j )\r\n\t\t\t\trow.set(j, row.get(j)+row.get(j+1));\r\n\t\t\tlist.add(new ArrayList<Integer>(row));\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public static int computeTimeFinish(ArrayList<Integer> l) {\n\n int sum = 0;\n Collections.sort(l);\n int[] peoples = new int[3];\n peoples[0] = l.size() / 3;\n peoples[1] = (l.size() - peoples[0]) / 2;\n peoples[2] = (l.size() - peoples[0]) / 2;\n int position = 0;\n\n while (l.size() > 0){\n int count = 0;\n int total = 0;\n\n while (peoples[position] > 0){\n\n if (l.size() == 0){\n break;\n }\n\n if (count % 2 == 0) {\n total += l.get(l.size() - 1);\n l.remove(l.size() - 1);\n } else {\n total += l.get(0);\n l.remove(0);\n }\n peoples[position]--;\n count++;\n }\n if (total > sum){\n sum = total;\n }\n position++;\n }\n\n return sum;\n }", "public Matrix4f GetMultipliedMatrix(Matrix4f m) {\n\n\t/*\n\tinputs--\n\t\n\tm :\n\t The input matrix m, instance of Matrix4f\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tmul :\n\t The matrix this times m\n\t*/\n\t\n\t// Create new matrix to hold the results\n\tMatrix4f mul = new Matrix4f();\n\t\n\t// Double for loop based standard multiplication\n\tfor (int n_i = 0; n_i < 4; n_i ++) {\n\t \n\t for(int n_j = 0; n_j < 4 ; n_j ++) {\n\t\t\n\t\t// Set entry one by one\n\t\tfloat f_val = 0;\n\t\tfor (int n_k = 0; n_k < 4; n_k ++) {\n\t\t\n\t\t f_val += this.mat_f_m[n_i][n_k]*m.GetComponent(n_k, n_j);\n\t\t\n\t\t}\n\t\tmul.SetComponent(n_i, n_j, f_val);\n\t\t\n\t }\n\t\n\t}\n\t\n\t// Return the multiplied matrix\n\treturn mul;\n \n }", "public List<List<Integer>> fourSum(int[] nums, int target) {\n Arrays.sort(nums); // sort\n List<List<Integer>> res = new ArrayList<>();\n if (nums.length < 4) return res;\n\n for (int i = 0; i < nums.length - 3; i++) {\n if (i == 0 || (i > 0 && nums[i] != nums[i - 1])) { // dedupe\n int sum1 = target - nums[i];\n for (int j = i + 1; j < nums.length - 2; j++) {\n if (j == i + 1 || (j > i + 1 && nums[j] != nums[j - 1])) {\n int newTarget = sum1;\n int left = j + 1, right = nums.length - 1, sum2 = newTarget - nums[j];\n while (left < right) {\n if (nums[left] + nums[right] == sum2) {\n res.add(new ArrayList<>(Arrays.asList(nums[i],\n nums[j], nums[left], nums[right])));\n\n while (left < right && nums[left] == nums[left + 1])\n left++; // dedupe\n while (left < right && nums[right] == nums[right - 1])\n right--; // dedupe\n\n left++; right--;\n }\n else if (nums[left] + nums[right] < sum2)\n left++;\n else right--;\n }\n }\n }\n }\n }\n return res;\n }", "public List<List<Integer>> fourSum_1(int[] nums, int target) \n {\n \tList<List<Integer>> result = new ArrayList<List<Integer>>();\n \tif(nums==null || nums.length<4) return result;\n \tArrays.sort(nums);\n \tfor(int i=0; i<nums.length-3; i++)\n \t{\n \t\tif(i!=0 && nums[i]==nums[i-1]) continue;\n \t\t//if(nums[i]>target) break; \n \t\t//Revisit!!! Why you cannot do this break here\n \t\tfor(int j=i+1; j<nums.length-2;j++)\n \t\t{\n \t\t\tif(j!=(i+1) && nums[j]==nums[j-1]) continue;\n \t\t\tint cur = nums[i]+nums[j];\n \t\t\t//if(cur>target) break;\n \t\t\t//Revisit!!! Why you cannot do this break here\n \t\t\t\n \t\t\tint k=j+1;\n \t\t\tint l = nums.length-1;\n \t\t\twhile(k<l)\n \t\t\t{\n \t\t\t\tif((cur+nums[k]+nums[l])==target)\n \t\t\t\t{\n \t\t\t\t\tList<Integer> newRes = new ArrayList<Integer>();\n \t\t\t\t\tnewRes.add(nums[i]);\n \t\t\t\t\tnewRes.add(nums[j]);\n \t\t\t\t\tnewRes.add(nums[k]);\n \t\t\t\t\tnewRes.add(nums[l]);\n \t\t\t\t\tresult.add(newRes);\n \t\t\t\t\tk++;\n \t\t\t\t\tl--;\n \t\t\t\t\twhile(k<l && nums[k]==nums[k-1]) k++;\n \t\t\t\t\twhile(k<l && nums[l]==nums[l+1]) l--;\n \t\t\t\t}\n \t\t\t\telse if((cur+nums[k]+nums[l])>target)\n \t\t\t\t{\n \t\t\t\t\tl--;\n \t\t\t\t\twhile(k<l && nums[l]==nums[l+1]) l--;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tk++;\n \t\t\t\t\twhile(k<l && nums[k]==nums[k-1]) k++;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \treturn result;\n }", "public static List<Integer> icecreamParlor(int m, List<Integer> arr) {\n\t\tInteger[] res = new Integer[2];\n\t\tHashtable<Integer, Integer> price_index = new Hashtable<>();\n\t\tfor (int i = 0; i < arr.size(); i++) {\n\t\t\tint p1 = arr.get(i);\n\t\t\tint p2 = m - p1;\n\n\t\t\tInteger j = price_index.get(p2);\n\t\t\tif (j != null) {\n\t\t\t\tres[0] = j + 1;\n\t\t\t\tres[1] = i + 1;\n\t\t\t}\n\t\t\tprice_index.put(p1, i);\n\t\t}\n\t\treturn Arrays.asList(res);\n\t}", "static List<MeanWithClusterProbAggregator> reduce(List<MeanWithClusterProbAggregator> l,\n List<MeanWithClusterProbAggregator> r) {\n A.ensure(l != null || r != null, \"Both partitions cannot equal to null\");\n\n if (l == null || l.isEmpty())\n return r;\n if (r == null || r.isEmpty())\n return l;\n\n A.ensure(l.size() == r.size(), \"l.size() == r.size()\");\n List<MeanWithClusterProbAggregator> res = new ArrayList<>();\n for (int i = 0; i < l.size(); i++)\n res.add(l.get(i).plus(r.get(i)));\n\n return res;\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "private void reduce(String[] arguments) {\n\t\ttry { \n\t\t\tlastDeletedNode = null;\n\t\t\tint ID = Integer.parseInt(arguments[1]);\n\t int m = Integer.parseInt(arguments[2]);\n\t Node curr = searchID(root, ID);\n\t if(curr != null)\n\t {\n\t \tcurr.count -= m;\n\t \tif(curr.count > 0)\n\t \t\tSystem.out.printf(\"%d\\n\", curr.count);\n\t \telse\n\t \t{\n\t \t\tdelete(root, ID);\n\t \t\tSystem.out.println(\"0\");\n\t \t}\n\t }\n\t else\n\t \tSystem.out.println(\"0\");\n\t } catch(NumberFormatException e) { \n\t System.out.println(\"Argument not an Integer\");\n\t }\n\t}", "public List<List<Integer>> generate(int numRows) {\n List<List<Integer>> ret = new ArrayList<>();\n\n if (numRows == 0) return ret;\n\n\n for (int i = 0; i < numRows; i++) {\n List<Integer> list = new ArrayList<>(); //first\n list.add(1);\n for (int j = 1; j < i; j++) {\n List<Integer> getList = ret.get(i - 1);\n int num = getList.get(j - 1) + getList.get(j);\n list.add(num);\n }\n\n if (i!=0){\n list.add(1); //end\n }\n ret.add(list);\n }\n\n return ret;\n }", "private int A(int n, int m) {\n int res = 1;\n for (int i = 0; i < m; n++)\n res *= n;\n return res;\n }", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "long sum(long[] a, int l, int r) {\n return l <= 0 ? a[r] : (a[r] + mod - a[l - 1]) % mod;\n }", "public static void main(String... args){\n\n List<List<Integer>> listN = new ArrayList<>();\n\n List<Integer> list1N = new ArrayList<>();\n list1N.add(1);\n list1N.add(2);\n list1N.add(3);\n\n\n List<Integer> list2N = new ArrayList<>();\n list2N.add(4);\n list2N.add(5);\n\n\n\n List<Integer> list3N = new ArrayList<>();\n list3N.add(5);\n list3N.add(6);\n\n\n List<Integer> list4N = new ArrayList<>();\n list4N.add(7);\n list4N.add(8);\n list4N.add(9);\n\n listN.add(list1N);\n listN.add(list2N);\n listN.add(list3N);\n listN.add(list4N);\n\n List<Integer> outputN = getMergedLLEfficient(listN);\n\n for(Integer elem : outputN)\n System.out.println(elem);\n }", "@Override\n\tpublic double mangeLegumes() {\n\t\treturn quantiteLegumes*this.getPoids();\n\t}", "public static void main(String[] args)\n\t{\n\t\tint n = 3;\n\t\tint m = 8;\n\t\t\n\t\tint tmp = m;\n\t\t\n\t\tif( (tmp >> (n-1) & 1) == 1)\n\t\t\ttmp &=~(1 << (n-1)) ;\n\t\telse\n\t\t\ttmp |=(1 << (n-1)) ;\n\t\t\n\t\tSystem.out.println(tmp);\n\t\t\n\t\tSystem.out.println(m ^= (1<<n-1));\n\t}", "public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }", "public final int mo34010l() {\n return this.f7227g;\n }", "public int getM() {\n return m_;\n }", "public static void main(String[] args) {\n\t\t\n\t\t int m= 9, n= 1,x=0 ;\n\t\t \n\t\t while (m>n) {\n\t\t\t m--;\n\t\t\t n+=2;\n\t\t\t x+=m+n;\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t \n\t\t }\n\t\t System.out.println(x);\n\t\t \n\t\t \n\t\t \n\t\t // a) 11\n\t \t// b) 13\n //c) 23\n //d) 36\n //e) 50\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tint []nums = {0,0,0};\n\t\tList<List<Integer>> res = threeSum(nums);\n\t\tfor(List list : res) {\n\t\t\tfor(int i=0; i<list.size(); i++) {\n\t\t\t\tSystem.out.print(list.get(i));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public int getM() {\n return m_;\n }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "public int[] pre4(int[] nums) {\n\n\t\tint length = 0;\n\n\t\tfor (int i=0; nums[i]!=4; i++) {\n\t\t\tlength++;\n\t\t}\n\n\t\tint[] array = new int[length];\n\n\t\tfor (int i=0; i < nums.length; i++) {\n\t\t\tif (nums[i] == 4) {\n\t\t\t\treturn array;\n\t\t\t}\n\t\t\tarray[i] = nums[i];\n\t\t}\n\n\t\treturn array;\n\n\t}", "public List<List<GenPolynomial<C>>> \n normalizeMatrix(int flen, List<List<GenPolynomial<C>>> M) { \n if ( M == null ) {\n return M;\n }\n if ( M.size() == 0 ) {\n return M;\n }\n List<List<GenPolynomial<C>>> N = new ArrayList<List<GenPolynomial<C>>>();\n List<List<GenPolynomial<C>>> K = new ArrayList<List<GenPolynomial<C>>>();\n int len = M.get( M.size()-1 ).size(); // longest row\n // pad / extend rows\n for ( List<GenPolynomial<C>> row : M ) {\n List<GenPolynomial<C>> nrow = new ArrayList<GenPolynomial<C>>( row );\n for ( int i = row.size(); i < len; i++ ) {\n nrow.add( null );\n }\n N.add( nrow );\n }\n // System.out.println(\"norm N fill = \" + N);\n // make zero columns\n int k = flen;\n for ( int i = 0; i < N.size(); i++ ) { // 0\n List<GenPolynomial<C>> row = N.get( i );\n if ( debug ) {\n logger.info(\"row = \" + row);\n }\n K.add( row );\n if ( i < flen ) { // skip identity part\n continue;\n }\n List<GenPolynomial<C>> xrow;\n GenPolynomial<C> a;\n //System.out.println(\"norm i = \" + i);\n for ( int j = i+1; j < N.size(); j++ ) {\n List<GenPolynomial<C>> nrow = N.get( j );\n //System.out.println(\"nrow j = \" +j + \", \" + nrow);\n if ( k < nrow.size() ) { // always true\n a = nrow.get( k );\n //System.out.println(\"k, a = \" + k + \", \" + a);\n if ( a != null && !a.isZERO() ) {\n xrow = blas.scalarProduct( a, row);\n xrow = blas.vectorAdd(xrow,nrow);\n //System.out.println(\"xrow = \" + xrow);\n N.set( j, xrow );\n }\n }\n }\n k++;\n }\n //System.out.println(\"norm K reduc = \" + K);\n // truncate \n N.clear();\n for ( List<GenPolynomial<C>> row: K ) {\n List<GenPolynomial<C>> tr = new ArrayList<GenPolynomial<C>>();\n for ( int i = 0; i < flen; i++ ) {\n tr.add( row.get(i) );\n }\n N.add( tr );\n }\n K = N;\n //System.out.println(\"norm K trunc = \" + K);\n return K;\n }", "public int reversePairs4(int[] nums) {\n int count = 0;\n Map<Long, Integer> bit = new HashMap<>();\n final long shift = 1L << 32;\n final long max = shift << 1;\n for (int i = nums.length - 1; i >= 0; i--) {\n for (long j = nums[i] - 1 + shift; j > 0; j -= (j & -j)) {\n count += bit.getOrDefault(j, 0);\n }\n for (long j = (long)nums[i] * 2 + shift; j < max; j += (j & -j)) {\n bit.put(j, bit.getOrDefault(j, 0) + 1);\n }\n }\n return count;\n }", "public ArrayList<ArrayList<Integer>> fourSum_02(ArrayList<Integer> a, int b) {\n\t\t//List to store the result\n\t\tArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n \tint len = a.size();\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = a.get(i) + a.get(j);\n \t\t\tif(h.containsKey(b-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(b-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add( a.get(i));\n\t \t\t\t\tl.add( a.get(j));\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != a.get(i)) && (exJ != a.get(j))) {\n\t \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(a.get(i));\n\t\t \t\t\t\tl.add(a.get(j));\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tboolean flag = true;\n\t\t \t\t\t\t\n\t\t \t\t\t\tfor(ArrayList<Integer> ll : res) {\n\t\t \t\t\t\t\tif(ll.equals(l)) {\n\t\t \t\t\t\t\t\tflag = false;\n\t\t \t\t\t\t\t\tbreak;\n\t\t \t\t\t\t\t}\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(flag == true)\n\t\t \t\t\t\t\tres.add(l);\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\th.put(sum, new Index(a.get(i), a.get(j)));\n \t\t}\n \t}\n \treturn res;\n\t}", "public static void enumm(int n, List<Integer> l, Set<String> set) {\n\t\tif (evaluar(l)) {\n\t\t\tSystem.out.println(\"-----\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < l.size(); i++) {\n\t\t\t\tif (l.get(i) <= 1)continue;\n\t\t\t\tint x = l.get(i);\n\t\t\t\tl.remove(i);\n\t\t\t\tfor (int j = 1; j <= n / 2; j++) {\n\t\t\t\t\tint d = x - (j);\n\t\t\t\t\tif (d < 1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tArrayList<Integer> it = new ArrayList<>(l);\n\t\t\t\t\tit.add(d);\n\t\t\t\t\tit.add(j);\n\t\t\t\t\tCollections.sort(it);\n\t\t\t\t\t// it.sort((s1,s2)->s1.compareTo(s2));\n\t\t\t\t\tset.add(it.toString());\n\t\t\t\t\tenumm(n, it, set);\n\t\t\t\t}\n\t\t\t\tl.add(i, x);\n\t\t\t}\n\t\t}\n\t}", "public int manhattan() {\n int md = 0;\n int counter = 1;\n for (int i = 0; i < this.tiles.length; i++) {\n int n = this.tiles[i];\n if (n != counter && n > 0)\n md += findMD(i, n);\n counter++;\n }\n return md;\n }", "public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>();\n Arrays.sort(num);\n \n for (int i = 0; i < num.length - 3; i++) {\n if (i != 0 && num[i] == num[i - 1]) {\n continue;\n }\n \n for (int j = i + 1; j < num.length - 2; j++) {\n if (j != i + 1 && num[j] == num[j - 1])\n continue;\n \n int left = j + 1;\n int right = num.length - 1;\n while (left < right) {\n int sum = num[i] + num[j] + num[left] + num[right];\n if (sum < target) {\n left++;\n } else if (sum > target) {\n right--;\n } else {\n ArrayList<Integer> tmp = new ArrayList<Integer>();\n tmp.add(num[i]);\n tmp.add(num[j]);\n tmp.add(num[left]);\n tmp.add(num[right]);\n rst.add(tmp);\n left++;\n right--;\n while (left < right && num[left] == num[left - 1]) {\n left++;\n }\n while (left < right && num[right] == num[right + 1]) {\n right--;\n }\n }\n }\n }\n }\n \n return rst;\n }", "int Manhattan(ArrayList<ArrayList<Integer>> cur)\n {\n int Manhattan = 0;\n\n if (cur.get(0).get(0) == 1)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(0).get(0) == 2 || cur.get(0).get(0) == 4)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(0).get(0) == 3 || cur.get(0).get(0) == 7 || cur.get(0).get(0) == 5)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(0).get(0) == 6 || cur.get(0).get(0) == 8)\n {\n Manhattan += 3;\n }\n\n else if (cur.get(0).get(0) == 0)\n {\n Manhattan += 4;\n }\n\n\n if (cur.get(0).get(1) == 2)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(0).get(1) == 1 || cur.get(0).get(1) == 3 || cur.get(0).get(1) == 5)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(0).get(1) == 4 || cur.get(0).get(1) == 6 || cur.get(0).get(1) == 8)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(0).get(1) == 7 || cur.get(0).get(1) == 0)\n {\n Manhattan += 3;\n }\n\n\n if (cur.get(0).get(2) == 3)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(0).get(2) == 2 || cur.get(0).get(2) == 6)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(0).get(2) == 1 || cur.get(0).get(2) == 5 || cur.get(0).get(2) == 0)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(0).get(2) == 4 || cur.get(0).get(2) == 8)\n {\n Manhattan += 3;\n }\n\n else if (cur.get(0).get(2) == 7)\n {\n Manhattan += 4;\n }\n\n\n if (cur.get(1).get(0) == 4)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(1).get(0) == 1 || cur.get(1).get(0) == 5 || cur.get(1).get(0) == 7)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(1).get(0) == 2 || cur.get(1).get(0) == 6 || cur.get(1).get(0) == 8)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(1).get(0) == 3 || cur.get(1).get(0) == 0)\n {\n Manhattan += 3;\n }\n\n\n if (cur.get(1).get(1) == 5)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(1).get(1) == 2 || cur.get(1).get(1) == 4 || cur.get(1).get(1) == 6 || cur.get(1).get(1) == 8)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(1).get(1) == 1 || cur.get(1).get(1) == 3 || cur.get(1).get(1) == 7 || cur.get(1).get(1) == 0)\n {\n Manhattan += 2;\n }\n\n\n if (cur.get(1).get(2) == 6)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(1).get(2) == 5 || cur.get(1).get(2) == 3 || cur.get(1).get(2) == 0)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(1).get(2) == 2 || cur.get(1).get(2) == 4 || cur.get(1).get(2) == 8)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(1).get(2) == 1 || cur.get(1).get(2) == 7)\n {\n Manhattan += 3;\n }\n\n\n if (cur.get(2).get(0) == 7)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(2).get(0) == 4 || cur.get(2).get(0) == 8)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(2).get(0) == 1 || cur.get(2).get(0) == 5 || cur.get(2).get(0) == 0)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(2).get(0) == 2 || cur.get(2).get(0) == 6)\n {\n Manhattan += 3;\n }\n\n else if (cur.get(2).get(0) == 3)\n {\n Manhattan += 4;\n }\n\n\n if (cur.get(2).get(1) == 8)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(2).get(1) == 7 || cur.get(2).get(1) == 5 || cur.get(2).get(1) == 0)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(2).get(1) == 2 || cur.get(2).get(1) == 4 || cur.get(2).get(1) == 6)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(2).get(1) == 1 || cur.get(2).get(1) == 3)\n {\n Manhattan += 3;\n }\n\n if (cur.get(2).get(2) == 0)\n {\n Manhattan += 0;\n }\n\n else if (cur.get(2).get(2) == 8 || cur.get(2).get(2) == 6)\n {\n Manhattan += 1;\n }\n\n else if (cur.get(2).get(2) == 3 || cur.get(2).get(2) == 5 || cur.get(2).get(2) == 7)\n {\n Manhattan += 2;\n }\n\n else if (cur.get(2).get(2) == 2 || cur.get(2).get(2) == 4)\n {\n Manhattan += 3;\n }\n\n else if (cur.get(2).get(2) == 1)\n {\n Manhattan += 4;\n }\n\n return Manhattan;\n\n }", "void mo1638a(long j, long j2, List list, ayp ayp);", "private static long f(long m) {\n\t\tlong k = 1;\r\n\t\tfor (long i=1; i<=m; i++){\r\n\t\t\tk *= i;\r\n\t\t}\r\n\t\treturn k;\r\n\t}", "private Instruction decodeL4() {\n String subType = nullIsIllegal(json.get(InstructionCodec.SUBTYPE),\n InstructionCodec.SUBTYPE + InstructionCodec.ERROR_MESSAGE).asText();\n\n if (subType.equals(L4ModificationInstruction.L4SubType.TCP_DST.name())) {\n TpPort tcpPort = TpPort.tpPort(nullIsIllegal(json.get(InstructionCodec.TCP_PORT),\n InstructionCodec.TCP_PORT + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());\n return Instructions.modTcpDst(tcpPort);\n } else if (subType.equals(L4ModificationInstruction.L4SubType.TCP_SRC.name())) {\n TpPort tcpPort = TpPort.tpPort(nullIsIllegal(json.get(InstructionCodec.TCP_PORT),\n InstructionCodec.TCP_PORT + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());\n return Instructions.modTcpSrc(tcpPort);\n } else if (subType.equals(L4ModificationInstruction.L4SubType.UDP_DST.name())) {\n TpPort udpPort = TpPort.tpPort(nullIsIllegal(json.get(InstructionCodec.UDP_PORT),\n InstructionCodec.UDP_PORT + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());\n return Instructions.modUdpDst(udpPort);\n } else if (subType.equals(L4ModificationInstruction.L4SubType.UDP_SRC.name())) {\n TpPort udpPort = TpPort.tpPort(nullIsIllegal(json.get(InstructionCodec.UDP_PORT),\n InstructionCodec.UDP_PORT + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());\n return Instructions.modUdpSrc(udpPort);\n }\n throw new IllegalArgumentException(\"L4 Instruction subtype \"\n + subType + \" is not supported\");\n }", "public void test4Draft(){\n assertEquals( 4, $computeRange.$list().size());\n //System.out.println( $computeRange.list$Normalized() );\n assertEquals( 4, $computeRange.$listNormalized().size());\n //System.out.println($computeRange.fill(\"multiply10to20\",10,20,\"*\"));\n }", "public void threeSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n\t\t\tint z1) {\n\t\tif (low + 1 >= high)\n\t\t\treturn;\n\n\t\tint max = nums[high];\n\t\tif (3 * nums[low] > target || 3 * max < target)\n\t\t\treturn;\n\n\t\tint i, z;\n\t\tfor (i = low; i < high - 1; i++) {\n\t\t\tz = nums[i];\n\t\t\tif (i > low && z == nums[i - 1]) // avoid duplicate\n\t\t\t\tcontinue;\n\t\t\tif (z + 2 * max < target) // z is too small\n\t\t\t\tcontinue;\n\n\t\t\tif (3 * z > target) // z is too large\n\t\t\t\tbreak;\n\n\t\t\tif (3 * z == target) { // z is the boundary\n\t\t\t\tif (i + 1 < high && nums[i + 2] == z)\n\t\t\t\t\tfourSumList.add(Arrays.asList(z1, z, z, z));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttwoSumForFourSum(nums, target - z, i + 1, high, fourSumList, z1, z);\n\t\t}\n\n\t}", "public void threeSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n\t\t\tint z1) {\n\t\tif (low + 1 >= high)\n\t\t\treturn;\n\n\t\tint max = nums[high];\n\t\tif (3 * nums[low] > target || 3 * max < target)\n\t\t\treturn;\n\n\t\tint i, z;\n\t\tfor (i = low; i < high - 1; i++) {\n\t\t\tz = nums[i];\n\t\t\tif (i > low && z == nums[i - 1]) // avoid duplicate\n\t\t\t\tcontinue;\n\t\t\tif (z + 2 * max < target) // z is too small\n\t\t\t\tcontinue;\n\n\t\t\tif (3 * z > target) // z is too large\n\t\t\t\tbreak;\n\n\t\t\tif (3 * z == target) { // z is the boundary\n\t\t\t\tif (i + 1 < high && nums[i + 2] == z)\n\t\t\t\t\tfourSumList.add(Arrays.asList(z1, z, z, z));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttwoSumForFourSum(nums, target - z, i + 1, high, fourSumList, z1, z);\n\t\t}\n\n\t}", "public int hammingWeight4(int n) {\n n -= (n >>> 1) & 0x55555555; //put count of each 2 bits into those 2 bits\n n = (n & 0x33333333) + (n >>> 2 & 0x33333333); //put count of each 4 bits into those 4 bits\n n = (n + (n >>> 4)) & 0x0F0F0F0F; //put count of each 8 bits into those 8 bits\n n += n >>> 8; // put count of each 16 bits into those 8 bits\n n += n >>> 16; // put count of each 32 bits into those 8 bits\n return n & 0xFF;\n }", "private int count(int[] L, int len) {\n int sum = 0;\n for (int l : L) {\n sum += l / len; //!!! 必须是(l/len), l可以被cut成多块长度为len的木头。\n }\n return sum;\n }", "@CallSuper\n public long multiplyAndGet(final long l) {\n long currentValue;\n\n for (; ; ) {\n currentValue = get();\n if (compareAndSet(currentValue, currentValue * l)) {\n return currentValue;\n }\n ii(this, mOrigin, \"Collision in concurrent add, will try again: \" + currentValue);\n }\n }", "public void m17237a(java.util.List<java.lang.Integer> r6) {\n /*\n r5 = this;\n r0 = 0;\n if (r6 == 0) goto L_0x0009;\n L_0x0003:\n r1 = r6.size();\n if (r1 != 0) goto L_0x000a;\n L_0x0009:\n return;\n L_0x000a:\n r1 = r5.f20994d;\n r1.lock();\n r2 = r5.m17234d();\n r1 = \"\";\n L_0x0016:\n r3 = r6.size();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n if (r0 >= r3) goto L_0x003b;\n L_0x001c:\n r3 = new java.lang.StringBuilder;\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r3.append(r1);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = r6.get(r0);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r1.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = \",\";\n r1 = r1.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r1.toString();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r0 + 1;\n goto L_0x0016;\n L_0x003b:\n r0 = r1.length();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n if (r0 <= 0) goto L_0x006e;\n L_0x0041:\n r0 = 0;\n r3 = r1.length();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = r3 + -1;\n r0 = r1.substring(r0, r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = \"result\";\n r3 = new java.lang.StringBuilder;\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r4 = \"_id in (\";\n r3 = r3.append(r4);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r3.append(r0);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = \")\";\n r0 = r0.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r0.toString();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = 0;\n r2.delete(r1, r0, r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n L_0x006e:\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x0077:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00a0:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00c9:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00f2:\n r0 = move-exception;\n r2.close();\n r1 = r5.f20994d;\n r1.unlock();\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.tts.e.c.a(java.util.List):void\");\n }", "public void dorm2l_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);", "static int maxXor(int l, int r) {\n\n int max = 0;\n int rplus = r + 1;\n for (; l < rplus; l++) {\n for (int g = l; g < rplus; g++) {\n int k = l ^ g;\n if (k > max) {\n max = k;\n }\n }\n }\n return max;\n }", "private int kiemtrasopt (List list){\n int dem = list.size();\n return dem;\n }", "public int wiggleMaxLength4(int[] nums) {\n if(nums == null || nums.length == 0){\n return 0;\n } else if(nums.length == 1){\n \treturn 1;\n }\n \n int len = nums.length;\n int[] tempNums = new int[len - 1];\n int[] dp = new int[len - 1];\n int maxLen = 0;\n \n for(int i = 0; i < len - 1; i++){\n if(nums[i] - nums[i + 1] > 0){\n tempNums[i] = 1;\n } else if(nums[i] - nums[i + 1] < 0){\n tempNums[i] = -1;\n } else {\n tempNums[i] = 0;\n }\n }\n \n for(int i = 0; i < len - 1; i++){\n \tif(tempNums[i] != 0){\n \t\tdp[i] = 1;\n \t}\n }\n \n maxLen = dp[0];\n \n for(int i = 0; i < len - 1; i++){\n for(int j = 0; j < i; j++){\n if(tempNums[i] * tempNums[j] == -1){\n dp[i] = Math.max(dp[i], dp[j] + 1);\n maxLen = Math.max(maxLen, dp[i]);\n }\n }\n }\n \n return maxLen + 1;\n }", "@Override\r\n\tpublic int challengeFour(int[][] arr) {\n\t\treturn 0;\r\n\t}", "private void plant(int l) {\n if (l >= empties.size()) {\n if (currentMines > bestMines) {\n copyField(current, best);\n bestMines = currentMines;\n }\n //geval 2: we zijn nog niet alle lege vakjes afgegaan, en we kunnen misschien nog beter doen dan de huidige oplossing\n } else if(currentMines + (empties.size() - l) > bestMines ) {\n //recursief verder uitwerken, met eerst de berekening van welk vakje we na (i,j) zullen behandelen\n int i = empties.get(l).getI();\n int j = empties.get(l).getJ();\n\n //probeer een mijn te leggen op positie i,j\n if (canPlace(i,j)) {\n placeMine(i, j);\n currentMines++;\n\n\n //recursie\n plant(l + 1);\n\n //hersteloperatie\n removeMine(i, j);\n currentMines--;\n\n }\n //recursief verder werken zonder mijn op positie i,j\n plant(l +1);\n }\n }" ]
[ "0.5725322", "0.57090926", "0.57021654", "0.55133796", "0.53472257", "0.5310767", "0.5152118", "0.5141349", "0.5138144", "0.51298445", "0.51206523", "0.51042825", "0.5085492", "0.5072985", "0.50682867", "0.5031558", "0.49809492", "0.49793038", "0.49735427", "0.49231872", "0.49022353", "0.48901868", "0.48842618", "0.4878606", "0.48734882", "0.48494464", "0.48419073", "0.483785", "0.4837104", "0.48037696", "0.48011", "0.47929555", "0.47912627", "0.47814512", "0.47776037", "0.47719607", "0.47713825", "0.47694826", "0.4768162", "0.47656816", "0.4763507", "0.4761738", "0.47469404", "0.47465643", "0.47427812", "0.47406095", "0.47394225", "0.47350004", "0.47349402", "0.4726681", "0.47253835", "0.4713316", "0.47023833", "0.4693845", "0.4689511", "0.46870762", "0.46869865", "0.46858373", "0.4682531", "0.46825302", "0.46801403", "0.4678517", "0.46772256", "0.46690664", "0.46654817", "0.4662222", "0.46587348", "0.46584675", "0.46517923", "0.4646686", "0.46465126", "0.4646399", "0.4644885", "0.46423554", "0.4640296", "0.4636026", "0.46354318", "0.46348843", "0.463377", "0.46317443", "0.46304047", "0.46301726", "0.4629699", "0.46274525", "0.4625156", "0.46238402", "0.46227726", "0.462009", "0.46169305", "0.46169305", "0.46133596", "0.46132216", "0.46085626", "0.45941454", "0.4593701", "0.45916668", "0.45867878", "0.45852947", "0.45820716", "0.45814618" ]
0.5091785
12
Clock. Returns the current CPU clock reading in milliseconds. Intervalls are system dependent.
public static long CLOCK() { return java.lang.System.currentTimeMillis(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double readClock()\n {\n return (System.currentTimeMillis() - startingTime) / 1000.0;\n }", "public double readClock()\n {\n\tif (frameByFrameClock) {\n\t return frameNumber * (1/30.0f);\n\t} else {\n\t long elapsed;\n\t \n\t if (drawAnimation.value) {\n\t\t// Time during animation\n\t\telapsed = System.currentTimeMillis() - startTime;\n\t } else {\n\t\t// Time during pause\n\t\telapsed = pauseTime - startTime;\n\t }\n\t \n\t return elapsed / 1000.0f;\n\t}\n }", "public int giveClock()\n {\n return clock;\n }", "long getCurrentClockNs() {\n return System.nanoTime();\n }", "public long getCurrentWallClockTime() {\n return System.currentTimeMillis() - startWallClockTime;\n }", "public long getLogicalClock() {\n return logicalclock.get();\n }", "public Clock getClock() {\n\t\treturn clock;\n\t}", "public float getEffectiveClockFrequency() {\n return (float) getCpu().getTime() * NANOSECS_IN_MSEC / getUptime();\n }", "public static GameClock getGameClock() {\r\n\t\treturn clock;\r\n\t}", "public static long getCpuTime( ) {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n\n bean.getCurrentThreadCpuTime( ) : 0L;\n\n }", "public static long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}", "public static long getCpuTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadCpuTime(): 0L;\n }", "public static long getCpuTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadCpuTime( ) : 0L;\n }", "public static long getCpuTime(){\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ?\n bean.getCurrentThreadCpuTime() : 0L;\n }", "private long getCpuTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : 0L;\n }", "Object getClock();", "public int getLogicalClock() throws RemoteException;", "public double getCpuTimeSec() {\n\treturn getCpuTime() / Math.pow(10, 9);\t\t\n}", "public long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}", "public static long getTime() \r\n {\r\n return System.nanoTime(); \r\n }", "public static long getSystemTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()): 0L;\n }", "public int getClockFrequency() {\n return clockFrequency;\n }", "public long getCpuTime() {\n\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\treturn bean.isCurrentThreadCpuTimeSupported() ?\n\t\t\tbean.getCurrentThreadCpuTime() : 0L;\n\t\n}", "public static long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n\n }", "public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}", "public long cpuMicros() {\n return this.cpuNanos / 1000;\n }", "public long getCpuTimeNanos() {\n return cpuTimeToNanos(cpu.getTime());\n }", "private long getSystemTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()) : 0L;\n }", "public VectorClock getClock() {\n\treturn vclock;\n }", "private long timeNow()\n {\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return (System.currentTimeMillis() * 1000L) + DUTC.get() * 1000000L + 3506716800000000L;\n }", "public long mo130408c() {\n return System.nanoTime();\n }", "public final long tickMillis() {\n return TIME_TICK;\n }", "public long getCurrentTimeMillis() {\n return System.currentTimeMillis();\n }", "public static long getTime() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}", "public long getCurrentSystemTime() {\n return getSystemTime() - startSystemTimeNano;\n }", "public static final long getTickMillis() {\n return p().TIME_TICK;\n }", "public double CPUServiceTime()\r\n\t{\r\n\t\treturn Math.random()* (30.0 - 10.0) + 10.0;\r\n\t}", "public static long currentTimeInSecond() {\n return Instant.now().getEpochSecond();\n }", "public static long now() {\n return System.nanoTime();\n }", "public long nanosToCpuTime(long nanosecs) {\n return nanosecs * clockFrequency / NANOSECS_IN_MSEC;\n }", "public Clock getValuationClock() {\n return (Clock) get(VALUATION_CLOCK_NAME);\n }", "public float getCurrentTime()\r\n\t{\r\n\t\tcurrenttime = Calendar.getInstance();\r\n\t\treturn currenttime.getTimeInMillis();\r\n\t}", "public long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n}", "public double getTime()\n {\n long l = System.currentTimeMillis()-base;\n return l/1000.0;\n }", "int getCPU_time();", "public long getCurrentThreadCpuTime() {\t\t\t\t\t\t//Total CPU time usage\n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\t\treturn bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : -1L;\n\t}", "Clock tryGetClock();", "@DISPID(56)\r\n\t// = 0x38. The runtime will prefer the VTID if present\r\n\t@VTID(54)\r\n\tint actualCPUTime_Milliseconds();", "public static double getTimeMs(){\n return System.nanoTime()*nanoToMs;\n }", "public int getTime(){\n return (timerStarted > 0) ? (int) ((System.currentTimeMillis() - timerStarted) / 1000L) : 0;\n }", "public long getStartCpuTime() {\r\n return startCpuTime;\r\n }", "public long elapsedTime(){\n\n // calculate elapsed time by getting current CPU time and substracting the CPU time from when we started the stopwatch\n\n // this does not stop the stopwatch\n\n return (magicBean.getCurrentThreadCpuTime() - stopWatchStartTimeNanoSecs);\n\n }", "public HashMap<User, Long> getClock(){\n\t\treturn this.clock;\n\t}", "public static int getCurrentMillisecond()\n\t{\n\t\treturn Calendar.getInstance().get(Calendar.MILLISECOND);\n\t}", "int time()\n\t{\n\t\treturn totalTick;\n\t}", "long ctime() {\n return ctime;\n }", "@Override\n\tpublic long getTime() {\n\t\treturn System.nanoTime() - startTime;\n\t}", "public float getCurrentTime () {\n\t\treturn timer;\n\t}", "long getCurrentTimeMs();", "private long CurrentTime(){\n return (TotalRunTime + System.nanoTime() - StartTime)/1000000;\n }", "public double time() {\n long diff = System.nanoTime() - start;\n double seconds = diff * 0.000000001;\n return seconds;\n }", "public int getSystemTime() {\n\t\treturn this.systemTime;\n\t}", "public static long getElapsedTime() {\n long time = System.currentTimeMillis() - START_TIME;\n // long time = System.nanoTime() / 1000000;\n return time;\n }", "public static float getCurrentTime(){\n return (float)(System.currentTimeMillis()-t0)/1000.0f;\r\n }", "@Override\n public synchronized double get() {\n if (m_running) {\n return ((getMsClock() - m_startTime) + m_accumulatedTime) / 1000.0;\n }\n return m_accumulatedTime;\n }", "public Long getCpu() {\n return this.Cpu;\n }", "public long getElapsedTimeMili() {\n return running ? ((System.currentTimeMillis() - startTime)/100) % 1000 : 0;\n }", "@Override\n\tpublic long currentTimeMillis() {\n\t\treturn this.currentTime;\n\t}", "long getCurrentTimeMs() {\n return System.currentTimeMillis();\n }", "public synchronized static int getTime() {\n\t\treturn time;\n\t}", "public long getElapsedMilliSecond() {\n long elapsed;\n if (running) {\n elapsed = (System.nanoTime() - startTime) / 1000000;\n } else {\n elapsed = (stopTime - startTime) / 1000000;\n }\n return elapsed;\n }", "private static long getClockFrequency(String target) throws IOException, InterruptedException {\n return pi4jSystemInfoConnector.getClockFrequency(target);\r\n }", "public static long GetElapsedTime() {\n\t\treturn System.currentTimeMillis() - _lTime;\n\t}", "protected void runClock() {\r\n // stop gameClock while game is iconified\r\n if( isRunning && (getState() == Frame.NORMAL) ) {\r\n seconds++;\r\n\r\n int hrs = seconds / 3600;\r\n int mins = seconds / 60 - hrs * 60;\r\n int secs = seconds - mins * 60 - hrs * 3600;\r\n\r\n String strHr = (hrs < 10 ? \"0\" : \"\") + Integer.toString( hrs );\r\n String strMin = (mins < 10 ? \"0\" : \"\") + Integer.toString( mins );\r\n String strSec = (secs < 10 ? \"0\" : \"\") + Integer.toString( secs );\r\n\r\n timeMesg.setText( strHr + \":\" + strMin + \":\" + strSec );\r\n }\r\n }", "public long getJVMCpuTime( ) {\n OperatingSystemMXBean bean =\n ManagementFactory.getOperatingSystemMXBean( );\n if ( ! (bean instanceof\n com.sun.management.OperatingSystemMXBean) )\n return 0L;\n return ((com.sun.management.OperatingSystemMXBean)bean)\n .getProcessCpuTime( );\n}", "public static long getUserTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadUserTime(): 0L;\n }", "private long getCurrentTimeInMillionSeconds(){\n Date currentData = new Date();\n return currentData.getTime();\n }", "long time() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}", "public Double getTime() {\n\t\treturn new Double((double) length * 36) / ((((double) speed) * 100));\n\t}", "@ApiModelProperty(required = true, value = \"The number (across all cores) of micro-seconds per second.\")\n public BigDecimal getCpu() {\n return cpu;\n }", "public final long getTime () {\n return time;\n }", "@DISPID(55)\r\n\t// = 0x37. The runtime will prefer the VTID if present\r\n\t@VTID(53)\r\n\tint actualCPUTime_Seconds();", "public double Time() {\n return OCCwrapJavaJNI.Units_Dimensions_Time(swigCPtr, this);\n }", "public long elapsedMillis() {\n/* 162 */ return elapsedTime(TimeUnit.MILLISECONDS);\n/* */ }", "VectorClock getCurrentVectorClock();", "public String displayClock()\r\n\t{\r\n\t\treturn stringFormatter(numberDisplay1.getHour()) + \":\"\r\n\t\t\t\t+ stringFormatter(numberDisplay1.getMinute()) + \":\"\r\n\t\t\t\t+ stringFormatter(numberDisplay1.getSecond());\r\n\t}", "synchronized public String get_and_increment_timestamp()\n {\n return String.format(CLOCK_FORMAT_STRING,++counter);\n }", "public long cpuTimeToNanos(long cpuTime) {\n return cpuTime * NANOSECS_IN_MSEC / clockFrequency;\n }", "public long wallMicros() {\n return this.wallNanos / 1000;\n }", "public interface Clock {\n public long nanoTime();\n}", "public float getTimeSeconds() { return getTime()/1000f; }", "public static int getTime() {\n\t\treturn time;\n\t}", "private static void showClock(MicroBlazeProcessor mb) {\r\n Clock clock = mb.getClock();\r\n //System.out.println(\"Number o clock cycles:\"+clock.getLatency());\r\n console.print(\"Number o clock cycles:\"+clock.getLatency());\r\n }", "public int ticksPerSec()\n\t{\n\t\treturn _ticksPerSec;\n\t}", "protected long getCurrentTime() {\n return System.currentTimeMillis();\n }", "public final long getTicks() {\n return time;\n }", "public long getTime(){\n\n formatDate(mCalendar.getTimeInMillis());\n\n return mCalendar.getTimeInMillis();\n\n }", "public static long getTime() {\n return (long)(new Date()).getTime();\n }", "public byte getTime_unit() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readByte(__io__address + 10);\n\t\t} else {\n\t\t\treturn __io__block.readByte(__io__address + 10);\n\t\t}\n\t}", "public static String getCurrentMillisecondTime()\n\t{\n\t\treturn getMillisecondTime(new Date());\n\t}" ]
[ "0.77281773", "0.7401253", "0.7107181", "0.6964717", "0.6919307", "0.6744156", "0.6633479", "0.6542255", "0.64850104", "0.6453351", "0.64501506", "0.64179105", "0.63931465", "0.63151205", "0.63001776", "0.6296023", "0.6253491", "0.6240508", "0.62323755", "0.62320787", "0.62133956", "0.61976206", "0.6178236", "0.6154788", "0.6044962", "0.60381997", "0.6036768", "0.60225254", "0.5948678", "0.59473723", "0.5940503", "0.5924814", "0.58956915", "0.58814746", "0.5878604", "0.5858787", "0.5855935", "0.5839605", "0.5825779", "0.5825428", "0.5816945", "0.5791127", "0.5789237", "0.57771176", "0.5770986", "0.5755651", "0.5726528", "0.57221365", "0.57096547", "0.56815934", "0.5678535", "0.56781805", "0.56679034", "0.5658262", "0.5657506", "0.5646435", "0.5605998", "0.5603826", "0.5597171", "0.5596976", "0.55862397", "0.55839384", "0.55829215", "0.5562307", "0.5559407", "0.55365795", "0.55259216", "0.55117846", "0.55088973", "0.54984474", "0.54977787", "0.5476424", "0.54669", "0.54664844", "0.54661185", "0.54577184", "0.545183", "0.5429622", "0.54266554", "0.54244053", "0.5422084", "0.54146343", "0.5409051", "0.5408195", "0.54005766", "0.53990614", "0.53906727", "0.53842765", "0.53802973", "0.53794557", "0.5374545", "0.5364416", "0.53635037", "0.53512174", "0.53388757", "0.5337682", "0.53302383", "0.53242", "0.532228", "0.5321122" ]
0.7682375
1
List element. A is a list. 1 le i le LENGTH(A). a is the ith element of A.
public static <C> C LELT(LIST<C> L, int i) { C x = null; if ( ! isNull( L ) ) { x = L.list.get(i); } return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void retriveElementInArrayList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tSystem.out.println(list.get(3));\n\n\t}", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public void add(E a)\n {\n if (size == data.length) { // if the list is at capacity...\n // create a new, larger array\n E[] newData = (E[])(new Object[2*data.length]);\n \n // copy over all of the old elements\n for (int i = 0; i < size; i++)\n newData[i] = data[i];\n \n // redirect the old data reference\n data = newData;\n }\n\n // insert the new element\n data[size] = a;\n size++;\n }", "public String getElement()\n\t{\n\t\treturn \"list\";\n\t}", "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public R visit(com.biosimilarity.lift.lib.scalar.Absyn.Listed p, A arg)\n {\n\n for (Expression x : p.listexpression_) {\n }\n\n return null;\n }", "@Override\n public int element() {\n isEmptyList();\n return first.value;\n }", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "T getElementFromIndex(int index) throws ListException;", "public void addElement(Integer e){\n list.add(e);\n }", "public Lista getListaAt(int i) {\n Lista iter = new Lista(this);\n for (int j = 0; j < i; j++) {\n iter = iter.next;\n }\n return iter;\n }", "public int lis(final List<Integer> A) {\n int size = A.size();\n int max = 0;\n int[] lis = new int[size];\n for ( int i = 0; i < size; i++ ) \n lis[i] = 1;\n for ( int i = 1; i < size; i++ ){ \n for (int j = 0; j < i; j++ ) {\n if ( A.get(i) > A.get(j) && lis[i] < lis[j] + 1){ \n lis[i] = lis[j] + 1; \n }\n }\n }\n \n for (int i = 0; i < size; i++ ) \n if ( max < lis[i] ) \n max = lis[i]; \n return max;\n }", "public void addElement(Integer elem){\n\t\tlist.add(elem);\n\t}", "@Override\n public E element(int index)\n throws SequenceException {\n if (index < 0) {\n throw new SequenceException(\"Indexed Element out of Range\");\n }\n\n // We need to chain down the list until we reach the indexed\n // position\n\n Node nodePointer = listHead;\n int i = 0;\n while (i < index) {\n if (nodePointer.next == null) {\n throw new SequenceException(\"Indexed Element out of Range\");\n } else {\n nodePointer = nodePointer.next;\n i += 1;\n }\n }\n\n return nodePointer.datum;\n }", "@Override\n\tpublic E get(int i) {\n\t\tif (i < 0 || i >= this.numberOfElements) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse {\n\t\t\treturn this.arrayList[i];\n\t\t}\n\t}", "static void print5(ArrayList<? extends A> list) {\n\n\t}", "public long getElem(int index) {\r\n return a[index];\r\n }", "void mo54419a(List<String> list);", "public static ArrayList getList() {\r\n return ListeElem;\r\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public ListDA() {\n elements = new Object[CAPACITY];\n }", "private static void appendTheSpecifiedElementToLinkedList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\n\t}", "public E next() throws NoSuchElementException\n {\n E retElement = null;\n if(hasNext() == true)\n {\n retElement = arrayList.get(index);\n index++;\n }\n else\n { throw new NoSuchElementException(); }\n return retElement;\n }", "public T caseElementList(ElementList object)\n {\n return null;\n }", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "public void push(Object element) {\r\n\t\tal.add(element, al.listSize);\r\n\t}", "public E getElement(int index) {\t//O(1)\r\n\t\t//checks if the index is valid\r\n\t\tif (index>=0 && index<size)\r\n\t\t\treturn (E) list[index];\t//returns element at particular index\r\n\t\treturn null;\r\n\t}", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "public XSListSimpleType asList() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: idiv \n // 1: laload \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ---- ------------------------------------------\n // 0 2 0 this Lcom/sun/xml/xsom/impl/ListSimpleTypeImpl;\n // \n // The error that occurred was:\n // \n // java.lang.ArrayIndexOutOfBoundsException\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "public interface IList<T> {\n \n public boolean isEmpty();\n \n public T getFirst();\n \n public T getLast();\n \n public T get(int i); // a[3] a.get(3)\n \n public void set(T p, int i);\n \n public int size(); // a.length a.size()\n \n public LinkedList<T> addLast(T p);\n \n public LinkedList<T> add(T p, int i);\n \n public void remove(T p);\n \n public void remove(int i);\n \n public boolean contains(T p);\n \n}", "public static void main(String[] args) {\n\t\tArrayList al = new ArrayList(); // support heterogeneous data main any type of value\r\n\t\t// add new element\r\n\t\tal.add(15);\r\n\t\tal.add(\"welocome\");\r\n\t\tal.add(2020);\r\n\t\tal.add(15.5);\r\n\t\tal.add(\"A\");\r\n\r\n\t\tSystem.out.println(al);\r\n\t\t// size of Arrylist\r\n\t\tSystem.out.println(\"no of index \" + al.size());\r\n\t\t\r\n\t\t// remove method\r\n\t\tal.remove(2);\r\n \tSystem.out.println(al);\r\n\r\n\t\t// Inert a data\r\n\t\tal.add(2, 2021);\r\n\t\tSystem.out.println(\"add the data in array list\" + al);\r\n\t\t// Retried the specific element\r\n\t\r\n \tSystem.out.println(al.get(2));\r\n\t\t// change and replace the element\r\n\t\tal.set(2, 2022);\r\n\t\tSystem.out.println(al);\r\n\t\t\r\n\t\t// search // contains\r\n\t\tSystem.out.println(al.contains(\"welocome\")); \r\n\t\t\r\n\t\t// is empty\r\n\t\tSystem.out.println(al.isEmpty());\r\n\r\n\t\tIterator it = al.iterator();\r\n\t\t\r\n\t\twhile (it.hasNext()) {\r\n\t\tSystem.out.println(it.next());\r\n\t\t}\r\n\r\n\t}", "public int getFirstElement() {\n\t\tif( head == null) {\n\t\t\tSystem.out.println(\"List is empty\");\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\telse {\n\t\t\treturn head.data;\n\t\t}\n\t}", "@Override\n\t@TimeComplexity(\"O(1)\")\n\tpublic E element()\n\t{\n\t\treturn element;\n\t}", "a(List list) {\n super(1);\n this.$sortedList = list;\n }", "@Override\n public T get(int index){\n if(isEmpty() || index > size() || index < 0){//if list is empty or given index is invalid, provide error message\n throw new IndexOutOfBoundsException();\n }\n \n DLNode<T> current = first;//a reference pointing to the first node\n for (int i = 0; i < index; i++) {//find the required index using a loop\n current = current.next;\n }\n return current.elem;//return element at the specified index\n }", "ArrayList<String> firstElements(ArrayList<String> myList);", "public static <T> List<T> clone(List<T> a) {\n\t\tList<T> newList = new ArrayList<T>();\n\t\t\n\t\tfor (T elt : a)\n\t\t\tnewList.add(elt);\n\t\t\n\t\treturn newList;\n\t}", "public interface ListElement<T extends ListElement<T>>\r\n {\r\n \t//Gets the ListNode in lst contianing this element\r\n \tpublic DoublyLinkedList<T>.ListNode\r\n \t\t\t\t\t getContainingListNode(DoublyLinkedList<T> lst);\r\n \t\r\n \t//Sets the ListNode in lst contianing this element\r\n \tpublic void setContainingListNode(DoublyLinkedList<T> lst,\r\n \t\t\t\t\t\t\t\t DoublyLinkedList<T>.ListNode node);\r\n \t\r\n \t//Called to say that lst no longer contains this element\r\n \tpublic void removeContainingList(DoublyLinkedList<T> lst);\r\n \t\r\n \t//Returns a Set of all DoublyLinkedLists which contian\r\n \t//this element\r\n \tpublic Set<DoublyLinkedList<T>> getContainingLists();\r\n }", "Object front()\n\t{\n\t\tif (length == 0) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call front() on empty List\");\n\t\t}\n\t\treturn front.data;\n\t}", "public static void main(String[] args) {\n\t\tList list =new ArrayList();\r\n\t\tlist.add(\"one\");\r\n\t\tlist.add(\"two\");\r\n\t\tlist.add(\"three\");\r\n\t\tlist.add(\"four\");\r\n\t\t\r\n\t\tSystem.out.println(list.size());\r\n\t\t\r\n\t\tSystem.out.println(list.get(1));\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tpublic void add(T element) {\n\t\tthis._list.add(element);\r\n\t}", "int addElement(int list, int data) {\n\t\treturn insertElement(list, -1, data);\n\t}", "public static void displayList(ExtendedListInterface aList) throws ListException {\r\n Object dataItem;\r\n\r\n for (int index = 1; index < aList.size(); index++){\r\n dataItem = aList.get(index);\r\n System.out.print(dataItem + \", \");\r\n }\r\n if (aList.size() >= 1) {\r\n dataItem = aList.get(aList.size());\r\n System.out.println(dataItem + \".\");\r\n } else {\r\n throw new ListException(\"displayList on an empty list\");\r\n }\r\n }", "public E element();", "@Override\n\tpublic E get(int idx) {\n\t\tE element = null;\n\t\tif (idx < 0 || idx >= size)\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\telement = list[idx];\n\t\treturn element;\n\t}", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }" ]
[ "0.6294271", "0.6247621", "0.6237301", "0.60004824", "0.6000365", "0.59417504", "0.5785549", "0.5678938", "0.56644505", "0.5589501", "0.5437808", "0.53843784", "0.5364543", "0.53418666", "0.53300136", "0.53241336", "0.53114736", "0.52887255", "0.5262357", "0.525275", "0.52441055", "0.52386796", "0.5219424", "0.52191985", "0.5215822", "0.5205088", "0.51695144", "0.5166636", "0.5166541", "0.51578695", "0.5157141", "0.51552075", "0.5152754", "0.5140591", "0.5130586", "0.5098711", "0.5095987", "0.509296", "0.5092483", "0.5090443", "0.50847185", "0.5076511", "0.5068949", "0.5066714", "0.50576633", "0.505467", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051588", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166", "0.5051166" ]
0.0
-1
Second. L is a list of length 2 or more. a is the second element of L.
public static <C> C SECOND(LIST<C> L) { C x = null; if ( ! isNull( L ) ) { x = L.list.get(2); } return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public static <C> LIST<C> LIST2(C a, C b) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public Node createSecondList(Node head) {\n\t\tif (head != null) {\n\t\t\t\n\t\t\t//Copying a List\n\t\t\tNode temp = head;\n\t\t\tNode secondHead = new Node(head);\n\t\t\tNode temp1 = secondHead;\n\t\t\twhile (temp.getNext() != null) {\n\t\t\t\ttemp = temp.getNext();\n\t\t\t\ttemp1.setNext(new Node(temp));\n\t\t\t\ttemp1 = temp1.getNext();\n\t\t\t}\n\n\t\t\t//Revering new list\n\t\t\tNode firstNode = secondHead;\n\t\t\tNode secondNode = secondHead;\n\t\t\tNode result = null;\n\t\t\twhile (firstNode != null) {\n\t\t\t\tsecondNode = firstNode.getNext();\n\t\t\t\tfirstNode.setNext(result);\n\t\t\t\tresult = firstNode;\n\t\t\t\tfirstNode = secondNode;\n\t\t\t}\n\t\t\tsecondHead = result;\n\t\t\treturn secondHead;\n\t\t}\n\t\treturn null;\n\n\t}", "void mo1638a(long j, long j2, List list, ayp ayp);", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public AstroArg seq(AstroArg first, AstroArg second) {\n AstroAST optList = (AstroAST)first;\n AstroAST nextNode = (AstroAST)second;\n nextNode.setNextSibling(null);\n if (null == optList) {\n return nextNode;\n }\n AstroAST sib = optList;\n while (true) {\n AstroAST optNextSib = (AstroAST)sib.getNextSibling();\n if (null == optNextSib) {\n sib.setNextSibling(nextNode);\n return optList;\n }\n sib = optNextSib;\n }\n }", "public static int stepTwo(ArrayList<Integer> list) {\n\t\t\n\t\tint passNumber = 0;\n\t\tint sum = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint num = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//sum every other number beginning with second from the right\n\t\t\tif (passNumber % 2 == 0) {\n\t\t\t\tsum += num;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "@Override\r\n\t\tpublic S getSecond() {\n\t\t\treturn pair.getSecond();\r\n\t\t}", "@Test\r\n\tvoid testFirst2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\tint output = test.first();\r\n\t\tassertEquals(-1, output);\r\n\t}", "public static MyStudent SecondHighest (List<MyStudent> list) {\n\t\t\t\n\t\t\treturn list.stream().sorted(Comparator.comparing(MyStudent::getScore)).skip(list.size()-2).findFirst().get();\n\t\t\t\n\t\t}", "public static <C> LIST<C> RED2(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(2,L.list.size()) );\n }\n return LP;\n }", "public static void m2(ArrayList<?> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\t//al.add(10);\n\t\t//al.add(10.5f);\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "@Override\r\n\t\tpublic E getSecond() {\n\t\t\treturn pair.getSecond();\r\n\t\t}", "@Override\r\n\t\tpublic E getSecond() {\n\t\t\treturn pair.getSecond();\r\n\t\t}", "public S second() {\n return this.second;\n }", "public Node method2(Node head)\n {\n Node[] linkedList = new Node[100];\n int index = 0;\n while (head != null)\n {\n linkedList[index] = head;\n head = head.next;\n index++;\n }\n\n return linkedList[index/2];\n }", "public List<T> subList(int arg0, int arg1) {\n\t\treturn null;\n\t}", "public int getSecondL() {\n/* 54 */ return this.secondL;\n/* */ }", "private static <T,S> void swap(List<T> x, List<S> a2, int a, int b) {\n\t\tT t = x.get(a);\n\t\tx.set(a, x.get(b));\n\t\tx.set(b,t);\n\t\tS t2 = a2.get(a);\n\t\ta2.set(a,a2.get(b));\n\t\ta2.set(b,t2);\n\t}", "public static void main(String[] args) {\n\t\tArrayList<String> list1=new ArrayList<String> ();\r\n\t\tlist1.add(\"Black\");\r\n\t\tlist1.add(\"White\");\r\n\t\tlist1.add(\"Red\");\r\n\t\tlist1.add(\"yellow\");\r\n\tSystem.out.println(list1.get(2));\r\n\r\n\t}", "private ListNode split2(ListNode head) {\n ListNode res = head.next;\n ListNode p1 = head;\n while (p1 != null) {\n ListNode p2 = p1.next;\n p1.next = p2.next;\n p1 = p1.next;\n if (p2.next != null) {\n p2.next = p1.next;\n }\n }\n return res;\n }", "public static int lastIndexOfSubList(java.util.List arg0, java.util.List arg1)\n { return 0; }", "private static <T> List<T> pairList(T a, T b) {\n ArrayList<T> res = new ArrayList<T>();\n res.add(a);\n res.add(b);\n return res;\n }", "public void a(ac ac2) {\n Object object = this.li;\n synchronized (object) {\n this.lv = ac2;\n return;\n }\n }", "ArrayList<String> firstElements(ArrayList<String> myList);", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "public final /* synthetic */ void a(int i2) {\n List<a> a2 = this.f68520c.a(i2);\n ArrayList arrayList = new ArrayList();\n for (a next : a2) {\n if (!(next == null || next.f56315e == null || TextUtils.isEmpty(next.f56315e))) {\n String[] split = next.f56315e.split(\"\\\\.\");\n if (split.length <= 0 || !split[split.length - 1].equals(\"gif\")) {\n arrayList.add(MvImageChooseAdapter.b.a(next));\n }\n }\n }\n this.f68519b.a((List<MvImageChooseAdapter.b>) arrayList, i2, true);\n }", "@Test\r\n\tpublic void testL1IsSubSeqOfL2WithElementsAtheEndOfL2() {\r\n\t\tl1 = Arrays.asList(2, 4, 5);\r\n\t\tl2 = Arrays.asList(23, 1, 1, 3,4,5,2);\r\n\t\tassertTrue(\"The list L1 is a subseq of L2\", sequencer.subSeq(l1, l2));\r\n\t}", "@Test\r\n\tpublic void testLastElementInHeadOfL1() {\r\n\t\tl1 = Arrays.asList(1,2,3,4,5);\r\n\t\tl2 = Arrays.asList(2,3,4,5,1,3,5,7);\r\n\t\tassertTrue(\"The list L1 is a subseq of L2\", sequencer.subSeq(l1, l2));\r\n\t}", "public static <E2> E2 last (\n\t\tfinal List<E2> list)\n\t{\n\t\treturn list.get(list.size() - 1);\n\t}", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "public int b(long j2) {\n return a(j2, a(j2));\n }", "private void secondLargestUtil(Node node, Counter counter) {\n if (node == null || counter.count >= 2) {\n return;\n }\n\n // Follow reverse inorder traversal so that the\n // largest element is visited first\n secondLargestUtil(node.right, counter);\n\n // Increment count of visited nodes\n counter.count++;\n\n // If c becomes 2 now, then this is the 2nd largest\n if (counter.count == 2) {\n System.out.println(\"2nd largest element is: \" + node.data);\n return;\n }\n\n secondLargestUtil(node.left, counter);\n }", "public List<Integer> crateSecond(int size) {\n int[] arr = {2, 1, 2, 3, 2, 4, 2, 5};\n int arrSize = 8;\n List<Integer> secondAnswer = new ArrayList<>(size);\n for (int i = 0; i < size; i++) {\n int index = i%arrSize;\n\n secondAnswer.add(arr[index]);\n }\n return secondAnswer;\n\n }", "static void swap(List l, int i1, int i2) {\n\t\tObject tmp=l.get(i1);\n\t\tl.set(i1, l.get(i2));\n\t\tl.set(i2, tmp);\n\t}", "public static void main(String[] args) {\n\t\tArrayList ar=new ArrayList();\n\t\tar.add(\"kavya\");\n\t\tar.add(\"anujaa\");\n\t\tar.add(\"jessie\");\n\t\tar.add(\"veena\");\n\t\tSystem.out.println(ar);\n\t\tList l2=ar.subList(1,4);\n\t\tSystem.out.println(l2);\n\n\t}", "public interface ListTwoWays<T> {\n boolean isEmpty();\n\n void insertToHead(T element);\n\n void insertToTail(T element);\n\n T deleteFromHead();\n\n T deleteFromTail();\n\n T getFromHead();\n\n T getFromTail();\n}", "public ArrayList<ArrayList<String>> fromSecondToFirst(ArrayList<String> words);", "public String firstTwo(String str) {\r\n return str.length() < 2 ? str : str.substring(0, 2);\r\n }", "public final synchronized void a(int i2) {\n wo woVar;\n aic.a(e(), \"Not yet complete!\");\n if (this.s.getAndAdd(i2) == 0 && (woVar = this.l) != null) {\n woVar.e();\n }\n }", "public B second() {\n return second;\n }", "public int f(long j2) {\n return d(j2, a(j2));\n }", "@Override\r\n\t\tpublic S getSecond() {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.getSecond();\r\n\t\t\t}\r\n\t\t}", "static\tListNode listCycle(ListNode a){\n if(a==null || a.next==null || a.next.next==null){\r\n return null;\r\n }\r\n boolean cycleExists = false;\r\n ListNode fast = a.next.next;\r\n ListNode slow = a;\r\n while(slow.next!=null && fast.next !=null && fast.next.next!=null){\r\n if(fast==slow){\r\n //return cycleSize;\r\n //cycleExists = true;\r\n //break;\r\n return fast;\r\n }else{\r\n \r\n fast = fast.next.next;\r\n slow = slow.next;\r\n }\r\n\r\n }\r\n \r\n return null;\r\n\t}", "public ListNode mergeTwoLists(ListNode a, ListNode b) {\r\n\t\tListNode merged = new ListNode(0);\r\n\r\n\t\tListNode first = a;\r\n\t\tListNode second = b;\r\n\t\tListNode third = merged;\r\n\r\n\t\twhile (first != null && second != null) {\r\n\t\t\tif (first.val <= second.val) {\r\n\t\t\t\tthird.next = first;\r\n\t\t\t\tfirst = first.next;\r\n\t\t\t} else {\r\n\t\t\t\tthird.next = second;\r\n\t\t\t\tsecond = second.next;\r\n\t\t\t}\r\n\t\t\tthird = third.next;\r\n\t\t}\r\n\r\n\t\tif (first != null) {\r\n\t\t\tthird.next = first;\r\n\t\t}\r\n\t\tif (second != null) {\r\n\t\t\tthird.next = second;\r\n\t\t}\r\n\r\n\t\treturn merged.next;\r\n\t}", "private static boolean ElementTest_2(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ElementTest_2\")) return false;\n ElementTest_2_0(b, l + 1);\n return true;\n }", "static boolean SecondDecl(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"SecondDecl\")) return false;\n if (!nextTokenIs(b, K_DECLARE)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = ContextItemDecl(b, l + 1);\n if (!r) r = OptionDecl(b, l + 1);\n if (!r) r = AnnotatedDecl(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public int f2(List<Book> a) {\r\n int count = 0;\r\n for (Book o : a) {\r\n if (o.getCode().startsWith(\"a\") || o.getCode().startsWith(\"A\")) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }", "public ArrayList<ArrayList<String>> fromFirstToSecond(ArrayList<String> words);", "public A getFirst() { return first; }", "public int getSecond() { return this.second; }", "public static void main(String[] args) {\n\t\tList list = new List(1);\n\t\tlist.next = new List(2);\n\t\tlist.next.next = new List(3);\n\t\tlist.next.next.next = new List(4);\n//\t\tlist.next.next.next.next = new List(5);\n\t\tSystem.out.println(list.toString());\n\t\tSystem.out.println();\n//\t\tSystem.out.println(reverse(list).toString());\n\t\tSystem.out.println(findMiddleElement(list));\n\t\t\n\t}", "private List<View> m9533a(List<View> list, List<View> list2) {\n LinkedList linkedList = new LinkedList();\n if (list != null && !list.isEmpty()) {\n int size = list.size();\n for (int i = 0; i < size; i++) {\n linkedList.add(list.get(i));\n }\n }\n if (list2 != null && !list2.isEmpty()) {\n int size2 = list2.size();\n for (int i2 = 0; i2 < size2; i2++) {\n linkedList.add(list2.get(i2));\n }\n }\n return linkedList;\n }", "public static void soo(Nodelink l1, Nodelink l2){\n Nodelink head = null;\n\n if (l1.data < l2.data) {\n head = l1;\n l1 = l1.next;\n }\n else {\n head = l2;\n l2 = l2.next;\n }\n Nodelink p = head;\n while (l1 != null && l2 != null){\n if (l1.data < l2.data)\n {\n p.next = l1;\n l1 = l1.next;\n }\n else\n {\n p.next = l2;\n l2 = l2.next;\n }\n\n p = p.next;\n }\n\n if (l1 == null)\n p.next = l2;\n if (l2 == null)\n p.next = l1;\n\n foo(head);\n\n\n\n }", "public T2 getSecond() {\n\t\treturn second;\n\t}", "public static ListNode merge2(ListNode l1,ListNode l2){\n if(l1==null) return l2;\n if(l2==null) return l1;\n if(l1.getVal()<l2.getVal()){\n l1.next=merge2(l1.next,l2);\n return l1;\n }else{\n l2.next=merge2(l1,l2.next);\n return l2;\n }\n }", "@Test\r\n\tpublic void testLastElementInHeadOfL11() {\r\n\t\tl1 = Arrays.asList(1,2);\r\n\t\tl2 = Arrays.asList(2,1);\r\n\t\tassertTrue(\"The list L1 is a subseq of L2\", sequencer.subSeq(l1, l2));\r\n\t}", "public static int indexOfSubList(java.util.List arg0, java.util.List arg1)\n { return 0; }", "public unsortedList2(Node root){\n\t\n\tNode first = root;\n\tNode runner;\n\twhile(root != null){\n\t\trunner = first;\n\t\twhile(runner != null){\n\t\t\t\tif(runner.next.val==root.val){\n\t\t\t\t\trunner.next = runner.next.next;\n\t\t\t\t}else{\n\t\t\t\t\trunner=runner.next;\n\t\t\t\t}\n\t\t}\n\t\tfirst=root.next;\n\t}\n}", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n\t\t//The base condition if one of the list is empty so then return the other list as it is.\n\t\tif (l1 == null) return l2;\n\t\tif (l2 == null) return l1;\n\t\t//Intializing the head of the ans\n\t\tListNode ans = l1;\n\t\tif (l2.val < l1.val) {\n\t\t\tans = l2;\n\t\t\tl2 = l2.next;\n\t\t} else l1 = l1.next;\n\t\t//Initializing ans in another variable so that it should'nt get lost.\n\t\tListNode ans2 = ans;\n\t\twhile (l1 != null && l2 != null) {\n\t\t\tif (l1.val <= l2.val) {\n\t\t\t\tans.next = l1;\n\t\t\t\tl1 = l1.next;\n\t\t\t\tans = ans.next;\n\t\t\t} else {\n\t\t\t\tans.next = l2;\n\t\t\t\tl2 = l2.next;\n\t\t\t\tans = ans.next;\n\t\t\t}\n\t\t}\n\t\t//if list are not same then one list will be left to traverse\n\t\tif (l1 == null && l2 != null) ans.next = l2;\n\t\tif (l2 == null && l1 != null) ans.next = l1;\n\t\treturn ans2;\n\t}", "public int c(long j2) {\n int a2 = a(j2);\n return a(j2, a2, a(j2, a2));\n }", "@Override\r\n\t\tpublic E setSecond(E second) {\n\t\t\treturn pair.setSecond(second);\r\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\tLinkedList<String> ll1 = new LinkedList<>();\n\t\tll1.add(\"Ali\");\n\t\tll1.add(\"Can\");\n\t\tll1.add(\"Mark\");\n\t\tll1.add(\"Tom\");\n\t\t\n\t\tSystem.out.println(ll1);\n\t\t\n\t\tll1.add(\"Angie\");\n\t\tll1.add(2,\"XXXX\");\n\t\tll1.addFirst(\"AAAA\");\n\t\tll1.addLast(\"ZZZZ\");\n\t\tSystem.out.println(ll1.contains(\"Can\"));//true\n\t\tSystem.out.println(ll1.contains(\"Mm\"));//false\n\t\tSystem.out.println(ll1.element());//AAAA==>Returns the first element without removing (copy+paste)\n\t\t\t\t\t\t\t\t\t\t //@throws NoSUchElementException if this list is empty\n\t\t\n\t\tSystem.out.println(ll1);\n\t\tSystem.out.println(ll1.getLast());//ZZZZ\n\t\t\n\t\tSystem.out.println(ll1.poll());//AAAA ==>Returns first element and removes it (cut+paste)\n\t\t\t\t\t\t\t\t\t // Returns null is this list is empty\n\t\tSystem.out.println(ll1.peek());//Returns first element without removing (copy+paste)\n\t\n\t\t//ll1.removeFirstOccurrence(\"XXXX\");\n\t\t\n\t\tll1.set(2, \"!!!!\");\n\t\tSystem.out.println(ll1.subList(2, 5));//[!!!!, Tom, Angie] Note: First index is inclusive, second is exclusive\n\t\tSystem.out.println(ll1);\n\t Collections.sort(ll1);\n\t \n\t\n\t}", "public static void main(String[] args) {\n\t\tListNode h1 = new ListNode(2);\n\t\tListNode h2 = new ListNode(1);\n\t\tListNode re = mergeTwoLists(h1,h2);\n\t\tSystem.out.println(re.val);\n\t\tSystem.out.println(re.next.val);\n\t}", "public String getChoice2(int a){\n String choice1 = choices[a][1];\n return choice1;\n }", "void secondLargestUtil(Node node, count C) {\n // Base cases, the second condition is important to\n // avoid unnecessary recursive calls\n if (node == null || C.c >= 2)\n return;\n\n // Follow reverse inorder traversal so that the\n // largest element is visited first\n this.secondLargestUtil(node.right, C);\n\n // Increment count of visited nodes\n C.c++;\n\n // If c becomes k now, then this is the 2nd largest\n if (C.c == 2) {\n System.out.print(\"2nd largest element is \" +\n node.data);\n return;\n }\n\n // Recur for left subtree\n this.secondLargestUtil(node.left, C);\n }", "private static <E> void swap(ArrayList<E> a, int i, int j) {\n\t\tE t = a.get(i);\n\t\ta.set(i, a.get(j));\n\t\ta.set(j, t);\n\t}", "private static <E> void swap(ArrayList<E> a, int i, int j) {\n\t\tE t = a.get(i);\n\t\ta.set(i, a.get(j));\n\t\ta.set(j, t);\n\t}", "@Test\r\n\tpublic void testL1IsSubSeqOfL2WithElementsAtheEnd() {\r\n\t\tl1 = Arrays.asList(2, 4, 5);\r\n\t\tl2 = Arrays.asList(2, 3, 1, 1, 3,4);\r\n\t\tassertTrue(\"The list L1 is a subseq of L2\", sequencer.subSeq(l1, l2));\r\n\t}", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}", "interface cl {\n void b(List<a> list, List<String> list2);\n}", "void mo13370a(int i, int i2, List<C15929a> list) throws IOException;", "public String getSecondWord()\r\n {\r\n return this.aSecondWord; \r\n }", "public Position getSecond() {\n return positions[1];\n }", "@Override\n public Function<List<? extends A>, B> apply(final Function2<? super A, ? super B, B> arg1, final B arg2) {\n return new Function<List<? extends A>, B>() {\n @Override\n public B apply(List<? extends A> arg) {\n B acc = arg2;\n Collections.reverse(arg);\n for (A element : arg) {\n acc = arg1.apply(element, acc);\n }\n return acc;\n }\n };\n }", "public static void swap(int[] a, int first, int second) {\r\n\r\n int c; // a catalyst variable used for the swap\r\n c = a[first]; //value of first item assigned to catalyst\r\n a[first] = a[second];//value of second item assigned to first\r\n a[second] = c; //value of catalyst assigned to second item\r\n }", "public static String getSecondPart(String str) {\n\t\t// we assume that str argument will only have even(length) strings\n\t\t// return second part of the string \n\t\t\n\t\t// str.substring(2); // abcd -> cd : 4 / 2 = 2\n\t\t// str.substring(3); // banana : 6 / 2 = 3\n\t\t// str.substring(4); // 12345678 : 8 / 2 =4\n\t\t\n\t\tint len = str.length();\n\t\tstr = str.substring(len / 2);\n\t\treturn str;\n\t}", "static void consumer(List<Integer> l) {\n\t\tConsumer<List<Integer>> modify = (list) -> {\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tlist.set(i, 2 * list.get(i));\n\t\t\t}\n\t\t};\n\t\tmodify.accept(l);\n\t}", "public ListIterator() {current=first.next;}", "public static int sumOfTwoLargestElements1(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n for (int num : a){\n if(num>firstNum){\n secondNum = firstNum;\n firstNum = num;\n }else if (num>secondNum){\n secondNum = num;\n }\n }\n return firstNum+secondNum;\n }", "@Override\n\tpublic List<Couple> couplelist2() {\n\t\treturn st.selectList(\"couplens.list2\");\n\t}", "public int i(long j2) {\n int a2 = a(j2);\n return b(a2, a(j2, a2));\n }", "public static void main(String[] args) {\n\t\tList list =new ArrayList();\r\n\t\tlist.add(\"one\");\r\n\t\tlist.add(\"two\");\r\n\t\tlist.add(\"three\");\r\n\t\tlist.add(\"four\");\r\n\t\t\r\n\t\tSystem.out.println(list.size());\r\n\t\t\r\n\t\tSystem.out.println(list.get(1));\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "private Student[] doubler(Student[] a){\n Student[] newArray = new Student[2*(a.length)];\n for(int i = 0; i<a.length; i++){\n newArray[i] = a[i];\n }\n return newArray;\n }", "@Override\r\n \t\t\tpublic float a2(String x, int b) {\n \t\t\t\treturn 2.5f;\r\n \t\t\t}", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummy = new ListNode(-1), cur = dummy;\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n cur.next = l1;\n l1 = l1.next;\n } else {\n cur.next = l2;\n l2 = l2.next;\n }\n cur = cur.next;\n }\n cur.next = (l1 != null) ? l1 : l2;\n return dummy.next;\n }", "public O before(O a)\r\n {\r\n int index = indexOf(a);\r\n if (index != -1 && index != 0) //is defined and not first\r\n return get(index-1);\r\n else return null;\r\n }", "public static <T extends Comparable<T>> List<T> sort(List<T> a) {\r\n if (a.size() < 2) {\r\n return a;\r\n }\r\n\r\n final List<T> leftHalf = a.subList(0, a.size() / 2);\r\n final List<T> rightHalf = a.subList(a.size() / 2, a.size());\r\n\r\n return Helper.merge(sort(leftHalf), sort(rightHalf));\r\n }", "public Integer getSecond(){\n return this.second;\n }", "private void helperTwo(T data1, BSTNode<T> temRoot, LinkedList<T> list) {\n int comparison = data1.compareTo(temRoot.getData());\n if (comparison < 0) {\n list.addFirst(temRoot.getLeft().getData());\n helperTwo(data1, temRoot.getLeft(), list);\n } else if (comparison > 0) {\n list.addFirst((temRoot.getRight().getData()));\n helperTwo(data1, temRoot.getRight(), list);\n } else {\n return;\n }\n }", "public B getSecond() {return second; }", "private static boolean simpleFormalParameter_2(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"simpleFormalParameter_2\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = simpleFormalParameter_2_0(b, l + 1);\n r = r && simpleFormalParameter_2_1(b, l + 1);\n r = r && consumeToken(b, COVARIANT);\n r = r && componentName(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public T sub(T first, T second);", "public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n final ListNode vituralHead = new ListNode(0);\n vituralHead.next = list1;\n\n ListNode cursor = vituralHead;\n int index = 0;\n\n ListNode aNode = null;\n ListNode bNode = null;\n while (cursor != null) {\n\n if (index == a) {\n aNode = cursor;\n }\n\n if (index == b + 1) {\n bNode = cursor;\n break;\n }\n\n index++;\n cursor = cursor.next;\n }\n\n ListNode tailOfList2 = list2;\n while (tailOfList2.next != null) {\n tailOfList2 = tailOfList2.next;\n }\n\n aNode.next = list2;\n tailOfList2.next = bNode.next;\n return vituralHead.next;\n }", "@Test\r\n\tpublic void testL1IsSubSeqOfL2WithSeveralOccurenceOfOneInL2() {\r\n\t\tl1 = Arrays.asList(2, 4, 5,5,5,5);\r\n\t\tl2 = Arrays.asList(2, 3, 1, 5, 1, 3);\r\n\t\tassertFalse(\"The list L1 is a subseq of L2\", sequencer.subSeq(l1, l2));\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic static void main(String[] args) {\n\r\n\t\tLinkedList<String> ll = new LinkedList<String>();\r\n\t\tll.add(\"My\");\r\n\t\tll.add(\"name\");\r\n\t\tll.add(\"is\");\r\n\t\tll.add(\"Sumit\");\r\n\t\r\n\t\tSystem.out.println(\"fisrt List:\"+ll);\r\n\t\t\r\n\t\tLinkedList<String> ll_sec = new LinkedList<String>();\r\n\t\tll_sec = (LinkedList<String>) ll.clone();\r\n\t\tSystem.out.println(\"Second List After cloning:\"+ll_sec);\r\n\t}" ]
[ "0.6153564", "0.5994707", "0.5694097", "0.5685094", "0.5677983", "0.56449807", "0.5499404", "0.54988337", "0.5491624", "0.53914577", "0.53880346", "0.53349257", "0.53230995", "0.52917874", "0.52526295", "0.52371174", "0.52371174", "0.51902723", "0.5175224", "0.5161644", "0.5159625", "0.5152913", "0.5142317", "0.5139548", "0.51068234", "0.5105532", "0.5098135", "0.5092828", "0.508208", "0.5081815", "0.5065786", "0.50563264", "0.50294065", "0.50271004", "0.50101745", "0.5009438", "0.50022477", "0.5000015", "0.4991764", "0.4984257", "0.49668056", "0.49461693", "0.4939086", "0.49355212", "0.49122566", "0.49022773", "0.49016827", "0.4899741", "0.48986354", "0.4888283", "0.48794085", "0.48660254", "0.48645774", "0.48641706", "0.48618963", "0.48611745", "0.48560643", "0.48533866", "0.4849065", "0.4846431", "0.48416936", "0.48370388", "0.48359835", "0.4834589", "0.4831395", "0.4814815", "0.48143476", "0.48097968", "0.48045138", "0.47903383", "0.47903383", "0.4788007", "0.4785916", "0.47856915", "0.47777706", "0.47748527", "0.47710064", "0.47684905", "0.47670573", "0.47581342", "0.4745702", "0.47380728", "0.473555", "0.4732724", "0.47253144", "0.47247058", "0.47202858", "0.4718663", "0.4717657", "0.47133726", "0.47063497", "0.47024378", "0.46981817", "0.46755162", "0.46752578", "0.46727642", "0.4669062", "0.46645483", "0.4657031", "0.4656305" ]
0.68171346
0
Third. L is a list of length 3 or more. a is the third element of L.
public static <C> C THIRD(LIST<C> L) { C x = null; if ( ! isNull( L ) ) { x = L.list.get(3); } return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> LIST3(C a, C b, C c) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static <C> LIST<C> RED3(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(3,L.list.size()) );\n }\n return LP;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static void m3(ArrayList<? extends Number> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static int stepThree(ArrayList<Integer> list) {\n\t\t\n\t\tint sum = 0;\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint num = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//sum every other number beginning with first from the right\n\t\t\tif (passNumber % 2 == 1) {\n\t\t\t\tsum += num;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public static <C> C FOURTH(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(4);\n }\n return x;\n }", "public ArrayList<T> firstThreeElements() throws EmptyCollectionException;", "private static boolean checkBy3 (int a) {\n return a % 3 == 0;\n }", "private static <T> int med3(List<T> x, Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x.get(a),x.get(b))<0 ?\n\t\t\t\t(comp.compare(x.get(b),x.get(c))<0 ? b : comp.compare(x.get(a),x.get(c))<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x.get(b),x.get(c))>0 ? b : comp.compare(x.get(a),x.get(c))>0 ? c : a));\n\t}", "public static /* synthetic */ int m28127a(List list, int i, int i2, C6080l lVar, int i3, Object obj) {\n if ((i3 & 1) != 0) {\n i = 0;\n }\n if ((i3 & 2) != 0) {\n i2 = list.size();\n }\n return m28126a(list, i, i2, lVar);\n }", "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public final void m1032a(List<Intent> list, List<String> list2, List<String> list3, long j, boolean z) {\n List<Intent> list4 = list;\n this.f1476d.mo44104b(list, new C3153h(this, list2, list3, j, z, list));\n }", "private static int med3(long x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "public static void main(String[] args) {\nArrayList<String>mylist =new ArrayList<String>();\r\nmylist.add(\"anu\");\r\nmylist.add(\"ammu\");\r\nmylist.add(\"renu\");\r\nSystem.out.println(mylist);\r\nfor(int i=0;i<3;i++)\r\n{\r\n\tSystem.out.println(i+\"=\" + mylist.get(i));\r\n}\r\n\t}", "private static void retriveElementInArrayList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tSystem.out.println(list.get(3));\n\n\t}", "private static <T> int med3(@Nonnull List<T> x, Comparator<? super T> comparator, int a, int b, int c) {\n return comparator.compare(x.get(a), x.get(b)) < 0\n ? comparator.compare(x.get(b), x.get(c)) < 0 ? b : comparator.compare(x.get(a), x.get(c)) < 0 ? c : a\n : comparator.compare(x.get(c), x.get(b)) < 0 ? b : comparator.compare(x.get(c), x.get(a)) < 0 ? c : a;\n }", "public int thirdMax(int[] nums) {\n List<Integer> list = new ArrayList<>();\n for (int num : nums) {\n helper(list, num);\n }\n if (list.size() < 3) {\n return list.get(0);\n } else {\n return list.get(2);\n }\n }", "private void exercise3() {\n final List<String> list = asList(\n \"The\", \"quick\", \"brown\", \"fox\", \"jumped\", \"over\", \"the\", \"lazy\", \"dog\");\n\n String result = list.stream()\n .skip(1)\n .limit(3)\n .collect(joining(\"-\"));\n\n System.out.println(result);\n }", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public Book booksByThreeAuthor(){\n for(Book book:bookList){\n if(book.getAuthors().size() == 3){ //checks the number of elements in the arraylist\n return book;\n }\n }\n return null;\n }", "public Object lambda3() {\n return frame.lambda2recur(C1259lists.cdr.apply1(this.lis));\n }", "public T third() {\n return this.third;\n }", "public void f3(List<Book> a) {\r\n List<Book> list = new ArrayList<>();\r\n for (Book o : a) {\r\n if (o.getPrice() >= 20) {\r\n list.add(o);\r\n }\r\n }\r\n //sort by ascending\r\n Collections.sort(list, new Comparator<Book>() {\r\n @Override\r\n public int compare(Book o1, Book o2) {\r\n if (o1.getPrice() > o2.getPrice()) {\r\n return 1;\r\n } else if (o1.getPrice() < o2.getPrice()) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n });\r\n //add\r\n int index = 0;\r\n for (int i = 0; i < a.size(); i++) {\r\n if (a.get(i).getPrice() >= 20) {\r\n a.remove(i);\r\n a.add(i, list.get(index));\r\n index++;\r\n }\r\n }\r\n }", "public static int sumOfTwoLargestElements3(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n int thirdNum = Integer.MIN_VALUE;\n int fourNum = Integer.MIN_VALUE;\n\n for (int num : a){\n if(num>firstNum){\n secondNum = firstNum;\n thirdNum = secondNum;\n firstNum = num;\n }else if (num>secondNum){\n thirdNum = secondNum;\n secondNum = num;\n }else if(num>thirdNum){\n thirdNum =num;\n }\n }\n return firstNum+secondNum+thirdNum;\n }", "public String getChoice3(int a){\n String choice2 = choices[a][2];\n return choice2;\n }", "private static int med3(int x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "public static <C> LIST<C> LIST4(C a, C b, C c, C d) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public List<List<Integer>> threeSum3(int[] nums) {\n List<List<Integer>> result = new ArrayList<>();\n Arrays.sort(nums);\n int n = nums.length;\n for (int i = 0; i < n - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) continue; // Bypass duplicate!\n for (int l = i + 1, r = n - 1; l < r; ) {\n if (nums[i] + nums[l] + nums[r] < 0) l++;\n else if (nums[i] + nums[l] + nums[r] > 0) r--;\n else {\n result.add(Arrays.asList(nums[i], nums[l++], nums[r--]));\n while (l < r && nums[l] == nums[l - 1]) l++; // Bypass duplicate!\n while (l < r && nums[r] == nums[r + 1]) r--;\n }\n }\n }\n return result;\n }", "private static int med3(byte x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "public static Node findLastKth3(Node n, int k) {\n\t\tif (n == null) {\n\t\t\treturn null;\n\t\t}\n\t\tNode result = findLastKth3(n.next, k);\n\t\tindex++;\n\t\tif (index == k)\n\t\t\treturn n;\n\t\telse\n\t\t\treturn result;\n\t}", "private boolean thirdPerson(Mention a, Mention b) {\n if (a.getPerson() == Person.THIRD\n && b.getPerson() == Person.THIRD\n && a.getMultiplicity() == b.getMultiplicity()\n && a.getGender() == b.getGender()) {\n addToCluster(a, b);\n return true;\n }\n\n return false;\n }", "private static int med3(float x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "public boolean isThreeOfAKind() {\r\n\r\n return getHighestConsecutive() == 3;\r\n }", "@Override\n\tpublic List<ThirdPage> getThirdWhole(String whole_name) {\n\t\treturn thirdPageMapper.findWithWholeName(whole_name);\n\t}", "public static boolean contains3(List<String> list) {\n Map<String, Integer> map = new HashMap<>();\n for (String str : list) {\n map.put(str, (map.containsKey(str) ? map.get(str) + 1 : 1));\n }\n return map.containsValue(3);\n // throw new UnsupportedOperationException(\"Not implemented yet.\");\n }", "boolean checkThreeSum(List<Integer> a, int threeSum) {\n\t\tCollections.sort(a); // n log n\n\t\t\n\t\tfor (int index = 0; index <= a.size() - 1; index++) {// o [n square]\n\t\t\tint current = a.get(index);\n\t\t\tif (checkTwoSum(a, threeSum - current, index)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public ArrayList<LinearNode<T>> firstThreeNodes() throws \n EmptyCollectionException;", "private static int med3(char x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "private static int med3(double x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "public int getThirdL() {\n/* 72 */ return this.thirdL;\n/* */ }", "private int med3(double x[], int a, int b, int c) {\r\n return (x[a] < x[b]\r\n ? (x[b] < x[c] ? b : x[a] < x[c] ? c : a)\r\n : (x[b] > x[c] ? b : x[a] > x[c] ? c : a));\r\n }", "private static int med3(short x[], int a, int b, int c) {\n\t\treturn (x[a] < x[b] ?\n\t\t\t\t(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :\n\t\t\t\t\t(x[b] > x[c] ? b : x[a] > x[c] ? c : a));\n\t}", "private static <T> int med3(T x[], Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "public String front3(String str) {\n String front;\n \n if (str.length() >= 3){\n front = str.substring(0,3);\n }\n else{\n front = str;\n }\n \n return (front + front + front);\n}", "public void Add3(String[] ss, String s) {\n\t\ttheList3 = Add(ss, s);\n\t\ttheSelected3 = new boolean[ss.length];\n\t}", "public static <T> int m28125a(@C6003d List<? extends T> list) {\n C14445h0.m62478f(list, \"$receiver\");\n return list.size() - 1;\n }", "public static int repeatedNumber(final List<Integer> a) {\n\t\tint n = a.size();\n\t\tHashMap<Integer, Integer> map_a=new HashMap<>();\n\t\t\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tmap_a.put(a.get(i), map_a.getOrDefault(a.get(i), 0)+1);\n\t\t}\n\t\tSystem.out.println(map_a);\n\t\tfor(int i:map_a.values()) {\n\t\t\tif(i>n/3)\n\t\t\t{\n\t\t\t\tSet<Integer> set= getKeysByValue(map_a, i);\n\t\t\t\treturn set.stream().findFirst().get();\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t\t\n\t\t//solution at site\n\n\t /* int num;\n\t int n = A.size();\n\t Collections.sort(A);\n\t for (int i = 0; i < n;) {\n\t int freq = 0;\n\t num = A.get(i);\n\t while (i < n && A.get(i) == num) {\n\t freq++;\n\t i++;\n\t }\n\t if (freq * 3 > n)\n\t return num;\n\t }\n\t return -1;*/\n\t}", "public static int max3(int a, int b, int c) {\r\n\t\t// Implement!\r\n\t\tint[] values = new int[3];\r\n\t\tvalues[0] = c;\r\n\t\tvalues[1] = a;\r\n\t\tvalues[2] = b;\r\n\r\n\t\tArrays.sort(values);\r\n\t\treturn values[2];\r\n\t}", "public interface a {\n void a(int i, List<String> list, boolean z, long j, String str, String str2, String str3);\n }", "public static List<String> threeLetterAWords(List<String> words) {\n\t\treturn words.stream()\n\t\t\t\t\t.filter(s -> (s.length() == 3) && (s.charAt(0) == 'a'))\n\t\t\t\t\t.collect(toList());\n\t}", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "private static boolean forLoopParts_3(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"forLoopParts_3\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = forLoopParts_3_0(b, l + 1);\n r = r && forLoopParts_3_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "private void helperThree(T data2, BSTNode<T> temRoot, LinkedList<T> list) {\n int comparison = data2.compareTo(temRoot.getData());\n if (comparison > 0) {\n list.addLast(temRoot.getRight().getData());\n helperThree(data2, temRoot.getRight(), list);\n } else if (comparison < 0) {\n list.addLast((temRoot.getLeft().getData()));\n helperThree(data2, temRoot.getLeft(), list);\n } else {\n return;\n }\n }", "public static ArrayList<Integer> longestSubseq3 () {\r\n\t\tArrayList<Integer> longest = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < A.length; i++) {\r\n\t\t\tArrayList<Integer> subseq = longestSubseq3(i);\r\n\t\t\tif (subseq.size() > longest.size()) {\r\n\t\t\t\tlongest = subseq;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn longest;\r\n\t}", "protected boolean checkThreeOfAKind(ReturnValue returnValue) {\n\t\tboolean returnBool = false;\n\t\tint localCheck = 0;\n\t\tint localPoints = 0;\n\t\tint localDiceInt;\n\t\tboolean localBool = false;\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tfor (int j = 0; j < 5; j++) {\n\t\t\t\tif (intList.get(i) == intList.get(j)) {\n\t\t\t\t\tlocalCheck++;\n\t\t\t\t\tif (localCheck == 3) {\n\t\t\t\t\t\tlocalBool = true;\n\t\t\t\t\t\tlocalPoints = intList.get(i) * 3;\n\t\t\t\t\t\tlocalDiceInt = intList.get(i);\n\t\t\t\t\t\treturnValue.setValue(localBool, localPoints, Box.THREE_OF_A_KIND);\n\t\t\t\t\t\treturnValue.setTheDiceInt(localDiceInt);\n\t\t\t\t\t\treturnBool = true;\n\t\t\t\t\t\treturn returnBool;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlocalCheck = 0;\n\t\t}\n\t\treturnValue.setValue(localBool, localPoints, Box.THREE_OF_A_KIND);\n\t\treturn returnBool;\n\t}", "public ListNode middleNode3(ListNode head) {\n ListNode slow = head, fast = head;\n while (fast != null && fast.next != null) {\n fast = fast.next.next;\n slow = slow.next;\n }\n return slow;\n }", "private static void printArray(ArrayList<Integer> list) {\n for (int i : list) {\n System.out.println(i * 3);\n }\n\n }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "public int thirdMax(int[] nums) {\n if (nums.length == 1) return nums[0];\n \n PriorityQueue<Integer> pq = new PriorityQueue<>(3);\n for (int num : nums) {\n if (!pq.contains(num)) {\n if (pq.size() < 3)\n pq.add(num);\n else if (num > pq.peek()) {\n pq.poll();\n pq.add(num);\n }\n }\n }\n if (pq.size() == 3 || pq.size() == 1) // size = 1 for [1,1,1]\n return pq.peek();\n else { // for size = 2\n pq.poll();\n return pq.peek();\n }\n \n \n /** 3. Three Pointers\n /* max1, max2, max3\n /* if num == max1/2/3, continue\n /* num > max1 -> max3 = max2, max2 = max1, max1 = num\n /* max1 > num > max2 -> max3 = max2, max2 = num\n /* max2 > num > max3 -> max3 = num\n */\n\n }", "@Test\r\n\tvoid testSize3() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\tint output = test.size();\r\n\t\tassertEquals(8, output);\r\n\t}", "void mo69875a(List<Aweme> list, boolean z);", "public static /* synthetic */ int m28129a(List list, Comparable comparable, int i, int i2, int i3, Object obj) {\n if ((i3 & 2) != 0) {\n i = 0;\n }\n if ((i3 & 4) != 0) {\n i2 = list.size();\n }\n return m28128a(list, (T) comparable, i, i2);\n }", "public static <C> C SECOND(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(2);\n }\n return x;\n }", "public long a(int i2, int i3) {\n return d(i2) + c(i2, i3);\n }", "public interface TriadList<T, K, L> extends List<Triad<T, K, L>>\r\n{\r\n\tpublic Triad.FirstConverter<T, K, L> getFirstConverter();\r\n\r\n\tpublic Triad.SecondConverter<T, K, L> getSecondConverter();\r\n\r\n\tpublic Triad.ThirdConverter<T, K, L> getThirdConverter();\r\n\r\n\tpublic Iterator<T> firstIterator();\r\n\r\n\tpublic Iterator<K> secondIterator();\r\n\r\n\tpublic Iterator<L> thirdIterator();\r\n\r\n\tpublic int indexOfFirst(T t);\r\n\r\n\tpublic int indexOfSecond(K k);\r\n\r\n\tpublic int indexOfThird(L l);\r\n\r\n\tpublic T getFirst(int index);\r\n\r\n\tpublic K getSecond(int index);\r\n\r\n\tpublic L getThird(int index);\r\n\r\n\tpublic void add(T t, K k, L l);\r\n\r\n\tpublic boolean containsFirst(T t);\r\n\r\n\tpublic boolean containsSecond(K k);\r\n\r\n\tpublic boolean containsThird(L l);\r\n\r\n\tpublic T elementAtFirst(int index);\r\n\r\n\tpublic K elementAtSecond(int index);\r\n\r\n\tpublic L elementAtThird(int index);\r\n\r\n\tpublic int indexOfFirst(T t, int index);\r\n\r\n\tpublic int indexOfSecond(K k, int index);\r\n\r\n\tpublic int indexOfThird(L l, int index);\r\n\r\n\tpublic int lastIndexOfFirst(T t, int index);\r\n\r\n\tpublic int lastIndexOfSecond(K k, int index);\r\n\r\n\tpublic int lastIndexOfThird(L l, int index);\r\n\r\n\tpublic int lastIndexOfFirst(T t);\r\n\r\n\tpublic int lastIndexOfSecond(K k);\r\n\r\n\tpublic int lastIndexOfThird(L l);\r\n\r\n\tpublic boolean removeFirst(T t);\r\n\r\n\tpublic boolean removeSecond(K k);\r\n\r\n\tpublic boolean removeThird(L l);\r\n\r\n\tpublic boolean removeElementFirst(T t);\r\n\r\n\tpublic boolean removeElementSecond(K k);\r\n\r\n\tpublic boolean removeElementThird(L l);\r\n\r\n\tpublic T[] toArrayFirst(T[] a);\r\n\r\n\tpublic K[] toArraySecond(K[] a);\r\n\r\n\tpublic L[] toArrayThird(L[] a);\r\n}", "@Test\n\tpublic void test3(){\n\t\tDoubleLinkedList dll = new DoubleLinkedList(getList(5));\n\t\t\n\t\tassertEquals(1, dll.get(1));\n\t\t\n\t\tdll.add(dll.size(), 99);\n\t\tassertEquals(dll.get(dll.size() - 1), 99);\n\t\tdll.add(1, 100);\n\t\tassertEquals(dll.get(1), 100);\n\t\t\n\t\tdll.remove(6);\n\t\tassertEquals(dll.indexOf(99), -1);\n\t\t\n\t\tdll.clear();\n\t\tassertEquals(dll.size(), 0);\n\t\t\n\t\tdll.addAll(getList(0));\n\t\tassertEquals(dll.size(), 0);\n\t\tdll.addAll(getList(5));\n\t\tassertEquals(dll.size(), 5);\n\t\t\n\t\tdll.addAll(dll.size() - 1, getList(6));\n\t\tassertEquals(dll.size(), 11);\n\t}", "public static void main(String args[]){\n ListNode one=new ListNode(1);\n one.next=new ListNode(3);\n one.next.next=new ListNode(2);\n one=partition(one,3);\n while (one!=null){\n System.out.print(one.val);\n one=one.next;\n }\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public List<List<Integer>> threeSum(int[] nums) {\n\n if (nums.length < 3) {\n return new ArrayList<>();\n }\n\n Arrays.sort(nums);\n\n // ex. [-1, 0, 1, 2,-1,-4] =>\n // [-4,-1,-1, 0, 1, 2]\n\n // ex. [ 3, 0,-2,-1, 1, 2] =>\n // [-2,-1, 0, 1, 2, 3]\n\n // ex. [-1, 0, 1, 2,-1,-4] =>\n // [-4,-1,-1, 0, 1, 2]\n\n List<List<Integer>> list = new ArrayList<List<Integer>>();\n\n // Loop throught the array\n for (int i = 0; i < nums.length - 2; i++) {\n\n if (i > 0 && nums[i] == nums[i - 1]) {\n continue;\n }\n\n // Index of first number\n int first = i;\n\n // Indices of second and third numbers\n int left = i + 1;\n int right = nums.length - 1;\n\n // Find nums[left] and nums[right] that add up to -firstNum\n // (Implies that the 3 numbers add up to 0)\n while (left < right) {\n int leftNum = nums[left];\n int rightNum = nums[right];\n int firstNumComplement = -nums[first];\n if (nums[left] + nums[right] == firstNumComplement) {\n List<Integer> triplet = new ArrayList<Integer>(3);\n triplet.add(nums[first]);\n triplet.add(nums[left]);\n triplet.add(nums[right]);\n list.add(triplet);\n left++;\n right--;\n while (left < right && nums[left] == leftNum) {\n left++;\n }\n while (left < right && nums[right] == rightNum) {\n right--;\n }\n } else if (nums[left] + nums[right] > firstNumComplement) {\n right--;\n } else {\n left++;\n }\n }\n }\n\n return list;\n }", "public static void main(String[] args) {\n\t\tArrayList ar=new ArrayList();\n\t\tar.add(\"kavya\");\n\t\tar.add(\"anujaa\");\n\t\tar.add(\"jessie\");\n\t\tar.add(\"veena\");\n\t\tSystem.out.println(ar);\n\t\tList l2=ar.subList(1,4);\n\t\tSystem.out.println(l2);\n\n\t}", "@Test\n public void pairNumbersDivisibleBy3_passTwoListsNumbers_returnListsOfPairs() {\n List<int[]> output = Java8Streams.pairNumbersDivisibleBy3(new ArrayList<>(Arrays.asList(1, 2, 3)), new ArrayList<>(Arrays.asList(3, 4)));\n assertThat(output).containsExactly(new int[]{2, 4}, new int[]{3, 3});\n }", "private static int med3(int x[], IntComparator comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "public static /* synthetic */ int m28131a(List list, Comparable comparable, int i, int i2, C6080l lVar, int i3, Object obj) {\n if ((i3 & 2) != 0) {\n i = 0;\n }\n if ((i3 & 4) != 0) {\n i2 = list.size();\n }\n C14445h0.m62478f(list, \"$receiver\");\n C14445h0.m62478f(lVar, \"selector\");\n return m28126a(list, i, i2, (C6080l<? super T, Integer>) new C6130a<Object,Integer>(lVar, comparable));\n }", "public String middleThree(String str) {\r\n int middlePoint = str.length() / 2;\r\n\r\n return str.length() > 2 ? str.substring(middlePoint - 1, middlePoint + 2) : str;\r\n }", "public static <C> C LELT(LIST<C> L, int i) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(i);\n }\n return x;\n }", "public static ArrayList<Integer> longestSubseq3 (int n) {\r\n\t\tif (cache.get(n) != null) {\r\n\t\t\treturn cache.get(n);\r\n\t\t}\r\n\t\tArrayList<Integer> longest = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tif (A[n] > A[i]) {\r\n\t\t\t\tArrayList<Integer> subseq = longestSubseq3(i);\r\n\t\t\t\tif (subseq.size() > longest.size()) {\r\n\t\t\t\t\tlongest = subseq;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tlongest = new ArrayList<Integer>(longest);\r\n\t\tlongest.add(A[n]);\r\n\t\tcache.put(n, longest);\r\n\t\treturn longest;\r\n\t}", "@Override\n\tpublic void setTargetListThree(Page page, HttpServletRequest request) {\n\t\t\n\t}", "public boolean isThreeOfAKind(){\n \r\n List<PokerCard> threeCards;\r\n \r\n //First possibility: first three cards match\r\n threeCards = cards.subList(0, 3);\r\n if(haveSameValue(threeCards)){\r\n handValue = threeCards.get(0).getValue();\r\n return true;\r\n }\r\n \r\n //Second possibility: middle three cards match\r\n threeCards = cards.subList(1, 4);\r\n if(haveSameValue(threeCards)){\r\n handValue = threeCards.get(0).getValue();\r\n return true;\r\n }\r\n \r\n //Third possibility: last three cards match\r\n threeCards = cards.subList(2, 5);\r\n if(haveSameValue(threeCards)){\r\n handValue = threeCards.get(0).getValue();\r\n return true;\r\n }\r\n return false;\r\n }", "private static List<List<Integer>> threeSum(int[] nums) {\n int len = nums.length;\n int start = 0;\n List<List<Integer>> result = new LinkedList<>();\n\n Arrays.sort(nums);\n\n while (start < len - 2) {\n if (start > 0 && nums[start] == nums[start - 1]) {\n start++;\n continue;\n }\n findPair(nums, -nums[start], start + 1, result);\n start++;\n }\n return result;\n }", "@Test\n public void test3() throws Throwable {\n\t\tfr.inria.diversify.sosie.logger.LogWriter.writeTestStart(1349,\"org.apache.commons.collections4.IteratorUtilsEvoSuiteTest.test3\");\n ListIterator<String> listIterator0 = IteratorUtils.singletonListIterator(\"Predicate must not be null\");\n assertEquals(-1, listIterator0.previousIndex());\n }", "public static void main(String[] args) {\n\n\t\tint[] a = {3,2,1};\n\t\tSystem.out.println(thirdMax(a));\n\t}", "protected List<Answer> getListNumOfAnswers(List<Answer> a, int n) {\n \tList<Answer> finalAnswers = new ArrayList<Answer>();\n \tfor (int i = 0; i < n; i++) {\n finalAnswers.add(a.get(i));\n }\n return finalAnswers;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint a[]={1,2,5,6,3,2}; \n\t\t\n\t\tint temp, size;\n\t\tsize = a.length;\n\n\t for(int i = 0; i<size; i++ ){\n\t for(int j = i+1; j<size; j++){\n\n\t if(a[i]>a[j]){\n\t temp = a[i];\n\t a[i] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t System.out.println(\"Third second largest number is:: \"+a[size-2]);\n\n\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 3;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 3;\r\n\t\t\t}", "private void m32688a(List<Animator> list, boolean z, TextView textView, int i, int i2, int i3) {\n if (textView != null && z) {\n if (i == i3 || i == i2) {\n list.add(m32682a(textView, i3 == i));\n if (i3 == i) {\n list.add(m32681a(textView));\n }\n }\n }\n }", "void runTime3()throws RuntimeException{\n\t\tint[]numList= {45,78,99};\n\t\tSystem.out.println(numList[5]);\n\t}", "public static void main(String[] args) {\n\t\tList list = new List(1);\n\t\tlist.next = new List(2);\n\t\tlist.next.next = new List(3);\n\t\tlist.next.next.next = new List(4);\n//\t\tlist.next.next.next.next = new List(5);\n\t\tSystem.out.println(list.toString());\n\t\tSystem.out.println();\n//\t\tSystem.out.println(reverse(list).toString());\n\t\tSystem.out.println(findMiddleElement(list));\n\t\t\n\t}", "public static <C> LIST<C> RED2(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(2,L.list.size()) );\n }\n return LP;\n }", "public static void main(String[] args) {\n\t\tList list =new ArrayList();\r\n\t\tlist.add(\"one\");\r\n\t\tlist.add(\"two\");\r\n\t\tlist.add(\"three\");\r\n\t\tlist.add(\"four\");\r\n\t\t\r\n\t\tSystem.out.println(list.size());\r\n\t\t\r\n\t\tSystem.out.println(list.get(1));\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "private void a(String paramString, int paramInt1, int paramInt2, int paramInt3, boolean paramBoolean)\r\n/* 578: */ {\r\n/* 579:581 */ List<String> localList = c(paramString, paramInt3);\r\n/* 580:582 */ for (String str : localList)\r\n/* 581: */ {\r\n/* 582:583 */ a(str, paramInt1, paramInt2, paramInt3, this.q, paramBoolean);\r\n/* 583:584 */ paramInt2 += this.a;\r\n/* 584: */ }\r\n/* 585: */ }", "public String getThirdNumber() {\n return thirdNumber;\n }", "public static ListNode insertionSortList3(ListNode head) {\n return null;\n }", "public static void main(String[] args) {\t\n\t\t//List olusturma nasil yapilir?\n\t\t//1. yol\n\t\tArrayList<String> sl1= new ArrayList<>();\n\t\t\n\t\t//2. yol\n\t\tArrayList<String> sl2= new ArrayList<>();\n\t\tSystem.out.println(sl1+\"\"+sl2);\n\t\t//3. yol (bunu kullanacagiz)\n\t\tList<String> sl3=new ArrayList<>();\n\t\tSystem.out.println(sl3);\n\t\t\n\t\t//Liste eleman ekleme\n\t\t\n\t\tsl3.add(\"A\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\tsl3.add(\"B\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\tsl3.add(\"C\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\t//herhangi bir indexe eleman ekleme\n\t\t\n\t\tsl3.add(0, \"Mustafa\");\n\t\t System.out.println(sl3);//[Mustafa, A, X, B, C]\n\t\t \n\t\t //List'lerde eleman sayisini bulma nasil yapilir?\n\t\t System.out.println(sl3.size());//5\n\t\t \n\t\t //Bir list'in bos olup olmadigin nasil anlariz?\n\t\t System.out.println(sl3.isEmpty());//isEmpty() ==> bos ise true, dolu ise false verir\n\t\t \n\t\t //Bir list'den istenen elemani silme nasil yapilir?\n\t\t \n\t\t //1. Yol: index ile silme yapabilirsiniz.\n\t\t System.out.println(sl3.remove(0));\n\t\t System.out.println(sl3);//[A, X, B, C]\n\t\t \n\t\t //2. Yol: Eleman secip sil\n\t\t sl3.remove(\"X\");\n\t\t System.out.println(sl3);//[A, B, C]\n\t\t \n\t\t sl3.add(\"B\");//[A, B, C, B]\n\t\t System.out.println(sl3.remove(\"B\"));//true\n\t\t //Ayni elemandan 1 den fazla varsa ilkini siler\n\t\t System.out.println(sl3);//[A, C, B]\n\t\t \n\t\t \n\t\t System.out.println(sl3.remove(\"W\"));//false\n\t\t //Java'dan olmayan bir elemani remove etmesini isterseniz\n\t\t //remove edemez ve list'i aynen oldugu gibi birakir.\n\t\t System.out.println(sl3);//[A, C, B]\n\t\t \n\t\t //remove(index) ne return eder?\n\t\t // sl3 ==> [A, C, B]\n\t\t System.out.println(sl3.remove(1));//C\n\t\t System.out.println(sl3);//[A, B]\n\t\t \n\t\t//remove(eleman) ne return eder?\n\t\t// sl3 ==> [A, B] \n\t\t System.out.println(sl3.remove(\"A\"));//true\n\t\t //remove() methodunun icine tamsayi koyarsaniz \n\t\t //Java onu index kabul eder. \n\t\t //Bu yuzden elemanlari integer olan bir listteki elemanlari silmek icin \n\t\t //remove() methodunun sadece indexlisini kullanabilirsiniz.\n\n \n}", "private void threeDimenItemListInit(List<CommonItemList> list, String[] array) {\n\t\tif (threeDimenSettingOnListAdapter == null) {\n\t\t\tthreeDimenSettingOnListAdapter = new GeneralList(this, list, array);\n\t\t\tcommonSettingListView.setAdapter(threeDimenSettingOnListAdapter);\n\t\t} else {\n\t\t\tthreeDimenSettingOnListAdapter.notifyDataSetChanged();\n\t\t}\n\t}" ]
[ "0.648155", "0.6417614", "0.6026944", "0.594748", "0.58115107", "0.57039595", "0.567752", "0.56734467", "0.5653802", "0.5532257", "0.5527946", "0.5475109", "0.54111236", "0.53862464", "0.53478974", "0.5316013", "0.5275119", "0.52714425", "0.52713686", "0.5262269", "0.5242195", "0.5207108", "0.52063346", "0.5173167", "0.51685065", "0.51610106", "0.5130421", "0.51223254", "0.5102115", "0.5074827", "0.5063238", "0.5036522", "0.50155425", "0.5014163", "0.50014985", "0.4998498", "0.49810538", "0.49726328", "0.49695754", "0.49686635", "0.49396688", "0.49321124", "0.49318236", "0.49313518", "0.4923995", "0.4911309", "0.4910558", "0.4891421", "0.48897454", "0.4871779", "0.48656616", "0.4849498", "0.4836641", "0.48276266", "0.4823533", "0.47946528", "0.47881535", "0.47850844", "0.47839707", "0.4781593", "0.47782025", "0.47721934", "0.47666878", "0.47594595", "0.4756997", "0.47550374", "0.4754676", "0.47430953", "0.47335315", "0.47261712", "0.4724723", "0.47234383", "0.47092026", "0.47084948", "0.47028726", "0.47007874", "0.46980497", "0.46966556", "0.46965787", "0.46952218", "0.46915397", "0.4691009", "0.46867764", "0.46788064", "0.4676909", "0.46708912", "0.46559933", "0.46543878", "0.46498588", "0.46498588", "0.46483532", "0.46457684", "0.46445355", "0.46406284", "0.46230793", "0.4612131", "0.4610212", "0.46087736", "0.460491", "0.46041447" ]
0.6768725
0
Fourth. L is a list of length 4 or more. a is the fourth element of L.
public static <C> C FOURTH(LIST<C> L) { C x = null; if ( ! isNull( L ) ) { x = L.list.get(4); } return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> LIST4(C a, C b, C c, C d) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static void m4(ArrayList<? super Integer> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t\tal.add(345);\n\t}", "static void print5(ArrayList<? extends A> list) {\n\n\t}", "public static List<Integer> rotLeft(List<Integer> a, int d) {\n\t\tint len = a.size();\n\t\t// 1,2,3,4,5\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\tresult.addAll(a);\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\t// i = 0 , 1, 2, 3, 4\n\t\t\t// j = 1 , 2, 3, 4, 0\n\t\t\tint j = (i + (len - d)) % len;\n\t\t\tresult.set(j, a.get(i));\n\t\t}\n\t\treturn result;\n\t}", "public static List<Integer> rotLeft(List<Integer> a, int d) {\n for(int count = 0; count < d; count++) {\n shiftElements(a);\n }\n return a;\n }", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "static boolean isFour(ArrayList<Card> c)\n {\n if(c.size() < 4)\n {\n return false;\n }\n \n for(int x = 0 ; x < c.size() - 3 ; x++)\n {\n if(c.get(x).getRank() == c.get(x+1).getRank() && c.get(x+1).getRank() == c.get(x+2).getRank() && c.get(x+2).getRank() == c.get(x+3).getRank())\n {\n return true;\n }\n } \n return false;\n }", "public static void main(String[] args) {\n\t\tArrayList ar=new ArrayList();\n\t\tar.add(\"kavya\");\n\t\tar.add(\"anujaa\");\n\t\tar.add(\"jessie\");\n\t\tar.add(\"veena\");\n\t\tSystem.out.println(ar);\n\t\tList l2=ar.subList(1,4);\n\t\tSystem.out.println(l2);\n\n\t}", "public static <C> LIST<C> LIST5(C a, C b, C c, C d, C e) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( e );\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static void main(String[] args) {\n\t\tList list = new List(1);\n\t\tlist.next = new List(2);\n\t\tlist.next.next = new List(3);\n\t\tlist.next.next.next = new List(4);\n//\t\tlist.next.next.next.next = new List(5);\n\t\tSystem.out.println(list.toString());\n\t\tSystem.out.println();\n//\t\tSystem.out.println(reverse(list).toString());\n\t\tSystem.out.println(findMiddleElement(list));\n\t\t\n\t}", "private static boolean record_1_4(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"record_1_4\")) return false;\n while (true) {\n int c = current_position_(b);\n if (!record_1_4_0(b, l + 1)) break;\n if (!empty_element_parsed_guard_(b, \"record_1_4\", c)) break;\n }\n return true;\n }", "public static void main(String[] args) {\n\t\tList list =new ArrayList();\r\n\t\tlist.add(\"one\");\r\n\t\tlist.add(\"two\");\r\n\t\tlist.add(\"three\");\r\n\t\tlist.add(\"four\");\r\n\t\t\r\n\t\tSystem.out.println(list.size());\r\n\t\t\r\n\t\tSystem.out.println(list.get(1));\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "void mo1638a(long j, long j2, List list, ayp ayp);", "public abstract void mo56920a(List<C4122e> list);", "public static void loopThroughListOfStrings(List<String> input) {\n\t\t\n\t\tList<String> output = input.stream().filter(i -> i.length()>=4).collect(Collectors.toList());\n\t\t\n\t\tSystem.out.println(output);\n\t}", "void mo54419a(List<String> list);", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "private static void retriveElementInArrayList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tSystem.out.println(list.get(3));\n\n\t}", "public boolean isFourOfAKind(){\n List<PokerCard> subList;\r\n \r\n //First possibility: first four cards are the same value\r\n subList = cards.subList(0, cards.size()-1);\r\n if(haveSameValue(subList)){\r\n handValue = subList.get(0).getValue();\r\n return true;\r\n }\r\n \r\n //Second possibility: last four cards are the same value\r\n subList = cards.subList(1, cards.size());\r\n if(haveSameValue(subList)){\r\n handValue = subList.get(0).getValue();\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "public abstract void mo56923b(List<C4122e> list);", "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "private static List<String> getIPv4First(List<InetAddress> in)\n {\n List<String> out = new ArrayList<>();\n int i = 0;\n for (InetAddress addr : in) {\n if (addr instanceof Inet4Address) {\n out.add(i++, addr.getHostAddress());\n }\n else {\n out.add(addr.getHostAddress());\n }\n }\n return out;\n }", "public static void main(String[] args) {\nArrayList<String>mylist =new ArrayList<String>();\r\nmylist.add(\"anu\");\r\nmylist.add(\"ammu\");\r\nmylist.add(\"renu\");\r\nSystem.out.println(mylist);\r\nfor(int i=0;i<3;i++)\r\n{\r\n\tSystem.out.println(i+\"=\" + mylist.get(i));\r\n}\r\n\t}", "void mo69875a(List<Aweme> list, boolean z);", "public static void main(String[] args) {\n\r\n\t\tMyList l = new MyList();\r\n\t\tl.add(\"LOUNIS\");\r\n\t\tl.addLast(\"LOUNIS\");\r\n\t\tl.add(\"LOUNIS-2\");\r\n\t\tl.add(\"LOUNIS-3\");\r\n\t\tl.addLast(\"LOUNIS-6\");\r\n\t\tl.add(\"LOUNIS-4\");\r\n\t\tl.add(\"test\",6);\r\n\t\tSystem.out.println(l.toString()); \r\n\t\tSystem.out.println(l.get(5)); \r\n\t\tSystem.out.println(l.sumLetter());\r\n\t}", "@Test\r\n\tvoid testRemove4() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\ttest.add(9);\r\n\t\ttest.remove(1);\r\n\t\tassertNotEquals(8, test.list.length);\r\n\t}", "public static IntList dincrList(IntList L, int x) { //iteratively\n /* Your code here. */\n IntList p = L;\n while (p != null) {\n p.first = p.first + x; //this mutate the L.first since p.first and l.first are the same\n p = p.rest; //until p = null then it point to another list\n }\n return L; //not p because P is null at this point and it point to the rest not the original list\n }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "private static void printArray(ArrayList<Integer> list) {\n for (int i : list) {\n System.out.println(i * 3);\n }\n\n }", "public boolean isFourOfAKind() {\r\n\r\n return getHighestConsecutive() == 4;\r\n }", "public static void printList(List l)\r\n\t{\r\n\t\tSystem.out.print(\"[\");\r\n\t\tif(l.size()>0)\r\n\t\t{\r\n\t\t\tfor(int i = 0; i < l.size()-1; i++)\r\n\t\t\t\tSystem.out.print(l.get(i) + \", \");\r\n\t\t\tSystem.out.print(l.get(l.size()-1));\r\n\t\t}\r\n\t\tSystem.out.print(\"]\\n\");\r\n\t\t\r\n\t}", "static int[] rotLeft(int[] a, int d) {\n int temp = a[a.length - 1];\n for (int i = a.length - 1; i > 1; i--) {\n if (i > 2) {\n a[i - 2] = temp;\n temp = a[i - 3];\n } else {\n a[0] = a[a.length - 1];\n }\n }\n\n return a;\n }", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "@Test\n public void test_4() {\n long expected = 805;\n List<List<Integer>> possibleRoads = List.of(\n List.of(8, 2),\n List.of(2, 9)\n );\n long result = roadsAndLibraries(9, 91, 84, possibleRoads);\n Assertions.assertEquals(expected, result);\n }", "public static void main(String[] args) {\n ArrayList<String> al = new ArrayList<String>();\n // simple add() methods for adding elements at the end\n al.add(\"Hi\");\n al.add(\"hello\");\n al.add(\"String\");\n al.add(\"Test\");\n System.out.println(al);\n //adding element to the 4th position\n //4th position = 3 index as index starts with 0\n al.add(3,\"Howdy\");\n\n System.out.println(\"Elements after adding string Howdy:\"+ al);\n //adding string to 1st position\n // al.add(0, \"Bye\");\n\n //Print\n System.out.println(\"Elements after adding string bye:\"+ al);\n }", "int mo1635a(long j, List list);", "@Test\n\tpublic void test3(){\n\t\tDoubleLinkedList dll = new DoubleLinkedList(getList(5));\n\t\t\n\t\tassertEquals(1, dll.get(1));\n\t\t\n\t\tdll.add(dll.size(), 99);\n\t\tassertEquals(dll.get(dll.size() - 1), 99);\n\t\tdll.add(1, 100);\n\t\tassertEquals(dll.get(1), 100);\n\t\t\n\t\tdll.remove(6);\n\t\tassertEquals(dll.indexOf(99), -1);\n\t\t\n\t\tdll.clear();\n\t\tassertEquals(dll.size(), 0);\n\t\t\n\t\tdll.addAll(getList(0));\n\t\tassertEquals(dll.size(), 0);\n\t\tdll.addAll(getList(5));\n\t\tassertEquals(dll.size(), 5);\n\t\t\n\t\tdll.addAll(dll.size() - 1, getList(6));\n\t\tassertEquals(dll.size(), 11);\n\t}", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "public boolean isListLengthFixed();", "@Test\n\tvoid testWordLadder() {\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.addAll(Arrays.asList(\"hot\", \"dot\", \"dog\", \"lot\", \"log\", \"cog\"));\n\t\tassertEquals(5, new WordLadder().ladderLength(\"hit\", \"cog\", list));\n\n\t\tlist.clear();\n\t\tlist.addAll(Arrays.asList(\"hot\", \"dot\", \"dog\", \"lot\", \"log\"));\n\t\tassertEquals(0, new WordLadder().ladderLength(\"hit\", \"cog\", list));\n\n\t\tlist.clear();\n\t\tlist.addAll(Arrays.asList(\"ts\", \"sc\", \"ph\", \"ca\", \"jr\", \"hf\", \"to\", \"if\", \"ha\", \"is\", \"io\", \"cf\", \"ta\"));\n\t\tassertEquals(4, new WordLadder().ladderLength(\"ta\", \"if\", list));\n\n\t\tlist.clear();\n\t\tlist.addAll(Arrays.asList(\"b\", \"c\"));\n\t\tassertEquals(2, new WordLadder().ladderLength(\"a\", \"c\", list));\n\t}", "private static void test4() {\n int[] numbers = {4, 5, 1, 6, 2, 7, 2, 8};\n int[] expected = {1, 2};\n\n test(\"Test4\", numbers, expected);\n }", "public static int stepThree(ArrayList<Integer> list) {\n\t\t\n\t\tint sum = 0;\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint num = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//sum every other number beginning with first from the right\n\t\t\tif (passNumber % 2 == 1) {\n\t\t\t\tsum += num;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public static void main(String[] args) {\n\t List<Integer> al = new ArrayList<>(Arrays.asList(1,2,3,4,5,6,7,8,9,10));\n\t\t//System.out.println(al);\n\t\t\n\t\t\t\n\t\t\t\tSystem.out.println(al);\n\t\t\t\n\t\t\n\t\t\n\t\n\t}", "public static int sumOfTwoLargestElements4(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n int thirdNum = Integer.MIN_VALUE;\n int fourNum = Integer.MIN_VALUE;\n// int[] arr = {-8, 9, -1, -16, 2, 4};\n\n\n for (int i=0; i<a.length; i++){\n System.out.println(\"====>\"+a[i]);\n if(a[i]>firstNum){\n secondNum = firstNum;\n thirdNum = secondNum;\n// fourNum = thirdNum;\n firstNum = a[i];\n }else if (a[i]>secondNum){\n thirdNum = secondNum;\n// fourNum = thirdNum;\n secondNum = a[i];\n }else if(a[i]>thirdNum){\n fourNum = thirdNum;\n thirdNum =a[i];\n }else if(a[i]>fourNum){\n fourNum = a[i];\n }\n\n }\n return firstNum+secondNum+thirdNum+fourNum;\n }", "@Test\n public void testLaenge() {\n System.out.println(\"---laenge---\");\n //Test1: An empty ADTList has a length of 0\n ADTList instance = ADTList.create();\n int expResult = 0;\n int result = instance.laenge();\n assertEquals(expResult, result);\n System.out.println(\"Test1 OK\");\n \n\n //Test2: An ADTList with 2 Elements has a length of 2\n ADTList instance2 = ADTList.create();\n instance2.insert(4,1);\n instance2.insert(3,2);\n int expResult2 = 2;\n int result2 = instance2.laenge();\n assertEquals(expResult2, result2);\n System.out.println(\"Test2 OK\");\n \n //Test3: Method is working after expanding the internally used arrays (assuming an initial array size of 5)\n ADTList instance3 = createTestADTListIns(6);\n int expResult3 = 6;\n int result3 = instance3.laenge();\n assertEquals(expResult3, result3);\n System.out.println(\"Test3 OK\");\n }", "private static boolean ContextItemDecl_4(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ContextItemDecl_4\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = VarValueAssignment(b, l + 1);\n if (!r) r = ContextItemDecl_4_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint a[]= {4 ,3 ,7 ,8 ,6 ,2 ,1};\r\n\t\t\r\n\t\tArrayList al=new ArrayList();\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tif(i+1<a.length)\r\n\t\t\t{\r\n\t\t\tif(a[i]<a[i+1])\r\n\t\t\t{\r\n\t\t\t\tal.add(a[i+1]);\r\n\t\t\t\tal.add(a[i]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tal.add(a[i+1]);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(al);\r\n\t}", "public ArrayList<ArrayList<Integer>> fourSum_02(ArrayList<Integer> a, int b) {\n\t\t//List to store the result\n\t\tArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n \tint len = a.size();\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = a.get(i) + a.get(j);\n \t\t\tif(h.containsKey(b-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(b-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add( a.get(i));\n\t \t\t\t\tl.add( a.get(j));\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != a.get(i)) && (exJ != a.get(j))) {\n\t \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(a.get(i));\n\t\t \t\t\t\tl.add(a.get(j));\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tboolean flag = true;\n\t\t \t\t\t\t\n\t\t \t\t\t\tfor(ArrayList<Integer> ll : res) {\n\t\t \t\t\t\t\tif(ll.equals(l)) {\n\t\t \t\t\t\t\t\tflag = false;\n\t\t \t\t\t\t\t\tbreak;\n\t\t \t\t\t\t\t}\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(flag == true)\n\t\t \t\t\t\t\tres.add(l);\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\th.put(sum, new Index(a.get(i), a.get(j)));\n \t\t}\n \t}\n \treturn res;\n\t}", "public static String checkList(String[] l1, String[] l2, String[] l3, String[] l4){\n Arrays.sort(l1);\n Arrays.sort(l2);\n Arrays.sort(l3);\n Arrays.sort(l4);\n //current runtime O(4log(N)) ~ O(log(N))\n\n String lexo = \"\";\n\n int count;\n\n //running through all elements of the first list O(N)\n for (int i = 0; i < l1.length; i++) {\n count = 1;\n if (Arrays.binarySearch(l2, l1[i]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l3, l1[i]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l4, l1[i]) >= 0)\n count += 1;\n if (count == 3){\n lexo = l1[i];\n break;\n }\n }\n //running through elements of the last list O(N)\n for (int j = 0; j < l2.length; j++) {\n count = 1;\n if (Arrays.binarySearch(l1, l2[j]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l3, l2[j]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l4, l2[j]) >= 0)\n count += 1;\n if (count == 3 && (l2[j].compareTo(lexo)<0 || lexo == \"\")){\n lexo = l2[j];\n break;\n }\n }\n //Total running time in a worst case scenario of no triplets is now 2N(4*log(N)) ~ O(N*log(N))\n return lexo;\n\n\n }", "private void grow() {\r\n\t\t\r\n\t\t Student [] newList = new Student[sizeOfList(list) + 4];\r\n\t int size = sizeOfList(list);\r\n\t \r\n\t for(int i = 0; i < size; i++) {\r\n\t \t newList[i] = list[i];\r\n\t }\r\n\t list = newList;\r\n\t}", "public interface a {\n void a(int i, List<String> list, boolean z, long j, String str, String str2, String str3);\n }", "public static void m3(ArrayList<? extends Number> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "private void exercise3() {\n final List<String> list = asList(\n \"The\", \"quick\", \"brown\", \"fox\", \"jumped\", \"over\", \"the\", \"lazy\", \"dog\");\n\n String result = list.stream()\n .skip(1)\n .limit(3)\n .collect(joining(\"-\"));\n\n System.out.println(result);\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static void main(String[] args) {\n\t\tMyList L = new MyList(1);\n\t\tL.next = new MyList(2);\n\t\tL.next.next = new MyList(3);\n\t\tL.next.next.next = new MyList(4);\n\t\tL.next.next.next.next = new MyList(5);\n\t\tL.next.next.next.next.next = new MyList(6);\n\t\tL.next.next.next.next.next.next = new MyList(7);\n\t\tL.Print();// expect 1,2,3,4,5,6,7\n\t\tInterweave(L);\n\t\tL.Print();// expect 1,7,2,6,3,5,4\n\n\t\t// notice this problem we used constant space and linear running time!\n\t}", "void mo100443a(List<String> list);", "public static void main(String[] args) {\t\n\t\t//List olusturma nasil yapilir?\n\t\t//1. yol\n\t\tArrayList<String> sl1= new ArrayList<>();\n\t\t\n\t\t//2. yol\n\t\tArrayList<String> sl2= new ArrayList<>();\n\t\tSystem.out.println(sl1+\"\"+sl2);\n\t\t//3. yol (bunu kullanacagiz)\n\t\tList<String> sl3=new ArrayList<>();\n\t\tSystem.out.println(sl3);\n\t\t\n\t\t//Liste eleman ekleme\n\t\t\n\t\tsl3.add(\"A\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\tsl3.add(\"B\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\tsl3.add(\"C\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\t//herhangi bir indexe eleman ekleme\n\t\t\n\t\tsl3.add(0, \"Mustafa\");\n\t\t System.out.println(sl3);//[Mustafa, A, X, B, C]\n\t\t \n\t\t //List'lerde eleman sayisini bulma nasil yapilir?\n\t\t System.out.println(sl3.size());//5\n\t\t \n\t\t //Bir list'in bos olup olmadigin nasil anlariz?\n\t\t System.out.println(sl3.isEmpty());//isEmpty() ==> bos ise true, dolu ise false verir\n\t\t \n\t\t //Bir list'den istenen elemani silme nasil yapilir?\n\t\t \n\t\t //1. Yol: index ile silme yapabilirsiniz.\n\t\t System.out.println(sl3.remove(0));\n\t\t System.out.println(sl3);//[A, X, B, C]\n\t\t \n\t\t //2. Yol: Eleman secip sil\n\t\t sl3.remove(\"X\");\n\t\t System.out.println(sl3);//[A, B, C]\n\t\t \n\t\t sl3.add(\"B\");//[A, B, C, B]\n\t\t System.out.println(sl3.remove(\"B\"));//true\n\t\t //Ayni elemandan 1 den fazla varsa ilkini siler\n\t\t System.out.println(sl3);//[A, C, B]\n\t\t \n\t\t \n\t\t System.out.println(sl3.remove(\"W\"));//false\n\t\t //Java'dan olmayan bir elemani remove etmesini isterseniz\n\t\t //remove edemez ve list'i aynen oldugu gibi birakir.\n\t\t System.out.println(sl3);//[A, C, B]\n\t\t \n\t\t //remove(index) ne return eder?\n\t\t // sl3 ==> [A, C, B]\n\t\t System.out.println(sl3.remove(1));//C\n\t\t System.out.println(sl3);//[A, B]\n\t\t \n\t\t//remove(eleman) ne return eder?\n\t\t// sl3 ==> [A, B] \n\t\t System.out.println(sl3.remove(\"A\"));//true\n\t\t //remove() methodunun icine tamsayi koyarsaniz \n\t\t //Java onu index kabul eder. \n\t\t //Bu yuzden elemanlari integer olan bir listteki elemanlari silmek icin \n\t\t //remove() methodunun sadece indexlisini kullanabilirsiniz.\n\n \n}", "public static <C> LIST<C> RED3(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(3,L.list.size()) );\n }\n return LP;\n }", "static int getCapacity(List al) throws Exception {\n Field field = ArrayList.class.getDeclaredField(\"elementData\");\n field.setAccessible(true);\n return ((Object[]) field.get(al)).length;\n }", "@Test\n public void test_1() {\n // 3 3 2 1\n long expected = 4;\n List<List<Integer>> possibleRoads = List.of(\n List.of(1, 2),\n List.of(3, 1),\n List.of(2, 3)\n );\n long result = roadsAndLibraries(3, 2, 1, possibleRoads);\n Assertions.assertEquals(expected, result);\n }", "public static void stepOne(ArrayList<Integer> list) {\n\t\t\n\t\t//keep track of number of times list is passed through\n\t\tint passNumber = 0;\n\t\t\n\t\t//iterate through arraylist from right to left\n\t\tfor(int i = list.size()-1; i >= 0; i--) {\n\n\t\t\tint newNum = list.get(i);\n\t\t\tpassNumber++;\n\t\t\t\n\t\t\t//for every other number beginning with second from the right\n\t\t\t//double number -- if two digit number results, add digits together\n\t\t\tif (passNumber % 2 == 0) {\n\t\t\t\n\t\t\t\tnewNum *= 2;\n\t\t\t\t\n\t\t\t\t//add digits together if two digit number \n\t\t\t\tif (newNum > 9) {\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\n\t\t\t\t\twhile(newNum > 0) {\n\t\t\t\t\t\tsum = sum + newNum % 10;\n\t\t\t\t\t\tnewNum = newNum / 10;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tnewNum = sum;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//replace number in list with new number\n\t\t\t\tlist.set(i, newNum);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void m10259a(ArrayList<Double> arrayList) {\n int size = arrayList.size();\n if (size <= this.f8993u) {\n this.f8973a.mo3315b((ArrayList) arrayList);\n return;\n }\n ArrayList arrayList2 = new ArrayList();\n int i = size / this.f8993u;\n for (int i2 = 0; i2 < this.f8993u; i2++) {\n int i3 = i2 * i;\n if (i3 >= size) {\n arrayList2.add(arrayList.get(size - 1));\n } else {\n arrayList2.add(arrayList.get(i3));\n }\n }\n this.f8973a.mo3315b(arrayList2);\n }", "@Test\r\n\tpublic void testLastElementInHeadOfL11() {\r\n\t\tl1 = Arrays.asList(1,2);\r\n\t\tl2 = Arrays.asList(2,1);\r\n\t\tassertTrue(\"The list L1 is a subseq of L2\", sequencer.subSeq(l1, l2));\r\n\t}", "private void m14040a(C4393d c4393d, List<Certificate> list) {\n try {\n c4393d.mo4573m((long) list.size()).mo4568k(10);\n int size = list.size();\n for (int i = 0; i < size; i++) {\n c4393d.mo4550b(ByteString.m14642a(((Certificate) list.get(i)).getEncoded()).m14654b()).mo4568k(10);\n }\n } catch (C4393d c4393d2) {\n throw new IOException(c4393d2.getMessage());\n }\n }", "public static void main(String[] args)\n\t{\n\t\tArrayList ar=new ArrayList();\n\t\tSystem.out.println(ar.size());\n\t\tar.add(23);\n\t\tar.add(30);\n\t\tar.add(40);\n\t\tSystem.out.println(ar.size());\n\t\t// We can add duplicates values also.\n\t\tar.add(23);\n\t\tar.get(1);\n\t\tSystem.out.println(\"whats the output\"+ar.get(1));\n\t\tSystem.out.println(ar);\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void m5(ArrayList<? super B> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\t//al.add(345);\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "public final void accept(List<? extends com.iqoption.fragment.c.a.a.j> list) {\n a aVar = this.dhx.dhv.dhu;\n kotlin.jvm.internal.i.e(list, \"list\");\n aVar.aU(list);\n }", "public final void m1032a(List<Intent> list, List<String> list2, List<String> list3, long j, boolean z) {\n List<Intent> list4 = list;\n this.f1476d.mo44104b(list, new C3153h(this, list2, list3, j, z, list));\n }", "public static void main(String [] args)\r\n\t{\n\t\t\r\n\t\tArrayList<String> arl = new ArrayList<String>();\r\n\t\t\t//addAryList(arl);\r\n\t\tprintArryList(arl);\r\n\t\t//n = sc.nextInt();\r\n\t LinkedList<String> lst = new LinkedList<String>();\r\n\t\tprintLList(lst);\r\n\r\n\t}", "@Test\n\tpublic void test1() {\n\t\t// toArray()\n\t\tDoubleLinkedList dll = new DoubleLinkedList(getList(10));\n\t\tObject[] a = new Object[] {21, 22, 23, 24, 25};\n\t\tassertArrayEquals(dll.toArray(a), getList(10).toArray());\n\t\t\n\t\tdll = new DoubleLinkedList(getList(4));\n\t\tassertEquals(dll.toArray(a)[4], null);\n\t\t\n\t\t// addBefore()\n\t\tdll.addBefore(101, dll.header);\n\t\t\n\t\t// remove()\n\t\ttry{\n\t\t\tdll.remove(dll.header);\n\t\t}catch(NoSuchElementException e){\n\t\t\tassertEquals(e.getMessage(), null);\n\t\t}\n\t\t\n\t\tdll.remove(dll.header.next);\n\t\t\n\t\t\n\t}", "public static void list(String[] list, int maximum) {\n\t\tint i;\n\t\tfor ( i = 0 ; i <= maximum; ); { TextIO.putln( \"\" + i + \". \" + list[i]);}\n\t}", "public static List<Integer> rotateLeft(int d, List<Integer> arr) {\n // Write your code here\n List<Integer> resultList = arr.subList(d, arr.size());\n resultList.addAll(arr.subList(0, d));\n return resultList;\n }", "private static boolean methodDeclaration_4(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"methodDeclaration_4\")) return false;\n methodDeclaration_4_0(b, l + 1);\n return true;\n }", "@Test public void asListSimple() {\n @SuppressWarnings(\"null\") final @NotNull List<Integer> is = as.list(new int @NotNull [] { 12, 13, 14 });\n azzert.that(is.get(0), is(fluent.ly.box.it(12)));\n azzert.that(is.get(1), is(fluent.ly.box.it(13)));\n azzert.that(is.get(2), is(fluent.ly.box.it(14)));\n azzert.that(is.size(), is(3));\n }", "int getNextList(int list) {\n\t\treturn m_lists.getField(list, 3);\n\t}", "protected List<Answer> getListNumOfAnswers(List<Answer> a, int n) {\n \tList<Answer> finalAnswers = new ArrayList<Answer>();\n \tfor (int i = 0; i < n; i++) {\n finalAnswers.add(a.get(i));\n }\n return finalAnswers;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tLinkedListPracticeSingly ll = new LinkedListPracticeSingly(10);\r\n\t\tll.addAtHead(11);\r\n\t\tll.addAtHead(12);\r\n\t\tll.addAtHead(13);\r\n\t\tSystem.out.println(\"\\nData Size >>>>>> [\"+getSize()+\"]\");\r\n\t\tll.printList();\r\n\t\t\r\n\t\tll.addAtTail(8);\r\n\t\tSystem.out.println(\"\\nData Size >>>>>> [\"+getSize()+\"]\");\r\n\t\tll.printList();\r\n\t\t\r\n\t\tll.addAtTail(7);\r\n\t\tSystem.out.println(\"\\nData Size >>>>>> [\"+getSize()+\"]\");\r\n\t\tll.printList();\r\n\t\t\r\n\t\tll.addAtIndex(4,19);\r\n\t\tSystem.out.println(\"\\nData Size >>>>>> [\"+getSize()+\"]\");\r\n\t\tll.printList();\r\n\t\t\r\n\t\t//ll.addAtIndex(4,9);\r\n\t\t//ll.deleteAtIndex(4);\r\n\t\t//ll.printList();\r\n\t}", "public ArrayList<Integer> spiralOrder(final List<ArrayList<Integer>> a) {\r\n\t\t ArrayList<Integer> result = new ArrayList<Integer>();\r\n\t\t int T = 0, B = a.size()-1, L = 0, R = a.get(0).size()-1; \r\n\t\t int dir = 0;\r\n\t\t if(B <= 0){\r\n\t\t return result;\r\n\t\t }\r\n\t\t while(L <= R && T <= B){\r\n\t\t if(dir == 0){\r\n\t\t for(int k = L; k <= R; k++){\r\n\t\t result.add(a.get(T).get(k));\r\n\t\t }\r\n\t\t T++;\r\n\t\t }\r\n\t\t else if(dir == 1){\r\n\t\t for(int k = T; k <= B; k++){\r\n\t\t result.add(a.get(k).get(R));\r\n\t\t }\r\n\t\t R--;\r\n\t\t }\r\n\t\t else if(dir == 2){\r\n\t\t for(int k = R; k >= L; k--){\r\n\t\t result.add(a.get(B).get(k));\r\n\t\t }\r\n\t\t B--;\r\n\t\t }\r\n\t\t else if(dir == 3){\r\n\t\t for(int k = B; k >= T; k--){\r\n\t\t result.add(a.get(k).get(L));\r\n\t\t }\r\n\t\t L++;\r\n\t\t }\r\n\t\t dir = (dir+1) % 4;\r\n\t\t }\r\n\t\t return result;\r\n\t}", "@Test\n public void test9() throws Throwable {\n\t\tfr.inria.diversify.sosie.logger.LogWriter.writeTestStart(1355,\"org.apache.commons.collections4.IteratorUtilsEvoSuiteTest.test9\");\n LinkedList<String>[] linkedListArray0 = (LinkedList<String>[]) Array.newInstance(LinkedList.class, 8);\n // Undeclared exception!\n try {\n IteratorUtils.arrayListIterator(linkedListArray0, 536);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // Start index must not be greater than the array length\n //\n }\n }", "static boolean argumentListPart(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"argumentListPart\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_);\n r = namedArgument(b, l + 1);\n if (!r) r = expression(b, l + 1);\n exit_section_(b, l, m, r, false, DartParser::argument_list_part_recover);\n return r;\n }", "private static boolean TableRow_4(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"TableRow_4\")) return false;\n int c = current_position_(b);\n while (true) {\n if (!TableRow_4_0(b, l + 1)) break;\n if (!empty_element_parsed_guard_(b, \"TableRow_4\", c)) break;\n c = current_position_(b);\n }\n return true;\n }", "public static boolean ArgumentList(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ArgumentList\")) return false;\n if (!nextTokenIs(b, L_PAR)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, ARGUMENT_LIST, null);\n r = consumeToken(b, L_PAR);\n p = r; // pin = 1\n r = r && report_error_(b, ArgumentList_1(b, l + 1));\n r = p && consumeToken(b, R_PAR) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "int mo13159a(List<Log> list);", "public static void main(String[] args) {\n\t\tListNode<Integer> l = new ListNode<Integer>(0);\r\n\t\t// pointer to first node\r\n\t\tListNode<Integer> head = l;\r\n\t\t\r\n\t\t// create new instances of nodes and link them together\r\n\t\tfor(int i = 0;i<5;i++)\t{\r\n\t\t\tl.next = new ListNode<Integer>(i+1);\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\t\t// set l back to it's first node\r\n\t\t\tl = head.next;\r\n\t\t\r\n\t\t// represents how many elements from the end will be rearranged\r\n\t\tint n = 3;\r\n\t\t\r\n\t\t// create instance of class and display list\r\n\t\tReArrangeLastN list = new ReArrangeLastN();\r\n\t\t\tlist.displayList(\"Original List: \",l);\r\n\t\t\t\r\n\t\t// initialize a node with the rearranged result and display list\r\n\t\tListNode<Integer> result = list.rearrangeLastN(l, n);\r\n\t\t\tlist.displayList(\"Rearranged List when n = \" + n +\": \",result);\r\n\t}", "private static int[] post4(int[] input) {\n int indexFor = 0;\n for (int i = input.length - 1; i >= 0; i--) {\n if (input[i] == 4) {\n indexFor = i;\n break;\n }\n }\n // 1. done\n int size = input.length - indexFor - 1;\n // 2. done\n int[] output = new int[size];\n // 2.5. done\n /* for (int i = size - 1; i >= 0; i--) {\n output[i] = input[input.length + i - size];\n }*/\n for (int i = 0; i < size; i++) {\n output[i] = input[i + indexFor + 1];\n }\n // 3. done\n return output;\n }", "public static void main(String[] args) {\r\n RotateList rl = new RotateList();\r\n // test list : 1->2->3->4->5->NULL.\r\n ListNode testList = new ListNode(0);\r\n for (int i = 1; i < 6; i++) {\r\n testList.addNodeTail(new ListNode(i));\r\n }\r\n System.out.println(\"The input list is the following:\");\r\n testList.printList();\r\n ListNode result = rl.rotateRight(testList, 3);\r\n System.out.println(\"And the output is the following:\");\r\n result.printList();\r\n }", "@Test\n public void getSizeOfList() {\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n\n assertEquals(4, list.size());\n }", "public static void main(String args[]){\n ListNode one=new ListNode(1);\n one.next=new ListNode(3);\n one.next.next=new ListNode(2);\n one=partition(one,3);\n while (one!=null){\n System.out.print(one.val);\n one=one.next;\n }\n }", "public final void mo81945a(List<MediaModel> list) {\n C7573i.m23587b(list, \"list\");\n if (!C7573i.m23585a((Object) mo81943a(), (Object) list)) {\n super.mo81945a(list);\n }\n }", "public static void main(String[] args) {\n\n\t\tList<Integer> arrList = new ArrayList<Integer>();\n\t\tarrList.add(1);\n\t\tarrList.add(2);\n\t\tList<Integer> arrLinked = new LinkedList<Integer>(arrList);\n\t\tarrLinked.add(1, 3);\n\t\tarrLinked.set(0, 4);\n\t\tSystem.out.println(arrLinked.get(2));\n\n\t\tSystem.out.println(arrLinked.toString());\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t// 10 Tests: \n\t\tList<Integer> a1 = new List<>();\n\t\tList<Integer> b1 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a2 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b2 = new List<>();\n\t\t\n\t\tList<Integer> a3 = new List<>();\n\t\tList<Integer> b3 = new List<>();\n\t\t\n\t\tList<Integer> a4 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b4 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\t\n\t\tList<Integer> a5 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\tList<Integer> b5 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a6 = new List<>(1, new List<>(4, new List<>(6, new List<>()))); \n\t\tList<Integer> b6 = new List<>(5, new List<>(6, new List<>(9, new List<>())));\n\t\t\n\t\tList<Integer> a7 = new List<>(-6, new List<>(-5, new List<>(-4, new List<>())));\n\t\tList<Integer> b7 = new List<>(-3, new List<>(-2, new List<>(-1, new List<>())));\n\t\t\n\t\tList<Integer> a8 = new List<>(-2, new List<>(-1, new List<>(0, new List<>())));\n\t\tList<Integer> b8 = new List<>(-1, new List<>(0, new List<>(1, new List<>(2, new List<>()))));\n\t\t\n\t\tList<Integer> a9 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b9 = new List<>(3, new List<>(4, new List<>(5, new List<>())));\n\t\t\n\t\tList<Integer> a10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\t\n\t\tSystem.out.println(unique(a1, b1));\n\t\tSystem.out.println(unique(a2, b2));\n\t\tSystem.out.println(unique(a3, b3));\n\t\tSystem.out.println(unique(a4, b4));\n\t\tSystem.out.println(unique(a5, b5));\n\t\tSystem.out.println(unique(a6, b6));\n\t\tSystem.out.println(unique(a7, b7));\n\t\tSystem.out.println(unique(a8, b8));\n\t\tSystem.out.println(unique(a9, b9));\n\t\tSystem.out.println(unique(a10, b10));\n\t\t\n\t}", "boolean isFourOfAKind();", "public static ab.a a(List<c.a.a.f> list) throws IOException {\n String string = null;\n String string2 = \"HTTP/1.1\";\n r.a a2 = new r.a();\n int n2 = list.size();\n int n3 = 0;\n do {\n String string3;\n int n4;\n f f2;\n String string4;\n if (n3 < n2) {\n f2 = ((c.a.a.f)list.get((int)n3)).h;\n string3 = ((c.a.a.f)list.get((int)n3)).i.a();\n string4 = string2;\n n4 = 0;\n } else {\n if (string == null) {\n throw new ProtocolException(\"Expected ':status' header not present\");\n }\n q q2 = q.a(string2 + \" \" + string);\n return new ab.a().a(x.c).a(q2.b).a(q2.c).a(a2.a());\n }\n while (n4 < string3.length()) {\n int n5 = string3.indexOf(0, n4);\n if (n5 == -1) {\n n5 = string3.length();\n }\n String string5 = string3.substring(n4, n5);\n if (!f2.equals((Object)c.a.a.f.a)) {\n if (f2.equals((Object)c.a.a.f.g)) {\n string4 = string5;\n string5 = string;\n } else {\n if (!j.contains((Object)f2)) {\n a2.a(f2.a(), string5);\n }\n string5 = string;\n }\n }\n int n6 = n5 + 1;\n string = string5;\n n4 = n6;\n }\n ++n3;\n string2 = string4;\n } while (true);\n }", "public static void main(String[] args) {\n\t\tList<?>[] list = new ArrayList<?>[6];\n\t}", "public static void main(String[] args) {\n list = new LinkedList(0);\n\n // add more elements to LinkedList\n list.push(1);\n list.push(2);\n list.push(3);\n list.push(4);\n list.pop();\n list.pop();\n list.push(42);\n list.push(42);\n list.push(42);\n list.push(42);\n list.pop();\n list.pop();\n list.push(3);\n list.push(4);\n list.pop();\n list.remove(4);\n list.remove(3);\n list.remove(42);\n list.remove(0);\n list.remove(-42);\n list.remove(2);\n list.remove(0);\n list.remove(0);\n list.remove(0);\n list.remove(0);\n list.remove(0);\n list.remove(-1);\n\n\n\n for(int i = 0; i < list.getLength(); i++) {\n System.out.println(\"Print: list: \\t\\t\" + list.get(i));\n }\n }", "public static bly a(List<bms> paramList, Random paramRandom, int paramInt1, int paramInt2, int paramInt3, EnumDirection paramej, int paramInt4)\r\n/* 28: */ {\r\n/* 29:848 */ bjb localbjb = bjb.a(paramInt1, paramInt2, paramInt3, -1, -1, 0, 5, 5, 5, paramej);\r\n/* 30:850 */ if ((!a(localbjb)) || (bms.a(paramList, localbjb) != null)) {\r\n/* 31:851 */ return null;\r\n/* 32: */ }\r\n/* 33:854 */ return new bly(paramInt4, paramRandom, localbjb, paramej);\r\n/* 34: */ }", "public static void main(String[] args) {\n\n\t\tAlternateSplitOfLinkedList list = new AlternateSplitOfLinkedList();\n\t\t//list.addAtBeginnning(6);\n\t\tlist.addAtBeginnning(5);\n\t\tlist.addAtBeginnning(4);\n\t\tlist.addAtBeginnning(3);\n\t\tlist.addAtBeginnning(2);\n\t\tlist.addAtBeginnning(1);\n\t\t\n\t\tlist.printLinkedList(list.head);\t\n\t\tlist.alternateSplit();\n\t\t\t\n\t}", "public static void main(String[] args) {\n ListNode l0 = new ListNode(1);\n ListNode l1 = new ListNode(2);\n ListNode l2 = new ListNode(3);\n ListNode l3 = new ListNode(4);\n l0.next = l1;\n l1.next = l2;\n l2.next = l3;\n\n System.out.println(l0);\n reverseList(l0);\n System.out.println(l3);\n }" ]
[ "0.6361381", "0.5953475", "0.58533424", "0.5747742", "0.56943446", "0.56608933", "0.5648718", "0.56334627", "0.5307459", "0.5242253", "0.5235607", "0.52091426", "0.51670134", "0.512797", "0.50844395", "0.5076924", "0.5070704", "0.50634724", "0.504553", "0.50155795", "0.49981973", "0.49702173", "0.49408114", "0.49352533", "0.493029", "0.49280715", "0.49187747", "0.49047613", "0.4894419", "0.48877612", "0.48853672", "0.48836303", "0.487613", "0.4867945", "0.48621565", "0.48557", "0.48503372", "0.4837818", "0.48277104", "0.48036176", "0.48015898", "0.4799548", "0.4796543", "0.4779548", "0.4762712", "0.4756519", "0.47476846", "0.474699", "0.474627", "0.47450125", "0.4738364", "0.47241715", "0.47227475", "0.47217643", "0.47052044", "0.4699535", "0.468697", "0.46829322", "0.46824753", "0.467885", "0.46766564", "0.46742308", "0.4670562", "0.46673772", "0.4662465", "0.46604687", "0.46569264", "0.46554866", "0.46527755", "0.46363991", "0.4627239", "0.4616524", "0.461376", "0.46127325", "0.4609804", "0.46091336", "0.46082556", "0.4606872", "0.46061942", "0.46038404", "0.4599924", "0.4589735", "0.4587737", "0.45872438", "0.45869887", "0.458532", "0.45845166", "0.4581894", "0.4573766", "0.45717704", "0.45716906", "0.45695454", "0.4569443", "0.45672482", "0.45641142", "0.4560462", "0.45584512", "0.45575073", "0.4553923", "0.45513284" ]
0.6264394
1
Constructive concatenation. L1 and L2 are lists. L is the concatenation of L1 and L2. The list L is constructed.
public static <C> LIST<C> CCONC(LIST<C> L1, LIST<C> L2) { if ( isNull( L1 ) ) { return L2; } if ( isNull( L2 ) ) { return L1; } LinkedList<C> list = new LinkedList<C>( L1.list ); list.addAll( L2.list ); return new LIST<C>( list ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static List<StateRef> append(List<StateRef> l1, List<StateRef> l2) {\n l1.addAll(l2);\n return l1;\n }", "public static <C> LIST<C> CONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n L1.list.addAll( L2.list );\n return L1;\n }", "public LinkedList concatenate(LinkedList anotherList) {\n\t\tLinkedList newString = stringList;\n\t\t\n\t\treturn newString;\n\t}", "public /*@ non_null @*/\n JMLListEqualsNode<E> concat(/*@ non_null @*/ JMLListEqualsNode<E> ls2)\n {\n return (next == null\n ? new JMLListEqualsNode<E>(val, ls2)\n : new JMLListEqualsNode<E>(val, next.concat(ls2))\n );\n }", "public static NodoListaS append(NodoListaS p1, NodoListaS p2) {\r\n\t\tNodoListaS r = new NodoListaS(null,null);\r\n\t\t// nodo generatore\r\n\t\tNodoListaS t = r;\r\n\t\tNodoListaS q = p1;\r\n\t\twhile (q != null) {\r\n\t\t\tt.next = new NodoListaS(q.info,null);\r\n\t\t\tq = q.next;\r\n\t\t\tt = t.next;\r\n\t\t}\r\n\t\tq = p2;\r\n\t\twhile (q != null) {\r\n\t\t\tt.next = new NodoListaS(q.info,null);\r\n\t\t\tq = q.next;\r\n\t\t\tt = t.next;\r\n\t\t}\r\n\t\treturn r.next;\r\n\t}", "Concat createConcat();", "private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private static <Item extends Comparable> List<Item> catenate(List<Item> q1, List<Item> q2) {\n List<Item> catenated = new ArrayList<>();\n for (Item item : q1) {\n catenated.add(item);\n }\n for (Item item: q2) {\n catenated.add(item);\n }\n return catenated;\n }", "@Test\n public void testConcat() {\n// System.out.println(\"---concat---\");\n// //Test1: concatenating two empty lists returns an empty list\n// ADTList instance = ADTList.create();\n// ADTList list = ADTList.create();\n// ADTList expResult = ADTList.create();\n// ADTList result = instance.concat(list);\n// assertEquals(expResult, result);\n// System.out.println(\"Test1 OK\");\n// \n// //Test2.1: concatenating an empty list with a non-empty list returns the non-empty list\n// ADTList instance2 = ADTList.create();\n// ADTList list2 = createTestADTListIns(6);\n// ADTList expResult2 = list2;\n// ADTList result2 = instance2.concat(list2);\n// assertEquals(expResult2, result2);\n// System.out.println(\"Test2.1 OK\");\n// \n// //Test2.2: concatenating a non-empty list with an empty list returns the non-empty list\n// ADTList instance3 = createTestADTListIns(6);\n// ADTList list3 = ADTList.create();\n// ADTList expResult3 = instance3;\n// ADTList result3 = instance3.concat(list3);\n// assertEquals(expResult3, result3);\n// System.out.println(\"Test2.2 OK\");\n// \n// //Test3: concatenating two non-empty lists returns a new list in the form [list1 list2].\n// ADTList instance4 = createTestADTList(1,1,2,2,3,3);\n// ADTList list4 = createTestADTList(4,1,5,2,6,3);\n// ADTList expResult4 = createTestADTListIns(6);\n// ADTList result4 = instance4.concat(list4);\n// assertEquals(expResult4, result4);\n// System.out.println(\"Test3 OK\");\n \n }", "public static StringList createFrom(String list1[], String list2[]) {\n StringList list = new StringList(list1);\n list.merge(list2);\n return list;\n }", "public static void main(String[] args) {\n\t\t\t\n\t\tLinkedList<Integer> l1 = new LinkedList<Integer>();\n\t\tLinkedList<Integer> l2 = new LinkedList<Integer>();\n\t\tl1.add(34);\n\t\tl1.add(67);\n\t\tl2.add(89);\n\t\tl2.add(45);\n\t\tl1.addAll(l2);\n\t\tSystem.out.println(l1);\n\n }", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "ArrayList<Float> polaczListy (ArrayList<Float> L1, ArrayList<Float> L2)\n\t{\n\t\tint i=L1.size();\n\t\twhile(i<Stale.horyzontCzasowy)\n\t\t{\n\t\t\tL1.add(L2.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn L1;\n\t}", "public void concatenateList (linkedList<E> M) {\n\r\n if(this.head == null){\r\n head = M.head;\r\n tail = M.tail;\r\n } else {\r\n tail.setNext(M.head);\r\n tail = M.tail;\r\n }\r\n\r\n }", "public IList<T> append(IList<T> l) {\n if (rest.isEmpty()) {\n rest = l;\n }\n else {\n rest.append(l);\n }\n return this;\n }", "@NonNull\n @SafeVarargs\n static LongConsList<Long> concat(@NonNull LongConsList<Long> first, @NonNull LongConsList<Long>... rest) {\n Objects.requireNonNull(first, ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS_0);\n Objects.requireNonNull(rest, ConsUtil.MSG_ARG_ARRAY_REST_IS_NULL);\n if (rest.length == 0) {\n return first;\n }\n LongConsList<Long> result = rest[rest.length - 1];\n if (result == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + rest.length);\n }\n for (int i = rest.length - 2; i >= -1; i--) {\n LongConsList<Long> cons;\n if (i == -1) {\n cons = first;\n } else {\n if (rest[i] == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + (i + 1));\n }\n cons = rest[i].longReverse();\n }\n while (cons != Nil.INSTANCE) {\n result = new LongConsListImpl(cons.longHead(), result);\n cons = cons.longTail();\n }\n }\n return result;\n }", "public void testMergeOfParameterLists() throws SQLException {\n SimpleParameterList o1SPL = new SimpleParameterList(8, Boolean.TRUE);\n o1SPL.setIntParameter(1, 1);\n o1SPL.setIntParameter(2, 2);\n o1SPL.setIntParameter(3, 3);\n o1SPL.setIntParameter(4, 4);\n\n SimpleParameterList s2SPL = new SimpleParameterList(4, Boolean.TRUE);\n s2SPL.setIntParameter(1, 5);\n s2SPL.setIntParameter(2, 6);\n s2SPL.setIntParameter(3, 7);\n s2SPL.setIntParameter(4, 8);\n\n o1SPL.appendAll(s2SPL);\n\n assertEquals(\n \"Expected string representation of parameter list does not match product.\",\n \"<[1 ,2 ,3 ,4 ,5 ,6 ,7 ,8]>\", o1SPL.toString());\n }", "@NonNull\n @SafeVarargs\n static <V> ConsList<V> concat(@NonNull ConsList<V> first, @NonNull ConsList<V>... rest) {\n Objects.requireNonNull(first, \"Null concat argument at position 0\");\n Objects.requireNonNull(rest, ConsUtil.MSG_ARG_ARRAY_REST_IS_NULL);\n if (rest.length == 0) {\n return first;\n }\n ConsList<V> result = rest[rest.length - 1];\n if (result == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + rest.length);\n }\n for (int i = rest.length - 2; i >= -1; i--) {\n ConsList<V> cons;\n if (i == -1) {\n cons = first;\n } else {\n if (rest[i] == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + (i + 1));\n }\n cons = rest[i].reverse();\n }\n while (cons != Nil.INSTANCE) {\n result = new ConsListImpl<>(cons.head(), result);\n cons = cons.tail();\n }\n }\n return result;\n }", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n ListNode newList;\n\n if(l1.val < l2.val) {\n newList = l1;\n\n l1 = l1.next;\n } else {\n newList = l2;\n l2 = l2.next;\n }\n\n ListNode head = newList;\n\n while (l1 != null && l2 != null) {\n if(l1.val < l2.val) {\n newList.next = l1;\n newList = newList.next;\n l1 = l1.next;\n } else {\n newList.next = l2;\n newList = newList.next;\n l2 = l2.next;\n }\n }\n\n if(l1 == null){\n newList.next = l2;\n } else {\n newList.next = l1;\n }\n\n return head;\n }", "public static String myConcatenator(String str1, String str2)\r\n {\r\n str1 += str2;\r\n return str1;\r\n }", "public ListNode mergeTwoListsWithExtraLinkedList(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy,temp;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n temp=new ListNode(l1.val);\n l1=l1.next;\n }\n else{\n temp=new ListNode(l2.val);\n l2=l2.next;\n }\n curr.next=temp;\n curr=curr.next;\n }\n while(l1!=null){\n curr.next=new ListNode(l1.val);\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=new ListNode(l2.val);\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "public ListNode mergeTwoListsIterative(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n else{\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n }\n while(l1!=null){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "public String concatenate() {\n\t\t// loop over each node in the list and \n\t\t// concatenate into a single string\n\t\tString concatenate = \"\";\n\t\tNode nodref = head;\n\t\twhile (nodref != null){\n\t\t\tString temp = nodref.data;\n\t\t\tconcatenate += temp;\n\t\t\tnodref = nodref.next;\n\t\t}\n\t\treturn concatenate;\n\t}", "public LinkedString concat(LinkedString str)\n {\n int num = this.length();\n for(int i = 0; i < str.length(); i++)\n {\n this.insert(num + i, str.charAt(i));\n }\n \n return this;\n }", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummy = new ListNode(-1), cur = dummy;\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n cur.next = l1;\n l1 = l1.next;\n } else {\n cur.next = l2;\n l2 = l2.next;\n }\n cur = cur.next;\n }\n cur.next = (l1 != null) ? l1 : l2;\n return dummy.next;\n }", "public ListNode mergeTwoListsRecursion(ListNode l1, ListNode l2) {\n if(l1==null)return l2;\n if(l2==null)return l1;\n if(l1.val<l2.val){\n l1.next=mergeTwoListsRecursion(l1.next,l2);\n return l1;\n }\n else{\n l2.next=mergeTwoLists(l1,l2.next);\n return l2;\n }\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode head = new ListNode(0);\n ListNode l3 = head;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n l3.next = l1;\n l1 = l1.next;\n } else {\n l3.next = l2;\n l2 = l2.next;\n }\n l3 = l3.next;\n }\n\n while (l1 != null) {\n l3.next = l1;\n l1 = l1.next;\n l3 = l3.next;\n }\n\n while (l2 != null) {\n l3.next = l2;\n l2 = l2.next;\n l3 = l3.next;\n }\n return head.next;\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n }", "public static ListNode merge2(ListNode l1,ListNode l2){\n if(l1==null) return l2;\n if(l2==null) return l1;\n if(l1.getVal()<l2.getVal()){\n l1.next=merge2(l1.next,l2);\n return l1;\n }else{\n l2.next=merge2(l1,l2.next);\n return l2;\n }\n }", "public void concat2Strings(String s1, String s2)\r\n {\r\n // s1.concat(s2);\r\n ///sau\r\n s1=s1+s2;\r\n System.out.println(\"Stringurile concatenate sunt \"+s1);\r\n }", "public static ListNode merge(ListNode l1, ListNode l2) {\n if (l1 == null) return l2;\n if (l2 == null) return l1;\n if (l1.val < l2.val) {\n l1.next = merge(l1.next, l2);\n return l1;\n } else {\n l2.next = merge(l1, l2.next);\n return l2;\n }\n }", "@Override\n\tpublic void concatenate(SetLinkedList<T> otherSet) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented yet!\");\n\t}", "public static StringList createFrom(String list1[], String list2[], String list3[]) {\n StringList list = new StringList(list1);\n list.merge(list2);\n list.merge(list3);\n return list;\n }", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\t \n\t\t ListNode result = null;\n\t\t \n\t\t ListNode temp = null;\n\t\t \n\t\t int sum = 0;\n\t\t \n\t\t int carryOver = 0;\n\t\t \n\t\t while(l1 != null || l2 != null)\n\t\t {\n\t\t\t int l1Num = 0;\n\t\t\t int l2Num = 0;\n\t\t\t \n\t\t\t if(l1 != null)\n\t\t\t {\n\t\t\t\t l1Num = l1.val;\n\t\t\t\t l1 = l1.next;\n\t\t\t }\n\t\t\t \n\t\t\t if(l2 != null)\n\t\t\t {\n\t\t\t\t l2Num = l2.val;\n\t\t\t\t l2 = l2.next;\n\t\t\t }\n\t\t\t \n\t\t\t sum = carryOver + l1Num + l2Num;\n\t\t\t \n\t\t\t carryOver = sum / 10;\n\t\t\t \n\t\t\t ListNode node = new ListNode(sum % 10);\n\t\t\t \n\t\t\t if(result == null)\n\t\t\t {\n\t\t\t\t result = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t temp.next = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t if(carryOver > 0)\n\t\t {\n\t\t\t ListNode carryNode = new ListNode(carryOver);\n\t\t\t temp.next = carryNode;\n\t\t }\n\t\t // Find out the sum , have a carry over in case \n\t\t \n\t\t // create output links \n\t\t return result;\n\t }", "public static LinkedList.LL merge(LinkedList.LL ll1, LinkedList.LL ll2) {\n LinkedList.Node n1 = ll1.head;\n LinkedList.Node n2 = ll2.head;\n LinkedList.Node prev = null;\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n ll2.print();\n while (n1.next != null || n2 != null) {\n if (n1.data <= n2.data && n1.next != null) {\n prev = n1;\n n1 = n1.next;\n } else if (n1.data > n2.data) {\n if (prev != null) {\n prev.next = n2;\n } else {\n ll1.head = n2;\n }\n LinkedList.Node next = n2.next;\n n2.next = n1;\n prev = n2;\n n2 = next;\n } else if (n1.next == null) {\n n1.next = n2;\n break;\n }\n }\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n System.out.println(\"-------------------------------------------------\"); \n return ll1;\n }", "IList<T> append(IList<T> l);", "public double addLength(Length l1, Length l2) {\n return Double.sum(l1.value*l1.unit.baseUnitConversion, l2.value*l2.unit.baseUnitConversion);\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n\n ListNode head = null;\n ListNode current = null;\n while(l1 != null && l2 != null) {\n\n if(l1.val < l2.val) {\n if(head == null) {\n head = current = l1;\n } else {\n current.next = l1;\n current = current.next;\n }\n l1 = l1.next;\n } else {\n if(head == null) {\n head = current = l2;\n } else {\n current.next = l2;\n current = current.next;\n }\n l2 = l2.next;\n }\n }\n\n if(l1 == null) {\n current.next = l2;\n }\n\n if(l2 == null) {\n current.next = l1;\n }\n\n return head;\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\r\n if (l1==null) {\r\n\t\t\treturn l2;\r\n\t\t}\r\n if (l2==null) {\r\n\t\t\treturn l1;\r\n\t\t}\r\n ListNode result=new ListNode(0);\r\n ListNode head=result;\r\n while(l1!=null&&l2!=null){\r\n \tif (l1.val<=l2.val) {\r\n\t\t\t\thead.next=l1;\r\n\t\t\t\tl1=l1.next;\r\n\t\t\t}else {\r\n\t\t\t\thead.next=l2;\r\n\t\t\t\tl2=l2.next;\r\n\t\t\t}\r\n \thead=head.next;\r\n }\r\n if (l1!=null) {\r\n\t\t\thead.next=l1;\r\n\t\t}\r\n if (l2!=null) {\r\n\t\t\thead.next=l2;\r\n\t\t}\r\n \r\n return result.next;\r\n }", "public List<String> merge(List<String> list1, List<String> list2){\n List<String> res = new ArrayList<>();\n for (String l1 : list1){\n for (String l2 : list2){\n res.add(l1+l2);\n }\n }\n return res;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n if (l1 == null) return l2;\n if (l2 == null) return l1;\n\n // create results head pointer with dummy node\n final ListNode results = new ListNode(0);\n // create and point results pointer to the head\n ListNode resultsPointer = results;\n\n // value to keep reminder from previous sum operation\n int carry = 0;\n\n // iterate numbers until we process both completely\n while (l1 != null || l2 != null) {\n // one of the numbers can be longer, that's why adding zeros to shorter number\n final int digit1 = l1 != null ? l1.val : 0;\n final int digit2 = l2 != null ? l2.val : 0;\n // just simple math https://en.wikipedia.org/wiki/Carry_(arithmetic)\n final int sum = digit1 + digit2 + carry;\n final int result = sum % 10;\n carry = sum / 10;\n\n // save result in results list\n resultsPointer.next = new ListNode(result);\n resultsPointer = resultsPointer.next;\n\n // move numbers to the next digits, if number has more digits\n if (l1 != null) l1 = l1.next;\n if (l2 != null) l2 = l2.next;\n }\n\n // if there is carry left, just add it to result\n if (carry > 0) {\n resultsPointer.next = new ListNode(carry);\n }\n\n // remove first dummy node\n return results.next;\n }", "public static ListNode mergeTwoLists2(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n\t\t//The base condition if one of the list is empty so then return the other list as it is.\n\t\tif (l1 == null) return l2;\n\t\tif (l2 == null) return l1;\n\t\t//Intializing the head of the ans\n\t\tListNode ans = l1;\n\t\tif (l2.val < l1.val) {\n\t\t\tans = l2;\n\t\t\tl2 = l2.next;\n\t\t} else l1 = l1.next;\n\t\t//Initializing ans in another variable so that it should'nt get lost.\n\t\tListNode ans2 = ans;\n\t\twhile (l1 != null && l2 != null) {\n\t\t\tif (l1.val <= l2.val) {\n\t\t\t\tans.next = l1;\n\t\t\t\tl1 = l1.next;\n\t\t\t\tans = ans.next;\n\t\t\t} else {\n\t\t\t\tans.next = l2;\n\t\t\t\tl2 = l2.next;\n\t\t\t\tans = ans.next;\n\t\t\t}\n\t\t}\n\t\t//if list are not same then one list will be left to traverse\n\t\tif (l1 == null && l2 != null) ans.next = l2;\n\t\tif (l2 == null && l1 != null) ans.next = l1;\n\t\treturn ans2;\n\t}", "@Nonnull\r\n\tpublic static <T> Observable<T> concat(\r\n\t\t\t@Nonnull Observable<? extends T> first,\r\n\t\t\t@Nonnull Observable<? extends T> second) {\r\n\t\tList<Observable<? extends T>> list = new ArrayList<Observable<? extends T>>();\r\n\t\tlist.add(first);\r\n\t\tlist.add(second);\r\n\t\treturn concat(list);\r\n\t}", "public IList<T> append(IList<T> l) {\n return l;\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if (l1 == null || l2 == null)\n return l1 != null ? l1 : l2;\n\n ListNode dummy = new ListNode(-1);\n ListNode prev = dummy, c1 = l1, c2 = l2;\n\n while (c1 != null && c2 != null) {\n if (c1.val <= c2.val) {\n prev.next = c1;\n c1 = c1.next;\n } else {\n prev.next = c2;\n c2 = c2.next;\n }\n prev = prev.next;\n }\n\n prev.next = c1 != null ? c1 : c2;\n ListNode head = dummy.next;\n dummy.next = null; // delete dummy;\n return head;\n }", "public LLNode solveAddLinkedList(LLNode l0, LLNode l1) {\n\t\tint carry = 0;\n\t\tLLNode head = null;\n\t\tLLNode node = null;\n\n\t\tint sum = l0.val + l1.val + carry;\n\t\tcarry = sum / 10;\n\t\tsum = sum % 10;\n\t\thead = new LLNode();\n\t\thead.val = sum;\n\t\tnode = head;\n\n\t\tl0 = l0.next;\n\t\tl1 = l1.next;\n\n\t\twhile (l0 != null || l1 != null) {\n\t\t\tsum = (l0 != null ? l0.val : 0) + (l1 != null ? l1.val : 0) + carry;\n\t\t\tcarry = sum / 10;\n\t\t\tsum = sum % 10;\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = sum;\n\n\t\t\tif (l0 != null)\n\t\t\t\tl0 = l0.next;\n\t\t\tif (l1 != null)\n\t\t\t\tl1 = l1.next;\n\t\t}\n\n\t\tif (carry > 0) {\n\t\t\thead.next = new LLNode();\n\t\t\thead = head.next;\n\t\t\thead.val = carry;\n\t\t}\n\n\t\treturn node;\n\t}", "public ArrayList<Object> naturalJoin(ArrayList<Movie> list1, ArrayList<Person> list2)\r\n {\n return new ArrayList<Object>();\r\n }", "public ArrayList<Object> fullUnion(ArrayList<Object> list1 , ArrayList<Object> list2){\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n retList.addAll(list1);\r\n retList.addAll(list2);\r\n return retList;\r\n }", "public void appendInPlace (List l) {\n\t\tif (this.isEmpty()) {\n\t\t\tmyHead = l.myHead;\n\t\t\tmySize = l.mySize;\n\t\t\tmyTail = l.myTail;\n\t\t}\n\t\telse if (l.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tmyTail.myNext = l.myHead;\n\t\t\tmyTail = l.myTail;\n\t\t\tmySize += l.mySize;\n\t\t}\n\t}", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n \tif(l1==null && l2==null)\n\t\treturn null;\n\tif(l1==null)\n\t\treturn l2;\n\tif(l2==null)\n\t\treturn l1;\n\t\n\tint sum =0;\n\tint carry = 0;\n\tListNode resList = new ListNode(0);\n ListNode dummy = resList;\n\twhile(l1!=null && l2!=null){\n\t\tsum = l1.val + l2.val + carry;\n\t\tcarry = sum/10;\n\t\tListNode newNode = new ListNode(sum%10);\n\t\tresList.next = newNode;\n\t\tresList = resList.next;\n\t\tl1=l1.next;\n\t\tl2=l2.next;\n\t}\n\twhile(l1!=null){\n\t\tsum = l1.val + carry;\n\t\tcarry = sum/10;\n\t\tListNode newNode = new ListNode(sum%10);\n\t\tresList.next = newNode;\n\t\tresList = resList.next;\n\t\tl1=l1.next;\n\t}\n\twhile(l2!=null){\n\t\tsum = l2.val + carry;\n\t\tcarry = sum/10;\n\t\tListNode newNode = new ListNode(sum%10);\n\t\tresList.next = newNode;\n\t\tresList = resList.next;\n\t\tl2=l2.next;\n\t}\n\tif(carry!=0){\n\t\tListNode newNode = new ListNode(carry);\n\t\tresList.next = newNode;\n\t}\n return dummy.next;\n }", "public void joinTwoArrayList(ArrayList<E> array1 , ArrayList<E> array2){\n\t\tint length2 = array2.size();\n\t\tfor(int i=0 ; i<length2 ; i++){\n\t\t\tarray1.add(array2.getElement(i));\n\t\t}\n\t}", "public StringConcat(Block block, StringResult arg1, StringResult arg2) {\n\t\tsuper(block, arg1, arg2);\n\t}", "public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n return addTwoNumbersHelper(l1, l2, 0);\n }", "public static LinkedList sumTwoLinkedLists(LinkedList LL1, LinkedList LL2) {\n\n int multiplier = 1;\n int total = 0;\n\n LinkedList.Node currNodeLL1 = LL1.head;\n\n while (currNodeLL1 != null) {\n int subtotal = multiplier * currNodeLL1.data;\n total += subtotal;\n multiplier *= 10;\n currNodeLL1 = currNodeLL1.next;\n }\n\n LinkedList.Node currNodeLL2 = LL2.head;\n\n multiplier = 1;\n\n while (currNodeLL2 != null) {\n int subtotal = multiplier * currNodeLL2.data;\n total += subtotal;\n multiplier *= 10;\n currNodeLL2 = currNodeLL2.next;\n }\n\n String totalString = Integer.toString(total);\n\n System.out.println(totalString);\n\n int lenTotal = totalString.length();\n\n// Initiate the new linked list, with the data of the head node being the last digit in the total\n// that we've calculated.\n\n LinkedList LLsum = new LinkedList(getIntAt(total, lenTotal - 1));\n\n// Add the other nodes in turn, going backwards through the digits of the total.\n\n for (int i = lenTotal - 2; i >= 0; i--) {\n LLsum.appendToTail(getIntAt(total, i));\n }\n\n return LLsum;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2){\r\n\t\tint sum=0,carry=0;\r\n\t\tListNode prebefore=new ListNode(0),run=prebefore;\r\n\t\twhile(!(l1==null && l2 ==null && carry==0)){\r\n\t\t\tsum=(l1==null?0:l1.val)+(l2==null?0:l2.val)+carry;\r\n\t\t\tcarry=sum/10;\r\n\t\t\trun.next=new ListNode(sum%10);\r\n\t\t\trun=run.next;\r\n\t\t\tl1=(l1==null?null:l1.next);\r\n\t\t\tl2=(l2==null?null:l2.next);\r\n\t\t\t\r\n\t\t}\r\n\t\tListNode res=prebefore.next;//and it is better to delete the prebefore node\r\n\t\tprebefore=null;\r\n\t\treturn res;\r\n\t}", "public static SinglyLinkedList<Poly> addition(SinglyLinkedList.Entry<Poly> list1,\n\t\t\tSinglyLinkedList.Entry<Poly> list2) {\n\n\t\tSinglyLinkedList<Poly> ans = new SinglyLinkedList();\n\t\twhile (list1 != null && list2 != null) {\n\t\t\tPoly p = new Poly(0, 0);\n\t\t\tPoly p1 = list1.element;\n\t\t\tPoly p2 = list2.element;\n\t\t\tif (p1.pow == p2.pow) {\n\t\t\t\tp.pow = p1.pow;\n\t\t\t\tp.num = p1.num + p2.num;\n\t\t\t\tlist1 = list1.next;\n\t\t\t\tlist2 = list2.next;\n\t\t\t} else if (p1.pow > p2.pow) {\n\t\t\t\tp.pow = p1.pow;\n\t\t\t\tp.num = p1.num;\n\t\t\t\tlist1 = list1.next;\n\t\t\t} else {\n\t\t\t\tp.pow = p2.pow;\n\t\t\t\tp.num = p2.num;\n\t\t\t\tlist2 = list2.next;\n\t\t\t}\n\t\t\tif (p.num != 0)\n\t\t\t\tans.add(p);\n\t\t}\n\t\twhile (list1 != null) {\n\t\t\tans.add(list1.element);\n\t\t\tlist1 = list1.next;\n\t\t}\n\t\twhile (list2 != null) {\n\t\t\tans.add(list2.element);\n\t\t\tlist2 = list2.next;\n\t\t}\n\t\treturn ans;\n\t}", "public static <T> node_t<T> \n overlapping_no_cycle_lists(node_t<T> L1, node_t<T> L2) {\n int L1_len = count_len(L1);\n int L2_len = count_len(L2);\n\n Ref<node_t<T>> RL1 = new Ref<node_t<T>>(L1);\n Ref<node_t<T>> RL2 = new Ref<node_t<T>>(L2);\n\n // Advance the longer list.\n advance_list_by_k(L1_len > L2_len ? RL1 : RL2, Math.abs(L1_len - L2_len));\n\n while (RL1.value != null && RL2.value != null && RL1.value != RL2.value) {\n RL1.value = RL1.value.next;\n RL2.value = RL2.value.next;\n }\n return RL1.value; // nullptr means no overlap between L1 and L2.\n }", "public static MyLinkedList add(MyLinkedList list1, MyLinkedList list2){\n //first reverse both the list, so that unit place can come to head\n list1.reverse();\n list2.reverse();\n MyLinkedList resposne = new MyLinkedList();\n int carry = 0;\n Node cursor1 = list1.head;\n Node cursor2 = list2.head;\n while(cursor1 != null || cursor2 != null) {\n\n int sum = carry ;\n if(cursor1!=null){\n sum += cursor1.data;\n cursor1 = cursor1.next;\n }\n\n if(cursor2!=null) {\n sum += cursor2.data;\n cursor2 = cursor2.next;\n }\n\n carry = sum / 10;\n resposne.insert(sum % 10);\n\n }\n //very important to remember\n if(carry!=0){\n resposne.insert(carry);\n }\n\n resposne.reverse();\n return resposne;\n }", "public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummyHead = new ListNode(0);\n ListNode endOfSortedList = dummyHead;\n\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n endOfSortedList.next = l1;\n l1 = l1.next;\n } else {\n endOfSortedList.next = l2;\n l2 = l2.next;\n }\n\n endOfSortedList = endOfSortedList.next;\n }\n\n if (l1 != null) {\n endOfSortedList.next = l1;\n }\n\n if (l2 != null) {\n endOfSortedList.next = l2;\n }\n\n return dummyHead.next;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n ListNode iter1=l1,iter2=l2,newHead=new ListNode(0),newTail;\n newTail=newHead;\n int res=0;\n int addition=0;\n while(l1!=null || l2!=null){\n int temp;\n if(l1==null){\n temp=l2.val+addition;\n l2=l2.next;\n }\n else if(l2==null){\n temp=l1.val+addition;\n l1=l1.next;\n }\n else{\n temp=l1.val+l2.val+addition;\n l1=l1.next;\n l2=l2.next;\n }\n addition=temp/10;\n temp=temp%10;\n newTail.next=new ListNode(temp);\n newTail=newTail.next;\n }\n if(addition!=0){\n newTail.next=new ListNode(addition);\n }\n return newHead.next;\n \n }", "public static Seq plus(Jumble j1, Jumble j2){\n int new_size = (j1.count < j2.count) ? j1.count : j2.count;\n int new_arr[] = new int[new_size];\n for(int i = 0; i < new_size; i++) {\n new_arr[i] = j1.values[i] + j2.values[i]; //add each corresponding element\n }\n return new Jumble(new_arr); // the Jumble constructor does copy \n }", "public Language concatenate(final Language language) {\n if (this.isEmpty() || language.isEmpty())\n return new Language();\n final Language concatenatedLanguage = new Language();\n for (final String s1 : strings) {\n for (final String s2 : language.strings) {\n concatenatedLanguage.addString(s1+s2);\n }\n }\n return concatenatedLanguage;\n }", "public ILoLoString append(ILoString that) {\n if (that.length() < 1) {\n return this;\n }\n else {\n return new ConsLoLoString(this.first, this.rest.append(that)); \n }\n }", "ArrayList<Edge> merge(ArrayList<Edge> l1, ArrayList<Edge> l2) {\n ArrayList<Edge> l3 = new ArrayList<Edge>();\n IComparator<Edge> c = new CompareEdges();\n while (l1.size() > 0 && l2.size() > 0) {\n if (c.apply(l1.get(0), l2.get(0))) {\n l3.add(l1.get(0));\n l1.remove(0);\n }\n else {\n l3.add(l2.get(0));\n l2.remove(0);\n }\n }\n while (l1.size() > 0) {\n l3.add(l1.get(0));\n l1.remove(0);\n }\n while (l2.size() > 0) {\n l3.add(l2.get(0));\n l2.remove(0);\n }\n return l3;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n \tint sum = 0;\n \tListNode l3 = new ListNode(0);\n \tListNode l = l3;\n \twhile (l1 != null || l2 != null || sum != 0) {\n \t\tif (l1 != null && l2 != null) {\n \t\t\tsum = l1.val + l2.val + sum;\n \t\t\tl1 = l1.next;\n \t\t\tl2 = l2.next;\n \t\t} else if (l2 != null) {\n \t\t\tsum = l2.val + sum;\n \t\t\tl2 = l2.next;\n \t\t} else if (l1 != null) {\n \t\t\tsum = l1.val + sum;\n \t\t\tl1 = l1.next;\n \t\t}\n \t\tint val;\n \t\tif (sum > 9) {\n \t\t\tval = sum % 10;\n \t\t\tsum = sum/10;\n \t\t} else {\n \t\t\tval = sum;\n \t\t\tsum = 0;\n \t\t}\n \t\tl3.next = new ListNode (val);\n \t\tl3 = l3.next;\n \t}\n return l.next;\n }", "public static SinglyLinkedList merge(SinglyLinkedList list1, SinglyLinkedList list2)\n\t{\n\t\tSinglyLinkedList list3 = new SinglyLinkedList();\n\t\tint i = 0;\n\t\tint j = 0;\n\t\twhile((i < list1.size()) && (j < list2.size()))\n\t\t{\n\t\t\tif(list1.getElementAt(i) < list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(i));\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) > list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) == list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tif(i == list1.size())\n\t\t{\n\t\t\tfor(int k = j; k < list2.size(); k++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(k));\n\t\t\t}\n\t\t}\n\t\telse if(j == list2.size())\n\t\t{\n\t\t\tfor(int l = i; l < list1.size(); l++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(l));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn list3;\n\t}", "public static <T extends Comparable<? super T>> \n void union(SLL<T> list1, SLL<T> list2,\n SLL<T> result) {\n \n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n \n T itemlist1=null, itemlist2=null;\n \n // get first item in each list\n if ( iterlist1 != null )\n itemlist1 = iterlist1.info;\n if( iterlist2 != null )\n itemlist2 = iterlist2.info;\n \n while ( itemlist1 != null || itemlist2 != null ) {\n\n int compareResult;\n if( itemlist1 == null ) {\n compareResult = 1;\n } else if ( itemlist2 == null ) {\n compareResult = -1;\n } else {\n compareResult = itemlist1.compareTo(itemlist2);\n }\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //appending to result list \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n result.addToTail(itemlist1); //appending to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n result.addToTail(itemlist2);\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n } \n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n Stack<Integer> stack1 = new Stack<>(), stack2 = new Stack<>();\n if(l1 == null) return l2;\n if(l2 == null) return l1;\n int carry = 0;\n ListNode tmp1 = l1, tmp2 = l2;\n while(tmp1 != null){\n \tstack1.push(tmp1.val);\n \ttmp1 = tmp1.next;\n } \n while(tmp2 != null){\n \tstack2.push(tmp2.val);\n \ttmp2 = tmp2.next;\n }\n int val1 = 0, val2 = 0, sum = 0;\n while(!stack1.isEmpty() || !stack2.isEmpty()){\n \tif(!stack1.isEmpty()){\n \t\tval1 = stack1.pop();\n \t}else{\n \t\tval1 = 0;\n \t}\n \tif(!stack2.isEmpty()){\n \t\tval2 = stack2.pop();\n \t}else{\n \t\tval2 = 0;\n \t}\n \tsum = val1 + val2 + carry;\n \tcarry = sum / 10;\n \ttmp1 = new ListNode(sum % 10);\n \ttmp1.next = tmp2;\n \ttmp2 = tmp1;\n }\n if(carry != 0){\n tmp1 = new ListNode(carry);\n tmp1.next = tmp2;\n tmp2 = tmp1;\n }\n return tmp1;\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\tListNode dummyHead = new ListNode(0);\n\t\tListNode p = l1, q = l2, curr = dummyHead;\n\t\tint carry = 0;\n\t\twhile (p != null || q != null) {\n\t\t\tint x = (p != null) ? p.val : 0;\n\t\t\tint y = (q != null) ? q.val : 0;\n\t\t\tint sum = carry + x + y;\n\t\t\tcarry = sum / 10;\n\t\t\tcurr.next = new ListNode(sum % 10);\n\t\t\tcurr = curr.next;\n\t\t\tif (p != null)\n\t\t\t\tp = p.next;\n\t\t\tif (q != null)\n\t\t\t\tq = q.next;\n\t\t}\n\t\tif (carry > 0) {\n\t\t\tcurr.next = new ListNode(carry);\n\t\t}\n\t\treturn dummyHead.next;\n\t}", "public String concate(String x, String y)\n\t{\n\t\treturn x.concat(y);\n\t}", "@Test\n public void testAppends(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n DoubleLinkedList<Integer> list2 = new DoubleLinkedList<Integer>();\n DoubleLinkedList<Integer> list3 = new DoubleLinkedList<Integer>();\n //builing of lists\n list1.addToFront(1);\n list1.addToFront(2);\n list1.addToFront(3);\n list2.addToFront(4);\n list2.addToFront(5);\n list2.addToFront(6);\n list3.addToFront(4);\n list3.addToFront(5);\n list3.addToFront(6);\n list3.addToFront(1);\n list3.addToFront(2);\n list3.addToFront(3);\n list1.append(list2);\n assertTrue(\"testing append with two lists\", list1.equals(list3));\n }", "public Join(Operator operator1, Operator operator2, TupleTransformation tupleTrans) {\n o1 = operator1;\n o2 = operator2;\n this.tupleTrans = tupleTrans;\n tuple1 = o1.next();\n }", "private Combined() {}", "public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {\r\n\t\tif (l1==null) {\r\n\t\t\treturn l2;\r\n\t\t}\r\n\t\tif (l2==null) {\r\n\t\t\treturn l1;\r\n\t\t}\r\n ListNode pre=new ListNode(0);\r\n ListNode head=pre;\r\n int temp=0;\r\n //temp不等于0就是为了处理进位\r\n while(l1!=null||l2!=null||temp!=0){\r\n \tListNode cur = new ListNode(0);\r\n \tint sum=((l1==null)?0:l1.val)+((l2==null)?0:l2.val)+temp;\r\n \tcur.val=sum%10;\r\n \ttemp=sum/10;\r\n \tpre.next=cur;\r\n \tpre=cur;\r\n \tl1=(l1==null)?l1:l1.next;\r\n \tl2=(l2==null)?l2:l2.next;\r\n }\r\n return head.next;\r\n }", "public static void prefixMerge(Client [] list1, Client [] list2, Client[] result){\n int resultCount = 0;\n for (int i = 0; resultCount < result.length; i++) //goes through list1 up until the end of result\n {\n for (int j = 0; j < list2.length && resultCount < result.length; j++) //goes through list2 up until the end of list2\n {\n for (int k = 0; k < resultCount; k++) { //check if current element of list2 is already in result\n if (list2[j].compareClient(result[k]) == 0) { j++; } //without this there is an issue where the previous element of list1 is\n } //repeated in list2 but the current element of list1 is larger\n\n if (list2[j].compareClient(list1[i]) < 0) { //copies current element of list2 to result if it is smaller\n result[resultCount] = list2[j]; //than current element of list1\n resultCount++;\n }\n }\n if (resultCount < result.length) { //copies current element of list1 to result if there is room in result\n result[resultCount] = list1[i]; // needed if statement because of outOfBounds exception where all elements\n resultCount++; //in result were already filled by list2\n }\n }\n\n }", "public RegexNode ReduceConcatenation()\n\t{\n\t\t// Eliminate empties and concat adjacent strings/chars\n\n\t\tboolean wasLastString;\n\t\tRegexOptions optionsLast;\n\t\tRegexOptions optionsAt;\n\t\tint i;\n\t\tint j;\n\n\t\tif (_children == null)\n\t\t{\n\t\t\treturn new RegexNode(RegexNode.Empty, _options);\n\t\t}\n\n\t\twasLastString = false;\n\t\toptionsLast = RegexOptions.forValue(0);\n\n\t\tfor (i = 0, j = 0; i < _children.size(); i++, j++)\n\t\t{\n\t\t\tRegexNode at;\n\t\t\tRegexNode prev;\n\n\t\t\tat = _children.get(i);\n\n\t\t\tif (j < i)\n\t\t\t{\n\t\t\t\t_children.set(j, at);\n\t\t\t}\n\n\t\t\tif (at._type == RegexNode.Concatenate && ((at._options.getValue() & RegexOptions.RightToLeft.getValue()) == (_options.getValue() & RegexOptions.RightToLeft.getValue())))\n\t\t\t{\n\t\t\t\tfor (int k = 0; k < at._children.size(); k++)\n\t\t\t\t{\n\t\t\t\t\tat._children.get(k)._next = this;\n\t\t\t\t}\n\n\t\t\t\t//_children.InsertRange(i + 1, at._children);\n\t\t\t\t_children.addAll(i + 1 , at._children);\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse if (at._type == RegexNode.Multi || at._type == RegexNode.One)\n\t\t\t{\n\t\t\t\t// Cannot merge strings if L or I options differ\n\t\t\t\toptionsAt = RegexOptions.forValue(at._options.getValue() & (RegexOptions.RightToLeft.getValue() | RegexOptions.IgnoreCase.getValue()));\n\n\t\t\t\tif (!wasLastString || optionsLast != optionsAt)\n\t\t\t\t{\n\t\t\t\t\twasLastString = true;\n\t\t\t\t\toptionsLast = optionsAt;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tprev = _children.get(--j);\n\n\t\t\t\tif (prev._type == RegexNode.One)\n\t\t\t\t{\n\t\t\t\t\tprev._type = RegexNode.Multi;\n\t\t\t\t\tprev._str = String.valueOf(prev._ch);\n\t\t\t\t}\n\n\t\t\t\tif ((optionsAt.getValue() & RegexOptions.RightToLeft.getValue()) == 0)\n\t\t\t\t{\n\t\t\t\t\tif (at._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str += (new Character(at._ch)).toString();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str += at._str;\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\tif (at._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str = (new Character(at._ch)).toString() + prev._str;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str = at._str + prev._str;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if (at._type == RegexNode.Empty)\n\t\t\t{\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twasLastString = false;\n\t\t\t}\n\t\t}\n\n\t\tif (j < i)\n\t\t{\n\t\t\t//_children.removeRange(j, i - j + j);\n\t\t\tArrayExt.removeRange(_children, j, i - j + j);\n\t\t}\n\n\t\treturn StripEnation(RegexNode.Empty);\n\t}", "public static <R> Tuple<R> concat(Tuple<R> a, Tuple<R> b) {\n\t\tLinkedList<R> list = new LinkedList<>();\n\t\tfor (R element : a) {\n\t\t\tlist.add(element);\n\t\t}\n\n\t\tfor (R element : b) {\n\t\t\tlist.add(element);\n\t\t}\n\n\t\treturn new Tuple<>(list);\n\t}", "protected Pair<JilExpr,List<JilStmt>> doStringConcat(Expr.BinOp bop){\n \t\tString builderLab = \"$builder\" + stringbuilder_label++;\r\n \t\tPair<JilExpr,List<JilStmt>> lhs = doExpression(bop.lhs());\r\n \t\tPair<JilExpr,List<JilStmt>> rhs = doExpression(bop.rhs());\r\n \t\t\r\n \t\tList<JilStmt> stmts = lhs.second();\r\n \t\tstmts.addAll(lhs.second());\r\n \t\tstmts.addAll(rhs.second());\r\n \t\t\r\n \t\tType.Clazz builder = new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\"StringBuilder\");\r\n \t\t\t\t\t\t\r\n \t\tstmts.add(new JilStmt.Assign(new JilExpr.Variable(builderLab, builder),\r\n \t\t\t\tnew JilExpr.New(builder, new ArrayList<JilExpr>(),\r\n \t\t\t\t\t\tnew Type.Function(T_VOID), bop.attributes())));\t\t\t\t\t\r\n \t\t\r\n \t\tType lhs_t = lhs.first().type(); \r\n \t\tif(lhs_t instanceof Type.Primitive || isString(lhs_t)) {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(lhs.first());\r\n \t\t\tstmts.add(new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder), \"append\",\r\n \t\t\t\t\tparams, new Type.Function(new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\t\"StringBuilder\"), lhs.first().type()), new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\")));\r\n \t\t} else {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(lhs.first());\r\n \t\t\tstmts.add(new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder),\r\n \t\t\t\t\t\"append\", params, new Type.Function(new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\"),\r\n \t\t\t\t\tJAVA_LANG_OBJECT), new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\t\"StringBuilder\")));\t\r\n \t\t}\r\n \r\n \t\t// Now, do the right hand side\r\n \t\tJilExpr r;\r\n \t\tType rhs_t = rhs.first().type(); \r\n \t\tif(rhs_t instanceof Type.Primitive || isString(rhs_t)) {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(rhs.first());\r\n \t\t\tr = new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder), \"append\",\r\n \t\t\t\t\tparams, new Type.Function(new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\t\"StringBuilder\"), rhs_t), new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\"));\r\n \t\t} else {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(rhs.first());\r\n \t\t\tr = new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder),\r\n \t\t\t\t\t\"append\", params, new Type.Function(new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\"), JAVA_LANG_OBJECT),\r\n \t\t\t\t\tnew Type.Clazz(\"java.lang\", \"StringBuilder\"));\r\n \t\t}\r\n \r\n \t\tr = new JilExpr.Invoke(r, \"toString\", new ArrayList<JilExpr>(),\r\n \t\t\t\tnew Type.Function(JAVA_LANG_STRING), JAVA_LANG_STRING);\r\n \t\t\r\n \t\treturn new Pair<JilExpr,List<JilStmt>>(r,stmts);\r\n \t}", "public Concat() {\r\n }", "public static <T> ImmutableList<T> listAndSurroundingElements(\n T elem1, Collection<? extends T> coll, T elem2) {\n return ImmutableList.<T>builderWithExpectedSize(coll.size() + 2)\n .add(elem1)\n .addAll(coll)\n .add(elem2)\n .build();\n }", "public XMLString concat(String str) {\n/* 673 */ return new XMLStringDefault(this.m_str.concat(str));\n/* */ }", "public static Node addTwoNumbers(Node l1, Node l2) {\n int carry = 0;\n Node dummyHead = new Node(0, null);\n Node current = dummyHead;\n\n while (l1 != null || l2 != null) {\n int x = (l1 != null) ? l1.getData() : 0;\n int y = (l2 != null) ? l2.getData() : 0;\n int sum = x + y + carry;\n carry = sum / 10;\n current.next = new Node(sum % 10, null);\n current = current.next;\n // Next index\n if (l1 != null) {\n l1 = l1.next;\n }\n if (l2 != null) {\n l2 = l2.next;\n }\n }\n if (carry > 0) {\n current.next = new Node(carry, null);\n }\n return dummyHead.next;\n }", "public Expression concat(Expression expr) {\r\n\t\telements.addAll(expr.elements);\r\n\t\treturn this;\r\n\t}", "public void merge(SortedList<T> list2){\n while(!list2.isEmpty()){\n this.internalInsert(list2.removeFromFront());\n }\n\n this.sort();\n }", "private Cell[] concatArray(Cell[] arr1, Cell[] arr2) {\r\n\t\tCell[] concat = new Cell[arr1.length + arr2.length];\r\n\t\tfor (int k = 0; k < concat.length; k++) {\r\n\t\t\tif (k < arr1.length) {\r\n\t\t\t\tconcat[k] = arr1[k];\r\n\t\t\t} else {\r\n\t\t\t\tconcat[k] = arr2[k - arr1.length];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn concat;\r\n\t}", "public ITree combine(int leftLength, int rightLength, double leftTheta, double rightTheta,\n ITree otherTree) {\n return new Branch(leftLength, rightLength, \n leftTheta, rightTheta, this.changeTheta(leftTheta), otherTree.changeTheta(rightTheta)); \n \n }", "public ITree combine(int leftLength, int rightLength, double leftTheta, double rightTheta,\n ITree otherTree) {\n return new Branch(leftLength, rightLength, leftTheta, rightTheta, \n this.changeTheta(leftTheta), this.changeTheta(rightTheta)); \n \n }", "public static Seq plus(Constant c1, Constant c2) {\n return new Constant((c1.num < c2.num)?c1.num:c2.num, (c1.value + c2.value)); \n }", "public ITree combine(int leftLength, int rightLength, double leftTheta, double rightTheta,\n ITree otherTree) {\n return new Branch(leftLength, rightLength, leftTheta, rightTheta, \n this.changeTheta(leftTheta), this.changeTheta(rightTheta)); \n }", "public static NodeValue strConcat(List<NodeValue> args) {\n // Step 1 : Choose type.\n // One lang tag -> that lang tag\n String lang = null ;\n boolean mixedLang = false ;\n boolean xsdString = false ;\n boolean simpleLiteral = false ;\n\n StringBuilder sb = new StringBuilder() ;\n\n for (NodeValue nv : args) {\n Node n = checkAndGetStringLiteral(\"CONCAT\", nv) ;\n String lang1 = n.getLiteralLanguage() ;\n if ( !lang1.equals(\"\") ) {\n if ( lang != null && !lang1.equals(lang) )\n // throw new\n // ExprEvalException(\"CONCAT: Mixed language tags: \"+args) ;\n mixedLang = true ;\n lang = lang1 ;\n } else if ( n.getLiteralDatatype() != null )\n xsdString = true ;\n else\n simpleLiteral = true ;\n\n sb.append(n.getLiteralLexicalForm()) ;\n }\n\n if ( mixedLang )\n return NodeValue.makeString(sb.toString()) ;\n\n // Must be all one lang.\n if ( lang != null ) {\n if ( !xsdString && !simpleLiteral )\n return NodeValue.makeNode(sb.toString(), lang, (String)null) ;\n else\n // Lang and one or more of xsd:string or simpleLiteral.\n return NodeValue.makeString(sb.toString()) ;\n }\n\n if ( simpleLiteral && xsdString )\n return NodeValue.makeString(sb.toString()) ;\n // All xsdString\n if ( xsdString )\n return NodeValue.makeNode(sb.toString(), XSDDatatype.XSDstring) ;\n if ( simpleLiteral )\n return NodeValue.makeString(sb.toString()) ;\n\n // No types - i.e. no arguments\n return NodeValue.makeString(sb.toString()) ;\n }", "@Override\n\tpublic void visit(Concat arg0) {\n\t\t\n\t}", "public ArrayList<Object> product(ArrayList<Object> list1, ArrayList<Object> list2)\r\n {\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n retList.addAll(list1);\r\n retList.addAll(list2);\r\n return retList;\r\n }", "ListNode addTwoNumbers2(ListNode l1, ListNode l2) {\n ListNode c1 = l1;\n ListNode c2 = l2;\n ListNode sentinel = new ListNode(0);\n ListNode d = sentinel;\n int sum = 0;\n while (c1 != null || c2 != null) {\n sum /= 10;\n if (c1 != null) {\n sum += c1.val;\n c1 = c1.next;\n }\n if (c2 != null) {\n sum += c2.val;\n c2 = c2.next;\n }\n d.next = new ListNode(sum % 10);\n d = d.next;\n }\n if (sum / 10 == 1) {\n d.next = new ListNode(1);\n }\n return sentinel.next;\n }", "@SuppressWarnings(\"unchecked\")\n public static <T> T[] concat(T[] left, T[] right) {\n T[] res;\n\n if (ArrayUtils.isEmpty(left)) {\n res = right;\n } else if (ArrayUtils.isEmpty(right)) {\n res = left;\n } else {\n res = (T[]) Array.newInstance(left[0].getClass(), left.length + right.length);\n System.arraycopy(left, 0, res, 0, left.length);\n System.arraycopy(right, 0, res, left.length, right.length);\n }\n\n return res;\n }", "@Test\r\n\tvoid testAppend2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.append(1);\r\n\t\ttest.append(2);\r\n\t\ttest.append(3);\r\n\t\ttest.append(4);\r\n\t\ttest.append(5);\r\n\t\ttest.append(6);\r\n\t\ttest.append(7);\r\n\t\ttest.append(8);\r\n\t\ttest.append(9);\r\n\t\ttest.append(10);\r\n\t\ttest.append(11);\r\n\t\tString output = test.toString();\r\n\t\tassertEquals(\"1 2 3 4 5 6 7 8 9 10 11\", output);\r\n\t}" ]
[ "0.69484395", "0.6859995", "0.64343953", "0.63054436", "0.61534774", "0.6002471", "0.59152395", "0.58914375", "0.58914375", "0.5888656", "0.58396935", "0.5703513", "0.5699124", "0.56711274", "0.5581037", "0.5572743", "0.55308497", "0.5464244", "0.5456919", "0.5446202", "0.5435006", "0.54313695", "0.54224926", "0.53650093", "0.5316013", "0.5307096", "0.52858114", "0.5271893", "0.52495223", "0.5243343", "0.52326906", "0.5220018", "0.5219632", "0.52028066", "0.5170591", "0.51703364", "0.5150051", "0.51485354", "0.5141034", "0.51302415", "0.5129933", "0.5121653", "0.5101602", "0.50967103", "0.50921136", "0.50878155", "0.5086401", "0.50668675", "0.5066573", "0.503938", "0.5036142", "0.50252855", "0.50214046", "0.5009657", "0.5006542", "0.50042707", "0.5001522", "0.5000923", "0.4991113", "0.4986621", "0.4984018", "0.49828917", "0.49795258", "0.4976192", "0.497247", "0.4968524", "0.49641", "0.49515718", "0.4940912", "0.49236223", "0.49119774", "0.4908872", "0.4908432", "0.49077284", "0.4900153", "0.48737732", "0.4850556", "0.48418453", "0.48417184", "0.4836493", "0.48359895", "0.48324016", "0.4827465", "0.48256564", "0.4814414", "0.47957757", "0.479388", "0.47829476", "0.47765672", "0.477092", "0.47656143", "0.47534543", "0.47516927", "0.47512186", "0.47471738", "0.4739192", "0.47271755", "0.46942016", "0.4693542", "0.46906015" ]
0.6505443
2
Constructive inverse. L is a list. M=INV(L). M is constructed using COMP.
public static <C> LIST<C> CINV(LIST<C> L) { if ( isNull( L ) ) { return L; } LinkedList<C> list = new LinkedList<C>(L.list); Collections.reverse( list ); return new LIST<C>( list ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> INV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n Collections.reverse( L.list );\n return L;\n }", "public Matrix inverse() {\n int n = L.getNrows();\n Matrix inv = Matrix.identity(n);\n solve(inv);\n return inv;\n }", "public Matrix inverse(){\r\n \tint n = this.nrow;\r\n \tif(n!=this.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = this.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \t\treturn invmat;\r\n \t}", "public Matrix inverseMatrix(Matrix L, Matrix U, Matrix P, int n)\n {\n\tMatrix Uinv = new Matrix(n,n);\n\tMatrix Linv = new Matrix(n,n);\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// forward substitution for L y = b.\n\t\tfor (int i = 1; i < n; i++)\n\t\t\tfor (int j = 0; j < i; j++)\n\t\t\t\ttemp.vector[i] -= L.matrix[i][j] * temp.vector[j];\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tLinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// back substitution for U x = y. \n\t\tfor (int i = n - 1; i >= 0; i--) {\n\t\t\tfor (int j = i + 1; j < n; j++) \n temp.vector[i] -= U.matrix[i][j] * temp.vector[j];\n\t\t\ttemp.vector[i] /= U.matrix[i][i];\n\t\t}\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tUinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n Matrix LinP = new Matrix();\n\tLinP = LinP.multiplication(Linv, P);\n Matrix results = new Matrix();\n results = results.multiplication(Uinv, LinP);\n\treturn results;\n\n }", "public Matrix inverse() throws JPARSECException {\n return solve(identity(m,m));\n }", "Matrix InverseT()\n {\n Matrix ad = new Matrix( y.cross(z), z.cross(x), x.cross(y) );\n float inv_det = 1.0f / ( x.dot( ad.x ) );\n ad.timesEqual( inv_det );\n return ad;\n }", "private DoubleMatrix invertCholesky(DoubleMatrix matrix) {\n int numOfRows = matrix.rows;\n double sum;\n int i, j, k;\n // ______ Compute inv(L) store in lower of A ______\n for (i = 0; i < numOfRows; ++i) {\n matrix.put(i, i, 1. / matrix.get(i, i));\n for (j = i + 1; j < numOfRows; ++j) {\n sum = 0.;\n for (k = i; k < j; ++k) {\n sum -= matrix.get(j, k) * matrix.get(k, i);\n }\n matrix.put(j, i, sum / matrix.get(j, j));\n }\n }\n // ______ Compute inv(A)=inv(LtL) store in lower of A ______\n for (i = 0; i < numOfRows; ++i) {\n for (j = i; j < numOfRows; ++j) {\n sum = 0.;\n for (k = j; k < numOfRows; ++k) {\n sum += matrix.get(k, i) * matrix.get(k, j); // transpose\n }\n matrix.put(j, i, sum);\n }\n }\n return matrix;\n }", "public void cinv_() {\n TH.THTensor_(cinv)(this, this);\n }", "public Inverse(int m, int n) \n { \n super(m, n); \n }", "public static double [][] inv(double [][] a) {\n int N = a.length;\n double [] col = new double[N];\n int [] indx = new int[N];\n double [][] y = new double[N][N];\n \n double d = ludcmp(a, indx);\n for (int j=0; j<N; j++ ) {\n for (int i=0; i<N; i++) \n col[i] = 0.0;\n col[j] = 1.0;\n lubksb(a, indx, col);\n for (int i=0; i<N; i++)\n y[i][j] = col[i];\n }\n return y; \n }", "public Matrix inverse() {\n\t\tMatrix a = copy();\n\t\tif (a.M != a.N) {\n\t\t\tthrow new RuntimeException(\"This matrix is not square!\");\n\t\t}\n\t\tMatrix i = identity(a.N);\n\t\tMatrix ai = a.augment(i);\n\t\tai = ai.specialrref();\n\t\tMatrix[] split = ai.split(a.N);\n\t\tif (split[0].equals(i)) {\n\t\t\treturn split[1];\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"This matrix is not invertible!\");\n\t\t}\n\t}", "@Override\n public void invert() {\n getInvertibles().parallelStream().forEach(Invertible::invert);\n }", "public static Matrix inverse(Matrix amat){\r\n \tint n = amat.nrow;\r\n \tif(n!=amat.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = amat.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \treturn invmat;\r\n \t}", "public T invert() {\n T ret = createLike();\n\n if (!ops.invert(mat, ret.mat))\n throw new SingularMatrixException();\n if (ops.hasUncountable(ret.mat))\n throw new SingularMatrixException(\"Solution contains uncountable numbers\");\n\n return ret;\n }", "private void makeInverse() {\n if (_map != null) {\n for (Map.Entry<Integer, Integer> e : _map.entrySet()) {\n _inverse.put(e.getValue(), e.getKey());\n }\n }\n }", "public final void invert() {\r\n\t\tRadical1 s = determinant();\r\n\t\tif (s.equals(Radical1.ZERO))\r\n\t\t\treturn;\r\n\r\n\t\tif (!s.equals(Radical1.ONE))\r\n\t\t\tthrow new ArithmeticException(\"can't invert radical expressions that have non-1 determinant (i.e. that rescale)\");\r\n\r\n\t\t// see Matrix4f.invert for an explination\r\n\r\n\t\tl1.setZero();\r\n\t\tl2.setZero();\r\n\t\tl3.setZero();\r\n\t\tl4.setZero();\r\n\t\tl5.setZero();\r\n\t\tl6.setZero();\r\n\t\tl7.setZero();\r\n\t\tl8.setZero();\r\n\t\tl9.setZero();\r\n\t\tl10.setZero();\r\n\t\tl11.setZero();\r\n\t\tl12.setZero();\r\n\t\tl13.setZero();\r\n\t\tl14.setZero();\r\n\t\tl15.setZero();\r\n\t\tl16.setZero();\r\n\r\n\t\tcalcPartInverse(5, 10, 15, 11, 14, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(6, 11, 13, 9, 15, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(7, 9, 14, 10, 13, op1, op2, op3, op4, l1);\r\n\r\n\t\tcalcPartInverse(9, 2, 15, 3, 14, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(10, 3, 13, 1, 15, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(11, 1, 14, 2, 13, op1, op2, op3, op4, l2);\r\n\r\n\t\tcalcPartInverse(13, 2, 7, 3, 6, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(14, 3, 5, 1, 7, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(15, 1, 6, 2, 5, op1, op2, op3, op4, l3);\r\n\r\n\t\tcalcPartInverse(1, 7, 10, 6, 11, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(2, 5, 11, 7, 9, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(3, 6, 9, 5, 10, op1, op2, op3, op4, l4);\r\n\r\n\t\tcalcPartInverse(6, 8, 15, 11, 12, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(7, 10, 12, 8, 14, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(4, 11, 14, 10, 15, op1, op2, op3, op4, l5);\r\n\r\n\t\tcalcPartInverse(10, 0, 15, 3, 12, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(11, 2, 12, 0, 14, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(8, 3, 14, 2, 15, op1, op2, op3, op4, l6);\r\n\r\n\t\tcalcPartInverse(14, 0, 7, 3, 4, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(15, 2, 4, 0, 6, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(12, 3, 6, 2, 7, op1, op2, op3, op4, l7);\r\n\r\n\t\tcalcPartInverse(2, 7, 8, 4, 11, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(3, 4, 10, 6, 8, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(0, 6, 11, 7, 10, op1, op2, op3, op4, l8);\r\n\r\n\t\tcalcPartInverse(7, 8, 13, 9, 12, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(4, 9, 15, 11, 13, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(5, 11, 12, 8, 15, op1, op2, op3, op4, l9);\r\n\r\n\t\tcalcPartInverse(11, 0, 13, 1, 12, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(8, 1, 15, 3, 13, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(9, 3, 12, 0, 15, op1, op2, op3, op4, l10);\r\n\r\n\t\tcalcPartInverse(15, 0, 5, 1, 4, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(12, 1, 7, 3, 5, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(13, 3, 4, 0, 7, op1, op2, op3, op4, l11);\r\n\r\n\t\tcalcPartInverse(3, 5, 8, 4, 9, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(0, 7, 9, 5, 11, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(1, 4, 11, 7, 8, op1, op2, op3, op4, l12);\r\n\r\n\t\tcalcPartInverse(4, 10, 13, 9, 14, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(5, 8, 14, 10, 12, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(6, 9, 12, 8, 13, op1, op2, op3, op4, l13);\r\n\r\n\t\tcalcPartInverse(8, 2, 13, 1, 14, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(9, 0, 14, 2, 12, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(10, 1, 12, 0, 13, op1, op2, op3, op4, l14);\r\n\r\n\t\tcalcPartInverse(12, 2, 5, 1, 6, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(13, 0, 6, 2, 4, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(14, 1, 4, 0, 5, op1, op2, op3, op4, l15);\r\n\r\n\t\tcalcPartInverse(0, 5, 10, 6, 9, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(1, 6, 8, 4, 10, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(2, 4, 9, 5, 8, op1, op2, op3, op4, l16);\r\n\r\n\t\tvalues[0].set(l1);\r\n\t\tvalues[1].set(l2);\r\n\t\tvalues[2].set(l3);\r\n\t\tvalues[3].set(l4);\r\n\t\tvalues[4].set(l5);\r\n\t\tvalues[5].set(l6);\r\n\t\tvalues[6].set(l7);\r\n\t\tvalues[7].set(l8);\r\n\t\tvalues[8].set(l9);\r\n\t\tvalues[9].set(l10);\r\n\t\tvalues[10].set(l11);\r\n\t\tvalues[11].set(l12);\r\n\t\tvalues[12].set(l13);\r\n\t\tvalues[13].set(l14);\r\n\t\tvalues[14].set(l15);\r\n\t\tvalues[15].set(l16);\r\n\r\n\t\tif (s.equals(Radical1.MINUS_ONE))\r\n\t\t\tnegate();\r\n\t}", "public final void invert() {\n\tdouble s = determinant();\n\tif (s == 0.0)\n\t return;\n\ts = 1/s;\n\t// alias-safe way.\n\tset(\n\t m11*m22 - m12*m21, m02*m21 - m01*m22, m01*m12 - m02*m11,\n\t m12*m20 - m10*m22, m00*m22 - m02*m20, m02*m10 - m00*m12,\n\t m10*m21 - m11*m20, m01*m20 - m00*m21, m00*m11 - m01*m10\n\t );\n\tmul((float)s);\n }", "public JTensor cinv() {\n JTensor r = new JTensor();\n TH.THTensor_(cinv)(r, this);\n return r;\n }", "public void invert()\n {\n assert isComplete;\n \n isInverted = !isInverted;\n }", "public static long modInverse(long a, long m) {\n a = mod(a, m);\n return a == 0 ? 0 : mod((1 - modInverse(m % a, a) * m) / a, m);\n }", "public Matriks Inverse(Matriks M){\r\n\t\tMatriks Minv = M.MatriksCofactor(M);\r\n\t\tMinv = Minv.Transpose();\r\n\t\tdouble det = M.DetCofactor(M);\r\n\t\tint sign = 1;\r\n\t\tfor(int i=0; i<BrsEff;i++){\r\n\t\t\tfor(int j=0; j<KolEff; j++){\r\n\t\t\t\tMinv.Elmt[i][j] = sign*(1/det)*Minv.Elmt[i][j];\r\n\t\t\t\tsign *= -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Minv;\r\n\t}", "public void invert() {\n \n float[] result = new float[16];\n System.arraycopy(IDENTITY, 0, result, 0, 16);\n \n for(int i = 0; i < 4; i++){\n int i4 = i*4;\n \n // make sure[i,i] is != 0\n \n for(int j = 0; matrix[i4+i] == 0 && j < 4; j++){\n if(j != i && matrix[j*4+i] != 0){\n transform(i, 1, j, matrix, result);\n }\n }\n \n // ensure tailing 0s\n \n for(int j = 0; j < i; j++){\n if(matrix[i4+j] != 0){\n transform(i, -matrix[i4+j]/matrix[j*4+j], j, matrix, result);\n }\n }\n\n if(matrix[i4+i] == 0){\n throw new IllegalArgumentException(\"Not invertable\");\n }\n\n // dump(\"row \"+i+\" leading zeros\", matrix, result);\n }\n \n for(int i = 3; i >= 0; i--){\n int i4 = i*4;\n if(matrix[i4+i] != 1){\n float f = matrix[i4+i];\n matrix[i4+i] = 1;\n for(int j = 0; j < 4; j++){\n result[i4+j] /= f;\n if(j > i){\n matrix[i4+j] /= f;\n }\n }\n }\n\n// dump(\"row \"+i+\" leading 1\", matrix, result);\n \n for(int j = i+1; j < 4; j++){\n if(matrix[i*4+j] != 0){\n transform(i, -matrix[i*4+j], j, matrix, result);\n }\n }\n\n// dump(\"row \"+i+\" tailing 0\", matrix, result);\n\n }\n\n matrix = result;\n }", "public void invert() {\n\t\tthis.vector.setXYZ(-this.vector.x(), -this.vector.y(), -this.vector.z());\n\t\tthis.energy = -this.energy;\n\t}", "public T pseudoInverse() {\n T ret = createLike();\n ops.pseudoInverse(mat, ret.mat);\n return ret;\n }", "int ainverse(int z)\n {\n return (65536-z);\n }", "public final native Mat4 inverse() /*-{\n return $wnd.mat4.inverse(this, $wnd.mat4.create());\n }-*/;", "Vec inverseFilter(DMatrixRMaj H, double V, DMatrixRMaj Cnew) {\n CommonOps_DDRM.mult(helix.C, H, tempV);\n double denom = -V + CommonOps_DDRM.dot(H, tempV);\n CommonOps_DDRM.scale(1.0/denom, helix.C, tempM);\n DMatrixRMaj Kstar = new DMatrixRMaj(5,1);\n CommonOps_DDRM.mult(tempM, H, Kstar); // Kalman gain matrix\n\n CommonOps_DDRM.scale(r, Kstar, tempV);\n Vec aNew = helix.a.sum(mToVec(tempV));\n directProd(Kstar, H, tempM);\n CommonOps_DDRM.scale(-1.0, tempM);\n CommonOps_DDRM.addEquals(tempM, U);\n CommonOps_DDRM.mult(tempM, helix.C, Cnew);\n if (debug) {\n System.out.format(\"StateVector.inverseFilter: V=%12.4e, denom=%12.4e\\n\", V, denom);\n helix.a.print(\"old helix\");\n aNew.print(\" new helix in StateVector.inverseFilter\");\n }\n return aNew;\n }", "public Index invert() {\n \t\tint n=length();\n \t\tIndex ni=new Index(n);\n \t\tfor (int i=0; i<n; i++) {\n \t\t\tni.set(this.get(i), i);\n \t\t}\n \t\treturn ni;\n \t}", "<T> void inverse(final T[] array);", "public Matrix getInversematrixS()\n {\n // Build alpha * I\n double [][] alphainvmatrix;\n alphainvmatrix = new double[x + 1][x + 1];\n for(int i = 0; i < x + 1; i++)\n {\n alphainvmatrix[i][i] = alpha;\n\n }\n Matrix alphamatrixnew = new Matrix(alphainvmatrix);\n\n // calculate summation\n Matrix sum = new Matrix(x + 1, 1);\n int i = 1;\n while (i <= arraylistofprices.size() - 1) {\n phimatrix(i);\n\n sum.plusEquals(phi);\n\n i++;\n }\n Matrix summation = sum.times(phiT);\n summation.timesEquals(beta); \n\n // alpha * I + beta * sum\n Matrix sInv = alphamatrixnew.plus(summation);\n return sInv;\n }", "static int[][] inverse(int A[][]) \n { \n int inverse[][] = new int[4][4];\n // Find determinant of A[][] \n int det = determinant(A, N)%26; \n System.out.println(det);\n if (det == 0) \n { \n System.out.print(\"Singular matrix, can't find its inverse\"); \n return null; \n } \n \n // Find adjoint \n int [][]adj = new int[N][N]; \n adjoint(A, adj); \n \n // Find Inverse using formula \"inverse(A) = adj(A)/det(A)\" \n for (int i = 0; i < N; i++) \n for (int j = 0; j < N; j++) {\n inverse[i][j] = adj[i][j]/det; \n inverse[i][j] = inverse[i][j]%26;\n System.out.print(inverse[i][j]);\n }\n return inverse; \n }", "Matrix inverse(Matrix m){\r\n Matrix mtemp = new Matrix(m.M);\r\n Matrix miden = new Matrix(m.rows,m.cols);\r\n miden = miden.identity();\r\n for(int i=0;i<mtemp.rows-1;i++){\r\n for(int j=i+1; j<mtemp.rows; j++){\r\n if(mtemp.M[i][i]<mtemp.M[j][i]){\r\n swapRow(mtemp,i,j);\r\n swapRow(miden,i,j);\r\n }\r\n }\r\n for(int k=i+1; k<mtemp.rows; k++){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=0;j<mtemp.cols;j++){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n miden.M[k][j] -= ratio*miden.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n for(int i=mtemp.rows-1;i>0;i--){\r\n for(int k=i-1; k>-1; k--){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=mtemp.cols-1;j>-1;j--){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n miden.M[k][j] -= ratio*miden.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n \r\n\r\n for(int i=0; i<mtemp.rows; i++){\r\n for(int j=0; j<mtemp.cols; j++){\r\n miden.M[i][j] /= mtemp.M[i][i];\r\n }\r\n }\r\n return miden;\r\n\r\n }", "public JamMatrix invert() {\n RealMatrix apacheUT = decomposition.getUT();\n RealMatrix apacheV = decomposition.getV();\n RealMatrix apacheDinv = getApacheDinv();\n\n return JamMatrix.wrap(apacheV.multiply(apacheDinv.multiply(apacheUT)).getData());\n }", "public Matrix opposite(){\r\n \tMatrix opp = Matrix.copy(this);\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\topp.matrix[i][j]=-this.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}", "long modInverse(long a, long m) \r\n { \r\n\t\t long m0 = m; \r\n long y = 0, x = 1; \r\n \r\n if (m == 1) \r\n return 0; \r\n \r\n while (a > 1) \r\n { \r\n // q is quotient \r\n \tlong q = a / m; \r\n \r\n \tlong t = m; \r\n \r\n // m is remainder now, process \r\n // same as Euclid's algo \r\n m = a % m; \r\n a = t; \r\n t = y; \r\n \r\n // Update x and y \r\n y = x - q * y; \r\n x = t; \r\n } \r\n \r\n // Make x positive \r\n if (x < 0) \r\n x += m0; \r\n \r\n return x; \r\n }", "public ImmutableBiMap<V, K> inverse() {\n/* 246 */ ImmutableBiMap<V, K> result = this.inverse;\n/* 247 */ return (result == null) ? (this.inverse = new Inverse()) : result;\n/* */ }", "public Matrix getInverse() throws InvalidMoveException {\r\n Matrix temp = null;\r\n double determinant = this.getDeterminant();\r\n\r\n if (determinant == 0) {\r\n throw new InvalidMoveException(\"The matrix are singular, and doesn't have any inverse.\");\r\n }\r\n\r\n // getting the cofactor matrix\r\n try {\r\n temp = this.getCofactor();\r\n\r\n } catch (IndexOutOfBoundsException e) {\r\n // actually this will never happened when we're the one who\r\n // handles the code.\r\n }\r\n // transpose it.\r\n temp.transpose();\r\n\r\n // multiply it with the determinant.\r\n temp.multiply(1 / determinant);\r\n return temp;\r\n }", "@Override\n public synchronized UnitConverter inverse() {\n if (inverse == null) {\n inverse = new ConcatenatedConverter(c2.inverse(), c1.inverse());\n inverse.inverse = this;\n }\n return inverse;\n }", "@Override\n public void Invert() {\n\t \n }", "@Override\n\tpublic void vInv() {\n\t\t\n\t}", "public final void invert(Matrix3f m1) {\n\tset(m1);\n\tinvert();\n }", "public void inverse(Projection projection);", "@Override\n\tpublic void visit(InverseExpression arg0) {\n\n\t}", "public RMTransform getTransformInverse() { return getTransform().invert(); }", "static int modInverse(int a, int m) \n\t{ \n\t\tint m0 = m; \n\t\tint y = 0, x = 1; \n\t\tif (m == 1) \n\t\t{ \n\t\t\treturn 0; \n\t\t} \n\n\t\twhile (a > 1) \n\t\t{ \n\n\t\t\t// q is quotient \n\t\t\tint q = a / m; \n\t\t\tint t = m; \n\n\t\t\t// m is remainder now, process \n\t\t\t// same as Euclid's algo \n\t\t\tm = a % m; \n\t\t\ta = t; \n\t\t\tt = y; \n\n\t\t\t// Update y and x \n\t\t\ty = x - q * y; \n\t\t\tx = t; \n\t\t} \n\n\t\t// Make x positive \n\t\tif (x < 0) \n\t\t{ \n\t\t\tx += m0; \n\t\t} \n\n\t\treturn x; \n\t}", "public static Transform rigidInverse(Transform t) {\n\t\treturn transpose(t.d, -t.c, (t.c * t.ty - t.tx * t.d), -t.b, t.a, (t.tx * t.b - t.a * t.ty));\n\t}", "public static Transform inverse(Transform t) {\n\t\tfloat inv_det = 1.0f / (t.a * t.d - t.c * t.b);\n\t\treturn transpose(t.d * inv_det, -t.c * inv_det, (t.c * t.ty - t.tx * t.d) * inv_det, -t.b * inv_det,\n\t\t\t\t\t\t t.a * inv_det, (t.tx * t.b - t.a * t.ty) * inv_det);\n\t}", "public void cpl() {\n\t\tint op = registers.getRegister(Register.A);\n\t\tint result = invert(op);\n\t\tregisters.setRegister(Register.A, result);\n\n\t\tregisters.setFlag(Flag.H, true);\n\t\tregisters.setFlag(Flag.N, true);\n\t}", "public static native void Inverse(long lpjFbxDualQuaternion);", "int invert(int c) {\n int index = wrap(c);\n if (_inverse != null && _inverse.containsKey(index)) {\n return _inverse.get(index);\n } else {\n return index;\n }\n }", "static void pregenInverse() \n\t{ \n\t\tinvfact[0] = invfact[1] = 1; \n\n\t\t// calculates the modInverse of \n\t\t// the last factorial \n\t\tinvfact[1000000] = modInverse(fact[1000000], mod); \n\n\t\t// precalculates the modInverse of \n\t\t// all factorials by formulae \n\t\tfor (int i = 999999; i > 1; --i) \n\t\t{ \n\t\t\tinvfact[i] = (int) (((long) invfact[i + 1] \n\t\t\t\t\t* (long) (i + 1)) % mod); \n\t\t} \n\t}", "public Vector3 invert()\n {\n this.scale(-1);\n return this;\n }", "public static void invert(int[] a) {\r\n\t\tint n = a.length;\r\n\t\tint j = n - 1;\r\n\t\tfor (int i = 0; i < j; i++) {\r\n\t\t\tint tmp = a[i];\r\n\t\t\ta[i] = a[j];\r\n\t\t\ta[j] = tmp;\r\n\t\t\tj--;\r\n\t\t}\r\n\t}", "public int[] llenadoInversion(int[] vector)\r\n\t{\r\n\t\tint[] vecInvertido=new int[vector.length];\r\n\t\tint vecAux;\r\n\t\t\r\n\t\tfor(int i=0;i<vector.length;i++)\r\n\t\t{\r\n\t\t\tvecInvertido[i]=vector[vector.length-i-1];\r\n\t\t}\r\n\t\treturn vecInvertido;\r\n\t}", "@Test\n public void testInversePrime() {\n final GaloisPrimeField field = new GaloisPrimeField(13);\n final GaloisElement element = field.element(9);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(3), inverse.value());\n }", "public static NodoListaS invertiLista(NodoListaS p) {\r\n\t\t// p riferimento alla lista da invertire\r\n\t\t// ris riferimento alla lista invertita\r\n\t\tNodoListaS ris = null;\r\n\t\twhile (p != null) {\r\n\t\t\t// suggerimento: considerare le operazioni\r\n\t\t\t// nel ciclo come se operassero\r\n\t\t\t// su due liste p e ris:\r\n\t\t\t// -estrazione del primo elemento di p\r\n\t\t\t// -inserimento in testa alla lista ris\r\n\t\t\tNodoListaS aux = p.next;\r\n\t\t\tp.next = ris;\r\n\t\t\tris = p;\r\n\t\t\tp = aux; \r\n\t\t}\r\n\t\treturn ris;\r\n\t}", "Edge inverse() {\n return bond.inverse().edge(u, v);\n }", "public void setInitialHInv( DMatrixRMaj Hinverse) {\n\t\tB.set(Hinverse);\n\t}", "public static int ModInv(int n, int m) {\n n = n % m;\n for (int x = 1; x < m; x++)\n if ( ((n * x) % m) == 1 || ((n * x) % m) == -(m-1))\n return x;\n return 1;\n }", "public final void invert(Matrix4rad toInvert) {\r\n\t\tthis.set(toInvert);\r\n\t\tinvert();\r\n\t}", "private void calcPartInverse(int i, int i1, int i2, int i3, int i4, Radical1 op1, Radical1 op2, Radical1 op3, Radical1 op4, Radical1 l1) {\r\n\t\taddR(l1, mulR(values[i], subR(mulR(values[i1], values[i2], op3), mulR(values[i3], values[i4], op4), op2), op1), l1);\r\n\t}", "@Test\n public void testInverseStressPrime() {\n final GaloisPrimeField field = new GaloisPrimeField(15_485_863);\n final GaloisElement element = field.element(1_000_000);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(2_540_812), inverse.value());\n }", "@Test\n public void testBuildInverse() {\n System.out.println(\"buildInverse\");\n int xIndex = 2;\n int yIndex = 5;\n String input1 = \"6 3 1 6 5 -2 4\";\n String input2 = \"6 3 1 6 5 -2 4\";\n CCGeneticDrift instance = new CCGeneticDrift();\n List<Integer> permutation = instance.inputStringToIntegerList(input1);\n String expResult = \"[6, 3, 1, 2, -5, -6, 4]\";\n List result = instance.buildInverse(permutation, xIndex, yIndex);\n assertEquals(result.toString(), expResult);\n }", "public Fp12_2Over3Over2 inverse() {\n final Fp6_3Over2 t0 = c0.square();\n final Fp6_3Over2 t1 = c1.square();\n final Fp6_3Over2 t2 = t0.sub(mulByNonResidue(t1));\n final Fp6_3Over2 t3 = t2.inverse();\n\n return new Fp12_2Over3Over2(c0.mul(t3), c1.mul(t3).negate(), Fp12Parameters);\n }", "public double[][] inverse(double[][] X, int n) {\n\t\tdouble[][] adj = adjoint(X, n);\n\t\tdouble[][] inv = new double[n][n];\n\t\tdouble det = determinant(X, n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tinv[i][j] = adj[i][j] / det;\n\t\treturn inv;\n\t}", "public static void ArrayInverso(int[] arr){\r\n\t\t\t\t\r\n\t\tint l=arr.length;\r\n\t\tint[] arr_inv = new int[l];\r\n\t\tfor (int i=0;i<l;i++){\r\n\t\tarr_inv[i]=arr[l-1-i];\r\n\t\tSystem.out.println(\"\\n array iniziale [\" + arr[i] + \"]\\n array invertito [\" + arr_inv[i] + \"]\");\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}", "public static double[] inv_J(double a, double m, double[] x, double[] y) {\r\n\t\tdouble[] J = new double[4];\r\n\t\tJ[0] = f1_a(a, m, x, y);\r\n\t\tJ[1] = f1_m(a, m, x, y);\r\n\t\tJ[2] = f2_a(a, m, x, y);\r\n\t\tJ[3] = f2_m(a, m, x, y);\r\n\t\tdouble temp = 1 / (J[0] * J[3] - J[1] * J[2]);\r\n\t\tdouble[] inv_J = new double[4];\r\n\t\tinv_J[0] = temp * J[3];\r\n\t\tinv_J[1] = -temp * J[1];\r\n\t\tinv_J[2] = -temp * J[2];\r\n\t\tinv_J[3] = temp * J[0];\r\n\t\treturn inv_J;\r\n\t}", "public Couleur obtenirCouleurInverse()\n\t{\n\t\tif (this == BLANC)\n\t\t\treturn NOIR;\n\t\treturn BLANC;\n\t}", "public void invert() throws NoninvertibleTransform3DException {\r\n\t\tthis.set(getInverse());\r\n\t}", "public BinaryInverseButton(\n\t\t\tBinaryOperator<Double> oper, BinaryOperator<Double> operInv, \n\t\t\tString symbol, CalculatorModel model) {\n\t\tsetText(symbol);\n\t\t\n\t\taddActionListener(e -> {\n\t\t\tif (model.isInverted()) {\n\t\t\t\tmodel.calcBinary(operInv);\n\t\t\t} else {\n\t\t\t\tmodel.calcBinary(oper);\n\t\t\t}\n\t\t});\n\t}", "public NumberType inverse(\n final double probability );", "public CubieCube inverseCube() {\n\n CubieCube clone = this.clone();\n for (int i = 0; i < edgesValues.length; i++) {\n clone.eo[i] = this.eo[clone.ep[i]];\n }\n for (int i = 0; i < cornerValues.length; i++) {\n char ori = this.co[clone.cp[i]];\n if (ori >= 3)\n clone.co[i] = ori;\n else {\n clone.co[i] = (char) -ori;\n if (clone.co[i] < 0)\n clone.co[i] += 3;\n }\n }\n return clone;\n }", "void invertAllBits();", "@Override\n public Optional<Curve> inverse() {\n Optional<Curve> invF = f.inverse();\n Optional<Curve> invG = g.inverse();\n\n if (invF.isPresent() && invG.isPresent()) {\n return Optional.of(new ComposedCurve(invF.get(), invG.get()));\n } else {\n return Optional.empty();\n }\n }", "public static Matrix opposite(Matrix amat){\r\n \tMatrix opp = Matrix.copy(amat);\r\n \tfor(int i=0; i<amat.nrow; i++){\r\n \t\tfor(int j=0; j<amat.ncol; j++){\r\n \t\topp.matrix[i][j]=-amat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "private static float[] qinv(float[] d, float[] s) {\n \td[0] = s[0];\n \td[1] = -s[1];\n \td[2] = -s[2];\n \td[3] = -s[3];\n \treturn(d);\n }", "public static <T> List<T> mirrored(List<T> l) throws IllegalArgumentException {\n if (l.isEmpty()) {\n throw new IllegalArgumentException();\n }\n List<T> mirroredList1 = new ArrayList<T>(l);\n List<T> mirroredList2 = new ArrayList<T>(l);\n Collections.reverse(mirroredList2);\n mirroredList2 = mirroredList2.subList(1, mirroredList2.size());\n mirroredList1.addAll(mirroredList2);\n return mirroredList1;\n }", "public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}", "public void setInverted(boolean inv) {\n/* 69 */ int dat = getData() & 0x7;\n/* 70 */ if (inv) {\n/* 71 */ dat |= 0x8;\n/* */ }\n/* 73 */ setData((byte)dat);\n/* */ }", "public void setInvert (boolean invert) {\r\n\t\tthis.invert = invert;\r\n\t}", "private void inflate(DMatrixRMaj M){\n Equation eq = new Equation();\n eq.alias(M, \"M\", this.inflationPow, \"p\");\n\n for(int i=0; i < M.numRows; i++){\n eq.alias(i, \"i\");\n eq.process(\"M(i,:) = M(i,:) .^ p\");\n\n }\n\n }", "public Vector2f negateLocal ()\n {\n return negate(this);\n }", "public Fraction inverse() {\n return new Fraction (denominator, numerator).reduce();\n }", "static <S, F> Function<Result<S, F>, Result<F, S>> invert() {\n return r -> r.either(Result::failure, Result::success);\n }", "@Nonnull\n @ReturnsMutableCopy\n public Matrix getL ()\n {\n final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);\n final double [] [] aNewArray = aNewMatrix.internalGetArray ();\n for (int nRow = 0; nRow < m_nRows; nRow++)\n {\n final double [] aSrcRow = m_aLU[nRow];\n final double [] aDstRow = aNewArray[nRow];\n for (int nCol = 0; nCol < m_nCols; nCol++)\n if (nRow > nCol)\n aDstRow[nCol] = aSrcRow[nCol];\n else\n if (nRow == nCol)\n aDstRow[nCol] = 1.0;\n else\n aDstRow[nCol] = 0.0;\n }\n return aNewMatrix;\n }", "public InvertibleSolenoid(PneumaticsModuleType module, int channel, boolean isInverted) {\n this(0, module, channel, isInverted);\n }", "@org.junit.Test\n public void inverser_vector() throws Exception {\n //voici un commentaire\n Vector<Integer> inppuut = new Vector<Integer>();\n inppuut.add(1);\n inppuut.add(2);\n inppuut.add(3);\n inppuut.add(4);\n\n Vector<Integer> expec = new Vector<Integer>();\n expec.add(4);\n expec.add(3);\n expec.add(2);\n expec.add(1);\n\n VectorHelper.inverser_vector(inppuut);\n assertEquals(expec, inppuut);\n\n }", "public static void main(String[] args) {\n\t\tint n=scn.nextInt();\r\n\t\tint[] arr=takeinput(n);\r\nint[] ans=Inverse(arr);\r\nfor(int val:ans)\r\n\tSystem.out.println(val);\r\n\t}", "public static Matrix asin(Matrix matrix)\n {\n double[][] internal = matrix.getArray();\n int row = matrix.getRowDimension(), col = matrix.getColumnDimension();\n Matrix X = new Matrix(row, col);\n double[][] C = X.getArray();\n double[][] M = matrix.getArray();\n for (int i = 0; i < row; i++)\n {\n for (int j = 0; j < col; j++)\n {\n if (M[i][j] <= 1.0d || M[i][j] >= -1.0d)\n {\n C[i][j] = Math.asin(M[i][j]);\n }\n else\n {\n C[i][j] = Double.NaN;\n }\n }\n }\n return X;\n }", "public final void negate() {\n \n \tthis.m00 = -this.m00;\n \tthis.m01 = -this.m01;\n \tthis.m02 = -this.m02;\n this.m10 = -this.m10;\n this.m11 = -this.m11;\n this.m12 = -this.m12;\n this.m20 = -this.m20;\n this.m21 = -this.m21;\n this.m22 = -this.m22;\n }", "public InverseTransformSampling(ProbabilityDistribution distribution, RandomLongGenerator uniform) {\n this.distribution = distribution;\n this.uniform = uniform;\n }", "private void invertStreets() {\n this.canCross = !this.canCross;\n String calleAux = this.calleVerde;\n this.calleVerde = this.calleRojo;\n this.calleRojo = this.calleVerde;\n }", "public void invert() {\n \n for(T first : getFirstDimension()) {\n \n for(T second : getMatches(first)) {\n \n Double sim = get(first, second);\n \n if(sim!=null && sim > 0.0) {\n set(first, second, 1.0/sim);\n }\n \n }\n \n }\n }", "public final void mINV_IMPLIES() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = INV_IMPLIES;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:412:12: ( ':-' )\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:412:16: ':-'\n\t\t\t{\n\t\t\tmatch(\":-\"); \n\n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}", "public boolean isInversed() {\n return isinv != null && isinv.booleanValue();\n }", "public void setInverted(boolean invert) {\r\n inverted = invert;\r\n }", "public void testDenseLUToInput() {\n\n\t\tMatrix m = new DenseMatrix(3, 3);\n\n\t\t// -2 2 -3\n\t\t// -1 1 3\n\t\t// 2 0 -1\n\t\tm.set(0, 0, -2);\n\t\tm.set(0, 1, 2);\n\t\tm.set(0, 2, -3);\n\t\tm.set(1, 0, -1);\n\t\tm.set(1, 1, 1);\n\t\tm.set(1, 2, 3);\n\t\tm.set(2, 0, 2);\n\t\tm.set(2, 1, 0);\n\t\tm.set(2, 2, -1);\n\n\t\t// SHOULD BE:\n\t\t// L:\n\t\t// 1.000 0.000 0.000\n\t\t// -1.000 1.000 0.000\n\t\t// 0.500 0.000 1.000\n\t\t//\n\t\t// U:\n\t\t// -2.000 2.000 -3.000\n\t\t// 0.000 2.000 -4.000\n\t\t// 0.000 0.000 4.500\n\t\t//\n\t\t// Permutation matrix:\n\t\t// 1.000 0.000 0.000\n\t\t// 0.000 0.000 1.000\n\t\t// 0.000 1.000 0.000\n\n\t\tDenseLU dlu = DenseLU.factorize(m);\n\n\t\t// check that m = L . U\n\t\tMatrix lTimesU = new DenseMatrix(3, 3);\n\t\tdlu.getL().mult(dlu.getU(), lTimesU);\n\t\tint[] pivots = dlu.getPivots();\n\t\tfor (MatrixEntry entry : m) {\n\t\t\tint row = entry.row();\n\t\t\tint col = entry.column();\n\t\t\tdouble val = entry.get();\n\t\t\tdouble valLU = pivots[row] * lTimesU.get(row, col);\n\t\t\tassert val == valLU : \"Row \" + row + \", Col \" + col\n\t\t\t\t\t+ \" wasn't equal! \" + val + \" \" + valLU;\n\t\t}\n\n\t\tMatrix lu = dlu.getLU();\n\t\t// m == lu\n\t\tfor (MatrixEntry entry : m) {\n\t\t\tint row = entry.row();\n\t\t\tint col = entry.column();\n\t\t\tdouble val = entry.get();\n\t\t\tdouble valLU = lu.get(row, col);\n\t\t\tassert val == valLU : \"Row \" + row + \", Col \" + col\n\t\t\t\t\t+ \" wasn't equal! \" + val + \" \" + valLU;\n\t\t}\n\t}", "@Override\n public void visit(P_Inverse inversePath) {\n engine.flipDirection() ;\n engine.eval(inversePath.getSubPath(), node, output) ;\n engine.flipDirection() ;\n }", "private void performInverseExpression(Map<ColumnIdentifier, byte[]> dbValues,\n \t\t\tTermMap tm, String effectiveSQLQuery) throws SQLException,\n \t\t\tR2RMLDataError, UnsupportedEncodingException {\n \t\t// Every column reference in the inverse expression MUST\n \t\t// be an existing column in t\n \t\tString inverseExpression = tm.getInverseExpression();\n \t\tif (inverseExpression == null)\n \t\t\treturn;\n \t\tSet<ColumnIdentifier> columnReferences = R2RMLToolkit\n \t\t\t\t.extractColumnNamesFromInverseExpression(inverseExpression);\n \t\tSet<ColumnIdentifier> existingColumns = getExistingColumnNames();\n \t\tfor (ColumnIdentifier referencedColumns : columnReferences) {\n \t\t boolean found = false;\n \t\t for (ColumnIdentifier existingColumn : existingColumns) {\n \t\t\tif(existingColumn.equals(referencedColumns)) {\n \t\t\t found = true;\n \t\t\t break;\n \t\t\t}\n \t\t }\n \t\t if (!found)\n \t\t\tthrow new R2RMLDataError(\"[R2RMLEngine:checkInverseExpression] Every column\"\n \t\t\t\t\t\t\t\t+ \" reference in the inverse expression must be an existing column : \"\n \t\t\t\t\t\t\t\t+ referencedColumns + \" does not exist.\");\n \t\t}\n \t\t// Let instantiation(r)\n \t\tString instantiation = R2RMLToolkit\n \t\t\t\t.extractColumnValueFromInverseExpression(inverseExpression,\n \t\t\t\t\t\tdbValues, columnReferences);\n \t\t// let same-term(r) be the set of logical table rows in t that are\n \t\t// the result of executing the following SQL query over the SQL\n \t\t// connection\n \t\tResultSet sameTerm = constructInversionTable(instantiation,\n \t\t\t\teffectiveSQLQuery);\n \t\t// For every logical table row r in t whose generated RDF term g is not\n \t\t// NULL, same-term(r)\n \t\t// MUST be exactly the set of logical table rows in t whose generated\n \t\t// RDF term is also g\n \t\t// => Save similar rows\n \t\tif (sameRows.containsKey(tm)) {\n \t\t\tsameRows.get(tm).put(rows.getRow(), sameTerm);\n \t\t} else {\n \t\t\tMap<Integer, ResultSet> sameRowsMap = new HashMap<Integer, ResultSet>();\n \t\t\tsameRowsMap.put(rows.getRow(), sameTerm);\n \t\t\tsameRows.put(tm, sameRowsMap);\n \t\t}\n \n \t}" ]
[ "0.6835238", "0.6669466", "0.63580745", "0.6350922", "0.6093458", "0.5946079", "0.5832552", "0.58227986", "0.57891285", "0.5761281", "0.57512665", "0.57275313", "0.5674034", "0.56292635", "0.55051655", "0.5472056", "0.5444921", "0.544134", "0.54335636", "0.5396351", "0.538208", "0.53799784", "0.5336596", "0.5303155", "0.52985734", "0.52673435", "0.52470493", "0.52467704", "0.5205758", "0.52020925", "0.5201456", "0.517227", "0.5134204", "0.5113377", "0.51122", "0.5104329", "0.51026845", "0.5062504", "0.5050159", "0.504014", "0.5012682", "0.50042135", "0.49937138", "0.49925268", "0.49791342", "0.4973443", "0.4965845", "0.4914671", "0.4914503", "0.4905144", "0.49012628", "0.4863115", "0.48601428", "0.4847742", "0.48464626", "0.4829539", "0.48291844", "0.4822474", "0.48223242", "0.48157126", "0.48076817", "0.48075876", "0.47786528", "0.47605705", "0.47583127", "0.47492662", "0.4747052", "0.47404674", "0.47111008", "0.47055846", "0.46944636", "0.46893302", "0.4688431", "0.46697077", "0.46450806", "0.4636638", "0.46287352", "0.46106768", "0.4599372", "0.45993403", "0.45714384", "0.4565813", "0.45581496", "0.4556434", "0.45349476", "0.4530736", "0.4512844", "0.44826669", "0.44815978", "0.44722068", "0.44681358", "0.4468065", "0.44675574", "0.44564664", "0.44552758", "0.44452593", "0.44367158", "0.44357386", "0.4429183", "0.44172415" ]
0.71771574
0
Inverse. L is a list. The inverse of L is returned. The list L is modified.
public static <C> LIST<C> INV(LIST<C> L) { if ( isNull( L ) ) { return L; } Collections.reverse( L.list ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Matrix inverse() {\n int n = L.getNrows();\n Matrix inv = Matrix.identity(n);\n solve(inv);\n return inv;\n }", "public Matrix inverse() {\n\t\tMatrix a = copy();\n\t\tif (a.M != a.N) {\n\t\t\tthrow new RuntimeException(\"This matrix is not square!\");\n\t\t}\n\t\tMatrix i = identity(a.N);\n\t\tMatrix ai = a.augment(i);\n\t\tai = ai.specialrref();\n\t\tMatrix[] split = ai.split(a.N);\n\t\tif (split[0].equals(i)) {\n\t\t\treturn split[1];\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"This matrix is not invertible!\");\n\t\t}\n\t}", "public static <C> LIST<C> CINV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LinkedList<C> list = new LinkedList<C>(L.list);\n Collections.reverse( list );\n return new LIST<C>( list );\n }", "public Index invert() {\n \t\tint n=length();\n \t\tIndex ni=new Index(n);\n \t\tfor (int i=0; i<n; i++) {\n \t\t\tni.set(this.get(i), i);\n \t\t}\n \t\treturn ni;\n \t}", "public Matrix inverse(){\r\n \tint n = this.nrow;\r\n \tif(n!=this.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = this.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \t\treturn invmat;\r\n \t}", "@Override\n public void invert() {\n getInvertibles().parallelStream().forEach(Invertible::invert);\n }", "<T> void inverse(final T[] array);", "public static NodoListaS invertiLista(NodoListaS p) {\r\n\t\t// p riferimento alla lista da invertire\r\n\t\t// ris riferimento alla lista invertita\r\n\t\tNodoListaS ris = null;\r\n\t\twhile (p != null) {\r\n\t\t\t// suggerimento: considerare le operazioni\r\n\t\t\t// nel ciclo come se operassero\r\n\t\t\t// su due liste p e ris:\r\n\t\t\t// -estrazione del primo elemento di p\r\n\t\t\t// -inserimento in testa alla lista ris\r\n\t\t\tNodoListaS aux = p.next;\r\n\t\t\tp.next = ris;\r\n\t\t\tris = p;\r\n\t\t\tp = aux; \r\n\t\t}\r\n\t\treturn ris;\r\n\t}", "public Matrix inverseMatrix(Matrix L, Matrix U, Matrix P, int n)\n {\n\tMatrix Uinv = new Matrix(n,n);\n\tMatrix Linv = new Matrix(n,n);\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// forward substitution for L y = b.\n\t\tfor (int i = 1; i < n; i++)\n\t\t\tfor (int j = 0; j < i; j++)\n\t\t\t\ttemp.vector[i] -= L.matrix[i][j] * temp.vector[j];\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tLinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// back substitution for U x = y. \n\t\tfor (int i = n - 1; i >= 0; i--) {\n\t\t\tfor (int j = i + 1; j < n; j++) \n temp.vector[i] -= U.matrix[i][j] * temp.vector[j];\n\t\t\ttemp.vector[i] /= U.matrix[i][i];\n\t\t}\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tUinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n Matrix LinP = new Matrix();\n\tLinP = LinP.multiplication(Linv, P);\n Matrix results = new Matrix();\n results = results.multiplication(Uinv, LinP);\n\treturn results;\n\n }", "public RMTransform getTransformInverse() { return getTransform().invert(); }", "public T pseudoInverse() {\n T ret = createLike();\n ops.pseudoInverse(mat, ret.mat);\n return ret;\n }", "public Matrix inverse() throws JPARSECException {\n return solve(identity(m,m));\n }", "public static <T> List<T> mirrored(List<T> l) throws IllegalArgumentException {\n if (l.isEmpty()) {\n throw new IllegalArgumentException();\n }\n List<T> mirroredList1 = new ArrayList<T>(l);\n List<T> mirroredList2 = new ArrayList<T>(l);\n Collections.reverse(mirroredList2);\n mirroredList2 = mirroredList2.subList(1, mirroredList2.size());\n mirroredList1.addAll(mirroredList2);\n return mirroredList1;\n }", "@Override\n public void Invert() {\n\t \n }", "public void invert() {\n\t\tthis.vector.setXYZ(-this.vector.x(), -this.vector.y(), -this.vector.z());\n\t\tthis.energy = -this.energy;\n\t}", "public final void invert() {\n\tdouble s = determinant();\n\tif (s == 0.0)\n\t return;\n\ts = 1/s;\n\t// alias-safe way.\n\tset(\n\t m11*m22 - m12*m21, m02*m21 - m01*m22, m01*m12 - m02*m11,\n\t m12*m20 - m10*m22, m00*m22 - m02*m20, m02*m10 - m00*m12,\n\t m10*m21 - m11*m20, m01*m20 - m00*m21, m00*m11 - m01*m10\n\t );\n\tmul((float)s);\n }", "public void inverse(Projection projection);", "public final void invert() {\r\n\t\tRadical1 s = determinant();\r\n\t\tif (s.equals(Radical1.ZERO))\r\n\t\t\treturn;\r\n\r\n\t\tif (!s.equals(Radical1.ONE))\r\n\t\t\tthrow new ArithmeticException(\"can't invert radical expressions that have non-1 determinant (i.e. that rescale)\");\r\n\r\n\t\t// see Matrix4f.invert for an explination\r\n\r\n\t\tl1.setZero();\r\n\t\tl2.setZero();\r\n\t\tl3.setZero();\r\n\t\tl4.setZero();\r\n\t\tl5.setZero();\r\n\t\tl6.setZero();\r\n\t\tl7.setZero();\r\n\t\tl8.setZero();\r\n\t\tl9.setZero();\r\n\t\tl10.setZero();\r\n\t\tl11.setZero();\r\n\t\tl12.setZero();\r\n\t\tl13.setZero();\r\n\t\tl14.setZero();\r\n\t\tl15.setZero();\r\n\t\tl16.setZero();\r\n\r\n\t\tcalcPartInverse(5, 10, 15, 11, 14, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(6, 11, 13, 9, 15, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(7, 9, 14, 10, 13, op1, op2, op3, op4, l1);\r\n\r\n\t\tcalcPartInverse(9, 2, 15, 3, 14, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(10, 3, 13, 1, 15, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(11, 1, 14, 2, 13, op1, op2, op3, op4, l2);\r\n\r\n\t\tcalcPartInverse(13, 2, 7, 3, 6, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(14, 3, 5, 1, 7, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(15, 1, 6, 2, 5, op1, op2, op3, op4, l3);\r\n\r\n\t\tcalcPartInverse(1, 7, 10, 6, 11, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(2, 5, 11, 7, 9, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(3, 6, 9, 5, 10, op1, op2, op3, op4, l4);\r\n\r\n\t\tcalcPartInverse(6, 8, 15, 11, 12, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(7, 10, 12, 8, 14, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(4, 11, 14, 10, 15, op1, op2, op3, op4, l5);\r\n\r\n\t\tcalcPartInverse(10, 0, 15, 3, 12, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(11, 2, 12, 0, 14, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(8, 3, 14, 2, 15, op1, op2, op3, op4, l6);\r\n\r\n\t\tcalcPartInverse(14, 0, 7, 3, 4, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(15, 2, 4, 0, 6, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(12, 3, 6, 2, 7, op1, op2, op3, op4, l7);\r\n\r\n\t\tcalcPartInverse(2, 7, 8, 4, 11, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(3, 4, 10, 6, 8, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(0, 6, 11, 7, 10, op1, op2, op3, op4, l8);\r\n\r\n\t\tcalcPartInverse(7, 8, 13, 9, 12, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(4, 9, 15, 11, 13, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(5, 11, 12, 8, 15, op1, op2, op3, op4, l9);\r\n\r\n\t\tcalcPartInverse(11, 0, 13, 1, 12, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(8, 1, 15, 3, 13, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(9, 3, 12, 0, 15, op1, op2, op3, op4, l10);\r\n\r\n\t\tcalcPartInverse(15, 0, 5, 1, 4, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(12, 1, 7, 3, 5, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(13, 3, 4, 0, 7, op1, op2, op3, op4, l11);\r\n\r\n\t\tcalcPartInverse(3, 5, 8, 4, 9, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(0, 7, 9, 5, 11, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(1, 4, 11, 7, 8, op1, op2, op3, op4, l12);\r\n\r\n\t\tcalcPartInverse(4, 10, 13, 9, 14, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(5, 8, 14, 10, 12, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(6, 9, 12, 8, 13, op1, op2, op3, op4, l13);\r\n\r\n\t\tcalcPartInverse(8, 2, 13, 1, 14, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(9, 0, 14, 2, 12, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(10, 1, 12, 0, 13, op1, op2, op3, op4, l14);\r\n\r\n\t\tcalcPartInverse(12, 2, 5, 1, 6, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(13, 0, 6, 2, 4, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(14, 1, 4, 0, 5, op1, op2, op3, op4, l15);\r\n\r\n\t\tcalcPartInverse(0, 5, 10, 6, 9, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(1, 6, 8, 4, 10, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(2, 4, 9, 5, 8, op1, op2, op3, op4, l16);\r\n\r\n\t\tvalues[0].set(l1);\r\n\t\tvalues[1].set(l2);\r\n\t\tvalues[2].set(l3);\r\n\t\tvalues[3].set(l4);\r\n\t\tvalues[4].set(l5);\r\n\t\tvalues[5].set(l6);\r\n\t\tvalues[6].set(l7);\r\n\t\tvalues[7].set(l8);\r\n\t\tvalues[8].set(l9);\r\n\t\tvalues[9].set(l10);\r\n\t\tvalues[10].set(l11);\r\n\t\tvalues[11].set(l12);\r\n\t\tvalues[12].set(l13);\r\n\t\tvalues[13].set(l14);\r\n\t\tvalues[14].set(l15);\r\n\t\tvalues[15].set(l16);\r\n\r\n\t\tif (s.equals(Radical1.MINUS_ONE))\r\n\t\t\tnegate();\r\n\t}", "Matrix InverseT()\n {\n Matrix ad = new Matrix( y.cross(z), z.cross(x), x.cross(y) );\n float inv_det = 1.0f / ( x.dot( ad.x ) );\n ad.timesEqual( inv_det );\n return ad;\n }", "public void invert()\n {\n assert isComplete;\n \n isInverted = !isInverted;\n }", "public Fraction inverse() {\n return new Fraction (denominator, numerator).reduce();\n }", "public ImmutableBiMap<V, K> inverse() {\n/* 246 */ ImmutableBiMap<V, K> result = this.inverse;\n/* 247 */ return (result == null) ? (this.inverse = new Inverse()) : result;\n/* */ }", "public T invert() {\n T ret = createLike();\n\n if (!ops.invert(mat, ret.mat))\n throw new SingularMatrixException();\n if (ops.hasUncountable(ret.mat))\n throw new SingularMatrixException(\"Solution contains uncountable numbers\");\n\n return ret;\n }", "Edge inverse() {\n return bond.inverse().edge(u, v);\n }", "public Vector3 invert()\n {\n this.scale(-1);\n return this;\n }", "public static Matrix inverse(Matrix amat){\r\n \tint n = amat.nrow;\r\n \tif(n!=amat.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = amat.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \treturn invmat;\r\n \t}", "private void makeInverse() {\n if (_map != null) {\n for (Map.Entry<Integer, Integer> e : _map.entrySet()) {\n _inverse.put(e.getValue(), e.getKey());\n }\n }\n }", "@Override\n\tpublic void visit(InverseExpression arg0) {\n\n\t}", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "public static void invert(int[] a) {\r\n\t\tint n = a.length;\r\n\t\tint j = n - 1;\r\n\t\tfor (int i = 0; i < j; i++) {\r\n\t\t\tint tmp = a[i];\r\n\t\t\ta[i] = a[j];\r\n\t\t\ta[j] = tmp;\r\n\t\t\tj--;\r\n\t\t}\r\n\t}", "public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}", "public final void invert(Matrix4rad toInvert) {\r\n\t\tthis.set(toInvert);\r\n\t\tinvert();\r\n\t}", "public Matrix opposite(){\r\n \tMatrix opp = Matrix.copy(this);\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\topp.matrix[i][j]=-this.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}", "public JamMatrix invert() {\n RealMatrix apacheUT = decomposition.getUT();\n RealMatrix apacheV = decomposition.getV();\n RealMatrix apacheDinv = getApacheDinv();\n\n return JamMatrix.wrap(apacheV.multiply(apacheDinv.multiply(apacheUT)).getData());\n }", "@Override\n public synchronized UnitConverter inverse() {\n if (inverse == null) {\n inverse = new ConcatenatedConverter(c2.inverse(), c1.inverse());\n inverse.inverse = this;\n }\n return inverse;\n }", "public static Transform inverse(Transform t) {\n\t\tfloat inv_det = 1.0f / (t.a * t.d - t.c * t.b);\n\t\treturn transpose(t.d * inv_det, -t.c * inv_det, (t.c * t.ty - t.tx * t.d) * inv_det, -t.b * inv_det,\n\t\t\t\t\t\t t.a * inv_det, (t.tx * t.b - t.a * t.ty) * inv_det);\n\t}", "public final native Mat4 inverse() /*-{\n return $wnd.mat4.inverse(this, $wnd.mat4.create());\n }-*/;", "public Matrix getInverse() throws InvalidMoveException {\r\n Matrix temp = null;\r\n double determinant = this.getDeterminant();\r\n\r\n if (determinant == 0) {\r\n throw new InvalidMoveException(\"The matrix are singular, and doesn't have any inverse.\");\r\n }\r\n\r\n // getting the cofactor matrix\r\n try {\r\n temp = this.getCofactor();\r\n\r\n } catch (IndexOutOfBoundsException e) {\r\n // actually this will never happened when we're the one who\r\n // handles the code.\r\n }\r\n // transpose it.\r\n temp.transpose();\r\n\r\n // multiply it with the determinant.\r\n temp.multiply(1 / determinant);\r\n return temp;\r\n }", "public void invert() throws NoninvertibleTransform3DException {\r\n\t\tthis.set(getInverse());\r\n\t}", "@Deprecated\n public static EquationExpression inverse(EquationExpression x) {\n return x.getInverse();\n }", "public static Direction inverse(Direction direction) {\n if (direction.isHorizontal()) {\n if (direction.equals(Direction.EAST))\n return Direction.WEST;\n else\n return Direction.EAST;\n } else {\n if (direction.equals(Direction.NORTH))\n return Direction.SOUTH;\n else\n return Direction.NORTH;\n }\n }", "public BiMap<V, K> inverse()\n {\n Set<K> keys = this.keySet();\n BiMap<V, K> inverse = new BiMap<V, K>();\n\n for (K key : keys)\n inverse.put(this.get(key), key);\n\n return inverse;\n\n }", "@Deprecated\n\tpublic static EquationExpression inverse(EquationExpression x) {\n\t\treturn x.getInverse();\n\t}", "public static <T> ReverseListIterator<T> reversed(List<T> original)\r\n\t{\r\n\t\treturn new ReverseListIterator<T>(original);\r\n\t}", "public static Transform rigidInverse(Transform t) {\n\t\treturn transpose(t.d, -t.c, (t.c * t.ty - t.tx * t.d), -t.b, t.a, (t.tx * t.b - t.a * t.ty));\n\t}", "public void invert() {\n \n float[] result = new float[16];\n System.arraycopy(IDENTITY, 0, result, 0, 16);\n \n for(int i = 0; i < 4; i++){\n int i4 = i*4;\n \n // make sure[i,i] is != 0\n \n for(int j = 0; matrix[i4+i] == 0 && j < 4; j++){\n if(j != i && matrix[j*4+i] != 0){\n transform(i, 1, j, matrix, result);\n }\n }\n \n // ensure tailing 0s\n \n for(int j = 0; j < i; j++){\n if(matrix[i4+j] != 0){\n transform(i, -matrix[i4+j]/matrix[j*4+j], j, matrix, result);\n }\n }\n\n if(matrix[i4+i] == 0){\n throw new IllegalArgumentException(\"Not invertable\");\n }\n\n // dump(\"row \"+i+\" leading zeros\", matrix, result);\n }\n \n for(int i = 3; i >= 0; i--){\n int i4 = i*4;\n if(matrix[i4+i] != 1){\n float f = matrix[i4+i];\n matrix[i4+i] = 1;\n for(int j = 0; j < 4; j++){\n result[i4+j] /= f;\n if(j > i){\n matrix[i4+j] /= f;\n }\n }\n }\n\n// dump(\"row \"+i+\" leading 1\", matrix, result);\n \n for(int j = i+1; j < 4; j++){\n if(matrix[i*4+j] != 0){\n transform(i, -matrix[i*4+j], j, matrix, result);\n }\n }\n\n// dump(\"row \"+i+\" tailing 0\", matrix, result);\n\n }\n\n matrix = result;\n }", "static <S, F> Function<Result<S, F>, Result<F, S>> invert() {\n return r -> r.either(Result::failure, Result::success);\n }", "int ainverse(int z)\n {\n return (65536-z);\n }", "public double[][] inverse(double[][] X, int n) {\n\t\tdouble[][] adj = adjoint(X, n);\n\t\tdouble[][] inv = new double[n][n];\n\t\tdouble det = determinant(X, n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tinv[i][j] = adj[i][j] / det;\n\t\treturn inv;\n\t}", "void invertAllBits();", "public Vector2f negateLocal ()\n {\n return negate(this);\n }", "@Test\n public void testReverse() {\n System.out.println(\"reverse\");\n al.add(1);\n al.add(2);\n al.add(3);\n ArrayList<Integer> rl = new ArrayList<>();\n rl.add(3);\n rl.add(2);\n rl.add(1);\n al.reverse();\n assertEquals(rl.get(0), al.get(0));\n assertEquals(rl.get(1), al.get(1));\n assertEquals(rl.get(2), al.get(2));\n }", "public static native void Inverse(long lpjFbxDualQuaternion);", "@Override\n\tpublic Type inverse() {\n\t\treturn Nothing.INSTANCE;\n\t}", "Vec inverseFilter(DMatrixRMaj H, double V, DMatrixRMaj Cnew) {\n CommonOps_DDRM.mult(helix.C, H, tempV);\n double denom = -V + CommonOps_DDRM.dot(H, tempV);\n CommonOps_DDRM.scale(1.0/denom, helix.C, tempM);\n DMatrixRMaj Kstar = new DMatrixRMaj(5,1);\n CommonOps_DDRM.mult(tempM, H, Kstar); // Kalman gain matrix\n\n CommonOps_DDRM.scale(r, Kstar, tempV);\n Vec aNew = helix.a.sum(mToVec(tempV));\n directProd(Kstar, H, tempM);\n CommonOps_DDRM.scale(-1.0, tempM);\n CommonOps_DDRM.addEquals(tempM, U);\n CommonOps_DDRM.mult(tempM, helix.C, Cnew);\n if (debug) {\n System.out.format(\"StateVector.inverseFilter: V=%12.4e, denom=%12.4e\\n\", V, denom);\n helix.a.print(\"old helix\");\n aNew.print(\" new helix in StateVector.inverseFilter\");\n }\n return aNew;\n }", "void reverse();", "void reverse();", "Direction invert() {\n switch (this) {\n case NORTH: return SOUTH;\n case SOUTH: return NORTH;\n case EAST: return WEST;\n case WEST: return EAST;\n case NORTH_EAST: return SOUTH_WEST;\n case NORTH_WEST: return SOUTH_EAST;\n case SOUTH_EAST: return NORTH_WEST;\n case SOUTH_WEST: return NORTH_EAST;\n default: return NULL;\n }\n }", "public void invert(boolean direction){\n intake.setInverted(direction);\n }", "@Override\n public void visit(P_Inverse inversePath) {\n engine.flipDirection() ;\n engine.eval(inversePath.getSubPath(), node, output) ;\n engine.flipDirection() ;\n }", "public static Shader invert( Shader shader ) {\n return new InvertedShader( shader );\n }", "public Vector3 negateLocal () {\n return negate(this);\n }", "public NumberType inverse(\n final double probability );", "@NonNull\n ConsList<E> reverse();", "public CoreMap<V, K> inverse() {\n return new CoreMap<V, K>(this.commonCore, map(new F1<MapEntry<K, V>, MapEntry<V, K>>() {\n @Override\n public MapEntry<V, K> f(MapEntry<K, V> x) {\n return new MapEntry<V, K>(x.value(), x.key());\n }\n\n }).unsafelist());\n }", "public int[] llenadoInversion(int[] vector)\r\n\t{\r\n\t\tint[] vecInvertido=new int[vector.length];\r\n\t\tint vecAux;\r\n\t\t\r\n\t\tfor(int i=0;i<vector.length;i++)\r\n\t\t{\r\n\t\t\tvecInvertido[i]=vector[vector.length-i-1];\r\n\t\t}\r\n\t\treturn vecInvertido;\r\n\t}", "void FlipBook()\r\n\t\t{\r\n\t\t\t Collections.reverse(this);\r\n\t\t}", "private static ArrayList<Long> reverse(ArrayList<Long> arrayList) {\n\t\tArrayList<Long> result = new ArrayList<Long>();\n\t\tfor(int i=arrayList.size()-1; i>=0; i--)\n\t\t result.add(arrayList.get(i));\n\t\treturn result;\n\t }", "public static void ArrayInverso(int[] arr){\r\n\t\t\t\t\r\n\t\tint l=arr.length;\r\n\t\tint[] arr_inv = new int[l];\r\n\t\tfor (int i=0;i<l;i++){\r\n\t\tarr_inv[i]=arr[l-1-i];\r\n\t\tSystem.out.println(\"\\n array iniziale [\" + arr[i] + \"]\\n array invertito [\" + arr_inv[i] + \"]\");\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}", "public final void invert(Matrix3f m1) {\n\tset(m1);\n\tinvert();\n }", "Node reversedLinkedList(Node oldList) {\n Node newList = null;\n while (oldList != null) {\n\tNode element = oldList;\n\toldList = oldList.next;\n\telement.next = newList;\n\tnewList = element;\n }\n return newList;\n}", "public static double [][] inv(double [][] a) {\n int N = a.length;\n double [] col = new double[N];\n int [] indx = new int[N];\n double [][] y = new double[N][N];\n \n double d = ludcmp(a, indx);\n for (int j=0; j<N; j++ ) {\n for (int i=0; i<N; i++) \n col[i] = 0.0;\n col[j] = 1.0;\n lubksb(a, indx, col);\n for (int i=0; i<N; i++)\n y[i][j] = col[i];\n }\n return y; \n }", "public static <T> List<T> unmodifiableList(List<T> original) {\n ArrayList<T> list = new ArrayList<>(original.size());\n original.forEach(list::add);\n return Collections.unmodifiableList(list);\n }", "@Override\n\tpublic Squarelotron inverseDiagonalFlip(int ring) {\n\t\tint[] array = numbers();\n\t\t//converts the array into a new Squarelotron\n\t\tSquarelotron copySquarelotron = makeSquarelotron(array);\n\t\tint[][] newSquarelotron = copySquarelotron.squarelotron;\n\t\t//finds length of squarelotron and takes the square root\n\t\tint length = array.length;\n\t\tdouble sqrtLength = Math.sqrt(length);\n\t\tint size =(int) sqrtLength;\n\t\t//loops through and flips with the inverse diagonal\n\t\tfor(int i = ring-1; i <= (size-ring); i++){\n\t\t\tint numberRt = newSquarelotron[ring-1][i];\n\t\t\tnewSquarelotron[ring-1][i] = newSquarelotron[size-i-1][size-ring];\n\t\t\tnewSquarelotron[size-i-1][size-ring]=numberRt;\n\t\t}\n\t\tfor(int i = ring; i <= (size-ring); i++){\n\t\t\tint numberLft = newSquarelotron[i][ring-1];\n\t\t\tnewSquarelotron[i][ring-1] = newSquarelotron[size-ring][size-i-1];\n\t\t\tnewSquarelotron[size-ring][size-i-1]=numberLft;\n\t\t}\n\t\tcopySquarelotron.squarelotron = newSquarelotron;\n\t\treturn copySquarelotron;\n\t}", "public CubieCube inverseCube() {\n\n CubieCube clone = this.clone();\n for (int i = 0; i < edgesValues.length; i++) {\n clone.eo[i] = this.eo[clone.ep[i]];\n }\n for (int i = 0; i < cornerValues.length; i++) {\n char ori = this.co[clone.cp[i]];\n if (ori >= 3)\n clone.co[i] = ori;\n else {\n clone.co[i] = (char) -ori;\n if (clone.co[i] < 0)\n clone.co[i] += 3;\n }\n }\n return clone;\n }", "void reverseList(){\n\n Node prev = null;\n Node next = null;\n Node iter = this.head;\n\n while(iter != null)\n {\n next = iter.next;\n iter.next = prev;\n prev = iter;\n iter = next;\n\n }\n\n //prev is the link to the head of the new list\n this.head = prev;\n\n }", "public DoubleLinkedSeq reverse(){\r\n\t DoubleLinkedSeq rev = new DoubleLinkedSeq();\r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t rev.addBefore(this.getCurrent());\r\n\t }\r\n\t \r\n\t return rev; \r\n }", "public List<E> reverseList(List<E> toReverse) {\n\t\tfor (int i = 0; i < toReverse.size() / 2; i++) {\n\t\t\tE temp = toReverse.get(i);\n\t\t\ttoReverse.set(i, toReverse.get(toReverse.size() - 1 - i));\n\t\t\ttoReverse.set(toReverse.size() - 1 - i, temp);\n\t\t}\n\t\treturn toReverse;\n\t}", "public static void reversList(Linkedlist list)\r\n\t {\r\n\t\t Node prev = null;\r\n\t\t Node current = list.head;\r\n\t\t Node next = null;\r\n\t\t \r\n\t\t while(current!=null)\r\n\t\t {\r\n\t\t\t next = current.next;\r\n\t\t\t current.next = prev;\r\n\t\t\t prev = current;\r\n\t\t\t current = next;\r\n\t\t\t \r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t list.head = prev;\r\n\t\t \r\n\t }", "public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }", "public boolean isInversed() {\n return isinv != null && isinv.booleanValue();\n }", "public /*@ non_null @*/ JMLListEqualsNode<E> reverse() {\n JMLListEqualsNode<E> ptr = this;\n JMLListEqualsNode<E> ret = null;\n //@ loop_invariant ptr != this ==> ret != null;\n //@ maintaining (* ret is the reverse of items in this up to ptr *);\n while (ptr != null) {\n //@ assume ptr.val != null ==> \\typeof(ptr.val) <: elementType;\n ret = new JMLListEqualsNode<E>(ptr.val == null ? null\n : (ptr.val) ,\n ret);\n ptr = ptr.next;\n }\n //@ assert ptr == null && ret != null;\n //@ assume elementType == ret.elementType;\n //@ assume containsNull <==> ret.containsNull;\n return ret;\n }", "int invert(int c) {\n int index = wrap(c);\n if (_inverse != null && _inverse.containsKey(index)) {\n return _inverse.get(index);\n } else {\n return index;\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic static List reverse(List list)\r\n\t{\r\n\t\tList newList = new ArrayList();\r\n\t\t\r\n\t\tfor(int x = list.size()-1; x>=0; x--)\r\n\t\t{\r\n\t\t\tnewList.add(list.get(x));\r\n\t\t}\r\n\t\t\r\n\t\treturn newList;\r\n\t\t\r\n\t\t\r\n\t}", "public void reverse() {\n\n\t\tif (head == null) {\n\t\t\tSystem.out.println(\"List is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tint nodes = nodeCounter();\n\t\tDLNode t = tail.prev;\n\t\thead = tail;\n\t\tfor (int i = 0; i < nodes - 1; i++) {\n\n\t\t\tif (t.list == null && t.val != Integer.MIN_VALUE) {\n\t\t\t\tthis.reverseHelperVal(t.val);\n\t\t\t\tt = t.prev;\n\t\t\t} else {\n\t\t\t\tthis.reverseHelperList(t.list);\n\t\t\t\tt = t.prev;\n\t\t\t}\n\t\t}\n\t\ttail.next = null;\n\t\thead.prev = null;\n\n\t}", "@Override\n public List<Invertible> getInvertibles() {\n final List<Invertible> invertibles = Collections.checkedList(new ArrayList<>(), Invertible.class);\n for(final Cube[][] matrix : cubes){\n for(final Cube[] array : matrix){\n for(final Cube cube : array){\n if(cube instanceof Invertible){\n invertibles.add((Invertible) cube);\n }\n }\n }\n }\n\n return Collections.unmodifiableList(invertibles);\n }", "public T negative() {\n T A = copy();\n ops.changeSign(A.mat);\n return A;\n }", "public Double inverse(Double advNum1){\n answer = 1 / advNum1;\n return answer;\n }", "public Direction invertAll(){\n switch(this){\n case STAY:\n return STAY;\n case SPIN_BACK:\n return SPIN_BACK;\n case FORWARD:\n return BACKWARD;\n case BACKWARD:\n return FORWARD;\n case SPIN_LEFT:\n return SPIN_RIGHT; \n case SPIN_RIGHT:\n return SPIN_LEFT;\n case ARC_LEFT:\n return ARC_RIGHT;\n case ARC_RIGHT:\n return ARC_LEFT; \n default:\n return this; \n }\n }", "public static void reverse(java.util.List arg0)\n { return; }", "@Override\n public Optional<Curve> inverse() {\n Optional<Curve> invF = f.inverse();\n Optional<Curve> invG = g.inverse();\n\n if (invF.isPresent() && invG.isPresent()) {\n return Optional.of(new ComposedCurve(invF.get(), invG.get()));\n } else {\n return Optional.empty();\n }\n }", "public Matrix getInversematrixS()\n {\n // Build alpha * I\n double [][] alphainvmatrix;\n alphainvmatrix = new double[x + 1][x + 1];\n for(int i = 0; i < x + 1; i++)\n {\n alphainvmatrix[i][i] = alpha;\n\n }\n Matrix alphamatrixnew = new Matrix(alphainvmatrix);\n\n // calculate summation\n Matrix sum = new Matrix(x + 1, 1);\n int i = 1;\n while (i <= arraylistofprices.size() - 1) {\n phimatrix(i);\n\n sum.plusEquals(phi);\n\n i++;\n }\n Matrix summation = sum.times(phiT);\n summation.timesEquals(beta); \n\n // alpha * I + beta * sum\n Matrix sInv = alphamatrixnew.plus(summation);\n return sInv;\n }", "public static long modInverse(long a, long m) {\n a = mod(a, m);\n return a == 0 ? 0 : mod((1 - modInverse(m % a, a) * m) / a, m);\n }", "public void invertOrientation() {\n\t\tPoint3D temp = getPoint(2);\n\t\tsetPoint(2, getPoint(1));\n\t\tsetPoint(1, temp);\n\n\t\tTriangleElt3D temp2 = getNeighbour(2);\n\t\tsetNeighbour(2, getNeighbour(1));\n\t\tsetNeighbour(1, temp2);\n\t\tif (this.getNetComponent() != null)\n\t\t\tthis.getNetComponent().setOriented(false);\n\t}", "public static Matrix opposite(Matrix amat){\r\n \tMatrix opp = Matrix.copy(amat);\r\n \tfor(int i=0; i<amat.nrow; i++){\r\n \t\tfor(int j=0; j<amat.ncol; j++){\r\n \t\topp.matrix[i][j]=-amat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}", "private DoubleMatrix invertCholesky(DoubleMatrix matrix) {\n int numOfRows = matrix.rows;\n double sum;\n int i, j, k;\n // ______ Compute inv(L) store in lower of A ______\n for (i = 0; i < numOfRows; ++i) {\n matrix.put(i, i, 1. / matrix.get(i, i));\n for (j = i + 1; j < numOfRows; ++j) {\n sum = 0.;\n for (k = i; k < j; ++k) {\n sum -= matrix.get(j, k) * matrix.get(k, i);\n }\n matrix.put(j, i, sum / matrix.get(j, j));\n }\n }\n // ______ Compute inv(A)=inv(LtL) store in lower of A ______\n for (i = 0; i < numOfRows; ++i) {\n for (j = i; j < numOfRows; ++j) {\n sum = 0.;\n for (k = j; k < numOfRows; ++k) {\n sum += matrix.get(k, i) * matrix.get(k, j); // transpose\n }\n matrix.put(j, i, sum);\n }\n }\n return matrix;\n }", "interface IInvertArray<T> {\n\n /**\n * Method for inverting arrays.\n * @param array array to inverse.\n * @param <T> array type.\n */\n <T> void inverse(final T[] array);\n\n}", "public E[] reverseList(E[] toReverse) {\n\t\tfor (int i = 0; i < toReverse.length / 2; i++) {\n\t\t\tE temp = toReverse[i];\n\t\t\ttoReverse[i] = toReverse[toReverse.length - 1 - i];\n\t\t\ttoReverse[toReverse.length - 1 - i] = temp;\n\t\t}\n\t\treturn toReverse;\n\t}", "public ListNode reverseList(ListNode l) {\n ListNode prev = null;\n ListNode cur = l;\n ListNode next = null;\n while (cur != null) {\n next = cur.next;\n cur.next = prev;\n prev = cur;\n cur = next;\n }\n \n return prev;\n }", "public Couleur obtenirCouleurInverse()\n\t{\n\t\tif (this == BLANC)\n\t\t\treturn NOIR;\n\t\treturn BLANC;\n\t}" ]
[ "0.7564506", "0.6757969", "0.67244816", "0.64072543", "0.63701767", "0.6134623", "0.6091005", "0.59330726", "0.59237045", "0.59163076", "0.59013665", "0.5878698", "0.58578986", "0.58323085", "0.58096194", "0.5794093", "0.57905334", "0.57629704", "0.5736586", "0.56793", "0.5675527", "0.5620108", "0.5604782", "0.5600981", "0.55821395", "0.55609447", "0.552762", "0.5451753", "0.54328746", "0.5412592", "0.5396531", "0.5390908", "0.5374749", "0.5353924", "0.5353256", "0.5332444", "0.5315952", "0.53084564", "0.52917796", "0.5270923", "0.52457005", "0.5233432", "0.5227172", "0.52208227", "0.5201036", "0.5183598", "0.5160943", "0.515825", "0.515415", "0.51291174", "0.5128593", "0.50975996", "0.5096733", "0.50818413", "0.50764906", "0.507416", "0.507416", "0.5041528", "0.5038155", "0.5020651", "0.5019404", "0.49839717", "0.49830055", "0.4967557", "0.49567276", "0.4955159", "0.49261284", "0.49174345", "0.49101165", "0.4891382", "0.48798466", "0.48769104", "0.48706898", "0.48525164", "0.4849443", "0.48356047", "0.48350877", "0.48335513", "0.48329338", "0.4825538", "0.48147044", "0.4811886", "0.48114267", "0.48091912", "0.48016363", "0.47936076", "0.4789126", "0.47885233", "0.47866836", "0.47748566", "0.47638118", "0.47635236", "0.47549254", "0.47421148", "0.47361434", "0.4731327", "0.47270766", "0.47227973", "0.4720857", "0.4718482" ]
0.7188756
1
Composition 2. a and b are objects. L is a list. M=COMP(a,COMP(b,L)).
public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) { LIST<C> LP = L; if ( L == null ) { LP = new LIST<C>(); } LP.list.addFirst( b ); LP.list.addFirst( a ); return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "T compose(AbsonObject abson);", "private HashMap<ComparableExpression, HashSet<ComparableExpression>> composition(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rel1,\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rel2) {\n\n HashMap<ComparableExpression, HashSet<ComparableExpression>> newRel = new HashMap<>();\n // (a,b) in rel1, (b,c) in rel2 => put (a,c) into newRel\n for (Map.Entry<ComparableExpression, HashSet<ComparableExpression>> r1 : rel1.entrySet()) {\n ComparableExpression key = r1.getKey();\n for (ComparableExpression oldValue : r1.getValue()) {\n // transitive relation?\n if (rel2.containsKey(oldValue)) {\n HashSet<ComparableExpression> newValues = rel2.get(oldValue);\n newRel.putIfAbsent(key, new HashSet<>());\n newRel.get(key).addAll(newValues);\n }\n }\n }\n return newRel;\n }", "private boolean comps(int a, int b){\n\t\tthis.comparisons.add(new Integer[]{a, b});\n\t\treturn true;\n\t}", "public Composite multiply(Composite comp) {\n\t\tif(comp.isUnit()){\n\t\t\treturn this;\n\t\t}\n\t\tif(this.isUnit()){\n\t\t\treturn comp;\n\t\t}\n\t\tNode head = comp.head;\n\t\tNode current_node = this.head;\n\t\t//long product = 1;\n\t\tBigInteger product = BigInteger.ONE;\n\t\twhile (current_node != null){\n\t\t\tlong factor = (long) Math.pow(current_node.factor, current_node.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\twhile (comp.head != null){\n\t\t\tlong factor = (long)Math.pow(comp.head.factor, comp.head.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n\t\tComposite p = new Composite();\n\t\tNode n = new Node(product.longValue(), 1);\n\t\tp.head = n;\n\t\tcomp.head = head;\n\t\treturn p;\n\t}", "public Composite add(Composite comp) {\n\t\t// REPLACE WITH WORKING CODE\n\t\t//do last\n//\t\tComposite common_factor = new Composite();\n//\t\tcommon_factor = this.lcm(comp);\n//\t\tlong factor = 0;\n//\t\twhile(common_factor != null){\n//\t\t\tfactor *= Math.pow(common_factor.head.factor, common_factor.head.power);\n//\t\t\tcommon_factor.head = common_factor.head.next;\n//\t\t}\n\t\tlong t = 1;\n\t\twhile(this.head != null){\n\t\t\tt *= Math.pow(this.head.factor, this.head.power);\n\t\t\tthis.head = this.head.next;\n\t\t}\n//\t\tt = t - factor;\n\t\tlong c = 1;\n\t\twhile(comp.head != null){\n\t\t\tc *= Math.pow(comp.head.factor, comp.head.power);\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n//\t\tc = c - factor;\n//\t\tlong remainder = c + t;\n\t\tlong sum = c + t;\n\t\t\n\t\treturn new Composite(BigInteger.valueOf(sum));\n\t}", "public static void main(String[] args) {\n\t\tint[] a = new int[]{};\n\t\tint[] b = new int[]{};\n\t\tSystem.out.println(comp(a,b));\n\n\t}", "public Composite lcm(Composite comp) {\n\t\tif(this.head.factor == 1){\n\t\t\treturn comp;\n\t\t}\n\t\tif(comp.head.factor == 1){\n\t\t\treturn this;\n\t\t}\n\t\tComposite multiple = new Composite();\n\t\tmultiple = this.multiply(comp);\n\t\tlong num = multiple.head.factor;\n\t\tlong d = 1;\n\t\tComposite com_divisor = this.gcd(comp);\n\t\twhile(com_divisor.head != null){\n\t\t\td *= Math.pow(com_divisor.head.factor, com_divisor.head.power);\n\t\t\tcom_divisor.head = com_divisor.head.next;\n\t\t}\n\t\tlong ans = num / d;\n\t\tBigInteger ans_b = BigInteger.valueOf(ans);\n\t\t\n\t\treturn new Composite(ans_b);\n\t}", "public ArrayList<Object> product(ArrayList<Object> list1, ArrayList<Object> list2)\r\n {\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n retList.addAll(list1);\r\n retList.addAll(list2);\r\n return retList;\r\n }", "public void compose(TransformMatrix mB) {\n\t\ta = mB.a * a;\n\t\tb = mB.b * b;\n\t\tc = mB.a * c + mB.c;\n\t\td = mB.b * d + mB.d;\n\t}", "MapComp<K, V> join(MapComp<K, V> m);", "private static <Item extends Comparable> List<Item> catenate(List<Item> q1, List<Item> q2) {\n List<Item> catenated = new ArrayList<>();\n for (Item item : q1) {\n catenated.add(item);\n }\n for (Item item: q2) {\n catenated.add(item);\n }\n return catenated;\n }", "public static boolean comp(int[] a, int[]b) {\n\t\tif((a == null) || (b == null)) return false;\n\n\t\t//Arrays.sort(a1);\n\t\tArrays.sort(a);\n\t\tfor(int x=0; x<a.length; ++x) {\n\t\t\tif(a[x]<0) a[x] *= -1; \n\t\t}\n\t\tArrays.sort(a);\n\t\tArrays.sort(b);\n\n\t\t//This works for non-negative int arrays\n\t\t//Arrays.sort(a);\n\t\t//Arrays.sort(b);\n\n\t\tif(a.length == b.length) {\n\t\t\tfor(int i=0; i<a.length; ++i) {\n\t\t\t\tif((a[i]*a[i]) != b[i]) return false;\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t\t\n\t\t//System.out.println(a[0] + \" \" + b[0]);\n\t\t//return null;\n\t}", "public static <C> LIST<C> CONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n L1.list.addAll( L2.list );\n return L1;\n }", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "@Override\n public BinaryOperator<List<Integer>> combiner() {\n return (resultList1, resultList2) -> {\n Integer currentTotal1 = resultList1.get(0);\n Integer currentTotal2 = resultList2.get(0);\n currentTotal1 += currentTotal2;\n resultList1.set(0, currentTotal1);\n return resultList1;\n };\n }", "C map(A first, B second);", "public static VectorIntf componentProduct(VectorIntf x, VectorIntf y) {\r\n if (x==null) throw new IllegalArgumentException(\"1st arg is null\");\r\n if (y==null) throw new IllegalArgumentException(\"2nd arg is null\");\r\n final int n = x.getNumCoords();\r\n if (n!=y.getNumCoords())\r\n throw new IllegalArgumentException(\"dimensions don't match\");\r\n VectorIntf z = x.newInstance(); // x.newCopy();\r\n try {\r\n for (int i = 0; i < n; i++) {\r\n z.setCoord(i, x.getCoord(i) * y.getCoord(i));\r\n }\r\n }\r\n catch (parallel.ParallelException e) {\r\n e.printStackTrace(); // can never get here\r\n }\r\n return z;\r\n }", "private Combined() {}", "private static List<Pair<String,String>> product(String[] alist, String[] blist){\n\n List<Pair<String, String>> prod = new ArrayList<>();\n\n for(String a : alist){\n for(String b : blist){\n prod.add(new Pair<>(a,b));\n }\n }\n return prod;\n }", "public static <C> LIST<C> CCONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n LinkedList<C> list = new LinkedList<C>( L1.list );\n list.addAll( L2.list );\n return new LIST<C>( list );\n }", "static void compare()\n {\n \tif(a < c)\n\t\t {\n\t\t\t comp_one = 1; //store this value , else zero default \n\t\t }\n\t\t if(c < b)\n\t\t {\n\t\t\t comp_two = 2; //store this value , else zero default\n\t\t }\n\t\t if(b < a)\n\t\t {\n\t\t\t comp_thr = 5; //store this value , else zero default\n\t\t }\n\t\t \n\t\t comp_val = comp_one + comp_two + comp_thr; //create a unique value by addition\n }", "@Test\n\tvoid test4AddComponentToList() {\n\t\tlistItems.add(comp1);\n\t\tlistItems.add(comp2);\n\t\tvc = new VerticalComponentList(x, y, listItems,0);\n\t\tvc.addComponent(comp3);\n\t\tassertEquals(comp3.hashCode(), vc.getComponentsList().get(vc.getComponentsList().size() - 1).hashCode());\n\t}", "static AggregateOperation compose(Iterable<AggregateOperation> operations) {\n // NOTE(user): It's possible to replace the following two sets with a single map.\n Set<SegmentId> segmentsToRemove = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToAdd = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToEndModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToStartModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<ParticipantId> participantsToRemove = new TreeSet<ParticipantId>(participantComparator);\n Set<ParticipantId> participantsToAdd = new TreeSet<ParticipantId>(participantComparator);\n Map<String, DocOpList> docOps = new TreeMap<String, DocOpList>();\n for (AggregateOperation operation : operations) {\n composeIds(operation.segmentsToRemove, segmentsToRemove, segmentsToAdd);\n composeIds(operation.segmentsToAdd, segmentsToAdd, segmentsToRemove);\n composeIds(operation.segmentsToEndModifying, segmentsToEndModifying, segmentsToStartModifying);\n composeIds(operation.segmentsToStartModifying, segmentsToStartModifying, segmentsToEndModifying);\n composeIds(operation.participantsToRemove, participantsToRemove, participantsToAdd);\n composeIds(operation.participantsToAdd, participantsToAdd, participantsToRemove);\n for (DocumentOperations documentOps : operation.docOps) {\n DocOpList docOpList = docOps.get(documentOps.id);\n if (docOpList != null) {\n docOps.put(documentOps.id, docOpList.concatenateWith(documentOps.operations));\n } else {\n docOps.put(documentOps.id, documentOps.operations);\n }\n }\n }\n return new AggregateOperation(\n new ArrayList<SegmentId>(segmentsToRemove),\n new ArrayList<SegmentId>(segmentsToAdd),\n new ArrayList<SegmentId>(segmentsToEndModifying),\n new ArrayList<SegmentId>(segmentsToStartModifying),\n new ArrayList<ParticipantId>(participantsToRemove),\n new ArrayList<ParticipantId>(participantsToAdd),\n mapToList(docOps));\n }", "Transform<A, B> getTransform();", "public static ImmutableGraph compose( final ImmutableGraph g0, final ImmutableGraph g1 ) {\n\t\treturn new ComposedGraph( g0, g1 );\n\t}", "interface MapComp<K extends Comparable<K>, V> {\n\n // Add given key-value to this map\n MapComp<K, V> add(K k, V v);\n\n // Count the number of key-values in this map\n Integer count();\n\n // Look up the value associated with given key in this map (if it exists)\n Optional<V> lookup(K k);\n\n // Produce a set of key-values in this map\n Set<Pairof<K, V>> keyVals();\n\n // Produce a list of key-values in ascending sorted order\n Listof<Pairof<K, V>> sortedKeyVals();\n\n // Produce a set of keys in this map\n Set<K> keys();\n\n // Produce a set of keys in ascending sorted order\n Listof<K> sortedKeys();\n\n // Produce a list of values in this map (order is unspecified)\n Listof<V> vals();\n\n // Produce a list of values in the ascending sorted order\n // of their keys in this map\n // NOTE: list is not itself sorted\n Listof<V> sortedVals();\n\n // Is this map the same as m?\n // (Does it have the same keys mapping to the same values?)\n Boolean same(MapComp<K, V> m);\n\n // Remove any key-value with the given key from this map\n MapComp<K, V> remove(K k);\n\n // Remove all key-values with keys that satisfy given predicate\n MapComp<K, V> removeAll(Predicate<K> p);\n\n // Remove all key-values w/ key-values that satisfy given binary predicate\n MapComp<K, V> removeAllPairs(BiPredicate<K, V> p);\n\n // Join this map and given map (entries in this map take precedence)\n MapComp<K, V> join(MapComp<K, V> m);\n}", "private List<T> getCompList(){\n\t\tList<T> l = new ArrayList<T>();\n\t\tfor(int i=0; i<list.size(); i++){\n\t\t\tif(indices[i]==1){\n\t\t\t\tl.add(list.get(i));\n\t\t\t}\n\t\t}\n\t\treturn l;\n\t}", "private double jaccardIndexCross(Object m1, Object m2) \n\t{\n\t\treturn 0;\n\t}", "@Test\n public void testCyclicalIdentity() {\n Vector a = Vector.of(Variable.of(\"a1\"), Variable.of(\"a2\"), Variable.of(\"a3\"));\n Vector b = Vector.of(Variable.of(\"b1\"), Variable.of(\"b2\"), Variable.of(\"b3\"));\n Vector c = Vector.of(Variable.of(\"c1\"), Variable.of(\"c2\"), Variable.of(\"c3\"));\n Vector lhs = a.cross(b).cross(c);\n lhs = lhs.simplify();\n Vector rhs = b.times(a.dot(c)).plus(a.times(b.dot(c)).times(Constant.MINUS_ONE));\n rhs = rhs.simplify();\n Assert.assertEquals(lhs.getValues()[0], rhs.getValues()[0]);\n Assert.assertEquals(lhs.getValues()[1], rhs.getValues()[1]);\n Assert.assertEquals(lhs.getValues()[2], rhs.getValues()[2]);\n Assert.assertEquals(lhs, rhs);\n }", "public Transform compose(Transform other){\n float[][] ans = new float[4][4];\n for(int row = 0; row < 4; row++){\n for(int col = 0; col < 4; col++){\n for(int i = 0; i < 3; i++){\n ans[row][col] += this.values[row][i] * other.values[i][col];\n }\n }\n ans[row][3] += this.values[row][3];\n }\n return new Transform(ans);\n }", "public Polynomial operate(){\n Polynomial result = a.multiplyPolynomial(b);\n return result;\n }", "public interface AbsonComposer<T extends AbsonDecomposable> {\n\t/**\n\t * Composes an object of type T, given the AbsonObject which \n\t * was presumably created from the same classes' decompose\n\t * function.\n\t * @param abson The AbsonObject which contains the data to compose.\n\t * @return The composed object.\n\t */\n\tT compose(AbsonObject abson);\n}", "static void m11180a(List<Component<?>> list) {\n Set<C3246b> c = m11182c(list);\n Set<C3246b> b = m11181b(c);\n int i = 0;\n while (!b.isEmpty()) {\n C3246b next = b.iterator().next();\n b.remove(next);\n i++;\n for (C3246b next2 : next.mo20820d()) {\n next2.mo20823g(next);\n if (next2.mo20822f()) {\n b.add(next2);\n }\n }\n }\n if (i != list.size()) {\n ArrayList arrayList = new ArrayList();\n for (C3246b next3 : c) {\n if (!next3.mo20822f() && !next3.mo20821e()) {\n arrayList.add(next3.mo20819c());\n }\n }\n throw new DependencyCycleException(arrayList);\n }\n }", "public Composite gcd(Composite comp) {\n\t\tint pow = 0;\n\t\tNode head = new Node(0,0);\n\t\tNode divisor = head;\n\t\tNode current_node = this.head;\n\t\tNode first = comp.head;\n\t\tNode comp_head = first;\n\t\twhile(current_node != null){\n\t\t\twhile(comp.head != null){\n\t\t\t\tif(current_node.factor == comp.head.factor){\n\t\t\t\t\tif(current_node.power > comp.head.power){\n\t\t\t\t\t\tpow = comp.head.power;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tpow = current_node.power;\n\t\t\t\t\t}\n\t\t\t\t\tdivisor.next = new Node(current_node.factor, pow);\n\n\t\t\t\t\tdivisor = divisor.next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcomp.head = comp.head.next;\n\t\t\t}\n\t\t\tcomp.head = comp_head;\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\tComposite head_comp = new Composite();\n\t\tif(head.next == null){\n\t\t\thead_comp.head = new Node(1,1);\n\t\t}\n\t\telse{\n\t\t\thead_comp.head = head.next;\n\t\t}\n\t\tcomp.head = first;\n\t\treturn head_comp;\n\t}", "static void _cpmvMergeResult(Object result_, Vector vresult_)\r\n {\r\n if (result_ == null) return;\r\n if (result_ instanceof Component || result_ instanceof Port)\r\n vresult_.addElement(result_);\r\n else {\r\n Object[] tmp_ = (Object[])result_;\r\n for (int j=0; j<tmp_.length; j++) vresult_.addElement(tmp_[j]);\r\n }\r\n }", "public final void mCMP() throws RecognitionException\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int _type = AshvmLexer.CMP;\n\t\t\tfinal int _channel = BaseRecognizer.DEFAULT_TOKEN_CHANNEL;\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:717:5: ( 'cmp' )\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:717:7: 'cmp'\n\t\t\t{\n\t\t\t\tthis.match(\"cmp\");\n\n\t\t\t}\n\n\t\t\tthis.state.type = _type;\n\t\t\tthis.state.channel = _channel;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t}\n\t}", "protected ByteBuf compose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next)\r\n/* 41: */ {\r\n/* 42:75 */ if ((cumulation instanceof CompositeByteBuf))\r\n/* 43: */ {\r\n/* 44:76 */ CompositeByteBuf composite = (CompositeByteBuf)cumulation;\r\n/* 45:77 */ composite.addComponent(true, next);\r\n/* 46:78 */ return composite;\r\n/* 47: */ }\r\n/* 48:80 */ return composeIntoComposite(alloc, cumulation, next);\r\n/* 49: */ }", "public static void compose() {\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n source.subscribe(new MyObserver<>());\n return source;\n });\n\n System.out.println(\"# 2\");\n\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n Observable<String> observable = Observable.just(\"composed\");\n observable.subscribe(new MyObserver<>());\n return observable;\n });\n }", "public interface Combine<T> {\n\n public T combineWith(T other);\n\n public void mergeFrom(T other);\n\n}", "@Override\n\tprotected void merge(Object in1, Object in2, Object out) {\n\t\t\n\t}", "public void merge(WModelObject otherObject)\n\t{\n\t\tWCollection collection = null;\n\n\t\t// Check to see if the argument is a WCollection object\n\t\ttry\n\t\t{\n\t\t\tcollection = (WCollection)otherObject;\n\t\t}\n\t\tcatch (ClassCastException exc)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(getClass().getName() + \": Collection objects can only be merged with other Collection objects\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Check to see if the two objects are of the same class\n\t\tClass thisClass = getClass();\n\t\tClass objClass = otherObject.getClass();\n\n\t\tif (thisClass.getName().compareTo(objClass.getName()) != 0)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(thisClass.getName() + \": Cannot compare two different collection objects\");\n\t\t\treturn;\n\t\t}\n\n\t\tWCollection primCollection = new WCollection(thisClass.getName());\t//JFG6.0\n\n\t\tint iObjectCount = this.size();\t\t\t\t\t\t\t//JFG6.0\n\t\tcom.ing.connector.Registrar.logDebugMessage(\"prim object size = \" + iObjectCount);\n\t\tfor (int iCount = 0; iCount < iObjectCount; ++iCount)\t\t\t\t//JFG6.0\n\t\t{\n\t\t\tprimCollection.addElement(this.elementAt(iCount));\t\t\t//JFG6.0\n\t\t\t//com.ing.connector.Registrar.logDebugMessage(\"Entering inside()\");\n\t\t}\n\n primCollection.sort(\"ClassKey\",true);\t\t\t\t\t\t//JFG6.0\n collection.sort(\"ClassKey\",true);\t\t\t\t\t\t\t//JFG6.0\n\n\t\tint iSecObjectCount = collection.size();\n int iStart = 0;\t\t\t\t\t\t\t\t\t\t//JFG6.0\n com.ing.connector.Registrar.logDebugMessage(\"Sec object size = \" + iSecObjectCount);\n\t\tfor (int iSecCount = 0; iSecCount < iSecObjectCount; ++iSecCount)\n\t\t{\n\t\t WModelObject secObject = null;\n\t\t WModelObject primObject = null;\n\n\t\t secObject = collection.elementAt(iSecCount);\n\t\t boolean keyFound = false;\n\n\t\t int iPrimObjectCount = primCollection.size();\n\t\t for (int iPrimCount = iStart; iPrimCount < iPrimObjectCount; ++iPrimCount)\n\t\t {\n\t\t primObject = primCollection.elementAt(iPrimCount);\n\n int iCompare = primObject.compareTo(secObject, \"ClassKey\");\n //com.ing.connector.Registrar.logDebugMessage(\"primObject.compareTo iCompare = \" + iCompare);\n \n\t\t if (iCompare == 0)\n\t\t {\n\t\t\tkeyFound = true;\n\t\t\tcom.ing.connector.Registrar.logDebugMessage(\"prim object and sec object are equal class \" + primObject.getClass().getName());\n\t\t\tprimObject.merge(secObject);\t//LPMO264\n iStart = iPrimCount + 1;\t\t\t\t\t\t\t//JFG6.0\n \n\t\t\tbreak;\n\t\t }\n else\t\t\t\t\t\t\t\t\t\t\t//JFG6.0\n {\n\t\t if (iCompare > 0)\t\t\t\t\t\t\t\t\t//JFG6.0\n\t\t {\n\t\t\t keyFound = false;\t\t\t\t\t\t\t\t//JFG6.0\n iStart = iPrimCount;\t\t\t\t\t\t\t\t//JFG6.0\n \n\t\t break;\t\t\t\t\t\t\t\t\t\t//JFG6.0\n\n }\n }\n\t\t }\n\t\t \n\t\t //com.ing.connector.Registrar.logDebugMessage(\"is keyFound \" + keyFound);\n\t\t if (!keyFound)\n\t\t {\n\t\t addElement(secObject);\n\t\t }\n\t\t}\n\n\t\tprimCollection = null;\t\t\t\t\t\t\t\t\t//JFG6.0\n\n//\t\tint iObjectCount = collection.size();\n//\t\tfor (int iCount = 0; iCount < iObjectCount; ++iCount)\n//\t\t{\n//\t\t\taddElement(collection.elementAt(iCount));\n//\t\t}\n\t}", "void merge();", "private List<ConcurrentRule> makeConcurrentRulesDuetoDependency(\r\n\t\t\tfinal ConcurrentRule cr1, \r\n\t\t\tfinal Rule r2,\r\n\t\t\tfinal Hashtable<?, ?> matchmap) {\n\t\tfinal DependencyPairContainer \r\n\t\tdependencyContainer = this.makeDependencyPairContainer();\r\n\t\tdependencyContainer.enableProduceConcurrentRule(true);\r\n\t\t// if this.completeConcurrency Is false, only max overlapping above nodes will be considered\r\n\t\t// otherwise use all overlappings to create concurrent rules\r\n\t\tdependencyContainer.setCompleteConcurrency(this.completeConcurrency);\r\n\t\t\r\n\t\tList<ConcurrentRule> list = null; \r\n\t\ttry {\r\n\t\t\tVector<Pair<Pair<OrdinaryMorphism, OrdinaryMorphism>, Pair<OrdinaryMorphism, OrdinaryMorphism>>>\r\n\t\t\tcriticalPairs = dependencyContainer.getCriticalPair(cr1.getRule(), r2, CriticalPair.EXCLUDE, true);\r\n\t\t\tif (criticalPairs != null) {\r\n\t\t\t\tlist = dependencyContainer.getConcurrentRules();\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {}\r\n\t\t\r\n\t\tif (list == null) \r\n\t\t\tlist = new Vector<ConcurrentRule>(1);\t\t\r\n\t\r\n\t\tif (this.completeConcurrency) {\r\n\t\t\t// make concurrent rule with disjoint (RHS1+LHS2) of (r1, r2)\t\r\n\t\t\tfinal ConcurrentRule cr = new ConcurrentRule(cr1, r2);\r\n\t\t\tif (cr.getRule() != null) {\r\n\t\t\t\tlist.add(cr);\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t\tfor (int c=0; c<list.size(); c++) {\r\n\t\t\tif (this.completeConcurRuleBackward)\r\n\t\t\t\tlist.get(c).setSecondSourceConcurrentRule(cr1);\r\n\t\t\telse\r\n\t\t\t\tlist.get(c).setFirstSourceConcurrentRule(cr1);\r\n\t\t}\r\n\t\r\n\t\textendRuleNameByIndex(list);\r\n//\t\tSystem.out.println(\"---> ApplicabilityChecker.makeConcurrentRulessDuetoDependency: count: \"+list.size());\r\n\t\treturn list;\r\n\t}", "interface Container2Operation {\r\n \r\n /**\r\n * Evaluates the specific function on two container values possibly modifying <code>result</code>.\r\n * \r\n * @param c1 the first container (must not be modified)\r\n * @param c2 the second container (must not be modified)\r\n * @param result the result (to be modified as a side effect)\r\n */\r\n public void evaluate(ContainerValue c1, ContainerValue c2, List<Value> result);\r\n }", "public static void main(String[] args) throws IOException {\n\t\t\t\n\t\t\tReader.init(System.in);\n\t\t int x=Reader.nextInt();\n\t\t int y=Reader.nextInt();\n\t\t LabUnion1 obj1=new LabUnion1();\n\t\t LabUnion1 obj2=new LabUnion1();\n\t\t LabUnion1 curr1=obj1.header;\n\t\t LabUnion1 curr2=obj2.header;\n\t\t System.out.println(curr1.getLink());\n\t\t for(int i=0;i<x;i++)\n\t\t {\n\t\t \t int n=Reader.nextInt();\n\t\t \t System.out.println(1);\n\t\t \t LabUnion1 element=new LabUnion1(n);\n\t\t \t curr1.setLink(element);\n\t\t \t curr1=curr1.link; \n\t\t }\n\t\t for(int j=0;j<y;j++)\n\t\t {\n\t\t \t int n=Reader.nextInt();\n\t\t \t LabUnion1 element=new LabUnion1(n);\n\t\t \t curr2.setLink(element);\n\t\t \t curr2=curr2.link; \n\t\t }\n\t\t \n\t\t \n\t\t \n\t\t LabUnion1 z=obj1.MergeSort(obj1,obj2);\n\t\t obj1.display();\n\t\t System.out.println(z.comp);\n\t\t \n\t\t}", "public static void main(String[] args) {\n\t\tInteger [] a= {1,4,7, 9, 2};\n\t\tInteger [] b={1,7,3,4,5};\n\t\tArrayList <Integer> c=new ArrayList<Integer>();\n\t\tfor(int i=0;i<a.length;i++)\n\t\t{\n\t\t\tfor(int j=0;j<b.length;j++)\n\t\t\t{\n\t\t\t\tif(a[i]==b[j])\n\t\t\t\t{\n\t\t\t\t\tif(!c.contains(a[i]))\n\t\t\t\t\t{\n\t\t\t\t\t\tc.add(a[i]);\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\tSystem.out.println(\"First Method : \"+c);\n\t\t//second method\n\t\tList<Integer> arr1=Arrays.asList(a);\n\t\tList<Integer> arr2=Arrays.asList(b);\n\t\tHashSet<Integer> aset=new HashSet<>(arr1);\n\t\taset.retainAll(arr2);\n\t\tSystem.out.println(\"Second Method: \"+aset);\n\t\t\n\t}", "public static void main(String[] args) {\n\n\t\tCollection<String> collection1 = new ArrayList<String>();\n\t\tcollection1.add(\"Toronto\");\n\t\tcollection1.add(\"Hamilton\");\n\t\tcollection1.add(\"London\");\n\t\tcollection1.add(\"Ottawa\");\n\t\tcollection1.add(\"Toronto\");\n\t\tSystem.out.println(\"A list of cities in c1 is \" + collection1);\n\t\tSystem.out.println(\" Is hamilton in c1? \" + collection1.contains(\"Hamilton\"));\n\t\tSystem.out.println(\"Size of collection c1 is \" + collection1.size());\n\t\tCollection<String> collection2 = new ArrayList<String>();\n\t\tcollection1.add(\"Vancouver\");\n\t\tcollection1.add(\"Delhi\");\n\t\tcollection1.add(\"chd\");\n\t\tcollection1.add(\"Toronto\");\n\t\tcollection1.addAll(collection2);\n\t\tSystem.out.println(\"combined list is : \" + collection1);\n//\t\tCollection<String> c1 = new ArrayList<String>(collection1);\n//\t\tc1.retainAll(collection2);\n//\t\tSystem.out.println(\"A list of cities in c1 is \" + c1);\n//\t\tc1.removeAll(collection2);\n//\t\tSystem.out.println(\"A list of cities in c1 is \" + c1);\n\t\t\n\t}", "public ArrayList<Object> naturalJoin(ArrayList<Movie> list1, ArrayList<Person> list2)\r\n {\n return new ArrayList<Object>();\r\n }", "Concat createConcat();", "public static void main(String[] args) {\n getList(lista1,m);\n getList(lista2,n);\n Integer[] arr1 = new Integer[lista1.size()];\n lista1.toArray(arr1);\n Integer[] arr2 = new Integer[lista2.size()];\n lista2.toArray(arr2);\n\n m=lista1.size();\n n=lista2.size();\n System.out.println(\"Primul polinom: \");\n printPoly(arr1, m);\n System.out.println(\"\\nAl doilea polinom: \");\n printPoly(arr2, n);\n Integer[] sum = add(arr1, arr2, m, n);\n Integer[] prod = multiply(arr1,arr2,m,n);\n int size = max(m, n);\n System.out.println(\"\\nSuma polinoamelor: \");\n printPoly(sum, size);\n System.out.println(\"\\nProdusul polinoamelor: \");\n printPoly(prod, m+n-1);\n\n }", "@Override\n public Collection<Integer> multiplyPolynomial(Collection<Integer> first,\n Collection<Integer> second) {\n if (first == null || second == null) {\n throw new IllegalArgumentException();\n }\n Integer[] firstPoly = first.toArray(new Integer[first.size()]);\n Integer[] secondPoly = second.toArray(new Integer[second.size()]);\n int sizeOfResult = firstPoly.length + secondPoly.length - 1;\n Integer[] result = Collections.nCopies(sizeOfResult, 0).toArray(new Integer[0]);\n for (int i = 0; i < firstPoly.length; i++) {\n for (int j = 0; j < secondPoly.length; j++) {\n result[i + j] = (result[i + j] + firstPoly[i] * secondPoly[j]);\n }\n }\n boolean isZeros = true;\n for (int i = 0; i < result.length; i++) {\n if (result[i] != 0) {\n isZeros = false;\n break;\n }\n }\n if (isZeros) {\n Integer[] arr = {0};\n List<Integer> res = Arrays.asList(arr);\n return res;\n } else {\n List<Integer> res = Arrays.asList(result);\n return res;\n }\n }", "interface cl {\n void b(List<a> list, List<String> list2);\n}", "public static int bccomp (String _left_operand , String _right_operand, int _scale) {\n//\t\treturn _left_operand.compareTo(_right_operand);\n\t\treturn ZendUtils.natsort(_left_operand, _right_operand);\n\t}", "int getCombine();", "private static <R, I, T> SerializableFunction<R, T> compose(\n SerializableFunction<R, I> f1, SerializableFunction<I, T> f2) {\n return r -> f2.apply(f1.apply(r));\n }", "public static void main(String[] args) {\n\t\tComplejo v[] = new Complejo[5];\r\n\t\tv[0] = new Complejo(1,5);\r\n\t\tv[1] = new Complejo(10,-3);\r\n\t\tv[2] = new Complejo(-1,4);\r\n\t\tv[3] = new Complejo(8,0);\r\n\t\tv[4] = new Complejo(9,3);\r\n\t\t\r\n\t\tfor (Complejo c : v) {\r\n\t\t\tSystem.out.println(c.modulo());\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tArrays.sort(v);\r\n\t\tfor (Complejo c : v) {\r\n\t\t\tSystem.out.println(c.modulo());\t\t\t\r\n\t\t}\r\n\t}", "public static <T> List<T> merge(Collection<T> c1, Collection<T> c2, Comparator<T> cp, boolean allowDup) {\n if (c1 == null || c2 == null) {\n throw new NullPointerException(\"The collections must not be null\");\n }\n if (cp == null) {\n throw new NullPointerException(\"The comparator must not be null\");\n }\n\n List<T> mergedList = new ArrayList<T>(c1.size() + c2.size());\n Iterator<T> iter1 = c1.iterator();\n Iterator<T> iter2 = c2.iterator();\n\n // Use prev pointers to avoid iterator from skipping an element that \n // has not been added to merged list.\n T t1Prev = null;\n T t2Prev = null;\n while (iter1.hasNext() && iter2.hasNext()) {\n T t1 = t1Prev == null ? iter1.next() : t1Prev;\n T t2 = t2Prev == null ? iter2.next() : t2Prev;\n if (t1.equals(t2)) {\n if (allowDup) {\n mergedList.add(t1);\n mergedList.add(t2);\n } else {\n mergedList.add(t1);\n }\n t1Prev = null;\n t2Prev = null;\n } else if (cp.compare(t1, t2) < 0) {\n mergedList.add(t1);\n t1Prev = null;\n t2Prev = t2;\n } else {\n mergedList.add(t2);\n t2Prev = null;\n t1Prev = t1;\n }\n }\n // Process possible remaining elements.\n while (iter1.hasNext()) {\n mergedList.add(iter1.next());\n }\n while (iter2.hasNext()) {\n mergedList.add(iter2.next());\n }\n\n return mergedList;\n }", "public static <T,P> void parallelSort(T[] a, P[] a2, Comparator<T> comp) {\n\t\tif (a.length!=a2.length)\n\t\t\tthrow new IllegalArgumentException(\"Arrays don't have same length!\");\n\t\tsort1(a, a2, comp,0, a.length);\n\t}", "private static <K> void merge(K[] S1, K[] S2, K[] S, Comparator<K> comp, long timeGiven, long startTime) throws TimedOutException {\n if (System.currentTimeMillis() - startTime > timeGiven) {\n throw new TimedOutException(\"TimeOut\");\n }\n int i = 0, j = 0;\n while (i + j < S.length) {\n if (j == S2.length || (i < S1.length && comp.compare(S1[i], S2[j]) > 0)) {\n S[i + j] = S1[i++]; // copy ith element of S1 and increment i\n } else {\n S[i + j] = S2[j++]; // copy jth element of S2 and increment j\n }\n }\n }", "BasicSet NextLClosure(BasicSet M,BasicSet A){\r\n\t\t//ConceptLattice cp=new ConceptLattice(context);\r\n\t\t//ApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\r\n\r\n\t\t\t\tBasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "@Override\n public int compare(Object arg0, Object arg1) {\n int a = arg0.hashCode();\n int b = arg1.hashCode();\n int accum;\n if (a == b) {\n accum = 0;\n } else if (a > b) {\n accum = 1;\n } else {\n accum = -1;\n }\n return accum;\n }", "static boolean GeneralComp(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"GeneralComp\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = EqualityComp(b, l + 1);\n if (!r) r = RelationalComp(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public static <T> Comparator<T> chain(final List<Comparator<? super T>> c) {\n return new Comparator<T>() {\n public int compare(T o1, T o2) {\n int x = 0;\n Iterator<Comparator<? super T>> it = c.iterator();\n while (x == 0 && it.hasNext()) {\n x = it.next().compare(o1, o2);\n }\n return x;\n }\n };\n }", "@Test\r\n public void testCompliment1() {\r\n int actual[] = set1.getComplement();\r\n Assert.assertArrayEquals(new int[] { 100, 200, 456, 234, 890, 990, 100,\r\n 210, 500, 700, 900 }, actual);\r\n }", "public static <T,P> void parallelSort(T[] a, int[] a2, Comparator<T> comp) {\n\t\tif (a.length!=a2.length)\n\t\t\tthrow new IllegalArgumentException(\"Arrays don't have same length!\");\n\t\tsort1(a, a2, comp,0, a.length);\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tInteger[] arr1 = {1,2,3,4,5};\r\n\t\tInteger[] arr2 = {10,20,30,40,50};\r\n\t\t\r\n\t\t\r\n//\t}\r\n\t\r\n//\tpublic static (ArrayList<Integer> list1, ArrayList<Integer> list2) {\r\n//\t\tInteger[] combine = new Integer[list1.size()+list2.size()];\r\n//\t\tfor(Integer i=0; i<list1.size(); i++) {\r\n//\t\t\tcombine[i] = list1<Integer>;\r\n//\t\t\t\r\n//\t\t}\r\n//\t\t\t\r\n\t\t\t\r\n\t//\t}\r\n\t\t\r\n\t\t\r\n\t\treturn;\r\n\t}", "private static boolean compareList(List<Object> l1, List<Object> l2)\n {\n int count=0;\n for (Object o : l1)\n {\n Object temp = o;\n for (Object otemp : l2)\n {\n if (EqualsBuilder.reflectionEquals(temp, otemp))\n {\n count++;\n }\n }\n\n }\n\n if(count == l1.size()) return true;\n return false;\n\n }", "public ComplementOp() {\r\n\t\tsuper();\r\n\t}", "@Override\n public int compare(T a, T b) {\n for (Comparator<T> comparator : comparators) {\n int cmp = comparator.compare(a, b);\n\n if (cmp != 0) {\n return cmp;\n }\n }\n return 0;\n }", "public static List<Integer> multiply(List<Integer> a1, List<Integer> a2) {\n if (a1.size() == 1 && a1.get(0) == 0\n || a2.size() == 1 && a2.get(0) == 0) {return Arrays.asList(0);}\n\n Integer[] arr = new Integer[a1.size() + a2.size()];\n Arrays.fill(arr, 0);\n List<Integer> res = Arrays.asList(arr);\n List<Integer> res2 = new ArrayList<>();\n\n Collections.reverse(a1);\n Collections.reverse(a2);\n\n for (int i = 0; i < a1.size(); i++) {\n for (int j = 0; j < a2.size(); j++) {\n res.set(i + j, res.get(i + j) + a1.get(i) * a2.get(i));\n res.set(i + j + 1, res.get(i + j + 1) + res.get(i + j) / 10);\n res.set(i + j, res.get(i + j) % 10);\n }\n }\n\n Collections.reverse(res);\n\n for (int i = 0; i < res.size(); i++) {\n if (res.get(i) != 0) {\n res2.add(res.get(i));\n }\n }\n\n return res2;\n }", "public int comp(Integer x1, Integer x2, int num) {\n int x = (int) x1;\n int y = (int) x2;\n switch (num) {\n case 1:\n return x2 + x1;\n case 2:\n return x2 - x1;\n case 3:\n return x2 * x1;\n case 4:\n return x2 / x1;\n default:\n return Integer.MAX_VALUE;\n }\n }", "public Collect_result(Collect_result other) {\r\n }", "public static <T,O> void parallelSort(List<T> a, List<O> a2, Comparator<T> cmp) {\n\t\tif (a.size()!=a2.size())\n\t\t\tthrow new IllegalArgumentException(\"Arrays don't have same length!\");\n\t\tsort1(a, a2, cmp, 0, a.size());\n\t}", "public static void main(String[] args) {\n\t\tint[] a = {-1,0,0,3,3,3,0,0,0};\n\t\tint[] b = {1,2,2};\n\t\tmerge(a,6, b,3);\n\t\tfor(int i=0;i<a.length;i++) {\n\t\tSystem.out.println(a[i]);}\n\t}", "Boolean same(MapComp<K, V> m);", "public static void main(String[] args) {\n List<Integer> list1 = new ArrayList<>();\n List<Integer> list2 = new ArrayList<>();\n list1.add(2);\n list1.add(3);\n list1.add(4);\n list2.add(1);\n list2.add(5);\n list2.add(6);\n merge(list1, list2).forEach(item -> System.out.print(item + \" \"));\n }", "public static void main(String[] args) {\n\t\tLL l1 = new LL();\n\t\tLL l2 = new LL();\n\t\tl1.insert(15);\n\t\tl1.insert(25);\n\t\tl1.insert(35);\n\t\tl1.insert(45);\n\t\tl1.insert(55);\n\t\t\n\t\tl2.insert(10);\n\t\tl2.insert(17);\n\t\tl2.insert(35);\n\t\tl2.insert(47);\n\t\tl2.insert(11);\n\t \t\n\t\t\n//\t\tl1.print();\n//\t\tl2.print();\n\t\t\n\t\tSystem.out.println(getIntersection(l1.head,l2.head));\n\t\t\n\t}", "private void linkComponents(List<Set<Factor>> components,\n Set<Factor> factors) {\n // The first component should be the biggest one. All other factors\n // should be linked to the first components randomly\n Set<Factor> first = components.get(0);\n for (int i = 1; i < components.size(); i++) {\n Set<Factor> second = components.get(i);\n Variable var1 = pickUpVar(first);\n Variable var2 = pickUpVar(second);\n Factor factor = createEqualFactor(var1, var2);\n factors.add(factor);\n }\n }", "public static <C> LIST<C> LIST2(C a, C b) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public List<OperationComptable> getListOperationsComptables(Date date1, Date date2) {\n\t\treturn null;\n\t}", "public void sort() {\n if(c==null) {\n int middle;\n\n Comparable[] left, right;\n\n\n if (unsorted.length <= 1) {\n\n sorted = unsorted;\n\n } else {\n\n middle = unsorted.length / 2;\n\n\n left = new Comparable[middle];\n\n right = new Comparable[unsorted.length - middle];\n\n\n System.arraycopy(unsorted, 0, left, 0, middle);\n\n System.arraycopy(unsorted, middle, right, 0, unsorted.length - middle);\n\n\n // Внимание! Опа, рекурсия :)\n\n SimpleMerger leftSort = new SimpleMerger(left, c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n sorted = merge(leftSort.getSorted(), rightSort.getSorted());\n\n }\n }else{\n\n int middle;\n\n Object[] left, right;\n\n\n if (unsorted2.length <= 1) {\n\n sorted2 = unsorted2;\n\n } else {\n\n middle = unsorted2.length / 2;\n\n\n left = new Object[middle];\n\n right = new Object[unsorted2.length - middle];\n System.arraycopy(unsorted2, 0, left, 0, middle);\n\n System.arraycopy(unsorted2, middle, right, 0, unsorted2.length - middle);\n\n\n\n\n SimpleMerger leftSort = new SimpleMerger(left,c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n\n sorted2 = merge2(leftSort.getSorted2(), rightSort.getSorted2());\n\n }\n\n }\n }", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "@Test\n\tvoid test2ConstructorWithList() {\n\t\t// comp1.setHeight(500); this is now component 4\n\t\tlistItems.add(comp1);\n\t\t// comp3.setWidth(678); now component 5\n\t\tlistItems.add(comp2);\n\t\tlistItems.add(comp3);\n\t\tlistItems.add(comp4);\n\t\tlistItems.add(comp5);\n\t\tvc = new VerticalComponentList(x, y, listItems,0);\n\t\tassertEquals(comp5, vc.getComponentsList().get(4));\n\t\tassertTrue(this.x == vc.getX() && this.y == vc.getY() && 678 == vc.getWidth()\n\t\t\t\t&& (comp1.getHeight() + comp2.getHeight() + comp3.getHeight()) + comp4.getHeight()\n\t\t\t\t\t\t+ comp5.getHeight() == vc.getHeight());\n\t}", "protected abstract int doCompare(Object o1, Object o2);", "public static ArrayList<String> joinArrayLists(ArrayList<String> EqList, ArrayList<String> sshList){\n\n\t\t\t\n\t\t\tArrayList<Integer> counteq = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> countssh = new ArrayList<Integer>();\n\t\t\t\n\t\t\tList<String> split1 = new ArrayList<String>();\n\t\t\tList<String> split2 = new ArrayList<String>();\n\t\t\t\n\t\t\tArrayList<String> combine = new ArrayList<String>();\n\t\t\t\n\t\t\t//Checks how many object exist in arrayList and addes their index to a new list\n\t\t\tfor(int i = 0;i<EqList.size();i++){\n\t\t\t\tif(EqList.get(i) == \"Object\"){\n\t\t\t\t\tcounteq.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int j = 0;j<sshList.size();j++){\n\t\t\t\tif(sshList.get(j) == \"Object\"){\n\t\t\t\t\tcountssh.add(j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//The size of the matrices must be equal. If it is 1, removes the ID and object index from the second matrix and addes it to the first arrayList\n\t\t\tif(counteq.size() == countssh.size()){\n\t\t\t\tif(counteq.size() == 1){\n\t\t\t\t\tif(EqList.get(1).equals(sshList.get(1))){\n\t\t\t\t\t\tEqList.remove(0);\n\t\t\t\t\t\tsshList.remove(0);\n\t\t\t\t\t\tsshList.remove(0);\n\t\t\t\t\t\tcombine.addAll(EqList);\n\t\t\t\t\t\tcombine.addAll(sshList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Based on the IDs of both lists, it splits both lists on the specified index and addes the two parts to the new combined matrix\n\t\t\t\t\t//The indexes are taken from the specified matrices counteq and countssh\n\t\t\t\t\tcounteq.add(EqList.size());\n\t\t\t\t\tcountssh.add(sshList.size());\n\t\t\t\t\tfor(int i = 0;i<counteq.size()-1;i++){\n\t\t\t\t\t\tfor(int j = 0;j<countssh.size()-1;j++){\n\t\t\t\t\t\t\tif(EqList.get(counteq.get(i)+1).equals(sshList.get(countssh.get(j)+1))){\n\n\t\t\t\t\t\t\t\t\tsplit1 = EqList.subList(counteq.get(i),counteq.get(i+1));\n\t\t\t\t\t\t\t\t\tsplit2 = sshList.subList(countssh.get(j)+2,countssh.get(j+1));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcombine.addAll(split1);\n\t\t\t\t\t\t\t\t\tcombine.addAll(split2);\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}\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Error! Arraylists size not the same. Please check the data\");\n\t\t\t\n\t\t\t//If any remaining object indexes are left, remove them\n\t\t\tfor(int i = 0;i<combine.size();i++){\n\t\t\t\tif(combine.get(i) == \"Object\"){\n\t\t\t\t\tcombine.remove(i);\n\t\t\t\t\ti=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn combine;\n\t\t}", "public Merge() {\r\n this.listsOfSorted = new LinkedList<>();\r\n\r\n }", "static List<MeanWithClusterProbAggregator> reduce(List<MeanWithClusterProbAggregator> l,\n List<MeanWithClusterProbAggregator> r) {\n A.ensure(l != null || r != null, \"Both partitions cannot equal to null\");\n\n if (l == null || l.isEmpty())\n return r;\n if (r == null || r.isEmpty())\n return l;\n\n A.ensure(l.size() == r.size(), \"l.size() == r.size()\");\n List<MeanWithClusterProbAggregator> res = new ArrayList<>();\n for (int i = 0; i < l.size(); i++)\n res.add(l.get(i).plus(r.get(i)));\n\n return res;\n }", "@Override\r\n protected void compute() {\r\n //if count != 0 || splitA.length == 1 then go, else for loop to make splitA.length subtasks to run splitArrayB and then they all call mergeAB\r\n if(global_count == 0){\r\n splitArrayB();\r\n }\r\n if(global_count != 0 || splitA.length == 1){\r\n mergeAB();\r\n }\r\n else{\r\n List<ConcurrentMerge> subtasks = new ArrayList<>();\r\n ConcurrentMerge temp;\r\n for(int i = 0; i < splitA.length; i++){\r\n global_count++;\r\n temp = new ConcurrentMerge(A, B, splitA, splitB, C, global_count);\r\n subtasks.add(temp);\r\n }\r\n invokeAll(subtasks);\r\n }\r\n }", "public static Comparator method_1282(Collection var0) {\n return method_1281((Comparator[])((Comparator[])var0.toArray(new Comparator[var0.size()])));\n }", "private Proof impossibility(Expression a, Expression b) {\n Proof axm1 = axm1(a, b); //a -> b -> a\n Proof contra = contra(b, a); //(b -> a) -> (!a -> !b)\n return implTrans(axm1, contra);//a -> !a -> !b\n }", "static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {\n\n List<Integer> result = new ArrayList<Integer>(2);\n result.add(0, 0);\n result.add(1, 0);\n for (int i = 0; i < a.size(); i++) {\n if (a.get(i) > b.get(i)) {\n result.set(0, result.get(0) + 1);\n } else if (a.get(i) < b.get(i)) {\n result.set(1, result.get(1) + 1);\n } else if (a.get(i) == b.get(i)) {\n result.set(0, result.get(0) + 1);\n result.set(1, result.get(1) + 1);\n }\n }\n return result;\n }", "public interface Transformer {\n\t/**\n\t * \n\t * @param srcComp an instance of the old version component\n\t * @param targetComp and instance of the new version component\n\t * @return\n\t */\n\tpublic boolean transform(Object srcComp, Object targetComp);\n\n}", "public static void main(String[] args) {\n IComplex a = new Complex(5.0, 6.0);\n\n IComplex b = new Complex(-3.0, 4.0);\n\n System.out.println(\"a = \" + a);\n System.out.println(\"b = \" + b);\n System.out.println(\"Re(a) = \" + a.re());\n System.out.println(\"Im(a) = \" + a.im());\n System.out.println(\"b + a = \" + b.plus(a));\n System.out.println(\"a - b = \" + a.minus(b));\n System.out.println(\"a * b = \" + a.times(b));\n System.out.println(\"b * a = \" + b.times(a));\n System.out.println(\"a / b = \" + a.divides(b));\n System.out.println(\"(a / b) * b = \" + a.divides(b).times(b));\n System.out.println(\"conj(a) = \" + a.conjugate());\n System.out.println(\"|a| = \" + a.abs());\n System.out.println(\"tan(a) = \" + a.tan());\n System.out.println(\"b + a = \" + Complex.plus(a,b));\n }", "public Cooperation createCooperation(Process lhs, Process rhs,\n ActionSet actions) {\n CooperationImpl cooperation = new CooperationImpl();\n cooperation.setLeftHandSide(lhs);\n cooperation.setRightHandSide(rhs);\n cooperation.setActionSet(actions);\n return cooperation;\n }", "public void a(List<cvm> paramList)\r\n/* 73: */ {\r\n/* 74: 79 */ b();\r\n/* 75: */ \r\n/* 76: 81 */ a.info(\"Reloading ResourceManager: \" + b.join(Iterables.transform(paramList, new cvu(this))));\r\n/* 77: 88 */ for (cvm localcvm : paramList) {\r\n/* 78: 89 */ a(localcvm);\r\n/* 79: */ }\r\n/* 80: 92 */ c();\r\n/* 81: */ }", "public void evaluate(ContainerValue c1, ContainerValue c2, List<Value> result);", "public boolean compareObjects(Object object1, Object object2, AbstractSession session) {\n Object firstCollection = getRealCollectionAttributeValueFromObject(object1, session);\n Object secondCollection = getRealCollectionAttributeValueFromObject(object2, session);\n ContainerPolicy containerPolicy = getContainerPolicy();\n\n if (containerPolicy.sizeFor(firstCollection) != containerPolicy.sizeFor(secondCollection)) {\n return false;\n }\n\n if (containerPolicy.sizeFor(firstCollection) == 0) {\n return true;\n }\n Object iterFirst = containerPolicy.iteratorFor(firstCollection);\n Object iterSecond = containerPolicy.iteratorFor(secondCollection);\n\n //loop through the elements in both collections and compare elements at the\n //same index. This ensures that a change to order registers as a change.\n while (containerPolicy.hasNext(iterFirst)) {\n //fetch the next object from the first iterator.\n Object firstAggregateObject = containerPolicy.next(iterFirst, session);\n Object secondAggregateObject = containerPolicy.next(iterSecond, session);\n\n //fetch the next object from the second iterator.\n //matched object found, break to outer FOR loop\t\t\t\n if (!getReferenceDescriptor().getObjectBuilder().compareObjects(firstAggregateObject, secondAggregateObject, session)) {\n return false;\n }\n }\n return true;\n }" ]
[ "0.6101663", "0.6070566", "0.5877071", "0.5872279", "0.5499033", "0.5468141", "0.5381728", "0.5342602", "0.52525645", "0.5249411", "0.5186162", "0.51689583", "0.5099442", "0.50707626", "0.5041345", "0.5030202", "0.5023685", "0.5000756", "0.49871615", "0.49679995", "0.4967619", "0.49657598", "0.49452195", "0.49354988", "0.49302468", "0.4902757", "0.48971802", "0.48724487", "0.48718852", "0.4864635", "0.48488587", "0.48366565", "0.4819171", "0.48068866", "0.47969997", "0.47882327", "0.47866112", "0.47766", "0.4774181", "0.47633833", "0.47499987", "0.47118816", "0.47017688", "0.46973133", "0.46953008", "0.4691317", "0.46887043", "0.46824804", "0.468155", "0.46793896", "0.4679126", "0.46775946", "0.4677326", "0.46682686", "0.46663076", "0.4666251", "0.4661932", "0.46610132", "0.46491817", "0.46352312", "0.46298975", "0.46273914", "0.46231064", "0.46199724", "0.46162197", "0.46155372", "0.4613623", "0.4610583", "0.4609876", "0.46089536", "0.4598371", "0.45917404", "0.45861727", "0.45860052", "0.45847914", "0.4584728", "0.4581028", "0.4569656", "0.4568146", "0.45656765", "0.45493647", "0.4547974", "0.45390588", "0.453879", "0.45376462", "0.4536002", "0.4519575", "0.45191216", "0.45188326", "0.4517109", "0.45122272", "0.4509596", "0.45043358", "0.4496608", "0.44937158", "0.44935325", "0.44928485", "0.4490637", "0.44904327", "0.44894218" ]
0.6768915
0
Composition 3. a1, a2 and a3 are objects. L is a list. M=COMP(a1,COMP(a2,COMP(a3,L))).
public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) { LIST<C> LP = L; if ( L == null ) { LP = new LIST<C>(); } LP.list.addFirst( c ); LP.list.addFirst( b ); LP.list.addFirst( a ); return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "T compose(AbsonObject abson);", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "IVec3 mult(IVec3 v);", "private static <T> int med3(List<T> x, Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x.get(a),x.get(b))<0 ?\n\t\t\t\t(comp.compare(x.get(b),x.get(c))<0 ? b : comp.compare(x.get(a),x.get(c))<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x.get(b),x.get(c))>0 ? b : comp.compare(x.get(a),x.get(c))>0 ? c : a));\n\t}", "public static /* synthetic */ int m28133a(List list, Object obj, Comparator comparator, int i, int i2, int i3, Object obj2) {\n if ((i3 & 4) != 0) {\n i = 0;\n }\n if ((i3 & 8) != 0) {\n i2 = list.size();\n }\n return m28132a(list, (T) obj, comparator, i, i2);\n }", "private void instantiateThirdVar(IntVar var1, int coeff1, IntVar var2, int coeff2, IntVar var3, int coeff3, int constant, Propagator prop) throws ContradictionException {\n IntIterableRangeSet possibleValues3 = new IntIterableRangeSet();\n int lb3 = var3.getLB();\n DisposableValueIterator iterator1 = var1.getValueIterator(true);\n while(iterator1.hasNext()){\n int v1 = iterator1.next();\n int updatedConstant = zpz.sub(constant,\n zpz.mul(zpz.repr(v1),coeff1));\n DisposableValueIterator iterator2 = var2.getValueIterator(true);\n while(iterator2.hasNext()){\n int v2 = iterator2.next();\n possibleValues3.add(zpz.getSmallestGreaterEqThan(lb3, zpz.div(zpz.sub(updatedConstant,\n zpz.mul(zpz.repr(v2),coeff2)),\n coeff3)));\n }\n }\n var3.removeAllValuesBut(possibleValues3, prop);\n }", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public Matrix3f(Matrix3f m1) {\n\t\n \tm00 = m1.m00; m01 = m1.m01; m02 = m1.m02;\n \tm10 = m1.m10; m11 = m1.m11; m12 = m1.m12;\n \tm20 = m1.m20; m21 = m1.m21; m22 = m1.m22;\n }", "public AffineTransform3D(double M11, double M12, double M13, double M14,\r\n\t\t\tdouble M21, double M22, double M23, double M24, double M31,\r\n\t\t\tdouble M32, double M33, double M34, double M41, double M42,\r\n\t\t\tdouble M43, double M44) {\r\n\t\tthis.M11 = M11;\r\n\t\tthis.M12 = M12;\r\n\t\tthis.M13 = M13;\r\n\t\tthis.M14 = M14;\r\n\t\tthis.M21 = M21;\r\n\t\tthis.M22 = M22;\r\n\t\tthis.M23 = M23;\r\n\t\tthis.M24 = M24;\r\n\t\tthis.M31 = M31;\r\n\t\tthis.M32 = M32;\r\n\t\tthis.M33 = M33;\r\n\t\tthis.M34 = M34;\r\n\t\tthis.M41 = M41;\r\n\t\tthis.M42 = M42;\r\n\t\tthis.M43 = M43;\r\n\t\tthis.M44 = M44;\r\n\t}", "static void m11180a(List<Component<?>> list) {\n Set<C3246b> c = m11182c(list);\n Set<C3246b> b = m11181b(c);\n int i = 0;\n while (!b.isEmpty()) {\n C3246b next = b.iterator().next();\n b.remove(next);\n i++;\n for (C3246b next2 : next.mo20820d()) {\n next2.mo20823g(next);\n if (next2.mo20822f()) {\n b.add(next2);\n }\n }\n }\n if (i != list.size()) {\n ArrayList arrayList = new ArrayList();\n for (C3246b next3 : c) {\n if (!next3.mo20822f() && !next3.mo20821e()) {\n arrayList.add(next3.mo20819c());\n }\n }\n throw new DependencyCycleException(arrayList);\n }\n }", "private static Atom[] getCAAtoms(Point3d[] points) {\n\n\t\tChain c = new ChainImpl();\n\t\tc.setId(\"A\");\t\n\n\t\t// create dummy BioJava atoms for each C-alpha coordinate\n\t\tAtom[] atoms = new Atom[points.length];\n\n\t\tfor (int i = 0; i < points.length; i++) {\n\t\t\tatoms[i] = new AtomImpl();\n\t\t\tatoms[i].setName(CA_NAME);\n\t\t\tGroup g = new AminoAcidImpl();\n\t\t\tg.setPDBName(GROUP_NAME);\n\t\t\tg.setResidueNumber(\"A\", i, ' ');\n\t\t\tg.addAtom(atoms[i]);\n\t\t\tc.addGroup(g);\n\n\t\t\tatoms[i].setX(points[i].x);\n\t\t\tatoms[i].setY(points[i].y);\n\t\t\tatoms[i].setZ(points[i].z);\n\t\t}\n\n\t\treturn atoms;\n\t}", "private static ExpSem apply(ExpSem exp1, ExpSem exp2, ExpSem exp3,\n TriFunction<Value,Value,Value,Value> fun)\n {\n if (exp1 instanceof ExpSem.Single &&\n exp2 instanceof ExpSem.Single &&\n exp3 instanceof ExpSem.Single)\n {\n ExpSem.Single e1 = (ExpSem.Single)exp1;\n ExpSem.Single e2 = (ExpSem.Single)exp2;\n ExpSem.Single e3 = (ExpSem.Single)exp3;\n return (ExpSem.Single)(Context c)->\n {\n Value v1 = e1.apply(c);\n Value v2 = e2.apply(c);\n Value v3 = e3.apply(c);\n return fun.apply(v1, v2, v3);\n };\n }\n else\n {\n ExpSem.Multiple e1 = exp1.toMultiple();\n ExpSem.Multiple e2 = exp2.toMultiple();\n ExpSem.Multiple e3 = exp3.toMultiple();\n return (ExpSem.Multiple)(Context c)->\n {\n Seq<Value> s1 = e1.apply(c);\n Seq<Value> s2 = e2.apply(c);\n Seq<Value> s3 = e3.apply(c);\n return \n s1.applyJoin((Value v1)->\n s2.applyJoin((Value v2)->\n s3.apply((Value v3)->fun.apply(v1,v2,v3))));\n };\n }\n }", "private void computeMultiClassMCC(ConfusionMatrixElement[] elements) {\n\t\tdouble Sq = matrixTotal * matrixTotal;\n\t\tdouble CS = Arrays.stream(elements).map(n -> n.tp).reduce(0.0d, (n, m) -> n + m) * matrixTotal;\n\t\tdouble t = 0.0d, p = 0.0d, tt = 0.0d, pp = 0.0d, tp = 0.0d;\n\t\t\n\t\tfor (ConfusionMatrixElement e : elements) {\n\t\t\tt = (e.tp + e.fp); \n\t\t\tp = (e.tp + e.fn);\n\t\t\t\n\t\t\ttt += (t * t);\n\t\t\tpp += (p * p);\n\t\t\ttp += (t * p);\n\t\t}\n\t\tmatrixMCC = (CS - tp) / (Math.sqrt(Sq - pp) * Math.sqrt(Sq - tt));\n\t}", "public static <C> LIST<C> LIST3(C a, C b, C c) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public final void normalizeCP(Matrix3f m1) {\n\tset(m1);\n\tnormalizeCP();\n }", "public static void compose() {\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n source.subscribe(new MyObserver<>());\n return source;\n });\n\n System.out.println(\"# 2\");\n\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n Observable<String> observable = Observable.just(\"composed\");\n observable.subscribe(new MyObserver<>());\n return observable;\n });\n }", "public ArrayList<C0252a> m1289a(ac acVar, int i, int i2, int i3) {\r\n int i4;\r\n double d = this.f759h[this.f758g];\r\n int e = (int) ((acVar.m827e() - this.f754c) / (256.0d * d));\r\n double d2 = this.f754c + (((double) (e * 256)) * d);\r\n double d3 = 0.0d;\r\n int f;\r\n if (this.f753b == 0) {\r\n f = (int) ((this.f755d - acVar.m828f()) / (256.0d * d));\r\n d3 = this.f755d - (((double) (f * 256)) * d);\r\n i4 = f;\r\n } else if (this.f753b == 1) {\r\n f = (int) ((acVar.m828f() - this.f755d) / (256.0d * d));\r\n d3 = ((double) ((f + 1) * 256)) * d;\r\n i4 = f;\r\n } else {\r\n i4 = 0;\r\n }\r\n PointF a = m1286a(new ac(d3, d2, false), acVar, this.f763l, d);\r\n C0252a c0252a = new C0252a(e, i4, this.f758g, -1);\r\n c0252a.f1050f = a;\r\n ArrayList<C0252a> arrayList = new ArrayList();\r\n arrayList.add(c0252a);\r\n int i5 = 1;\r\n while (true) {\r\n int i6;\r\n Object obj = null;\r\n for (i6 = e - i5; i6 <= e + i5; i6++) {\r\n Object obj2;\r\n int i7 = i4 + i5;\r\n PointF a2 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a2 != null) {\r\n if (obj == null) {\r\n obj2 = 1;\r\n } else {\r\n obj2 = obj;\r\n }\r\n C0252a c0252a2 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a2.f1050f = a2;\r\n arrayList.add(c0252a2);\r\n obj = obj2;\r\n }\r\n i7 = i4 - i5;\r\n PointF a3 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a3 != null) {\r\n if (obj == null) {\r\n obj = 1;\r\n }\r\n C0252a c0252a3 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a3.f1050f = a3;\r\n arrayList.add(c0252a3);\r\n }\r\n }\r\n for (i7 = (i4 + i5) - 1; i7 > i4 - i5; i7--) {\r\n i6 = e + i5;\r\n a2 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a2 != null) {\r\n if (obj == null) {\r\n obj2 = 1;\r\n } else {\r\n obj2 = obj;\r\n }\r\n c0252a2 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a2.f1050f = a2;\r\n arrayList.add(c0252a2);\r\n obj = obj2;\r\n }\r\n i6 = e - i5;\r\n a3 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a3 != null) {\r\n if (obj == null) {\r\n obj = 1;\r\n }\r\n c0252a3 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a3.f1050f = a3;\r\n arrayList.add(c0252a3);\r\n }\r\n }\r\n if (obj == null) {\r\n return arrayList;\r\n }\r\n i5++;\r\n }\r\n }", "public interface AbsonComposer<T extends AbsonDecomposable> {\n\t/**\n\t * Composes an object of type T, given the AbsonObject which \n\t * was presumably created from the same classes' decompose\n\t * function.\n\t * @param abson The AbsonObject which contains the data to compose.\n\t * @return The composed object.\n\t */\n\tT compose(AbsonObject abson);\n}", "IVec3 cross(IVec3 v);", "@Test\n public void testCyclicalIdentity() {\n Vector a = Vector.of(Variable.of(\"a1\"), Variable.of(\"a2\"), Variable.of(\"a3\"));\n Vector b = Vector.of(Variable.of(\"b1\"), Variable.of(\"b2\"), Variable.of(\"b3\"));\n Vector c = Vector.of(Variable.of(\"c1\"), Variable.of(\"c2\"), Variable.of(\"c3\"));\n Vector lhs = a.cross(b).cross(c);\n lhs = lhs.simplify();\n Vector rhs = b.times(a.dot(c)).plus(a.times(b.dot(c)).times(Constant.MINUS_ONE));\n rhs = rhs.simplify();\n Assert.assertEquals(lhs.getValues()[0], rhs.getValues()[0]);\n Assert.assertEquals(lhs.getValues()[1], rhs.getValues()[1]);\n Assert.assertEquals(lhs.getValues()[2], rhs.getValues()[2]);\n Assert.assertEquals(lhs, rhs);\n }", "private HashMap<ComparableExpression, HashSet<ComparableExpression>> composition(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rel1,\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rel2) {\n\n HashMap<ComparableExpression, HashSet<ComparableExpression>> newRel = new HashMap<>();\n // (a,b) in rel1, (b,c) in rel2 => put (a,c) into newRel\n for (Map.Entry<ComparableExpression, HashSet<ComparableExpression>> r1 : rel1.entrySet()) {\n ComparableExpression key = r1.getKey();\n for (ComparableExpression oldValue : r1.getValue()) {\n // transitive relation?\n if (rel2.containsKey(oldValue)) {\n HashSet<ComparableExpression> newValues = rel2.get(oldValue);\n newRel.putIfAbsent(key, new HashSet<>());\n newRel.get(key).addAll(newValues);\n }\n }\n }\n return newRel;\n }", "private void add3(int[] x3, int[] z3, int[] x2, int[] z2, int[] x1, int[] z1, int[] x, int[] z) {\r\n\t\tint[] t = fieldTX;\r\n\t\tint[] u = fieldTZ;\r\n\t\tint[] v = fieldUX;\r\n\t\tint[] w = fieldUZ;\r\n\t\tSubtractBigNbrModN(x2, z2, v, TestNbr, NumberLength); // v = x2-z2\r\n\t\tAddBigNbrModN(x1, z1, w, TestNbr, NumberLength); // w = x1+z1\r\n\t\tMontgomeryMult(v, w, u); // u = (x2-z2)*(x1+z1)\r\n\t\tAddBigNbrModN(x2, z2, w, TestNbr, NumberLength); // w = x2+z2\r\n\t\tSubtractBigNbrModN(x1, z1, t, TestNbr, NumberLength); // t = x1-z1\r\n\t\tMontgomeryMult(t, w, v); // v = (x2+z2)*(x1-z1)\r\n\t\tAddBigNbrModN(u, v, t, TestNbr, NumberLength); // t = 2*(x1*x2-z1*z2)\r\n\t\tMontgomeryMult(t, t, w); // w = 4*(x1*x2-z1*z2)^2\r\n\t\tSubtractBigNbrModN(u, v, t, TestNbr, NumberLength); // t =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2*(x2*z1-x1*z2)\r\n\t\tMontgomeryMult(t, t, v); // v = 4*(x2*z1-x1*z2)^2\r\n\t\tif (BigNbrAreEqual(x, x3)) {\r\n\t\t\tSystem.arraycopy(x, 0, u, 0, NumberLength);\r\n\t\t\tSystem.arraycopy(w, 0, t, 0, NumberLength);\r\n\t\t\tMontgomeryMult(z, t, w);\r\n\t\t\tMontgomeryMult(v, u, z3);\r\n\t\t\tSystem.arraycopy(w, 0, x3, 0, NumberLength);\r\n\t\t} else {\r\n\t\t\tMontgomeryMult(w, z, x3); // x3 = 4*z*(x1*x2-z1*z2)^2\r\n\t\t\tMontgomeryMult(x, v, z3); // z3 = 4*x*(x2*z1-x1*z2)^2\r\n\t\t}\r\n\t}", "private static <T> int med3(T x[], Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "public static Collection<ConstraintsPair[]> generateRulesConstraintsCombinations(final String constraint1,\n final String constraint2,\n final String constraint3) {\n final Set<ConstraintsPair> constraintsPairs = new HashSet<>();\n final List<ConstraintsPair[]> result = new ArrayList<>();\n\n final List<String> constraintsList = new ArrayList<>();\n constraintsList.add(constraint1);\n constraintsList.add(constraint2);\n constraintsList.add(constraint3);\n final List<String> constraintsCombinations = getConstraintsCombinations(constraintsList);\n\n for (final String constraintsRule1 : constraintsCombinations) {\n for (final String constraintsRule2 : constraintsCombinations) {\n final ConstraintsPair constraintsPair = new ConstraintsPair(constraintsRule1, constraintsRule2);\n if (constraintsPairs.add(constraintsPair)) {\n result.add(new ConstraintsPair[]{constraintsPair});\n }\n }\n }\n return result;\n }", "public AffineTransform3D() {\r\n\t\tthis.M11 = 1;\r\n\t\tthis.M12 = 0;\r\n\t\tthis.M13 = 0;\r\n\t\tthis.M14 = 0;\r\n\t\tthis.M21 = 0;\r\n\t\tthis.M22 = 1;\r\n\t\tthis.M23 = 0;\r\n\t\tthis.M24 = 0;\r\n\t\tthis.M31 = 0;\r\n\t\tthis.M32 = 0;\r\n\t\tthis.M33 = 1;\r\n\t\tthis.M34 = 0;\r\n\t\tthis.M41 = 0;\r\n\t\tthis.M42 = 0;\r\n\t\tthis.M43 = 0;\r\n\t\tthis.M44 = 1;\r\n\t}", "@Override\n public void combineCons(ArrayList<Note> list) {\n }", "public Composite multiply(Composite comp) {\n\t\tif(comp.isUnit()){\n\t\t\treturn this;\n\t\t}\n\t\tif(this.isUnit()){\n\t\t\treturn comp;\n\t\t}\n\t\tNode head = comp.head;\n\t\tNode current_node = this.head;\n\t\t//long product = 1;\n\t\tBigInteger product = BigInteger.ONE;\n\t\twhile (current_node != null){\n\t\t\tlong factor = (long) Math.pow(current_node.factor, current_node.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\twhile (comp.head != null){\n\t\t\tlong factor = (long)Math.pow(comp.head.factor, comp.head.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n\t\tComposite p = new Composite();\n\t\tNode n = new Node(product.longValue(), 1);\n\t\tp.head = n;\n\t\tcomp.head = head;\n\t\treturn p;\n\t}", "public Composite add(Composite comp) {\n\t\t// REPLACE WITH WORKING CODE\n\t\t//do last\n//\t\tComposite common_factor = new Composite();\n//\t\tcommon_factor = this.lcm(comp);\n//\t\tlong factor = 0;\n//\t\twhile(common_factor != null){\n//\t\t\tfactor *= Math.pow(common_factor.head.factor, common_factor.head.power);\n//\t\t\tcommon_factor.head = common_factor.head.next;\n//\t\t}\n\t\tlong t = 1;\n\t\twhile(this.head != null){\n\t\t\tt *= Math.pow(this.head.factor, this.head.power);\n\t\t\tthis.head = this.head.next;\n\t\t}\n//\t\tt = t - factor;\n\t\tlong c = 1;\n\t\twhile(comp.head != null){\n\t\t\tc *= Math.pow(comp.head.factor, comp.head.power);\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n//\t\tc = c - factor;\n//\t\tlong remainder = c + t;\n\t\tlong sum = c + t;\n\t\t\n\t\treturn new Composite(BigInteger.valueOf(sum));\n\t}", "private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "Set<Set<V>> routine3(Graph<V, E> g)\n {\n Set<Set<V>> NuvList = new HashSet<>();\n for (V u : g.vertexSet()) {\n for (V v : g.vertexSet()) {\n if (u == v || !g.containsEdge(u, v))\n continue;\n NuvList.add(N(g, u, v));\n }\n }\n\n Set<Set<V>> tripleList = new HashSet<>();\n for (V a : g.vertexSet()) {\n for (V b : g.vertexSet()) {\n if (a == b || g.containsEdge(a, b))\n continue;\n Set<V> Nab = N(g, a, b);\n for (V c : g.vertexSet()) {\n if (isTripleRelevant(g, a, b, c)) {\n tripleList.add(X(g, Nab, c));\n }\n }\n }\n }\n Set<Set<V>> res = new HashSet<>();\n for (Set<V> Nuv : NuvList) {\n for (Set<V> triple : tripleList) {\n Set<V> temp = new HashSet<>();\n temp.addAll(Nuv);\n temp.addAll(triple);\n res.add(temp);\n }\n }\n return res;\n }", "interface A3 extends A1, A2{\r\n\t\r\n}", "public tc a(List<lc> list) {\n long j2;\n LinkedList linkedList = new LinkedList(list);\n Collections.sort(linkedList);\n linkedList.add(new lc(-1, -1, -1));\n ArrayList arrayList = new ArrayList();\n long j3 = 0;\n int i2 = 0;\n while (true) {\n j2 = -9223372036854775807L;\n if (i2 >= a()) {\n break;\n }\n if (((lc) linkedList.peek()).a != i2) {\n long b2 = b(i2);\n if (b2 != -9223372036854775807L) {\n j3 += b2;\n }\n } else {\n ov a2 = a(i2);\n ov ovVar = new ov(a2.a, a2.b - j3, a(a2.c, linkedList), a2.d);\n arrayList.add(ovVar);\n }\n i2++;\n }\n long j4 = this.b;\n if (j4 != -9223372036854775807L) {\n j2 = j4 - j3;\n }\n tc tcVar = new tc(this.a, j2, this.c, this.d, this.e, this.f, this.g, this.h, this.k, this.i, this.j, arrayList);\n return tcVar;\n }", "public vec3 cross(vec3 arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.cross(this, arg);\r\n\t\treturn tmp;\r\n\t}", "public static DeformableMesh3D mergeMeshes(List<DeformableMesh3D> meshes){\n int posCount = 0;\n int triCount = 0;\n int conCount = 0;\n for(DeformableMesh3D mesh: meshes){\n posCount += mesh.positions.length;\n triCount += mesh.triangle_index.length;\n conCount += mesh.connection_index.length;\n }\n double[] points = new double[posCount];\n int[] triangles = new int[triCount];\n int[] connections = new int[conCount];\n\n int offset = 0;\n int toff = 0;\n int coff = 0;\n\n for(DeformableMesh3D mesh: meshes){\n System.arraycopy(mesh.positions, 0, points, offset, mesh.positions.length);\n for(int i = 0; i<mesh.triangle_index.length; i++){\n triangles[i + toff] = mesh.triangle_index[i] + offset/3;\n }\n for(int i = 0; i<mesh.connection_index.length; i++){\n connections[i+coff] = mesh.connection_index[i] + offset/3;\n }\n\n\n offset += mesh.positions.length;\n toff += mesh.triangle_index.length;\n coff += mesh.connection_index.length;\n }\n\n return new DeformableMesh3D(points, connections, triangles);\n }", "public void concatenate(AffineTransform3D Tx) {\r\n\t\tthis.set(MatrixMult(this, Tx));\r\n\t}", "private static Set<C3246b> m11182c(List<Component<?>> list) {\n Set<C3246b> set;\n HashMap hashMap = new HashMap(list.size());\n for (Component next : list) {\n C3246b bVar = new C3246b(next);\n Iterator it = next.getProvidedInterfaces().iterator();\n while (true) {\n if (it.hasNext()) {\n Class cls = (Class) it.next();\n C3247c cVar = new C3247c(cls, !next.isValue());\n if (!hashMap.containsKey(cVar)) {\n hashMap.put(cVar, new HashSet());\n }\n Set set2 = (Set) hashMap.get(cVar);\n if (set2.isEmpty() || cVar.f18935b) {\n set2.add(bVar);\n } else {\n throw new IllegalArgumentException(String.format(\"Multiple components provide %s.\", new Object[]{cls}));\n }\n }\n }\n }\n for (Set<C3246b> it2 : hashMap.values()) {\n for (C3246b bVar2 : it2) {\n for (Dependency next2 : bVar2.mo20819c().getDependencies()) {\n if (next2.isDirectInjection() && (set = (Set) hashMap.get(new C3247c(next2.getInterface(), next2.isSet()))) != null) {\n for (C3246b bVar3 : set) {\n bVar2.mo20817a(bVar3);\n bVar3.mo20818b(bVar2);\n }\n }\n }\n }\n }\n HashSet hashSet = new HashSet();\n for (Set addAll : hashMap.values()) {\n hashSet.addAll(addAll);\n }\n return hashSet;\n }", "private Combined() {}", "public static /* synthetic */ int m64345a(Object[] objArr, Object obj, Comparator comparator, int i, int i2, int i3, Object obj2) {\n if ((i3 & 4) != 0) {\n i = 0;\n }\n if ((i3 & 8) != 0) {\n i2 = objArr.length;\n }\n return m64344a((T[]) objArr, (T) obj, comparator, i, i2);\n }", "public static <A, B, C> Equal<P3<A, B, C>> p3Equal(final Equal<A> ea, final Equal<B> eb, final Equal<C> ec) {\n return new Equal<P3<A, B, C>>(new F<P3<A, B, C>, F<P3<A, B, C>, Boolean>>() {\n public F<P3<A, B, C>, Boolean> f(final P3<A, B, C> p1) {\n return new F<P3<A, B, C>, Boolean>() {\n public Boolean f(final P3<A, B, C> p2) {\n return ea.eq(p1._1(), p2._1()) && eb.eq(p1._2(), p2._2()) && ec.eq(p1._3(), p2._3());\n }\n };\n }\n });\n }", "public static <A> Equal<V3<A>> v3Equal(final Equal<A> ea) {\n return streamEqual(ea).comap(V3.<A>toStream_());\n }", "static AggregateOperation compose(Iterable<AggregateOperation> operations) {\n // NOTE(user): It's possible to replace the following two sets with a single map.\n Set<SegmentId> segmentsToRemove = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToAdd = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToEndModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToStartModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<ParticipantId> participantsToRemove = new TreeSet<ParticipantId>(participantComparator);\n Set<ParticipantId> participantsToAdd = new TreeSet<ParticipantId>(participantComparator);\n Map<String, DocOpList> docOps = new TreeMap<String, DocOpList>();\n for (AggregateOperation operation : operations) {\n composeIds(operation.segmentsToRemove, segmentsToRemove, segmentsToAdd);\n composeIds(operation.segmentsToAdd, segmentsToAdd, segmentsToRemove);\n composeIds(operation.segmentsToEndModifying, segmentsToEndModifying, segmentsToStartModifying);\n composeIds(operation.segmentsToStartModifying, segmentsToStartModifying, segmentsToEndModifying);\n composeIds(operation.participantsToRemove, participantsToRemove, participantsToAdd);\n composeIds(operation.participantsToAdd, participantsToAdd, participantsToRemove);\n for (DocumentOperations documentOps : operation.docOps) {\n DocOpList docOpList = docOps.get(documentOps.id);\n if (docOpList != null) {\n docOps.put(documentOps.id, docOpList.concatenateWith(documentOps.operations));\n } else {\n docOps.put(documentOps.id, documentOps.operations);\n }\n }\n }\n return new AggregateOperation(\n new ArrayList<SegmentId>(segmentsToRemove),\n new ArrayList<SegmentId>(segmentsToAdd),\n new ArrayList<SegmentId>(segmentsToEndModifying),\n new ArrayList<SegmentId>(segmentsToStartModifying),\n new ArrayList<ParticipantId>(participantsToRemove),\n new ArrayList<ParticipantId>(participantsToAdd),\n mapToList(docOps));\n }", "public static ImmutableGraph compose( final ImmutableGraph g0, final ImmutableGraph g1 ) {\n\t\treturn new ComposedGraph( g0, g1 );\n\t}", "public final void transform(Tuple3f t, Tuple3f result) {\n\t\n \t// alias-safe\n \tresult.set(this.m00 * t.x + this.m01 * t.y + this.m02 * t.z,\n \t\t\t this.m10 * t.x + this.m11 * t.y + this.m12 * t.z,\n \t\t\t this.m20 * t.x + this.m21 * t.y + this.m22 * t.z);\n }", "public static void main(String[] args) {\n\t\tMath3 m3 = new Math3();\r\n\t\tSystem.out.println(m3.add(3,3));\r\n\t\tSystem.out.println(m3.add(3L,3));\r\n\t\tSystem.out.println(m3.add(3,3L));\r\n\t\tSystem.out.println(m3.add(3L,3L));\r\n\t\tSystem.out.println(m3.add(new int[]{10,20,30}));\r\n\t}", "public static void main(String[] args) {\n\t\tVector3 i = new Vector3(1, 0, 0);\n\t\tVector3 j = new Vector3(0, 1, 0);\n\t\tVector3 k = i.cross(j);\n\t\t\n\t\tVector3 l = k.add(j).scale(5);\n\t\t\n\t\tVector3 m = l.normalized();\n\t\t\n\t\tSystem.out.println(i);\n\t\tSystem.out.println(j);\n\t\tSystem.out.println(k);\n\t\tSystem.out.println(l);\n\t\tSystem.out.println(l.norm());\n\t\tSystem.out.println(m);\n\t\tSystem.out.println(l.dot(j));\n\t\tSystem.out.println(i.add(new Vector3(0, 1, 0)).cosAngle(l));\n\t}", "private void instantiateVarsTriple(IntVar var1, int coeff1, IntVar var2, int coeff2, IntVar var3, int coeff3, int constant, Propagator prop) throws ContradictionException {\n this.instantiateThirdVar(var1, coeff1, var2, coeff2, var3, coeff3, constant, prop);\n this.instantiateThirdVar(var2, coeff2, var3, coeff3, var1, coeff1, constant, prop);\n this.instantiateThirdVar(var1, coeff1, var3, coeff3, var2, coeff2, constant, prop);\n }", "public static void main(String[] args) {\n\t\tCollection c=new ArrayList();\n\t\t\n\t\tc.add(23);\n\t\tc.add(34);\n\t\t\n\t\tCollection c1=new ArrayList();\n\t\t\n\tc1.add(45);\n\tc1.add(67);\n\t\n\tc.addAll(c1);\n\tSystem.out.println(c);\n\t\n\t\n\tCollection c2=new ArrayList();\n\tc2.add(12);\n\tc2.add(23);\n\tc2.add(25);\n\t\n\tCollection c3=new ArrayList();\n\tc3.add(34);\n\tc3.add(45);\n\tc3.add(25);\n\tc3.add(25);\n\t\n\tc2.addAll(c3);\n\t\n\tSystem.out.println(c2);\n\tSystem.out.println(\"-------------------\");\n\t\n\t\n\tc2.removeAll(c3);\n\tSystem.out.println(c2);\n\t\n\tSystem.out.println(\"-------------------\");\n\tCollection c4=new ArrayList();\n\tc4.add(25);\n\tc4.add(23);\n\tc4.add(86);\n\tc4.add(98);\n\t\n\t\n\t\n\tCollection c5=new ArrayList();\n\tc5.add(25);\n\tc5.add(23);\n\tc5.add(12);\n\tc5.add(13);\n\t\n\tc4.retainAll(c5);\n\tSystem.out.println(c4);\n\t\n\tSystem.out.println(\"-------------------\");\n\t\n\tCollection c6=new ArrayList();\n\tc6.add(12);\n\tc6.add(23);\n\t\n\tObject a[]= c6.toArray();\n\tfor(int i=0;i < a.length ; i++)\n\t{\n\t\tSystem.out.println(a[i]);\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t\n\tc4.clear();\n\tSystem.out.println(c4);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t}", "public static /* synthetic */ void m64535a(Object[] objArr, Comparator comparator, int i, int i2, int i3, Object obj) {\n if ((i3 & 2) != 0) {\n i = 0;\n }\n if ((i3 & 4) != 0) {\n i2 = objArr.length;\n }\n m64534a((T[]) objArr, comparator, i, i2);\n }", "private static <T> int med3(@Nonnull List<T> x, Comparator<? super T> comparator, int a, int b, int c) {\n return comparator.compare(x.get(a), x.get(b)) < 0\n ? comparator.compare(x.get(b), x.get(c)) < 0 ? b : comparator.compare(x.get(a), x.get(c)) < 0 ? c : a\n : comparator.compare(x.get(c), x.get(b)) < 0 ? b : comparator.compare(x.get(c), x.get(a)) < 0 ? c : a;\n }", "public void preConcatenate(AffineTransform3D Tx) {\r\n\t\tthis.set(MatrixMult(Tx, this));\r\n\t}", "@Override\n\tpublic int hashCode() {\n\t\treturn this.l1.hashCode() + this.l2.hashCode() + this.l3.hashCode();\n\t}", "public void calculos() {\n a = a1+a2+a3;\n b = b1+b2+b3;\n c = c1+c2+c3;\n }", "public Vec3(Vec3 copy){\n\t\tthis(copy.x, copy.y, copy.z);\n\t}", "public static /* synthetic */ int m28129a(List list, Comparable comparable, int i, int i2, int i3, Object obj) {\n if ((i3 & 2) != 0) {\n i = 0;\n }\n if ((i3 & 4) != 0) {\n i2 = list.size();\n }\n return m28128a(list, (T) comparable, i, i2);\n }", "@Test\n\tvoid test4AddComponentToList() {\n\t\tlistItems.add(comp1);\n\t\tlistItems.add(comp2);\n\t\tvc = new VerticalComponentList(x, y, listItems,0);\n\t\tvc.addComponent(comp3);\n\t\tassertEquals(comp3.hashCode(), vc.getComponentsList().get(vc.getComponentsList().size() - 1).hashCode());\n\t}", "private static final <R, C extends Collection<? super R>> C m64428a(@C6003d Object[] objArr, C c) {\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n c.add(obj);\n }\n }\n return c;\n }", "private void combine(ArrayList<Piece> numbers, int index,ArrayList<Piece> combinePieces) {\n // Leaves when you get to end of players pieces\n if (index == numbers.size()) {\n combinations.add(combinePieces);\n } \n // Includes the current piece or doesn't include it in combination\n else {\n ArrayList<Piece> Include = new ArrayList<Piece>();\n\n for (int i = 0; i < combinePieces.size(); i++)\n Include.add(combinePieces.get(i));\n\n Include.add(numbers.get(index));\n\n // Recalls method for next run\n combine(numbers, ++index, Include);\n combine(numbers, index, combinePieces);\n }\n }", "static <T> Function<T, T> compose(Function<T, T>... functions) {\n return compose(Stream.of(functions));\n }", "public Plane3(Plane3 p) {\n this.a = p.a; this.b = p.b; this.c = p.c; this.v = p.v; this.d = p.d;\n }", "private static BigInteger multiplyToomCook3(BigInteger a, BigInteger b) {\n int alen = a.mag.length;\n int blen = b.mag.length;\n\n int largest = Math.max(alen, blen);\n\n // k is the size (in ints) of the lower-order slices.\n int k = (largest+2)/3; // Equal to ceil(largest/3)\n\n // r is the size (in ints) of the highest-order slice.\n int r = largest - 2*k;\n\n // Obtain slices of the numbers. a2 and b2 are the most significant\n // bits of the numbers a and b, and a0 and b0 the least significant.\n BigInteger a0, a1, a2, b0, b1, b2;\n a2 = a.getToomSlice(k, r, 0, largest);\n a1 = a.getToomSlice(k, r, 1, largest);\n a0 = a.getToomSlice(k, r, 2, largest);\n b2 = b.getToomSlice(k, r, 0, largest);\n b1 = b.getToomSlice(k, r, 1, largest);\n b0 = b.getToomSlice(k, r, 2, largest);\n\n BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1, db1;\n\n v0 = a0.multiply(b0);\n da1 = a2.add(a0);\n db1 = b2.add(b0);\n vm1 = da1.subtract(a1).multiply(db1.subtract(b1));\n da1 = da1.add(a1);\n db1 = db1.add(b1);\n v1 = da1.multiply(db1);\n v2 = da1.add(a2).shiftLeft(1).subtract(a0).multiply(\n db1.add(b2).shiftLeft(1).subtract(b0));\n vinf = a2.multiply(b2);\n\n // The algorithm requires two divisions by 2 and one by 3.\n // All divisions are known to be exact, that is, they do not produce\n // remainders, and all results are positive. The divisions by 2 are\n // implemented as right shifts which are relatively efficient, leaving\n // only an exact division by 3, which is done by a specialized\n // linear-time algorithm.\n t2 = v2.subtract(vm1).exactDivideBy3();\n tm1 = v1.subtract(vm1).shiftRight(1);\n t1 = v1.subtract(v0);\n t2 = t2.subtract(t1).shiftRight(1);\n t1 = t1.subtract(tm1).subtract(vinf);\n t2 = t2.subtract(vinf.shiftLeft(1));\n tm1 = tm1.subtract(t2);\n\n // Number of bits to shift left.\n int ss = k*32;\n\n BigInteger result = vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0);\n\n if (a.signum != b.signum) {\n return result.negate();\n } else {\n return result;\n }\n }", "public void compose(TransformMatrix mB) {\n\t\ta = mB.a * a;\n\t\tb = mB.b * b;\n\t\tc = mB.a * c + mB.c;\n\t\td = mB.b * d + mB.d;\n\t}", "private Complejo[] crearComplejos(double[][] numeros) {\n\t\tComplejo[] complejos = new Complejo[numeros.length];\n\t\tfor (int i = 0; i < numeros.length;i++) {\n\t\t\tcomplejos[i] = new Complejo(numeros[i][0],numeros[i][1]);\n\t\t}\n\t\treturn complejos;\n\t}", "private void assertTransitive(UMLMessageArgument msgArg1,UMLMessageArgument msgArg2, UMLMessageArgument msgArg3) throws Exception\r\n\t{\r\n\t\tif(msgArg1 != null && msgArg2 != null && msgArg3 != null)\r\n\t\t{\r\n\t\t\tif(msgArg1.equals(msgArg2) && msgArg2.equals(msgArg3))\r\n\t\t\t{\r\n\t\t\t\tassertTrue(msgArg1.equals(msgArg3));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public abstract Combinacion elegirCombinacionOculta();", "int getCombine();", "public static void m3(ArrayList<? extends Number> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "public CMLVector3(CMLPoint3 p) {\r\n Vector3 v = new Vector3(p.getEuclidPoint3());\r\n this.setXYZ3(v.getArray());\r\n }", "public void mo1992a(int i, int i2, int i3, int i4) {\n this.f1963b.add(new Jca(i, i3, i2, i4));\n }", "private static <Item extends Comparable> List<Item> catenate(List<Item> q1, List<Item> q2) {\n List<Item> catenated = new ArrayList<>();\n for (Item item : q1) {\n catenated.add(item);\n }\n for (Item item: q2) {\n catenated.add(item);\n }\n return catenated;\n }", "public long a(int i2, int i3) {\n return d(i2) + c(i2, i3);\n }", "public static <R, A, B, C> CompletionStage<R> combine(\n CompletionStage<A> a, CompletionStage<B> b, CompletionStage<C> c,\n Function3<A, B, C, R> function) {\n final CompletableFuture<A> af = a.toCompletableFuture();\n final CompletableFuture<B> bf = b.toCompletableFuture();\n final CompletableFuture<C> cf = c.toCompletableFuture();\n\n return CompletableFuture.allOf(af, bf, cf)\n .thenApply(ignored -> function.apply(af.join(), bf.join(), cf.join()));\n }", "public static void main(String[] args) {\n\n\t\tComplexNumber c1 = new ComplexNumber(2, 3);\n\t\tComplexNumber c2 = ComplexNumber.parse(\"2.5-3i\");\n\n\t\tComplexNumber c3 = c1.add(ComplexNumber.fromMagnitudeAndAngle(2, 1.57)).div(c2).power(3).root(2)[1];\n\n\t\tSystem.out.println(c3);\n\t}", "private static int med3(int x[], IntComparator comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "private boolean concurrentRuleAsymParallelIndependent(\r\n\t\t\tfinal int i,\r\n\t\t\tfinal Rule ri,\r\n\t\t\tfinal ConcurrentRule cr,\r\n\t\t\tfinal List<Rule> sequence,\r\n\t\t\tfinal int concurdepth,\r\n\t\t\tString criterion) {\n\r\n\t\tboolean result = true; \t\t\r\n\t\tint concurrrentRuleDepth = cr.getDepth();\r\n\t\t\t\r\n\t\tVector<Rule> remainList = new Vector<Rule>();\r\n\t\tfor (int l=i+1; l<sequence.size(); l++) {\r\n\t\t\tremainList.add(sequence.get(l));\r\n\t\t}\r\n\t\t\r\n\t\tVector<Rule> crSourceList = new Vector<Rule>();\r\n\t\tint start = i-concurrrentRuleDepth;\r\n\t\tfor (int l=start; l<=i; l++) {\r\n\t\t\tcrSourceList.add(sequence.get(l));\r\n\t\t}\r\n\t\t\r\n\t\t// find conflicts of concurrent rule with rules before\r\n\t\tfor (int l = 0; l<crSourceList.size(); l++) {\r\n\t\t\tRule r = crSourceList.get(l);\r\n\t\t\tint indx = start + l;\r\n\t\t\tPair<Boolean, List<String>> \r\n\t\t\truleRes = this.ruleSequence.getRuleResult(indx, r.getName(), ApplicabilityConstants.NO_IMPEDING_PREDECESSORS);\r\n\t\t\tif (ruleRes != null && !ruleRes.first.booleanValue()) {\r\n\t\t\t\tresult = false;\t\r\n//\t\t\t\tString otherRule = ruleRes.second.isEmpty()? \"\": ruleRes.second.get(0);\r\n//\t\t\t\tSystem.out.println(\"---> Concurrent rule: \"+cr.getRule().getName()+\": its base rule: \"+r.getName()+\" has conflict with \" +otherRule);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (result) {\r\n\t\t\t// find conflicts of concurrent rule with successor rules \r\n\t\t\tfor (int l = 0; l<crSourceList.size(); l++) {\r\n\t\t\t\tRule r1 = crSourceList.get(l);\r\n\t\t\t\tfor (int k=0; k<remainList.size(); k++) {\r\n\t\t\t\t\tRule r2 = remainList.get(k);\r\n\t\t\t\t\tSimpleExcludePair excludePair = this.makeExcludePair();\r\n\t\t\t\t\tif (!asymParallelIndependentByCPA(excludePair, r1, -1, r2, -1)) {\r\n\t\t\t\t\t\tresult = false;\t\r\n//\t\t\t\t\t\tSystem.out.println(\"---> Concurrent rule: \"+cr.getRule().getName()+\": its base rule: \"+r1.getName()+\" has conflict with \" +r2.getName());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} \r\n\t\t\t\t\texcludePair.dispose();\r\n\t\t\t\t}\r\n\t\t\t\tif (!result) {\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\tthis.info = this.getConcurrentRuleNameInfo(cr.getRule(), ri);\t\t\t\r\n\t\tsetRuleResult(i, ri.getName(), result, criterion, this.info);\t\t\t\r\n\r\n\t\tremainList.clear();\r\n\t\tcrSourceList.clear();\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public Point3(Point3 p) {\n this.x = p.x; this.y = p.y; this.z = p.z;\n }", "public Complex Plus (Complex z) {\nreturn new Complex(u+z.u,v+z.v);\n\n}", "private boolean concurrentRuleAsymParallelIndependentByCPA(\r\n\t\t\tfinal int i,\r\n\t\t\tfinal Rule ri,\r\n\t\t\tfinal ConcurrentRule cr,\r\n\t\t\tfinal List<Rule> sequence,\r\n\t\t\tfinal int concurdepth,\r\n\t\t\tString criterion) {\n\t\t\r\n\t\tboolean result = true; \r\n\t\tVector<Rule> tmp = new Vector<Rule>();\r\n\t\ttmp.addAll(sequence);\r\n\t\tint n = 0;\r\n\t\twhile (concurdepth-n >= 0) {\t\t\t\r\n\t\t\ttmp.remove(i-n);\r\n\t\t\tn++;\r\n\t\t}\r\n\t\tif ((i-n) < 0) {\r\n\t\t\ttmp.add(0, cr.getRule());\r\n\t\t} else {\r\n\t\t\ttmp.add(i-n, cr.getRule());\r\n\t\t}\r\n\t\tint c = tmp.indexOf(cr.getRule());\r\n\t\t\r\n\t\t// find conflicts of concurrent rule with rules before\r\n\t\tfor (int j=0; j<c; j++) {\r\n\t\t\tfinal Rule rj = tmp.get(j);\t\r\n\t\t\tfinal SimpleExcludePair excludePair = this.makeExcludePair();\t\t\t\t\r\n\t\t\tif(!asymParallelIndependentByCPA(excludePair, rj, -1, cr.getRule(), -1)) {\r\n\t\t\t\tresult = false;\t\t\r\n//\t\t\t\tSystem.out.println(\"---> Concurrent rule: \"+cr.getRule().getName()+\" has conflict with \" +rj.getName());\r\n\t\t\t\tbreak;\r\n\t\t\t} \r\n\t\t\texcludePair.dispose();\r\n\t\t}\r\n\t\tif (result) {\r\n\t\t\t// find conflicts of concurrent rule with successor rules\r\n\t\t\tfor (int l=c+1; l<tmp.size(); l++) {\r\n\t\t\t\tfinal Rule rj = tmp.get(l);\t\r\n\t\t\t\tfinal SimpleExcludePair excludePair = this.makeExcludePair();\r\n\t\t\t\tif (!asymParallelIndependentByCPA(excludePair, cr.getRule(), -1, rj, -1)) {\r\n\t\t\t\t\tresult = false;\t\r\n//\t\t\t\t\tSystem.out.println(\"---> Concurrent rule: \"+cr.getRule().getName()+\" has conflict with \" +rj.getName());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} \r\n\t\t\t\texcludePair.dispose();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.info = this.getConcurrentRuleNameInfo(cr.getRule(), ri);\r\n\t\tsetRuleResult(i, ri.getName(), result, criterion, this.info);\r\n//\t\tSystem.out.println(\"=== >>> Concurrent rule: \"+cr.getRule().getName()+\" is applicable without conflicts!\");\r\n\t\t\t\t\r\n\t\ttmp.clear();\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public Vector3D(Vector3D p1, Vector3D p2)\r\n\t{\r\n\t\tthis.x = p2.x - p1.x;\r\n\t\tthis.y = p2.y - p1.y;\r\n\t\tthis.z = p2.z - p1.z;\r\n\t}", "public Composite lcm(Composite comp) {\n\t\tif(this.head.factor == 1){\n\t\t\treturn comp;\n\t\t}\n\t\tif(comp.head.factor == 1){\n\t\t\treturn this;\n\t\t}\n\t\tComposite multiple = new Composite();\n\t\tmultiple = this.multiply(comp);\n\t\tlong num = multiple.head.factor;\n\t\tlong d = 1;\n\t\tComposite com_divisor = this.gcd(comp);\n\t\twhile(com_divisor.head != null){\n\t\t\td *= Math.pow(com_divisor.head.factor, com_divisor.head.power);\n\t\t\tcom_divisor.head = com_divisor.head.next;\n\t\t}\n\t\tlong ans = num / d;\n\t\tBigInteger ans_b = BigInteger.valueOf(ans);\n\t\t\n\t\treturn new Composite(ans_b);\n\t}", "public interface Combine<T> {\n\n public T combineWith(T other);\n\n public void mergeFrom(T other);\n\n}", "public static void main(String[] args) {\n\t\tComplejo v[] = new Complejo[5];\r\n\t\tv[0] = new Complejo(1,5);\r\n\t\tv[1] = new Complejo(10,-3);\r\n\t\tv[2] = new Complejo(-1,4);\r\n\t\tv[3] = new Complejo(8,0);\r\n\t\tv[4] = new Complejo(9,3);\r\n\t\t\r\n\t\tfor (Complejo c : v) {\r\n\t\t\tSystem.out.println(c.modulo());\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tArrays.sort(v);\r\n\t\tfor (Complejo c : v) {\r\n\t\t\tSystem.out.println(c.modulo());\t\t\t\r\n\t\t}\r\n\t}", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "public Point3 mult(int[] arr) {\n Point3 p = new Point3(x * arr[0], y * arr[1], z * arr[2]);\n return p;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void do_s3( S3 v, Compare cmp )\n\t{\n\t\t\n\t\tcmp.compare( v, server.f4( v ) );\n\t\tdo_s2( v, cmp );\n\t\t\n\t\tS3[] a = { v };\n\t\tCompare acmp = new AS3Compare( cmp );\n\n\t\tacmp.compare( a, server.f8( a ) );\n\t\tdo_obj( a, acmp );\n\t}", "java.lang.String getC3();", "@Override\n\tpublic void abs3_m1() {\n\t\t\n\t}", "static void compare()\n {\n \tif(a < c)\n\t\t {\n\t\t\t comp_one = 1; //store this value , else zero default \n\t\t }\n\t\t if(c < b)\n\t\t {\n\t\t\t comp_two = 2; //store this value , else zero default\n\t\t }\n\t\t if(b < a)\n\t\t {\n\t\t\t comp_thr = 5; //store this value , else zero default\n\t\t }\n\t\t \n\t\t comp_val = comp_one + comp_two + comp_thr; //create a unique value by addition\n }", "private void placeLinearChains3D(IMolecule molecule, IAtomContainer startAtoms, AtomPlacer3D ap3d, AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws Exception {\n\t\t//logger.debug(\"****** PLACE LINEAR CHAINS ******\");\n\t\tIAtom dihPlacedAtom = null;\n\t\tIAtom thirdPlacedAtom = null;\n\t\tIAtomContainer longestUnplacedChain = molecule.getBuilder().newAtomContainer();\n\t\tif (startAtoms.getAtomCount() == 0) {\n\t\t\t//no branch points ->linear chain\n\t\t\t//logger.debug(\"------ LINEAR CHAIN - FINISH ------\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < startAtoms.getAtomCount(); i++) {\n\t\t\t\t//logger.debug(\"FOUND BRANCHED ALKAN\");\n\t\t\t\t//logger.debug(\"Atom NOT NULL:\" + molecule.getAtomNumber(startAtoms.getAtomAt(i)));\n\t\t\t\tthirdPlacedAtom = ap3d.getPlacedHeavyAtom(molecule, startAtoms.getAtom(i));\n\t\t\t\tdihPlacedAtom = ap3d.getPlacedHeavyAtom(molecule, thirdPlacedAtom, startAtoms.getAtom(i));\n\t\t\t\tlongestUnplacedChain.addAtom(dihPlacedAtom);\n\t\t\t\tlongestUnplacedChain.addAtom(thirdPlacedAtom);\n\t\t\t\tlongestUnplacedChain.addAtom(startAtoms.getAtom(i));\n\n\t\t\t\tlongestUnplacedChain.add(atomPlacer.getLongestUnplacedChain(molecule, startAtoms.getAtom(i)));\n\t\t\t\tsetAtomsToUnVisited(molecule);\n\t\t\t\t\n\t\t\t\tif (longestUnplacedChain.getAtomCount() < 4) {\n\t\t\t\t\t//di,third,sec\n\t\t\t\t\t//logger.debug(\"------ SINGLE BRANCH METHYLTYP ------\");\n\t\t\t\t\t//break;\n\t\t\t\t} else {\n\t\t\t\t\t//logger.debug(\"LongestUnchainLength:\"+longestUnplacedChain.getAtomCount());\n\t\t\t\t\tap3d.placeAliphaticHeavyChain(molecule, longestUnplacedChain);\n\t\t\t\t\tap3d.zmatrixChainToCartesian(molecule, true);\n\t\t\t\t\tsearchAndPlaceBranches(molecule, longestUnplacedChain, ap3d, atlp3d, atomPlacer);\n\t\t\t\t}\n\t\t\t\tlongestUnplacedChain.removeAllElements();\n\t\t\t}//for\n\n\t\t}\n\t\t//logger.debug(\"****** HANDLE ALIPHATICS END ******\");\n\t}", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "public Transform compose(Transform other){\n float[][] ans = new float[4][4];\n for(int row = 0; row < 4; row++){\n for(int col = 0; col < 4; col++){\n for(int i = 0; i < 3; i++){\n ans[row][col] += this.values[row][i] * other.values[i][col];\n }\n }\n ans[row][3] += this.values[row][3];\n }\n return new Transform(ans);\n }", "public final void add(Matrix3f m1) {\n\tm00 += m1.m00; m01 += m1.m01; m02 += m1.m02;\n\tm10 += m1.m10; m11 += m1.m11; m12 += m1.m12;\n\tm20 += m1.m20; m21 += m1.m21; m22 += m1.m22;\n }", "static void _cpmvMergeResult(Object result_, Vector vresult_)\r\n {\r\n if (result_ == null) return;\r\n if (result_ instanceof Component || result_ instanceof Port)\r\n vresult_.addElement(result_);\r\n else {\r\n Object[] tmp_ = (Object[])result_;\r\n for (int j=0; j<tmp_.length; j++) vresult_.addElement(tmp_[j]);\r\n }\r\n }", "private void linkComponents(List<Set<Factor>> components,\n Set<Factor> factors) {\n // The first component should be the biggest one. All other factors\n // should be linked to the first components randomly\n Set<Factor> first = components.get(0);\n for (int i = 1; i < components.size(); i++) {\n Set<Factor> second = components.get(i);\n Variable var1 = pickUpVar(first);\n Variable var2 = pickUpVar(second);\n Factor factor = createEqualFactor(var1, var2);\n factors.add(factor);\n }\n }", "public AffineTransform3D(AffineTransform3D T) {\r\n\t\tthis.M11 = T.M11;\r\n\t\tthis.M12 = T.M12;\r\n\t\tthis.M13 = T.M13;\r\n\t\tthis.M14 = T.M13;\r\n\t\tthis.M21 = T.M21;\r\n\t\tthis.M22 = T.M22;\r\n\t\tthis.M23 = T.M23;\r\n\t\tthis.M24 = T.M24;\r\n\t\tthis.M31 = T.M31;\r\n\t\tthis.M32 = T.M32;\r\n\t\tthis.M33 = T.M33;\r\n\t\tthis.M34 = T.M34;\r\n\t\tthis.M41 = T.M41;\r\n\t\tthis.M42 = T.M42;\r\n\t\tthis.M43 = T.M43;\r\n\t\tthis.M44 = T.M44;\r\n\t}", "Tuple (Atomic... elements) {\n for (Atomic element : elements) {\n add (element);\n }\n }", "public List<Collection<Graph.Vertex<Integer>>> checkP3InComponent(UndirectedGraph<Integer,Integer> graph){\n\t\tList<Collection<Graph.Vertex<Integer>>> p3s = new ArrayList<Collection<Graph.Vertex<Integer>>>(); //stores vertices of p3s found\n\t\t\n\t\t//if the no of vertices in graph is less than 3, then graph cannot have a p3\n\t\t\n\t\tif(graph.size()<3){\n\t\t\treturn p3s;\n\t\t}\n\t\t\n\t\tSet<Set<Integer>> marked = new HashSet<Set<Integer>>(); //to prevent creating the same p3 more than once\n\t\n\t\t//create mapping between matrix indices and vertex\n\t\tList<Graph.Vertex<Integer>> vertexIndexMap = new ArrayList<Graph.Vertex<Integer>>();\n\t\tIterator<Graph.Vertex<Integer>> vIt = graph.vertices(); //gets the vertex iterator\n\t\twhile(vIt.hasNext()){\n\t\t\tvertexIndexMap.add(vIt.next());\n\t\t}\n\t\t\n\t\tint[][] A = graph.getAdjacencyMatrix();\n\t\tint[][] A2;\n\t\ttry {\n\t\t\tA2 = Utility.multiplyMatrix(A, A);\n\t\t} catch (MatrixException e) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//look for a path of length 2 in A2\n\t\tfor(int i=0; i<A2.length;i++){\n\t\t\tfor(int j=i+1; j<A2.length;j++){\n\t\t\t\tif((int)A2[i][j]>0 && (int)A[i][j]==0){ //then a P3 is found\n\t\t\t\t\t//look for third vertex\n\t\t\t\t\tfor(int k=0; k<A.length;k++){\n\t\t\t\t\t\tif(k!=i && k!= j && ((int)A[k][i] == 1) && ((int)A[k][j] == 1)){\n\t\t\t\t\t\t\tList<Graph.Vertex<Integer>> vert = new ArrayList<Graph.Vertex<Integer>>();\n\t\t\t\t\t\t\tSet<Integer> hh = new HashSet<Integer>();\n\t\t\t\t\t\t\tGraph.Vertex<Integer> u = vertexIndexMap.get(i);\n\t\t\t\t\t\t\tGraph.Vertex<Integer> v = vertexIndexMap.get(j);\n\t\t\t\t\t\t\tGraph.Vertex<Integer> w = vertexIndexMap.get(k); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvert.add(u); vert.add(v); vert.add(w);\n\t\t\t\t\t\t\thh.add(u.getElement()); hh.add(v.getElement()); hh.add(w.getElement());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(marked.add(hh)){\n\t\t\t\t\t\t\t\tp3s.add(vert);\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}\n\t\t}\n\t\n\t\treturn p3s;\n\t}", "public ArrayList<Object> product(ArrayList<Object> list1, ArrayList<Object> list2)\r\n {\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n retList.addAll(list1);\r\n retList.addAll(list2);\r\n return retList;\r\n }", "public ChampionnatComplexe (Matrice mat,Options o) {\n\t\topt = o;\n\t\tint [] Eq12 = FonctionsTransverses.tirage(12);\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3];\n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibreDesPoule = equilibreDesPoule + ( Integer.max(grpA1[z], grpB1[z]) - Integer.min(grpA1[z], grpB1[z]) ) + ( Integer.max(grpA2[z], grpB2[z]) - Integer.min(grpA2[z], grpB2[z]) );\n\t\t}\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}" ]
[ "0.6334946", "0.5670821", "0.5169463", "0.50813574", "0.50300276", "0.50034386", "0.49219579", "0.48779383", "0.4876558", "0.48477435", "0.48330453", "0.47945538", "0.47922415", "0.47652495", "0.47227395", "0.47074777", "0.46889466", "0.46507242", "0.46479303", "0.46464252", "0.46427077", "0.46304443", "0.4612638", "0.4593408", "0.4586875", "0.4581712", "0.4572523", "0.45702735", "0.4564054", "0.45616207", "0.4555049", "0.45445737", "0.45441508", "0.45382527", "0.45293307", "0.45217037", "0.45216382", "0.45186132", "0.45158994", "0.45127356", "0.45114368", "0.45110065", "0.4505808", "0.45049053", "0.44965762", "0.44956568", "0.4482458", "0.44774204", "0.44730946", "0.44673634", "0.44623867", "0.44618276", "0.44557235", "0.44400796", "0.44358718", "0.4432956", "0.44278064", "0.44158405", "0.4415739", "0.43970963", "0.439078", "0.43848753", "0.4371188", "0.4371132", "0.43706343", "0.43705004", "0.43652573", "0.43651798", "0.43640557", "0.43606287", "0.4358836", "0.43586126", "0.43580827", "0.4355848", "0.43549252", "0.43483445", "0.43479455", "0.4347729", "0.43452156", "0.43375528", "0.43371892", "0.43326485", "0.43313488", "0.43189904", "0.43145308", "0.43060446", "0.430224", "0.42997465", "0.4299722", "0.4299235", "0.42988706", "0.42987925", "0.42969832", "0.4291662", "0.4291359", "0.42911863", "0.42874607", "0.42874324", "0.4282337", "0.42751756" ]
0.65274453
0
Composition 4. a1, a2, a3 and a4 are objects. L is a list. M=COMP(a1,COMP(a2,COMP(a3,COMP(a4,l)))).
public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) { LIST<C> LP = L; if ( L == null ) { LP = new LIST<C>(); } LP.list.addFirst( d ); LP.list.addFirst( c ); LP.list.addFirst( b ); LP.list.addFirst( a ); return LP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "T compose(AbsonObject abson);", "static void m11180a(List<Component<?>> list) {\n Set<C3246b> c = m11182c(list);\n Set<C3246b> b = m11181b(c);\n int i = 0;\n while (!b.isEmpty()) {\n C3246b next = b.iterator().next();\n b.remove(next);\n i++;\n for (C3246b next2 : next.mo20820d()) {\n next2.mo20823g(next);\n if (next2.mo20822f()) {\n b.add(next2);\n }\n }\n }\n if (i != list.size()) {\n ArrayList arrayList = new ArrayList();\n for (C3246b next3 : c) {\n if (!next3.mo20822f() && !next3.mo20821e()) {\n arrayList.add(next3.mo20819c());\n }\n }\n throw new DependencyCycleException(arrayList);\n }\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> LIST4(C a, C b, C c, C d) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public void mo1992a(int i, int i2, int i3, int i4) {\n this.f1963b.add(new Jca(i, i3, i2, i4));\n }", "private static char[] composePart(ComposePartArgs paramComposePartArgs, int paramInt1, char[] paramArrayOfChar, int paramInt2, int paramInt3, int paramInt4, UnicodeSet paramUnicodeSet)\n/* */ {\n/* 1642 */ boolean bool = (paramInt4 & 0x1000) != 0;\n/* */ \n/* */ \n/* 1645 */ int[] arrayOfInt = new int[1];\n/* 1646 */ char[] arrayOfChar = new char[(paramInt3 - paramInt1) * 20];\n/* */ for (;;)\n/* */ {\n/* 1649 */ paramComposePartArgs.length = decompose(paramArrayOfChar, paramInt1, paramInt2, arrayOfChar, 0, arrayOfChar.length, bool, arrayOfInt, paramUnicodeSet);\n/* */ \n/* */ \n/* 1652 */ if (paramComposePartArgs.length <= arrayOfChar.length) {\n/* */ break;\n/* */ }\n/* 1655 */ arrayOfChar = new char[paramComposePartArgs.length];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 1660 */ int i = paramComposePartArgs.length;\n/* */ \n/* 1662 */ if (paramComposePartArgs.length >= 2) {\n/* 1663 */ RecomposeArgs localRecomposeArgs = new RecomposeArgs(null);\n/* 1664 */ localRecomposeArgs.source = arrayOfChar;\n/* 1665 */ localRecomposeArgs.start = 0;\n/* 1666 */ localRecomposeArgs.limit = i;\n/* 1667 */ paramComposePartArgs.prevCC = recompose(localRecomposeArgs, paramInt4, paramUnicodeSet);\n/* 1668 */ i = localRecomposeArgs.limit;\n/* */ }\n/* */ \n/* */ \n/* 1672 */ paramComposePartArgs.length = i;\n/* 1673 */ return arrayOfChar;\n/* */ }", "public void reduce4( T mrt ) {\n // Reduce any AppendableVecs\n for( int i=0; i<_fr._vecs.length; i++ )\n if( _fr._vecs[i] instanceof AppendableVec )\n ((AppendableVec)_fr._vecs[i]).reduce((AppendableVec)mrt._fr._vecs[i]);\n // User's reduction\n reduce(mrt);\n }", "public static void main(String[] args) {\n\t\tComplejo v[] = new Complejo[5];\r\n\t\tv[0] = new Complejo(1,5);\r\n\t\tv[1] = new Complejo(10,-3);\r\n\t\tv[2] = new Complejo(-1,4);\r\n\t\tv[3] = new Complejo(8,0);\r\n\t\tv[4] = new Complejo(9,3);\r\n\t\t\r\n\t\tfor (Complejo c : v) {\r\n\t\t\tSystem.out.println(c.modulo());\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tArrays.sort(v);\r\n\t\tfor (Complejo c : v) {\r\n\t\t\tSystem.out.println(c.modulo());\t\t\t\r\n\t\t}\r\n\t}", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "static AggregateOperation compose(Iterable<AggregateOperation> operations) {\n // NOTE(user): It's possible to replace the following two sets with a single map.\n Set<SegmentId> segmentsToRemove = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToAdd = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToEndModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToStartModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<ParticipantId> participantsToRemove = new TreeSet<ParticipantId>(participantComparator);\n Set<ParticipantId> participantsToAdd = new TreeSet<ParticipantId>(participantComparator);\n Map<String, DocOpList> docOps = new TreeMap<String, DocOpList>();\n for (AggregateOperation operation : operations) {\n composeIds(operation.segmentsToRemove, segmentsToRemove, segmentsToAdd);\n composeIds(operation.segmentsToAdd, segmentsToAdd, segmentsToRemove);\n composeIds(operation.segmentsToEndModifying, segmentsToEndModifying, segmentsToStartModifying);\n composeIds(operation.segmentsToStartModifying, segmentsToStartModifying, segmentsToEndModifying);\n composeIds(operation.participantsToRemove, participantsToRemove, participantsToAdd);\n composeIds(operation.participantsToAdd, participantsToAdd, participantsToRemove);\n for (DocumentOperations documentOps : operation.docOps) {\n DocOpList docOpList = docOps.get(documentOps.id);\n if (docOpList != null) {\n docOps.put(documentOps.id, docOpList.concatenateWith(documentOps.operations));\n } else {\n docOps.put(documentOps.id, documentOps.operations);\n }\n }\n }\n return new AggregateOperation(\n new ArrayList<SegmentId>(segmentsToRemove),\n new ArrayList<SegmentId>(segmentsToAdd),\n new ArrayList<SegmentId>(segmentsToEndModifying),\n new ArrayList<SegmentId>(segmentsToStartModifying),\n new ArrayList<ParticipantId>(participantsToRemove),\n new ArrayList<ParticipantId>(participantsToAdd),\n mapToList(docOps));\n }", "public interface AbsonComposer<T extends AbsonDecomposable> {\n\t/**\n\t * Composes an object of type T, given the AbsonObject which \n\t * was presumably created from the same classes' decompose\n\t * function.\n\t * @param abson The AbsonObject which contains the data to compose.\n\t * @return The composed object.\n\t */\n\tT compose(AbsonObject abson);\n}", "protected void reduce4( T mrt ) {\n // Reduce any AppendableVecs\n if( _noutputs > 0 )\n for( int i=0; i<_appendables.length; i++ )\n _appendables[i].reduce(mrt._appendables[i]);\n // User's reduction\n reduce(mrt);\n }", "private void crossProduct() {\n BaseCandidateElement[] it = o.inputObject.firstStageCandidates.values().toArray(new BaseCandidateElement[0]);\n // logger.info(Arrays.toString(it));\n for (int i = 0; i < it.length; i++) {\n for (int j = i + 1; j < it.length; j++) {\n if (PrecisConfigProperties.HIERARCHY_DIMS_ENABLED && hierarchyDimsNegation.checkIfBelongToSameHierarchyGroup(it[i], it[j]))\n continue;\n if (it[i].xor(it[j]).cardinality() == 4) {\n BitSet b = it[i].or(it[j]);\n o.inputObject.addCandidate(b);\n }\n }\n }\n }", "private Complejo[] crearComplejos(double[][] numeros) {\n\t\tComplejo[] complejos = new Complejo[numeros.length];\n\t\tfor (int i = 0; i < numeros.length;i++) {\n\t\t\tcomplejos[i] = new Complejo(numeros[i][0],numeros[i][1]);\n\t\t}\n\t\treturn complejos;\n\t}", "public Matrix4f(Vector4f col1, Vector4f col2, Vector4f col3, Vector4f col4) {\n m00 = col1.x;\n m10 = col1.y;\n m20 = col1.z;\n m30 = col1.w;\n\n m01 = col2.x;\n m11 = col2.y;\n m21 = col2.z;\n m31 = col2.w;\n\n m02 = col3.x;\n m12 = col3.y;\n m22 = col3.z;\n m32 = col3.w;\n\n m03 = col4.x;\n m13 = col4.y;\n m23 = col4.z;\n m33 = col4.w;\n }", "@Test\n public void testCyclicalIdentity() {\n Vector a = Vector.of(Variable.of(\"a1\"), Variable.of(\"a2\"), Variable.of(\"a3\"));\n Vector b = Vector.of(Variable.of(\"b1\"), Variable.of(\"b2\"), Variable.of(\"b3\"));\n Vector c = Vector.of(Variable.of(\"c1\"), Variable.of(\"c2\"), Variable.of(\"c3\"));\n Vector lhs = a.cross(b).cross(c);\n lhs = lhs.simplify();\n Vector rhs = b.times(a.dot(c)).plus(a.times(b.dot(c)).times(Constant.MINUS_ONE));\n rhs = rhs.simplify();\n Assert.assertEquals(lhs.getValues()[0], rhs.getValues()[0]);\n Assert.assertEquals(lhs.getValues()[1], rhs.getValues()[1]);\n Assert.assertEquals(lhs.getValues()[2], rhs.getValues()[2]);\n Assert.assertEquals(lhs, rhs);\n }", "private void c()\r\n/* 91: */ {\r\n/* 92:103 */ for (cvl localcvl : this.d) {\r\n/* 93:104 */ localcvl.a(this);\r\n/* 94: */ }\r\n/* 95: */ }", "int getCombine();", "private void computeMultiClassMCC(ConfusionMatrixElement[] elements) {\n\t\tdouble Sq = matrixTotal * matrixTotal;\n\t\tdouble CS = Arrays.stream(elements).map(n -> n.tp).reduce(0.0d, (n, m) -> n + m) * matrixTotal;\n\t\tdouble t = 0.0d, p = 0.0d, tt = 0.0d, pp = 0.0d, tp = 0.0d;\n\t\t\n\t\tfor (ConfusionMatrixElement e : elements) {\n\t\t\tt = (e.tp + e.fp); \n\t\t\tp = (e.tp + e.fn);\n\t\t\t\n\t\t\ttt += (t * t);\n\t\t\tpp += (p * p);\n\t\t\ttp += (t * p);\n\t\t}\n\t\tmatrixMCC = (CS - tp) / (Math.sqrt(Sq - pp) * Math.sqrt(Sq - tt));\n\t}", "public static ArrayList<String> joinArrayLists(ArrayList<String> EqList, ArrayList<String> sshList){\n\n\t\t\t\n\t\t\tArrayList<Integer> counteq = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> countssh = new ArrayList<Integer>();\n\t\t\t\n\t\t\tList<String> split1 = new ArrayList<String>();\n\t\t\tList<String> split2 = new ArrayList<String>();\n\t\t\t\n\t\t\tArrayList<String> combine = new ArrayList<String>();\n\t\t\t\n\t\t\t//Checks how many object exist in arrayList and addes their index to a new list\n\t\t\tfor(int i = 0;i<EqList.size();i++){\n\t\t\t\tif(EqList.get(i) == \"Object\"){\n\t\t\t\t\tcounteq.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int j = 0;j<sshList.size();j++){\n\t\t\t\tif(sshList.get(j) == \"Object\"){\n\t\t\t\t\tcountssh.add(j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//The size of the matrices must be equal. If it is 1, removes the ID and object index from the second matrix and addes it to the first arrayList\n\t\t\tif(counteq.size() == countssh.size()){\n\t\t\t\tif(counteq.size() == 1){\n\t\t\t\t\tif(EqList.get(1).equals(sshList.get(1))){\n\t\t\t\t\t\tEqList.remove(0);\n\t\t\t\t\t\tsshList.remove(0);\n\t\t\t\t\t\tsshList.remove(0);\n\t\t\t\t\t\tcombine.addAll(EqList);\n\t\t\t\t\t\tcombine.addAll(sshList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Based on the IDs of both lists, it splits both lists on the specified index and addes the two parts to the new combined matrix\n\t\t\t\t\t//The indexes are taken from the specified matrices counteq and countssh\n\t\t\t\t\tcounteq.add(EqList.size());\n\t\t\t\t\tcountssh.add(sshList.size());\n\t\t\t\t\tfor(int i = 0;i<counteq.size()-1;i++){\n\t\t\t\t\t\tfor(int j = 0;j<countssh.size()-1;j++){\n\t\t\t\t\t\t\tif(EqList.get(counteq.get(i)+1).equals(sshList.get(countssh.get(j)+1))){\n\n\t\t\t\t\t\t\t\t\tsplit1 = EqList.subList(counteq.get(i),counteq.get(i+1));\n\t\t\t\t\t\t\t\t\tsplit2 = sshList.subList(countssh.get(j)+2,countssh.get(j+1));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcombine.addAll(split1);\n\t\t\t\t\t\t\t\t\tcombine.addAll(split2);\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}\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Error! Arraylists size not the same. Please check the data\");\n\t\t\t\n\t\t\t//If any remaining object indexes are left, remove them\n\t\t\tfor(int i = 0;i<combine.size();i++){\n\t\t\t\tif(combine.get(i) == \"Object\"){\n\t\t\t\t\tcombine.remove(i);\n\t\t\t\t\ti=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn combine;\n\t\t}", "public Object lambda4(Object a, Object b) {\n Object[] objArr = new Object[2];\n objArr[0] = C1259lists.cons(C1259lists.car.apply1(this.elt), a);\n Object[] objArr2 = objArr;\n objArr2[1] = C1259lists.cons(C1259lists.cadr.apply1(this.elt), b);\n return misc.values(objArr2);\n }", "public int fourSumCount(int[] nums1, int[] nums2, int[] nums3, int[] nums4) {\n\n int sum = 0;\n HashMap<Integer, Integer> complementsSum34Count = new HashMap<>();\n\n for (int num3 : nums3) {\n for (int num4 : nums4) {\n int sum34 = num3 + num4;\n if (!complementsSum34Count.containsKey(-sum34)) complementsSum34Count.put(-sum34, 0);\n complementsSum34Count.put(-sum34, complementsSum34Count.get(-sum34) + 1);\n }\n }\n\n for (int num1 : nums1) {\n for (int num2 : nums2) {\n int sum12 = num1 + num2;\n if (complementsSum34Count.containsKey(sum12))\n sum += complementsSum34Count.get(sum12);\n }\n }\n\n return sum;\n }", "@Test\n\tvoid test4AddComponentToList() {\n\t\tlistItems.add(comp1);\n\t\tlistItems.add(comp2);\n\t\tvc = new VerticalComponentList(x, y, listItems,0);\n\t\tvc.addComponent(comp3);\n\t\tassertEquals(comp3.hashCode(), vc.getComponentsList().get(vc.getComponentsList().size() - 1).hashCode());\n\t}", "public float determinaConCofactores(float numfila,float num1,float num2, float num3, float num4){\n \n float respuesta= numfila*((num1*num2)-1*(num3*num4));\n return respuesta;\n \n }", "private static Set<C3246b> m11182c(List<Component<?>> list) {\n Set<C3246b> set;\n HashMap hashMap = new HashMap(list.size());\n for (Component next : list) {\n C3246b bVar = new C3246b(next);\n Iterator it = next.getProvidedInterfaces().iterator();\n while (true) {\n if (it.hasNext()) {\n Class cls = (Class) it.next();\n C3247c cVar = new C3247c(cls, !next.isValue());\n if (!hashMap.containsKey(cVar)) {\n hashMap.put(cVar, new HashSet());\n }\n Set set2 = (Set) hashMap.get(cVar);\n if (set2.isEmpty() || cVar.f18935b) {\n set2.add(bVar);\n } else {\n throw new IllegalArgumentException(String.format(\"Multiple components provide %s.\", new Object[]{cls}));\n }\n }\n }\n }\n for (Set<C3246b> it2 : hashMap.values()) {\n for (C3246b bVar2 : it2) {\n for (Dependency next2 : bVar2.mo20819c().getDependencies()) {\n if (next2.isDirectInjection() && (set = (Set) hashMap.get(new C3247c(next2.getInterface(), next2.isSet()))) != null) {\n for (C3246b bVar3 : set) {\n bVar2.mo20817a(bVar3);\n bVar3.mo20818b(bVar2);\n }\n }\n }\n }\n }\n HashSet hashSet = new HashSet();\n for (Set addAll : hashMap.values()) {\n hashSet.addAll(addAll);\n }\n return hashSet;\n }", "@Override\n public Petrinet compose(String id, Set<String> flags, Context context, Petrinet... petrinets) throws CompilationException {\n\n Petrinet x = petrinets[0].reId(\"G\");\n MultiProcessModel model = buildmpmFromPetri(x);\n Map<Multiset<PetriNetPlace>, AutomatonNode> markingToNode = model.getProcessNodesMapping().getMarkingToNode();\n //Map<AutomatonNode, Multiset<PetriNetPlace> > nodeToMarking = model.getProcessNodesMapping().getNodeToMarking();\n\n return composeM(id,flags,context,markingToNode,x);\n }", "public Object lambda10(Object a, Object b, Object c, Object d) {\n Object[] objArr = new Object[4];\n objArr[0] = C1259lists.cons(C1259lists.car.apply1(this.elt), a);\n Object[] objArr2 = objArr;\n objArr2[1] = C1259lists.cons(C1259lists.cadr.apply1(this.elt), b);\n Object[] objArr3 = objArr2;\n objArr3[2] = C1259lists.cons(C1259lists.caddr.apply1(this.elt), c);\n Object[] objArr4 = objArr3;\n objArr4[3] = C1259lists.cons(C1259lists.cadddr.apply1(this.elt), d);\n return misc.values(objArr4);\n }", "public static void compose() {\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n source.subscribe(new MyObserver<>());\n return source;\n });\n\n System.out.println(\"# 2\");\n\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n Observable<String> observable = Observable.just(\"composed\");\n observable.subscribe(new MyObserver<>());\n return observable;\n });\n }", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "public Object lambda13(Object a, Object b, Object c, Object d, Object e) {\n Object[] objArr = new Object[5];\n objArr[0] = C1259lists.cons(C1259lists.car.apply1(this.elt), a);\n Object[] objArr2 = objArr;\n objArr2[1] = C1259lists.cons(C1259lists.cadr.apply1(this.elt), b);\n Object[] objArr3 = objArr2;\n objArr3[2] = C1259lists.cons(C1259lists.caddr.apply1(this.elt), c);\n Object[] objArr4 = objArr3;\n objArr4[3] = C1259lists.cons(C1259lists.cadddr.apply1(this.elt), d);\n Object[] objArr5 = objArr4;\n objArr5[4] = C1259lists.cons(C1259lists.car.apply1(C1259lists.cddddr.apply1(this.elt)), e);\n return misc.values(objArr5);\n }", "private static char recompose(RecomposeArgs paramRecomposeArgs, int paramInt, UnicodeSet paramUnicodeSet)\n/* */ {\n/* 1315 */ int i3 = 0;int i4 = 0;\n/* */ \n/* */ \n/* */ \n/* 1319 */ int[] arrayOfInt = new int[2];\n/* 1320 */ int i7 = -1;\n/* 1321 */ int n = 0;\n/* 1322 */ int i6 = 0;\n/* 1323 */ int i5 = 0;\n/* */ \n/* 1325 */ NextCombiningArgs localNextCombiningArgs = new NextCombiningArgs(null);\n/* 1326 */ localNextCombiningArgs.source = paramRecomposeArgs.source;\n/* */ \n/* 1328 */ localNextCombiningArgs.cc = '\\000';\n/* 1329 */ localNextCombiningArgs.c2 = '\\000';\n/* */ for (;;)\n/* */ {\n/* 1332 */ localNextCombiningArgs.start = paramRecomposeArgs.start;\n/* 1333 */ int m = getNextCombining(localNextCombiningArgs, paramRecomposeArgs.limit, paramUnicodeSet);\n/* 1334 */ int i1 = localNextCombiningArgs.combiningIndex;\n/* 1335 */ paramRecomposeArgs.start = localNextCombiningArgs.start;\n/* */ \n/* 1337 */ if (((m & 0x80) != 0) && (i7 != -1)) { int i;\n/* 1338 */ int j; int k; if ((i1 & 0x8000) != 0)\n/* */ {\n/* */ \n/* */ \n/* */ \n/* 1343 */ if (((paramInt & 0x100) != 0) || (i5 == 0)) {\n/* 1344 */ i = -1;\n/* 1345 */ m = 0;\n/* 1346 */ localNextCombiningArgs.c2 = paramRecomposeArgs.source[i7];\n/* 1347 */ if (i1 == 65522)\n/* */ {\n/* */ \n/* */ \n/* 1351 */ localNextCombiningArgs.c2 = ((char)(localNextCombiningArgs.c2 - 'ᄀ'));\n/* 1352 */ if (localNextCombiningArgs.c2 < '\\023') {\n/* 1353 */ i = paramRecomposeArgs.start - 1;\n/* 1354 */ localNextCombiningArgs.c = ((char)(44032 + (localNextCombiningArgs.c2 * '\\025' + (localNextCombiningArgs.c - 'ᅡ')) * 28));\n/* */ \n/* 1356 */ if ((paramRecomposeArgs.start != paramRecomposeArgs.limit) && ((localNextCombiningArgs.c2 = (char)(paramRecomposeArgs.source[paramRecomposeArgs.start] - 'ᆧ')) < '\\034'))\n/* */ {\n/* */ \n/* 1359 */ paramRecomposeArgs.start += 1; NextCombiningArgs \n/* 1360 */ tmp261_259 = localNextCombiningArgs;tmp261_259.c = ((char)(tmp261_259.c + localNextCombiningArgs.c2));\n/* */ }\n/* */ else {\n/* 1363 */ m = 64;\n/* */ }\n/* 1365 */ if (!nx_contains(paramUnicodeSet, localNextCombiningArgs.c)) {\n/* 1366 */ paramRecomposeArgs.source[i7] = localNextCombiningArgs.c;\n/* */ }\n/* */ else {\n/* 1369 */ if (!isHangulWithoutJamoT(localNextCombiningArgs.c)) {\n/* 1370 */ paramRecomposeArgs.start -= 1;\n/* */ }\n/* */ \n/* 1373 */ i = paramRecomposeArgs.start;\n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1388 */ else if (isHangulWithoutJamoT(localNextCombiningArgs.c2)) {\n/* 1389 */ NextCombiningArgs tmp351_349 = localNextCombiningArgs;tmp351_349.c2 = ((char)(tmp351_349.c2 + (localNextCombiningArgs.c - 'ᆧ')));\n/* 1390 */ if (!nx_contains(paramUnicodeSet, localNextCombiningArgs.c2)) {\n/* 1391 */ i = paramRecomposeArgs.start - 1;\n/* 1392 */ paramRecomposeArgs.source[i7] = localNextCombiningArgs.c2;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1397 */ if (i != -1)\n/* */ {\n/* 1399 */ j = i;\n/* 1400 */ k = paramRecomposeArgs.start;\n/* 1401 */ while (k < paramRecomposeArgs.limit) {\n/* 1402 */ paramRecomposeArgs.source[(j++)] = paramRecomposeArgs.source[(k++)];\n/* */ }\n/* 1404 */ paramRecomposeArgs.start = i;\n/* 1405 */ paramRecomposeArgs.limit = j;\n/* */ }\n/* */ \n/* 1408 */ localNextCombiningArgs.c2 = '\\000';\n/* */ \n/* 1410 */ if (m != 0)\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1417 */ if (paramRecomposeArgs.start == paramRecomposeArgs.limit) {\n/* 1418 */ return (char)i5;\n/* */ }\n/* */ \n/* */ \n/* 1422 */ n = 65520;\n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1438 */ else if (((n & 0x8000) == 0) && ((paramInt & 0x100) != 0 ? (i5 == localNextCombiningArgs.cc) || (i5 != 0) : (i5 < localNextCombiningArgs.cc) || (i5 == 0)))\n/* */ {\n/* */ int i2;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1446 */ if (0 != (i2 = combine(combiningTable, n, i1, arrayOfInt)))\n/* */ {\n/* */ \n/* 1449 */ if (!nx_contains(paramUnicodeSet, (char)i3, (char)i4))\n/* */ {\n/* 1451 */ i3 = arrayOfInt[0];\n/* 1452 */ i4 = arrayOfInt[1];\n/* */ \n/* */ \n/* */ \n/* 1456 */ i = localNextCombiningArgs.c2 == 0 ? paramRecomposeArgs.start - 1 : paramRecomposeArgs.start - 2;\n/* */ \n/* */ \n/* 1459 */ paramRecomposeArgs.source[i7] = ((char)i3);\n/* 1460 */ if (i6 != 0) {\n/* 1461 */ if (i4 != 0)\n/* */ {\n/* 1463 */ paramRecomposeArgs.source[(i7 + 1)] = ((char)i4);\n/* */ }\n/* */ else\n/* */ {\n/* 1467 */ i6 = 0;\n/* 1468 */ j = i7 + 1;\n/* 1469 */ k = j + 1;\n/* 1470 */ while (k < i) {\n/* 1471 */ paramRecomposeArgs.source[(j++)] = paramRecomposeArgs.source[(k++)];\n/* */ }\n/* 1473 */ i--;\n/* */ }\n/* 1475 */ } else if (i4 != 0) {\n/* 1476 */ i6 = 1;\n/* 1477 */ paramRecomposeArgs.source[(i7 + 1)] = ((char)i4);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1483 */ if (i < paramRecomposeArgs.start) {\n/* 1484 */ j = i;\n/* 1485 */ k = paramRecomposeArgs.start;\n/* 1486 */ while (k < paramRecomposeArgs.limit) {\n/* 1487 */ paramRecomposeArgs.source[(j++)] = paramRecomposeArgs.source[(k++)];\n/* */ }\n/* 1489 */ paramRecomposeArgs.start = i;\n/* 1490 */ paramRecomposeArgs.limit = j;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1496 */ if (paramRecomposeArgs.start == paramRecomposeArgs.limit) {\n/* 1497 */ return (char)i5;\n/* */ }\n/* */ \n/* */ \n/* 1501 */ if (i2 > 1) {\n/* 1502 */ n = getCombiningIndexFromStarter((char)i3, (char)i4); continue;\n/* */ }\n/* */ \n/* 1505 */ i7 = -1;\n/* */ \n/* */ \n/* */ \n/* 1509 */ continue;\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* 1514 */ i5 = localNextCombiningArgs.cc;\n/* 1515 */ if (paramRecomposeArgs.start == paramRecomposeArgs.limit) {\n/* 1516 */ return (char)i5;\n/* */ }\n/* */ \n/* */ \n/* 1520 */ if (localNextCombiningArgs.cc == 0)\n/* */ {\n/* 1522 */ if ((m & 0x40) != 0)\n/* */ {\n/* 1524 */ if (localNextCombiningArgs.c2 == 0) {\n/* 1525 */ i6 = 0;\n/* 1526 */ i7 = paramRecomposeArgs.start - 1;\n/* */ } else {\n/* 1528 */ i6 = 0;\n/* 1529 */ i7 = paramRecomposeArgs.start - 2;\n/* */ }\n/* 1531 */ n = i1;\n/* */ }\n/* */ else {\n/* 1534 */ i7 = -1;\n/* */ }\n/* 1536 */ } else if ((paramInt & 0x2000) != 0)\n/* */ {\n/* 1538 */ i7 = -1;\n/* */ }\n/* */ }\n/* */ }", "IVec3 mult(IVec3 v);", "public Matrix4f mult(Matrix4f r) {\r\n\t\tMatrix4f ret = new Matrix4f();\r\n\t\t\t\r\n\t\tfor(int i=0; i<4; i++) {\r\n\t\t\tfor(int j=0; j<4; j++) {\r\n\t\t\t\tret.m[i][j] = m[i][0] * r.m[0][j] +\r\n\t\t\t\t\t\t m[i][1] * r.m[1][j] +\r\n\t\t\t\t\t\t m[i][2] * r.m[2][j] +\r\n\t\t\t\t\t\t m[i][3] * r.m[3][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn ret;\r\n\t}", "public abstract Vector4fc mulProject(IMatrix4f mat);", "protected void sequence_Parallele4(ISerializationContext context, Parallele4 semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "public static void main(String[] args){\n\n ArrayList<String> test = new ArrayList<>();\n test.add(\"T\");\n test.add(\"L\");\n\n ArrayList<String> test2 = new ArrayList<>();\n test2.add(\"P\");\n\n PFD pfd1 = new PFD(test,test2,1);\n\n ArrayList<String> test3 = new ArrayList<>();\n test3.add(\"T\");\n test3.add(\"L\");\n\n ArrayList<String> test4 = new ArrayList<>();\n test4.add(\"M\");\n\n PFD pfd2 = new PFD(test3,test4,1);\n\n ArrayList<String> test5 = new ArrayList<>();\n test5.add(\"P\");\n ArrayList<String> test6 = new ArrayList<>();\n test6.add(\"M\");\n\n ArrayList<String> test7 = new ArrayList<>();\n test7.add(\"T\");\n ArrayList<String> test8 = new ArrayList<>();\n test8.add(\"S\");\n\n PFD pfd3 = new PFD(test5,test6,3);\n PFD pfd4 = new PFD(test7,test8,3);\n ArrayList<PFD> test2List = new ArrayList<PFD>(Arrays.asList(pfd1, pfd2));\n ArrayList<String> r = new ArrayList<String>(Arrays.asList(\"M\", \"S\", \"T\", \"P\"));\n// System.out.println(test2List);\n// System.out.println(\"Closure: \" + getClosureForAttr(new ArrayList<String>(Arrays.asList(\"T\",\"M\")),test2List,1));\n// System.out.println(\"BDNF? \"+ isSatisfiedBDFN(test2List,3));\n// System.out.println(getCanCover1(test2List));\n// S = DecomposeWithTheCertainty(r,test2List,4);\n// System.out.println(turnDeOutputToString());\n// System.out.println(getAllComb(r, new ArrayList<ArrayList<String>>()));\n\n// System.out.println(getMinimalKeys(test2List,r,4));\n\n// System.out.println(\"B-prime: \"+getBetaPrimeList(test2List,r,2));\n// System.out.println(\"Satisfied 3NF? \"+isSatisfied3NF(test2List,r,3));\n// System.out.println(\"Is not subset:\"+isNotSubset(pfd4,test2List));\n ArrayList<String> t = new ArrayList<>();\n t.add(\"A\");\n t.add(\"B\");\n t.add(\"C\");\n ArrayList<String> t1 = new ArrayList<>();\n t1.add(\"B\");\n t1.add(\"A\");\n// t1.add(\"D\");\n t.retainAll(t1);\n// System.out.println(t.toString());\n// System.out.println(String.join(\"\",t1));\n//\n// System.out.println(getAllCombo(r).toString());\n double x = 2 / 3.0;\n System.out.println(x);\n\n}", "public Transform compose(Transform other){\n float[][] ans = new float[4][4];\n for(int row = 0; row < 4; row++){\n for(int col = 0; col < 4; col++){\n for(int i = 0; i < 3; i++){\n ans[row][col] += this.values[row][i] * other.values[i][col];\n }\n }\n ans[row][3] += this.values[row][3];\n }\n return new Transform(ans);\n }", "public PhotometricStereo(String image1, String image2, String image3, String image4) {\n\t\tthis.I1 = retrieveImageIntensities(image1);\n\t\tthis.I2 = retrieveImageIntensities(image2);\n\t\tthis.I3 = retrieveImageIntensities(image3);\n\t\tthis.I4 = retrieveImageIntensities(image4);\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.print(combine(4, 2));\r\n\t}", "public static String convertCardNumber(String part1, String part4) {\n\n return part1 + \"*\" + part4;\n }", "private Combined() {}", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "@Override\n public IComplexNDArray gerc(IComplexNumber alpha, IComplexNDArray x,\n IComplexNDArray y, IComplexNDArray a) {\n NativeBlas.cgerc(a.rows(), a.columns(), (ComplexFloat) alpha, x.data(), x.offset(), 1, y.data(), y.offset(), 1, a.data(),\n a.offset(), a.rows());\n return a;\n }", "public void compose(TransformMatrix mB) {\n\t\ta = mB.a * a;\n\t\tb = mB.b * b;\n\t\tc = mB.a * c + mB.c;\n\t\td = mB.b * d + mB.d;\n\t}", "public ChampionnatComplexe (Matrice mat,Options o) {\n\t\topt = o;\n\t\tint [] Eq12 = FonctionsTransverses.tirage(12);\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3];\n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibreDesPoule = equilibreDesPoule + ( Integer.max(grpA1[z], grpB1[z]) - Integer.min(grpA1[z], grpB1[z]) ) + ( Integer.max(grpA2[z], grpB2[z]) - Integer.min(grpA2[z], grpB2[z]) );\n\t\t}\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}", "public static void main(String[] args) {\n\t\tList<Conta> lista = new Vector<Conta>();\r\n\t\t\r\n\t\t\r\n\t\tContaCorrente cc1 = new ContaCorrente(22, 11);\t\r\n\t\tConta cc2 = new ContaPoupanca(22, 22);\r\n\t\tlista.add(cc1);\r\n\t\tlista.add(cc2);\r\n\t\r\n\t\tSystem.out.println(\"Tamanho: \" + lista.size());\r\n\t\tConta ref = (Conta) lista.get(0);\r\n\t\tSystem.out.println(ref.getNumero());\r\n\t\t\r\n\t\tlista.remove(0);\r\n\t\tSystem.out.println(\"Tamanho: \" + lista.size());\r\n\t\t\r\n\t\tContaCorrente cc3 = new ContaCorrente(22, 33);\t\r\n\t\tConta cc4 = new ContaPoupanca(22, 44);\r\n\t\tlista.add(cc3);\r\n\t\tlista.add(cc4);\r\n\t\r\n//\t\tfor (int i = 0; i < lista.size(); i++) {\r\n//\t\t\tObject referencia = lista.get(i);\r\n//\t\t\tSystem.out.println(referencia);\r\n//\t\t}\r\n//\t\tPor ser mais código legado, ainda se escreve e se encontra o \"for\" da maneira acima.\r\n\t\t\r\n\t\tfor (Conta conta : lista) {\r\n\t\t\tSystem.out.println(conta);\r\n\t\t}\r\n\t\t\r\n\t}", "public void multL(TransformationMatrix m) {\n\t\tdouble b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34;\n\t\tb11 = m.a11*a11 + m.a12*a21 + m.a13*a31;\n\t\tb12 = m.a11*a12 + m.a12*a22 + m.a13*a32;\n\t\tb13 = m.a11*a13 + m.a12*a23 + m.a13*a33;\n\t\tb14 = m.a11*a14 + m.a12*a24 + m.a13*a34 + m.a14;\n\t\tb21 = m.a21*a11 + m.a22*a21 + m.a23*a31;\n\t\tb22 = m.a21*a12 + m.a22*a22 + m.a23*a32;\n\t\tb23 = m.a21*a13 + m.a22*a23 + m.a23*a33;\n\t\tb24 = m.a21*a14 + m.a22*a24 + m.a23*a34 + m.a24;\n\n\t\tb31 = m.a31*a11 + m.a32*a21 + m.a33*a31;\n\t\tb32 = m.a31*a12 + m.a32*a22 + m.a33*a32;\n\t\tb33 = m.a31*a13 + m.a32*a23 + m.a33*a33;\n\t\tb34 = m.a31*a14 + m.a32*a24 + m.a33*a34 + m.a34;\n\n\t\ta11 = b11; a12 = b12; a13 = b13; a14 = b14;\n\t\ta21 = b21; a22 = b22; a23 = b23; a24 = b24;\n\t\ta31 = b31; a32 = b32; a33 = b33; a34 = b34;\n\t}", "String mo1889a(String str, String str2, String str3, String str4);", "private static Atom[] getCAAtoms(Point3d[] points) {\n\n\t\tChain c = new ChainImpl();\n\t\tc.setId(\"A\");\t\n\n\t\t// create dummy BioJava atoms for each C-alpha coordinate\n\t\tAtom[] atoms = new Atom[points.length];\n\n\t\tfor (int i = 0; i < points.length; i++) {\n\t\t\tatoms[i] = new AtomImpl();\n\t\t\tatoms[i].setName(CA_NAME);\n\t\t\tGroup g = new AminoAcidImpl();\n\t\t\tg.setPDBName(GROUP_NAME);\n\t\t\tg.setResidueNumber(\"A\", i, ' ');\n\t\t\tg.addAtom(atoms[i]);\n\t\t\tc.addGroup(g);\n\n\t\t\tatoms[i].setX(points[i].x);\n\t\t\tatoms[i].setY(points[i].y);\n\t\t\tatoms[i].setZ(points[i].z);\n\t\t}\n\n\t\treturn atoms;\n\t}", "public static DeformableMesh3D mergeMeshes(List<DeformableMesh3D> meshes){\n int posCount = 0;\n int triCount = 0;\n int conCount = 0;\n for(DeformableMesh3D mesh: meshes){\n posCount += mesh.positions.length;\n triCount += mesh.triangle_index.length;\n conCount += mesh.connection_index.length;\n }\n double[] points = new double[posCount];\n int[] triangles = new int[triCount];\n int[] connections = new int[conCount];\n\n int offset = 0;\n int toff = 0;\n int coff = 0;\n\n for(DeformableMesh3D mesh: meshes){\n System.arraycopy(mesh.positions, 0, points, offset, mesh.positions.length);\n for(int i = 0; i<mesh.triangle_index.length; i++){\n triangles[i + toff] = mesh.triangle_index[i] + offset/3;\n }\n for(int i = 0; i<mesh.connection_index.length; i++){\n connections[i+coff] = mesh.connection_index[i] + offset/3;\n }\n\n\n offset += mesh.positions.length;\n toff += mesh.triangle_index.length;\n coff += mesh.connection_index.length;\n }\n\n return new DeformableMesh3D(points, connections, triangles);\n }", "public void mo29735a(p163g.p500m.p501a.C11747s r3, C<java.lang.Object> r4) throws java.io.IOException {\n /*\n r2 = this;\n r3.mo29787a()\n java.util.Iterator r4 = r4.iterator()\n L_0x0007:\n boolean r0 = r4.hasNext()\n if (r0 == 0) goto L_0x0017\n java.lang.Object r0 = r4.next()\n g.m.a.h<T> r1 = r2.f27291a\n r1.toJson(r3, r0)\n goto L_0x0007\n L_0x0017:\n r3.mo29794d()\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p163g.p500m.p501a.C11719e.mo29735a(g.m.a.s, java.util.Collection):void\");\n }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "@Test\n public void serialDecomposition_test1()\n {\n // The function:\n // i2 i4 i7 Q | o0 o2 o3\n // 1 1 0 G0 | 1 - -\n // 1 1 - G6 | - - 1\n // 0 0 0 G7 | - 1 -\n // 1 0 1 G0 | - 1 1\n // 1 1 1 G2 | - 1 1\n // 1 1 1 G5 | - 1 1\n // 0 1 0 G0 | - 1 1\n // 1 1 0 G2 | - 1 -\n // 1 - - G1 | - - 1\n // 1 0 0 G5 | 1 1 -\n // 0 1 1 G5 | - - 1\n // 0 - - G1 | - 1 -\n // 0 0 1 G0 | - - 1\n // 0 0 1 G2 | - - 1\n // 1 1 1 G7 | - 1 -\n // 0 0 0 G0 | - - 1\n // 1 1 0 G7 | - 1 1\n // 1 0 1 G2 | - 1 1\n // 0 1 0 G5 | - - 1\n // 1 1 0 G5 | - 1 1\n // 1 0 0 G2 | - 1 1\n // 1 0 0 G0 | - 1 1\n // 1 0 0 G7 | - 1 1\n // 1 0 1 G7 | - 1 -\n // 0 0 1 G5 | - - 1\n // 1 0 1 G5 | - 1 1\n // 0 0 1 G7 | 1 1 1\n // 1 1 - G0 | - 1 1\n // 0 0 0 G2 | 1 1 1\n // 1 - - G3 | - 1 -\n // 0 - - G3 | - - 1\n // 0 - - G5 | 0 - -\n // 0 - 0 G7 | 0 - -\n // 0 - - G0 | 0 - -\n // - - 1 G0 | 0 - -\n // - - 1 G2 | 0 - -\n // 1 0 - G0 | 0 - -\n // 1 0 - G2 | 0 - -\n // 1 0 - G7 | 0 - -\n // - 1 - G7 | 0 - -\n // - 1 - G5 | 0 - -\n // - 1 - G2 | 0 - -\n // 1 - 1 G5 | 0 - -\n // - - - G1 | 0 - -\n // - - - G3 | 0 - -\n // - - - G4 | 0 - -\n // - - - G0 | - - -\n // - - - G2 | - - -\n // - - - G6 | - - -\n // - - - G7 | - - -\n // - - - G5 | - - -\n // - - - G4 | - - -\n // - - - G6 | 0 - -\n // 0 0 0 G5 | 0 0 0\n // 0 - 1 G2 | - 0 -\n // 0 - 1 G5 | - 0 -\n // 0 1 - G2 | 0 0 0\n // 0 1 - G4 | 0 0 0\n // 0 1 - G2 | 0 0 -\n // 0 1 - G5 | 0 0 -\n // 0 1 - G4 | 0 0 -\n // 0 - 0 G7 | 0 - 0\n // 0 1 - G7 | 0 0 0\n // 0 0 - G0 | 0 0 -\n // 0 0 - G4 | 0 0 -\n // 0 1 1 G0 | 0 0 0\n // 0 - - G4 | 0 0 0\n // 0 - - G3 | - 0 -\n // 0 - - G4 | - 0 -\n // 0 - - G1 | 0 - 0\n // 0 - - G4 | 0 - 0\n // - 0 0 G6 | - - 0\n // - 0 0 G5 | - - 0\n // - 0 0 G4 | - - 0\n // 1 0 1 G6 | - - 0\n // - 0 - G6 | 0 0 0\n // 1 - 1 G7 | - - 0\n // 1 - - G1 | 0 0 -\n // 1 - - G6 | 0 0 -\n // 1 - - G4 | 0 0 -\n // - 1 0 G2 | - - 0\n // - 1 0 G4 | - - 0\n // - - - G4 | 0 0 0\n // 1 - - G3 | - - 0\n // 1 - - G4 | - - 0\n // - - - G3 | - - -\n // - - - G1 | - - -\n\n // Y = {o0o2o3}, U = {i7}, V = {i2i4}\n // Iv = i2i4\n Blanket βIv = Blanket.create(\"1,2,5,6,8,9,15,17,20,28,30,35,36,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,78,79,80,81,82,83,84,85,86,87; 3,12,13,14,16,25,27,29,31,32,33,34,35,36,44,45,46,47,48,49,50,51,52,53,54,55,56,62,64,65,67,68,69,70,71,72,73,74,76,83,86,87; 4,9,10,18,21,22,23,24,26,30,35,36,37,38,39,43,44,45,46,47,48,49,50,51,52,53,72,73,74,75,76,77,78,79,80,83,84,85,86,87; 7,11,12,19,31,32,33,34,35,36,40,41,42,44,45,46,47,48,49,50,51,52,53,55,56,57,58,59,60,61,62,63,66,67,68,69,70,71,81,82,83,86,87;\");\n // Iu = i7\n Blanket βIu = Blanket.create(\"1,2,3,7,8,9,10,12,16,17,19,20,21,22,23,28,29,30,31,32,33,34,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,57,58,59,60,61,62,63,64,65,67,68,69,70,71,72,73,74,76,78,79,80,81,82,83,84,85,86,87; 2,4,5,6,9,11,12,13,14,15,18,24,25,26,27,28,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,55,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,75,76,77,78,79,80,83,84,85,86,87;\");\n Blanket βQ = Blanket.create(\"G0:1,4,7,13,16,22,28,34,35,37,47,64,66; G1:9,12,44,70,78,87; G2:5,8,14,18,21,29,36,38,42,48,55,57,59,81; G3:30,31,45,68,84,86; G4:46,52,58,61,65,67,69,71,74,80,82,83,85; G5:6,10,11,19,20,25,26,32,41,43,51,54,56,60,73; G6:2,49,53,72,75,76,79; G7:3,15,17,23,24,27,33,39,40,50,62,63,77;\");\n Blanket βY = Blanket.create(\"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,47,48,49,50,51,52,86,87; 1,2,9,11,13,14,16,19,25,31,47,48,49,50,51,52,55,56,68,69,86,87; 1,3,8,10,12,15,24,30,47,48,49,50,51,52,72,73,74,75,77,81,82,84,85,86,87; 1,47,48,49,50,51,52,55,56,68,69,72,73,74,75,77,81,82,84,85,86,87; 2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,86,87; 2,9,11,13,14,16,19,25,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,55,56,59,60,61,64,65,68,69,78,79,80,86,87; 3,8,12,15,24,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,62,70,71,72,73,74,75,77,81,82,84,85,86,87; 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87;\");\n DecompositionBlankets decomposition = Decompositions.serialDecomposition(βIv, βIu, βQ, βY, 0, false);\n Assertions.assertThat(decomposition).isNotNull();\n\n Blanket βQv = decomposition.QvJoinedWithQu ? decomposition.Qu.BxB(decomposition.QvPartial) : decomposition.Qv;\n Blanket βQu = decomposition.QuJoinedWithQv ? decomposition.Qv.BxB(decomposition.QuPartial) : decomposition.Qu;\n\n Assertions.assertThat(decomposition.Iv.BxB(βQv).BleB(decomposition.G)).isTrue(); // βIv x βQv <= βG - true\n Assertions.assertThat(decomposition.G.BxB(decomposition.Iu != null ? decomposition.Qu.BxB(decomposition.Iu) : βQu).BleB(decomposition.H)).isTrue(); // βIu x βG x βQu <= βY - true\n Assertions.assertThat(decomposition.Qv.BxB(decomposition.Qu).BeqB(decomposition.Q)).isTrue(); // βQv x βQu = βQ - true\n Assertions.assertThat(decomposition.Qv.BxB(decomposition.Qu).BeqB(βQ)).isTrue(); // βQv x βQu = βQ - true\n }", "public ArrayList<ArrayList<Course>> permutationOfCourseList(ArrayList<Course> originalCourseList) {\n ArrayList<ArrayList<Course>> results = new ArrayList<ArrayList<Course>>();\n if (originalCourseList == null || originalCourseList.size() == 0) {\n return results;\n }\n ArrayList<Course> result = new ArrayList<>();\n recursivePermuter(originalCourseList, results, result);\n return results;\n }", "static void _cpmvMergeResult(Object result_, Vector vresult_)\r\n {\r\n if (result_ == null) return;\r\n if (result_ instanceof Component || result_ instanceof Port)\r\n vresult_.addElement(result_);\r\n else {\r\n Object[] tmp_ = (Object[])result_;\r\n for (int j=0; j<tmp_.length; j++) vresult_.addElement(tmp_[j]);\r\n }\r\n }", "protected ByteBuf compose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next)\r\n/* 41: */ {\r\n/* 42:75 */ if ((cumulation instanceof CompositeByteBuf))\r\n/* 43: */ {\r\n/* 44:76 */ CompositeByteBuf composite = (CompositeByteBuf)cumulation;\r\n/* 45:77 */ composite.addComponent(true, next);\r\n/* 46:78 */ return composite;\r\n/* 47: */ }\r\n/* 48:80 */ return composeIntoComposite(alloc, cumulation, next);\r\n/* 49: */ }", "protected Vector combinePaths (Component [] activePaths)\n {\n HashSet set = new HashSet();\n for (int i=0; i < activePaths.length; i++) {\n set.addAll(activePaths[i].getNodes());\n } // for i\n return new Vector(set);\n\n }", "public PrimObject perform(PrimObject arg1, PrimObject arg2, PrimObject arg3, PrimObject arg4, String selector) {\n return perform0(selector, arg1, arg2, arg3, arg4);\n }", "public ArrayList<C0252a> m1289a(ac acVar, int i, int i2, int i3) {\r\n int i4;\r\n double d = this.f759h[this.f758g];\r\n int e = (int) ((acVar.m827e() - this.f754c) / (256.0d * d));\r\n double d2 = this.f754c + (((double) (e * 256)) * d);\r\n double d3 = 0.0d;\r\n int f;\r\n if (this.f753b == 0) {\r\n f = (int) ((this.f755d - acVar.m828f()) / (256.0d * d));\r\n d3 = this.f755d - (((double) (f * 256)) * d);\r\n i4 = f;\r\n } else if (this.f753b == 1) {\r\n f = (int) ((acVar.m828f() - this.f755d) / (256.0d * d));\r\n d3 = ((double) ((f + 1) * 256)) * d;\r\n i4 = f;\r\n } else {\r\n i4 = 0;\r\n }\r\n PointF a = m1286a(new ac(d3, d2, false), acVar, this.f763l, d);\r\n C0252a c0252a = new C0252a(e, i4, this.f758g, -1);\r\n c0252a.f1050f = a;\r\n ArrayList<C0252a> arrayList = new ArrayList();\r\n arrayList.add(c0252a);\r\n int i5 = 1;\r\n while (true) {\r\n int i6;\r\n Object obj = null;\r\n for (i6 = e - i5; i6 <= e + i5; i6++) {\r\n Object obj2;\r\n int i7 = i4 + i5;\r\n PointF a2 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a2 != null) {\r\n if (obj == null) {\r\n obj2 = 1;\r\n } else {\r\n obj2 = obj;\r\n }\r\n C0252a c0252a2 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a2.f1050f = a2;\r\n arrayList.add(c0252a2);\r\n obj = obj2;\r\n }\r\n i7 = i4 - i5;\r\n PointF a3 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a3 != null) {\r\n if (obj == null) {\r\n obj = 1;\r\n }\r\n C0252a c0252a3 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a3.f1050f = a3;\r\n arrayList.add(c0252a3);\r\n }\r\n }\r\n for (i7 = (i4 + i5) - 1; i7 > i4 - i5; i7--) {\r\n i6 = e + i5;\r\n a2 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a2 != null) {\r\n if (obj == null) {\r\n obj2 = 1;\r\n } else {\r\n obj2 = obj;\r\n }\r\n c0252a2 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a2.f1050f = a2;\r\n arrayList.add(c0252a2);\r\n obj = obj2;\r\n }\r\n i6 = e - i5;\r\n a3 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a3 != null) {\r\n if (obj == null) {\r\n obj = 1;\r\n }\r\n c0252a3 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a3.f1050f = a3;\r\n arrayList.add(c0252a3);\r\n }\r\n }\r\n if (obj == null) {\r\n return arrayList;\r\n }\r\n i5++;\r\n }\r\n }", "protected Score compose() {\r\n // Simple example composition\r\n Phrase phrase = new Phrase();\r\n Score s = new Score(new Part(phrase));\r\n //for(int i = 0; i < 8; i++) {\r\n Note n = new Note (48 + (int)(Math.random() * variableA), 0.5 + variableB * 0.25);\r\n phrase.addNote(n);\r\n //}\r\n \r\n //Instrument[] tempInsts = {new SineInst(44100)};\r\n //insts = tempInsts;\r\n return s;\r\n }", "public static /* synthetic */ int m28133a(List list, Object obj, Comparator comparator, int i, int i2, int i3, Object obj2) {\n if ((i3 & 4) != 0) {\n i = 0;\n }\n if ((i3 & 8) != 0) {\n i2 = list.size();\n }\n return m28132a(list, (T) obj, comparator, i, i2);\n }", "public List init(List list) {\n Iterator it = components.iterator();\n PortletComponent comp;\n while (it.hasNext()) {\n comp = (PortletComponent) it.next();\n comp.setTheme(theme);\n list = comp.init(list);\n }\n System.err.println(\"Made a components list!!!! \" + list.size());\n for (int i = 0; i < list.size(); i++) {\n ComponentIdentifier c = (ComponentIdentifier) list.get(i);\n System.err.println(\"id: \" + c.getComponentID() + \" : \" + c.getClassName() + \" : \" + c.hasPortlet());\n \n }\n componentIdentifiers = list;\n return componentIdentifiers;\n }", "private ArrayList<Vertex> getProjectedVertices4(){\n\t\t\n\t\tArrayList<Vertex> projectedVertices = new ArrayList<>(); // To store the projection of each vertex\n\t\t\n\t\t// Transform each vertex from world coordinates to eye coordinates\n\t\tfor(Vertex v : vertices){\n\t\t\tprojectedVertices.add(v.transform4());\n\t\t}\n\t\t\n\t\tfor(Vertex v : projectedVertices){\n\n\t\t\t// Get perspective projection onto 3D region\n\t\t\tVertex projection = v.perspectiveProjection4();\n\t\t\tv.setX(projection.getX());\n\t\t\tv.setY(projection.getY());\n\t\t\tv.setZ(projection.getZ());\n\t\t\t\n\t\t\t// Map to viewbox\n\t\t\tprojection = v.mapToViewbox();\n\t\t\tv.setX(projection.getX());\n\t\t\tv.setY(projection.getY());\n\t\t\tv.setZ(projection.getZ());\n\t\t}\n\t\t\n\t\treturn projectedVertices;\n\t}", "public abstract ArrayList<Object> calculateTransform(ArrayList<Integer> arr);", "ArrayList<ArrayList<Double>> getComponentsCorelationTableModel(\n ArrayList<ArrayList<Double>> workingObjectData) {\n ArrayList<ArrayList<Double>> new_all_objects = new ArrayList<>();\n ArrayList<ArrayList<Double>> workingFeatureData = getTransposedData(workingObjectData);\n int size = eigenVectors.length;\n for (int i = 0; i < objectCount; i++) {\n ArrayList<Double> object = new ArrayList<>();\n\n for (int j = 0; j < size; j++) {\n double sum = 0;\n for (int k = 0; k < featureCount; k++) {\n sum += workingObjectData.get(i).get(k) * eigenVectors[j][k];\n }\n object.add(sum);\n }\n new_all_objects.add(object);\n }\n new_all_components = getTransposedData(new_all_objects);\n double[][] new_correlation = new double[featureCount][size];\n for (int h = 0; h < featureCount; h++)\n for (int j = 0; j < size; j++) {\n new_correlation[h][j] =\n middleSquareValue(new_all_components.get(j), middleValue(new_all_components.get(j))) /\n middleSquareValue(workingFeatureData.get(h), middleValue(workingFeatureData.get(h)))\n * eigenVectors[j][h];\n }\n return doubleArrayToDoubleList(new_correlation);\n }", "BasicSet NextLClosure(BasicSet M,BasicSet A){\r\n\t\t//ConceptLattice cp=new ConceptLattice(context);\r\n\t\t//ApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\r\n\r\n\t\t\t\tBasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "String mo1888b(String str, String str2, String str3, String str4);", "public static void main(String[] args) {\n\t\tCollection c=new ArrayList();\n\t\t\n\t\tc.add(23);\n\t\tc.add(34);\n\t\t\n\t\tCollection c1=new ArrayList();\n\t\t\n\tc1.add(45);\n\tc1.add(67);\n\t\n\tc.addAll(c1);\n\tSystem.out.println(c);\n\t\n\t\n\tCollection c2=new ArrayList();\n\tc2.add(12);\n\tc2.add(23);\n\tc2.add(25);\n\t\n\tCollection c3=new ArrayList();\n\tc3.add(34);\n\tc3.add(45);\n\tc3.add(25);\n\tc3.add(25);\n\t\n\tc2.addAll(c3);\n\t\n\tSystem.out.println(c2);\n\tSystem.out.println(\"-------------------\");\n\t\n\t\n\tc2.removeAll(c3);\n\tSystem.out.println(c2);\n\t\n\tSystem.out.println(\"-------------------\");\n\tCollection c4=new ArrayList();\n\tc4.add(25);\n\tc4.add(23);\n\tc4.add(86);\n\tc4.add(98);\n\t\n\t\n\t\n\tCollection c5=new ArrayList();\n\tc5.add(25);\n\tc5.add(23);\n\tc5.add(12);\n\tc5.add(13);\n\t\n\tc4.retainAll(c5);\n\tSystem.out.println(c4);\n\t\n\tSystem.out.println(\"-------------------\");\n\t\n\tCollection c6=new ArrayList();\n\tc6.add(12);\n\tc6.add(23);\n\t\n\tObject a[]= c6.toArray();\n\tfor(int i=0;i < a.length ; i++)\n\t{\n\t\tSystem.out.println(a[i]);\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t\n\tc4.clear();\n\tSystem.out.println(c4);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t}", "public static <A, B, C, D> Equal<P4<A, B, C, D>> p4Equal(final Equal<A> ea, final Equal<B> eb, final Equal<C> ec,\n final Equal<D> ed) {\n return new Equal<P4<A, B, C, D>>(new F<P4<A, B, C, D>, F<P4<A, B, C, D>, Boolean>>() {\n public F<P4<A, B, C, D>, Boolean> f(final P4<A, B, C, D> p1) {\n return new F<P4<A, B, C, D>, Boolean>() {\n public Boolean f(final P4<A, B, C, D> p2) {\n return ea.eq(p1._1(), p2._1()) && eb.eq(p1._2(), p2._2()) && ec.eq(p1._3(), p2._3()) &&\n ed.eq(p1._4(), p2._4());\n }\n };\n }\n });\n }", "public Composite lcm(Composite comp) {\n\t\tif(this.head.factor == 1){\n\t\t\treturn comp;\n\t\t}\n\t\tif(comp.head.factor == 1){\n\t\t\treturn this;\n\t\t}\n\t\tComposite multiple = new Composite();\n\t\tmultiple = this.multiply(comp);\n\t\tlong num = multiple.head.factor;\n\t\tlong d = 1;\n\t\tComposite com_divisor = this.gcd(comp);\n\t\twhile(com_divisor.head != null){\n\t\t\td *= Math.pow(com_divisor.head.factor, com_divisor.head.power);\n\t\t\tcom_divisor.head = com_divisor.head.next;\n\t\t}\n\t\tlong ans = num / d;\n\t\tBigInteger ans_b = BigInteger.valueOf(ans);\n\t\t\n\t\treturn new Composite(ans_b);\n\t}", "public tc a(List<lc> list) {\n long j2;\n LinkedList linkedList = new LinkedList(list);\n Collections.sort(linkedList);\n linkedList.add(new lc(-1, -1, -1));\n ArrayList arrayList = new ArrayList();\n long j3 = 0;\n int i2 = 0;\n while (true) {\n j2 = -9223372036854775807L;\n if (i2 >= a()) {\n break;\n }\n if (((lc) linkedList.peek()).a != i2) {\n long b2 = b(i2);\n if (b2 != -9223372036854775807L) {\n j3 += b2;\n }\n } else {\n ov a2 = a(i2);\n ov ovVar = new ov(a2.a, a2.b - j3, a(a2.c, linkedList), a2.d);\n arrayList.add(ovVar);\n }\n i2++;\n }\n long j4 = this.b;\n if (j4 != -9223372036854775807L) {\n j2 = j4 - j3;\n }\n tc tcVar = new tc(this.a, j2, this.c, this.d, this.e, this.f, this.g, this.h, this.k, this.i, this.j, arrayList);\n return tcVar;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn this.l1.hashCode() + this.l2.hashCode() + this.l3.hashCode();\n\t}", "public Composite add(Composite comp) {\n\t\t// REPLACE WITH WORKING CODE\n\t\t//do last\n//\t\tComposite common_factor = new Composite();\n//\t\tcommon_factor = this.lcm(comp);\n//\t\tlong factor = 0;\n//\t\twhile(common_factor != null){\n//\t\t\tfactor *= Math.pow(common_factor.head.factor, common_factor.head.power);\n//\t\t\tcommon_factor.head = common_factor.head.next;\n//\t\t}\n\t\tlong t = 1;\n\t\twhile(this.head != null){\n\t\t\tt *= Math.pow(this.head.factor, this.head.power);\n\t\t\tthis.head = this.head.next;\n\t\t}\n//\t\tt = t - factor;\n\t\tlong c = 1;\n\t\twhile(comp.head != null){\n\t\t\tc *= Math.pow(comp.head.factor, comp.head.power);\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n//\t\tc = c - factor;\n//\t\tlong remainder = c + t;\n\t\tlong sum = c + t;\n\t\t\n\t\treturn new Composite(BigInteger.valueOf(sum));\n\t}", "public final PropagationStrategy coll(ArrayList<? extends ISchedulable> elements, CombinedAttribute ca) throws RecognitionException {\n PropagationStrategy ps = null;\n\n\n CommonTree r = null;\n CommonTree m = null;\n Iterator it = null;\n\n\n if (elements.isEmpty()) {\n LOGGER.error(\"% Create a empty collection\");\n throw new FZNException(\"Create a empty collection\");\n } else if (elements.size() == 1) {\n LOGGER.warn(\"% Create a collection with a single element\");\n }\n\n try {\n // parser/flatzinc/FlatzincFullExtWalker.g:435:5: ( ^( QUEUE it= qiter ) | ^( LIST (r= REV )? it= liter ) | ^( HEAP (m= MAX )? it= qiter ) )\n int alt24 = 3;\n switch (input.LA(1)) {\n case QUEUE: {\n alt24 = 1;\n }\n break;\n case LIST: {\n alt24 = 2;\n }\n break;\n case HEAP: {\n alt24 = 3;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 24, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt24) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:435:7: ^( QUEUE it= qiter )\n {\n match(input, QUEUE, FOLLOW_QUEUE_in_coll978);\n\n match(input, Token.DOWN, null);\n pushFollow(FOLLOW_qiter_in_coll982);\n it = qiter();\n\n state._fsp--;\n\n\n match(input, Token.UP, null);\n\n\n ps = new Queue(elements.toArray(new ISchedulable[elements.size()]));\n ps = it.set(ps);\n ps.attachEvaluator(ca);\n\n\n }\n break;\n case 2:\n // parser/flatzinc/FlatzincFullExtWalker.g:441:7: ^( LIST (r= REV )? it= liter )\n {\n match(input, LIST, FOLLOW_LIST_in_coll998);\n\n match(input, Token.DOWN, null);\n // parser/flatzinc/FlatzincFullExtWalker.g:441:15: (r= REV )?\n int alt22 = 2;\n switch (input.LA(1)) {\n case REV: {\n alt22 = 1;\n }\n break;\n }\n\n switch (alt22) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:441:15: r= REV\n {\n r = (CommonTree) match(input, REV, FOLLOW_REV_in_coll1002);\n\n }\n break;\n\n }\n\n\n pushFollow(FOLLOW_liter_in_coll1007);\n it = liter();\n\n state._fsp--;\n\n\n match(input, Token.UP, null);\n\n\n ISchedulable[] elts = elements.toArray(new ISchedulable[elements.size()]);\n // check if an order is required\n boolean order = false;\n for (int i = 0; i < elts.length; i++) {\n try {\n elts[i].evaluate();\n order = true;\n } catch (NullPointerException npe) {\n if (order) {\n LOGGER.error(\"% Cannot sort the collection, keys are missing\");\n throw new FZNException(\"Cannot sort the collection, keys are missing\");\n }\n }\n }\n ps = new Sort(order, r != null, elts);\n ps = it.set(ps);\n ps.attachEvaluator(ca);\n\n\n }\n break;\n case 3:\n // parser/flatzinc/FlatzincFullExtWalker.g:461:7: ^( HEAP (m= MAX )? it= qiter )\n {\n match(input, HEAP, FOLLOW_HEAP_in_coll1023);\n\n match(input, Token.DOWN, null);\n // parser/flatzinc/FlatzincFullExtWalker.g:461:15: (m= MAX )?\n int alt23 = 2;\n switch (input.LA(1)) {\n case MAX: {\n alt23 = 1;\n }\n break;\n }\n\n switch (alt23) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:461:15: m= MAX\n {\n m = (CommonTree) match(input, MAX, FOLLOW_MAX_in_coll1027);\n\n }\n break;\n\n }\n\n\n pushFollow(FOLLOW_qiter_in_coll1032);\n it = qiter();\n\n state._fsp--;\n\n\n match(input, Token.UP, null);\n\n\n ISchedulable[] elts = elements.toArray(new ISchedulable[elements.size()]);\n for (int i = 0; i < elts.length; i++) {\n try {\n elts[i].evaluate();\n } catch (NullPointerException npe) {\n LOGGER.error(\"% Cannot sort the collection, keys are missing\");\n throw new FZNException(\"Cannot sort the collection, keys are missing\");\n }\n }\n ps = new SortDyn(m != null, elts);\n ps = it.set(ps);\n ps.attachEvaluator(ca);\n\n\n }\n break;\n\n }\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return ps;\n }", "public Matrix4f GetMultipliedMatrix(Matrix4f m) {\n\n\t/*\n\tinputs--\n\t\n\tm :\n\t The input matrix m, instance of Matrix4f\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tmul :\n\t The matrix this times m\n\t*/\n\t\n\t// Create new matrix to hold the results\n\tMatrix4f mul = new Matrix4f();\n\t\n\t// Double for loop based standard multiplication\n\tfor (int n_i = 0; n_i < 4; n_i ++) {\n\t \n\t for(int n_j = 0; n_j < 4 ; n_j ++) {\n\t\t\n\t\t// Set entry one by one\n\t\tfloat f_val = 0;\n\t\tfor (int n_k = 0; n_k < 4; n_k ++) {\n\t\t\n\t\t f_val += this.mat_f_m[n_i][n_k]*m.GetComponent(n_k, n_j);\n\t\t\n\t\t}\n\t\tmul.SetComponent(n_i, n_j, f_val);\n\t\t\n\t }\n\t\n\t}\n\t\n\t// Return the multiplied matrix\n\treturn mul;\n \n }", "public static void main(String[] args) {\n\t\tCar a=new Car(); //object creation , here a:object reference variables\n\t\tCar b =new Car();\n\t\tCar c=new Car();\n\t\t\n\t\ta.mod=2015;\n\t\ta.wheel=4;\n\t\t\n\t\tb.mod=2014;\n\t\tb.wheel=4;\n\t\t\n\t\tc.mod=2013;\n\t\tc.wheel=4;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(a.mod);\n\tSystem.out.println(b.wheel);\n\t//shifting of object refrences\n\ta=b;\n\tb=c;\n\tc=a;\n\t\t\ta.mod=10;\n\t\t\tSystem.out.println(a.mod);\n\t\t\tc.mod=20;\n\t\t\tSystem.out.println(a.mod);\n\t}", "private static final <R, C extends Collection<? super R>> C m64428a(@C6003d Object[] objArr, C c) {\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n c.add(obj);\n }\n }\n return c;\n }", "void mo54408a(int i, int i2, int i3, int i4);", "public static void main(String[] args) {\r\n System.out.println(combine(5, 3));\r\n System.out.println(combine1(5, 2));\r\n }", "private List<QuantifiedVariableCore> transform(QuantifiedVariableCore[] qv)\n {\n List<QuantifiedVariableCore> qv0 = new ArrayList<QuantifiedVariableCore>();\n for (QuantifiedVariableCore q : qv)\n qv0.add(transform(q));\n return qv0;\n }", "private static int mergeOrdered(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4, boolean paramBoolean)\n/* */ {\n/* 738 */ int k = 0;\n/* */ \n/* */ \n/* 741 */ int m = paramInt2 == paramInt3 ? 1 : 0;\n/* 742 */ NextCCArgs localNextCCArgs = new NextCCArgs(null);\n/* 743 */ localNextCCArgs.source = paramArrayOfChar2;\n/* 744 */ localNextCCArgs.next = paramInt3;\n/* 745 */ localNextCCArgs.limit = paramInt4;\n/* */ \n/* 747 */ if ((paramInt1 != paramInt2) || (!paramBoolean))\n/* */ {\n/* 749 */ while (localNextCCArgs.next < localNextCCArgs.limit) {\n/* 750 */ int j = getNextCC(localNextCCArgs);\n/* 751 */ if (j == 0)\n/* */ {\n/* 753 */ k = 0;\n/* 754 */ if (m != 0) {\n/* 755 */ paramInt2 = localNextCCArgs.next;\n/* */ } else {\n/* 757 */ paramArrayOfChar2[(paramInt2++)] = localNextCCArgs.c;\n/* 758 */ if (localNextCCArgs.c2 != 0) {\n/* 759 */ paramArrayOfChar2[(paramInt2++)] = localNextCCArgs.c2;\n/* */ }\n/* */ }\n/* 762 */ if (paramBoolean) {\n/* */ break;\n/* */ }\n/* 765 */ paramInt1 = paramInt2;\n/* */ }\n/* */ else {\n/* 768 */ int i = paramInt2 + (localNextCCArgs.c2 == 0 ? 1 : 2);\n/* 769 */ k = insertOrdered(paramArrayOfChar1, paramInt1, paramInt2, i, localNextCCArgs.c, localNextCCArgs.c2, j);\n/* */ \n/* 771 */ paramInt2 = i;\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* 776 */ if (localNextCCArgs.next == localNextCCArgs.limit)\n/* */ {\n/* 778 */ return k;\n/* */ }\n/* 780 */ if (m == 0)\n/* */ {\n/* */ do {\n/* 783 */ paramArrayOfChar1[(paramInt2++)] = paramArrayOfChar2[(localNextCCArgs.next++)];\n/* 784 */ } while (localNextCCArgs.next != localNextCCArgs.limit);\n/* 785 */ localNextCCArgs.limit = paramInt2;\n/* */ }\n/* 787 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 788 */ localPrevArgs.src = paramArrayOfChar2;\n/* 789 */ localPrevArgs.start = paramInt1;\n/* 790 */ localPrevArgs.current = localNextCCArgs.limit;\n/* 791 */ return getPrevCC(localPrevArgs);\n/* */ }", "protected Decomposition(int components) {\n this.components = components;\n }", "public static void main(String[] args) {\n\t\tShared s=new Shared();\n\t\tComposing[] c={new Composing(s),new Composing(s),new Composing(s),new Composing(s),new Composing(s) };\n\t\tfor (Composing composing : c) {\n\t\t\tcomposing.dispose();\n\t\t}\n\t\tComposing compTest=new Composing(s);\n\t\tComposing comTest2=new Composing(s);\n\t\ts.finalize();\n\t\tShared s2=new Shared();\n\t\tComposing comTest3=new Composing(s2);\n\t\ts2.finalize();\n\t}", "private void m14040a(C4393d c4393d, List<Certificate> list) {\n try {\n c4393d.mo4573m((long) list.size()).mo4568k(10);\n int size = list.size();\n for (int i = 0; i < size; i++) {\n c4393d.mo4550b(ByteString.m14642a(((Certificate) list.get(i)).getEncoded()).m14654b()).mo4568k(10);\n }\n } catch (C4393d c4393d2) {\n throw new IOException(c4393d2.getMessage());\n }\n }", "public ChampionnatComplexe (int [] Eq12,Matrice mat,Options o ) {\n\t\topt = o;\n\t\tint equilibrea = 0;\n\t\tint equilibreb = 0;\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3]; \n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibrea = grpA1[z] + grpA2[z] ;\n\t\t\tequilibreb = grpB1[z] + grpB2[z] ;\n\t\t}\n\t\tequilibreDesPoule = Integer.max(equilibrea, equilibreb) - Integer.min(equilibreb, equilibreb);\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}", "public abstract Combinacion elegirCombinacionOculta();", "private void compose() {\n for(Group group : inputGroupList){\n if(group.getGroups().size() > 0){\n LinkedList<Integer> upperGroups = group.getGroups();\n for(int i = 0; i < upperGroups.size(); i++){\n int id = upperGroups.get(i);\n Group upper = findById(id);\n upper.addChild(group);\n }\n } else{\n root.addChild(group);\n }\n }\n for(Address adr : inputAddressList){\n if(adr.getGroups().size() > 0){\n LinkedList<Integer> upperGroups = adr.getGroups();\n for(int i = 0; i < upperGroups.size(); i++){\n int id = upperGroups.get(i);\n Group upper = findById(id);\n upper.addChild(adr);\n adr.addParent(upper);\n }\n } else{\n root.addChild(adr);\n }\n }\n\n assert(root.getChildren().size() > 0);\n }", "private IMatrix cofactor() {\n\t\tint n = this.getColsCount();\n\t\tIMatrix algCompl = newInstance(n, n);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tdouble value = Math.pow(-1, i + j);\n\t\t\t\tIMatrix sub = this.subMatrix(i, j, true);\n\t\t\t\tDouble det = sub.determinant();\n\t\t\t\tvalue *= det;\n\t\t\t\talgCompl.set(i, j, value);\n\t\t\t}\n\t\t}\n\t\treturn algCompl;\n\t}", "static Vector4d computePlane(Vector3d a, Vector3d b, Vector3d c)\n\t{\n\t\tVector4d plane = new Vector4d();\n\t\t\n\t\tVector3d ab = new Vector3d();\n\t\tab.sub(b, a);\n\t\t\n\t\tVector3d ac = new Vector3d();\n\t\tac.sub(c, a);\n\t\t\n\t\tVector3d n = new Vector3d();\n\t\tn.cross(ab, ac);\n\t\tn.normalize();\n\t\t\n\t\tplane.set(n);\n\t\tplane.w = - a.dot(n);\n\t\t\n\t\treturn plane;\n\t}", "public TransformationMatrix(TransformationMatrix l, TransformationMatrix r) {\n\t\ta11 = l.a11*r.a11 + l.a12*r.a21 + l.a13*r.a31;\n\t\ta12 = l.a11*r.a12 + l.a12*r.a22 + l.a13*r.a32;\n\t\ta13 = l.a11*r.a13 + l.a12*r.a23 + l.a13*r.a33;\n\t\ta14 = l.a11*r.a14 + l.a12*r.a24 + l.a13*r.a34 + l.a14;\n\t\ta21 = l.a21*r.a11 + l.a22*r.a21 + l.a23*r.a31;\n\t\ta22 = l.a21*r.a12 + l.a22*r.a22 + l.a23*r.a32;\n\t\ta23 = l.a21*r.a13 + l.a22*r.a23 + l.a23*r.a33;\n\t\ta24 = l.a21*r.a14 + l.a22*r.a24 + l.a23*r.a34 + l.a24;\n\t\ta31 = l.a31*r.a11 + l.a32*r.a21 + l.a33*r.a31;\n\t\ta32 = l.a31*r.a12 + l.a32*r.a22 + l.a33*r.a32;\n\t\ta33 = l.a31*r.a13 + l.a32*r.a23 + l.a33*r.a33;\n\t\ta34 = l.a31*r.a14 + l.a32*r.a24 + l.a33*r.a34 + l.a34;\n\n\t}", "public static void main(String[] args) {\n\t\tint[] a=new int[10];\n\t\tInteger a1[]= {10,20,30};\n\t\t\n\t\t\n\t\tArrayList<Integer>a2=new ArrayList<Integer>(Arrays.asList(a1));\n\tVector <Integer> aggg4=new Vector<Integer>();\n\tSystem.out.println(aggg4.capacity());\n\t\ta2.add(80);\n\t\ta2.add(90);\n\t\ta2.add(100);\n//\t\tfor(int i=0;i<a2.size();i++)\n//\t\t{\n\t\t\tSystem.out.println(a2);\n\t\t\tInteger a3[]=new Integer[a2.size()];\n\t\t\ta2.toArray(a3);\n\t\t\tfor(int i=0;i<a3.length;i++)\n\t\t\t{\n\t\t\tSystem.out.println(a3[i]);\n\t\t\t}\n\t\t\tArrayList a4=new ArrayList<Integer>();\n\t\t\ta4.add(110);\n\t\t\ta4.add(120);\n\t\t\tObject[] i=a4.toArray();\n\t\t\tfor(Object oo:i)\n\t\t\t{\n\t\t\t\tSystem.out.println(oo);\n\t\t\t}\n\t\n\t\t\t\n\t\t\t\n\t//}\n\t}", "public void a(List<cvm> paramList)\r\n/* 73: */ {\r\n/* 74: 79 */ b();\r\n/* 75: */ \r\n/* 76: 81 */ a.info(\"Reloading ResourceManager: \" + b.join(Iterables.transform(paramList, new cvu(this))));\r\n/* 77: 88 */ for (cvm localcvm : paramList) {\r\n/* 78: 89 */ a(localcvm);\r\n/* 79: */ }\r\n/* 80: 92 */ c();\r\n/* 81: */ }", "public static void main(String[] args) {\n\t\tint numCourses = 5;\n\t\tint[][] prerequisites = {\n\t\t\t\t{0,1},\n\t\t\t\t{2,4},\n\t\t\t\t{3,4},\n\t\t\t\t{1,3},\n\t\t\t\t{2,3}\n\t\t\t};\n\t\t\n\t\tint res[] = findOrder(numCourses, prerequisites);\n\t\t\n\t\tfor(int val: res)\n\t\t\tSystem.out.print(\" \" + val);\n\t\t\n\t}", "public AffineTransform3D(double M11, double M12, double M13, double M14,\r\n\t\t\tdouble M21, double M22, double M23, double M24, double M31,\r\n\t\t\tdouble M32, double M33, double M34, double M41, double M42,\r\n\t\t\tdouble M43, double M44) {\r\n\t\tthis.M11 = M11;\r\n\t\tthis.M12 = M12;\r\n\t\tthis.M13 = M13;\r\n\t\tthis.M14 = M14;\r\n\t\tthis.M21 = M21;\r\n\t\tthis.M22 = M22;\r\n\t\tthis.M23 = M23;\r\n\t\tthis.M24 = M24;\r\n\t\tthis.M31 = M31;\r\n\t\tthis.M32 = M32;\r\n\t\tthis.M33 = M33;\r\n\t\tthis.M34 = M34;\r\n\t\tthis.M41 = M41;\r\n\t\tthis.M42 = M42;\r\n\t\tthis.M43 = M43;\r\n\t\tthis.M44 = M44;\r\n\t}", "ORDecomposition createORDecomposition();", "public Composite multiply(Composite comp) {\n\t\tif(comp.isUnit()){\n\t\t\treturn this;\n\t\t}\n\t\tif(this.isUnit()){\n\t\t\treturn comp;\n\t\t}\n\t\tNode head = comp.head;\n\t\tNode current_node = this.head;\n\t\t//long product = 1;\n\t\tBigInteger product = BigInteger.ONE;\n\t\twhile (current_node != null){\n\t\t\tlong factor = (long) Math.pow(current_node.factor, current_node.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\twhile (comp.head != null){\n\t\t\tlong factor = (long)Math.pow(comp.head.factor, comp.head.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n\t\tComposite p = new Composite();\n\t\tNode n = new Node(product.longValue(), 1);\n\t\tp.head = n;\n\t\tcomp.head = head;\n\t\treturn p;\n\t}", "public static void main(String[] args) {\n getList(lista1,m);\n getList(lista2,n);\n Integer[] arr1 = new Integer[lista1.size()];\n lista1.toArray(arr1);\n Integer[] arr2 = new Integer[lista2.size()];\n lista2.toArray(arr2);\n\n m=lista1.size();\n n=lista2.size();\n System.out.println(\"Primul polinom: \");\n printPoly(arr1, m);\n System.out.println(\"\\nAl doilea polinom: \");\n printPoly(arr2, n);\n Integer[] sum = add(arr1, arr2, m, n);\n Integer[] prod = multiply(arr1,arr2,m,n);\n int size = max(m, n);\n System.out.println(\"\\nSuma polinoamelor: \");\n printPoly(sum, size);\n System.out.println(\"\\nProdusul polinoamelor: \");\n printPoly(prod, m+n-1);\n\n }", "private void calcPartInverse(int i, int i1, int i2, int i3, int i4, Radical1 op1, Radical1 op2, Radical1 op3, Radical1 op4, Radical1 l1) {\r\n\t\taddR(l1, mulR(values[i], subR(mulR(values[i1], values[i2], op3), mulR(values[i3], values[i4], op4), op2), op1), l1);\r\n\t}", "protected <T> List<List<T>> cartesianProduct(List<List<T>> lists) {\n\t List<List<T>> resultLists = new ArrayList<List<T>>();\n\t if (lists.size() == 0) {\n\t resultLists.add(new ArrayList<T>());\n\t \n\t return resultLists;\n\t } else {\n\t List<T> firstList = lists.get(0);\n\t List<List<T>> remainingLists = cartesianProduct(lists.subList(1, lists.size()));\n\t for (T condition : firstList) {\n\t for (List<T> remainingList : remainingLists) {\n\t ArrayList<T> resultList = new ArrayList<T>();\n\t resultList.add(condition);\n\t resultList.addAll(remainingList);\n\t resultLists.add(resultList);\n\t }\n\t }\n\t }\n\t System.out.print(String.format(\"\\r%d\", resultLists.size()));\n\t return resultLists;\n\t}", "public final void rule__Cooperate__Group__4__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:4835:1: ( ( ( rule__Cooperate__RoleAssignment_4 ) ) )\r\n // InternalDroneScript.g:4836:1: ( ( rule__Cooperate__RoleAssignment_4 ) )\r\n {\r\n // InternalDroneScript.g:4836:1: ( ( rule__Cooperate__RoleAssignment_4 ) )\r\n // InternalDroneScript.g:4837:2: ( rule__Cooperate__RoleAssignment_4 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getCooperateAccess().getRoleAssignment_4()); \r\n }\r\n // InternalDroneScript.g:4838:2: ( rule__Cooperate__RoleAssignment_4 )\r\n // InternalDroneScript.g:4838:3: rule__Cooperate__RoleAssignment_4\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Cooperate__RoleAssignment_4();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getCooperateAccess().getRoleAssignment_4()); \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 }" ]
[ "0.5363483", "0.5201708", "0.5178615", "0.49331474", "0.48113453", "0.4809156", "0.48059472", "0.47542253", "0.47213256", "0.46850678", "0.46812648", "0.46792457", "0.46697402", "0.4624743", "0.46167877", "0.46139616", "0.4608819", "0.4588922", "0.4582169", "0.4571173", "0.45269313", "0.4524933", "0.4522145", "0.45005864", "0.44919804", "0.4486795", "0.44787526", "0.44718015", "0.4470124", "0.44659668", "0.44608262", "0.44469178", "0.44182312", "0.4404874", "0.44046167", "0.43982273", "0.4393064", "0.43824127", "0.43795013", "0.43776467", "0.43774825", "0.43732062", "0.43729174", "0.4371955", "0.43704534", "0.43686068", "0.43653002", "0.43618912", "0.43507895", "0.43456027", "0.43422008", "0.43390304", "0.4338869", "0.4338171", "0.4337014", "0.43345162", "0.4332756", "0.4316128", "0.43074113", "0.43043488", "0.43036526", "0.43013033", "0.42898136", "0.4286013", "0.42845345", "0.42839655", "0.42778137", "0.42749754", "0.42743233", "0.42665598", "0.4264707", "0.42633802", "0.42631394", "0.42621243", "0.42600372", "0.4258386", "0.4257035", "0.42523676", "0.42499533", "0.42484567", "0.42462206", "0.42442396", "0.42368954", "0.4236847", "0.423093", "0.42277414", "0.42274565", "0.42273596", "0.42269948", "0.42252073", "0.4223301", "0.42174295", "0.4215843", "0.4212087", "0.42119548", "0.4210495", "0.42097428", "0.42069077", "0.42056718", "0.42046064" ]
0.59165955
0
Concatenation. L1 and L2 are lists. L=CONC(L1,L2). The list L1 is modified.
public static <C> LIST<C> CONC(LIST<C> L1, LIST<C> L2) { if ( isNull( L1 ) ) { return L2; } if ( isNull( L2 ) ) { return L1; } L1.list.addAll( L2.list ); return L1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> CCONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n LinkedList<C> list = new LinkedList<C>( L1.list );\n list.addAll( L2.list );\n return new LIST<C>( list );\n }", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public LinkedList concatenate(LinkedList anotherList) {\n\t\tLinkedList newString = stringList;\n\t\t\n\t\treturn newString;\n\t}", "public String concatenate() {\n\t\t// loop over each node in the list and \n\t\t// concatenate into a single string\n\t\tString concatenate = \"\";\n\t\tNode nodref = head;\n\t\twhile (nodref != null){\n\t\t\tString temp = nodref.data;\n\t\t\tconcatenate += temp;\n\t\t\tnodref = nodref.next;\n\t\t}\n\t\treturn concatenate;\n\t}", "private static <Item extends Comparable> List<Item> catenate(List<Item> q1, List<Item> q2) {\n List<Item> catenated = new ArrayList<>();\n for (Item item : q1) {\n catenated.add(item);\n }\n for (Item item: q2) {\n catenated.add(item);\n }\n return catenated;\n }", "public String concate(String x, String y)\n\t{\n\t\treturn x.concat(y);\n\t}", "public String devolver_campos_concatenados(){\n String dato_concatenado=\"\";\n campos_concaenados=\" \";\n for (int j=0;j<numero_campos;j++){\n if(j==numero_campos-1){\n dato_concatenado=campos[j];\n }else{\n dato_concatenado=campos[j]+\", \";\n }\n campos_concaenados=campos_concaenados+dato_concatenado;\n }\n \n return campos_concaenados;\n }", "public String conCat(String a, String b) {\r\n String res = \"\";\r\n\r\n if (a.length() > 0 && b.length() > 0) {\r\n if (a.charAt(a.length() - 1) == b.charAt(0)) {\r\n res = a + b.substring(1);\r\n } else {\r\n res = a + b;\r\n }\r\n } else {\r\n res = a + b;\r\n }\r\n\r\n return res;\r\n }", "public void concat2Strings(String s1, String s2)\r\n {\r\n // s1.concat(s2);\r\n ///sau\r\n s1=s1+s2;\r\n System.out.println(\"Stringurile concatenate sunt \"+s1);\r\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "@NonNull\n @SafeVarargs\n static <V> ConsList<V> concat(@NonNull ConsList<V> first, @NonNull ConsList<V>... rest) {\n Objects.requireNonNull(first, \"Null concat argument at position 0\");\n Objects.requireNonNull(rest, ConsUtil.MSG_ARG_ARRAY_REST_IS_NULL);\n if (rest.length == 0) {\n return first;\n }\n ConsList<V> result = rest[rest.length - 1];\n if (result == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + rest.length);\n }\n for (int i = rest.length - 2; i >= -1; i--) {\n ConsList<V> cons;\n if (i == -1) {\n cons = first;\n } else {\n if (rest[i] == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + (i + 1));\n }\n cons = rest[i].reverse();\n }\n while (cons != Nil.INSTANCE) {\n result = new ConsListImpl<>(cons.head(), result);\n cons = cons.tail();\n }\n }\n return result;\n }", "@NonNull\n @SafeVarargs\n static LongConsList<Long> concat(@NonNull LongConsList<Long> first, @NonNull LongConsList<Long>... rest) {\n Objects.requireNonNull(first, ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS_0);\n Objects.requireNonNull(rest, ConsUtil.MSG_ARG_ARRAY_REST_IS_NULL);\n if (rest.length == 0) {\n return first;\n }\n LongConsList<Long> result = rest[rest.length - 1];\n if (result == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + rest.length);\n }\n for (int i = rest.length - 2; i >= -1; i--) {\n LongConsList<Long> cons;\n if (i == -1) {\n cons = first;\n } else {\n if (rest[i] == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + (i + 1));\n }\n cons = rest[i].longReverse();\n }\n while (cons != Nil.INSTANCE) {\n result = new LongConsListImpl(cons.longHead(), result);\n cons = cons.longTail();\n }\n }\n return result;\n }", "public static String myConcatenator(String str1, String str2)\r\n {\r\n str1 += str2;\r\n return str1;\r\n }", "Concat createConcat();", "public static Node cccc_combination(LinkedList list1, LinkedList list2) {\n\n Node Katlyn1 = list1.head;\n Node Katlyn2 = list2.head;\n Node nodethaniel = new Node(0);\n Node tail = nodethaniel;\n\n while (true) {\n if (Katlyn1 == null) {\n tail.next = Katlyn2;\n break;\n }\n if (Katlyn2 == null) {\n tail.next = Katlyn1;\n break;\n }\n // Arrow function in Java?\n if (Katlyn1.valueData <= Katlyn2.valueData) {\n tail.next = Katlyn1;\n Katlyn1 = Katlyn1.next;\n } else {\n tail.next = Katlyn2;\n Katlyn2 = Katlyn2.next;\n }\n tail = tail.next;\n }\n return nodethaniel.next;\n }", "static List<StateRef> append(List<StateRef> l1, List<StateRef> l2) {\n l1.addAll(l2);\n return l1;\n }", "private Cell[] concatArray(Cell[] arr1, Cell[] arr2) {\r\n\t\tCell[] concat = new Cell[arr1.length + arr2.length];\r\n\t\tfor (int k = 0; k < concat.length; k++) {\r\n\t\t\tif (k < arr1.length) {\r\n\t\t\t\tconcat[k] = arr1[k];\r\n\t\t\t} else {\r\n\t\t\t\tconcat[k] = arr2[k - arr1.length];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn concat;\r\n\t}", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static Seq plus(Constant c1, Constant c2) {\n return new Constant((c1.num < c2.num)?c1.num:c2.num, (c1.value + c2.value)); \n }", "public String[] concatArrays(String[] input1, String[] input2){\n String[] result = new String[input1.length + input2.length];\n System.arraycopy(input1, 0, result, 0, input1.length);\n System.arraycopy(input2, 0, result, input1.length, result.length - input1.length);\n return result;\n }", "public final Fp6 conj()\r\n\t{\r\n\t\treturn new Fp6(v0.conj(), v1.conj().neg(), v2.conj());\r\n\t}", "public static void prefixMerge(Client [] list1, Client [] list2, Client[] result){\n int resultCount = 0;\n for (int i = 0; resultCount < result.length; i++) //goes through list1 up until the end of result\n {\n for (int j = 0; j < list2.length && resultCount < result.length; j++) //goes through list2 up until the end of list2\n {\n for (int k = 0; k < resultCount; k++) { //check if current element of list2 is already in result\n if (list2[j].compareClient(result[k]) == 0) { j++; } //without this there is an issue where the previous element of list1 is\n } //repeated in list2 but the current element of list1 is larger\n\n if (list2[j].compareClient(list1[i]) < 0) { //copies current element of list2 to result if it is smaller\n result[resultCount] = list2[j]; //than current element of list1\n resultCount++;\n }\n }\n if (resultCount < result.length) { //copies current element of list1 to result if there is room in result\n result[resultCount] = list1[i]; // needed if statement because of outOfBounds exception where all elements\n resultCount++; //in result were already filled by list2\n }\n }\n\n }", "public static String conocidosToString(List<String> conocidos){\r\n String s = \"\"; \r\n for(int i= 0; i<conocidos.size(); i++){\r\n String c = conocidos.get(i);\r\n s = s + c + \" \";\r\n }\r\n return s;\r\n \r\n}", "public static void prefixMerge(Client [] list1, Client [] list2,\n Client[] result){\n\n int listOneIndex = 0;\n int listTwoIndex = 0;\n for (int i = 0; i < result.length; i++){\n if (list1[listOneIndex].compareClient(list2[listTwoIndex]) < 0){\n result[i] = list1[listOneIndex];\n listOneIndex++;\n } else if (list1[listOneIndex].compareClient(list2[listTwoIndex]) > 0) {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n } else {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n listOneIndex++;\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n public static <T> T[] concat(T[] left, T[] right) {\n T[] res;\n\n if (ArrayUtils.isEmpty(left)) {\n res = right;\n } else if (ArrayUtils.isEmpty(right)) {\n res = left;\n } else {\n res = (T[]) Array.newInstance(left[0].getClass(), left.length + right.length);\n System.arraycopy(left, 0, res, 0, left.length);\n System.arraycopy(right, 0, res, left.length, right.length);\n }\n\n return res;\n }", "@Override\n\tpublic void concatenate(SetLinkedList<T> otherSet) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented yet!\");\n\t}", "ArrayList<Float> polaczListy (ArrayList<Float> L1, ArrayList<Float> L2)\n\t{\n\t\tint i=L1.size();\n\t\twhile(i<Stale.horyzontCzasowy)\n\t\t{\n\t\t\tL1.add(L2.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn L1;\n\t}", "public static <C> LIST<C> CINV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LinkedList<C> list = new LinkedList<C>(L.list);\n Collections.reverse( list );\n return new LIST<C>( list );\n }", "public LinkedString concat(LinkedString str)\n {\n int num = this.length();\n for(int i = 0; i < str.length(); i++)\n {\n this.insert(num + i, str.charAt(i));\n }\n \n return this;\n }", "private ArrayList<Concert> cloneConcertList(){\n ArrayList<Concert> tempConcertList = new ArrayList<Concert>();\n tempConcertList.addAll(concertList);\n return tempConcertList;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public void concat(Matrix matrix) {\n\t\t\n\t}", "public static void main(String[] args) {\n List<String> res = lcs(\"LCLC\",\"CLCL\");\r\n for(String s:res){\r\n \t System.out.print(s +\",\");\r\n }\r\n\t}", "public static String concat(String[] list) {\n StringJoiner joiner = new StringJoiner(\" \");\n for (String s : list) {\n joiner.add(s);\n }\n return joiner.toString();\n }", "public String join(String conjunction, Iterable<String> list) {\n\t\treturn join(conjunction, list.iterator());\n\t}", "public static <T> T[] concat(T[] first, T[] second) {\r\n\t\tT[] result = Arrays.copyOf(first, first.length + second.length);\r\n\t\tSystem.arraycopy(second, 0, result, first.length, second.length);\r\n\t\treturn result;\r\n\t}", "public void addCc(List<String> addresses) {\n\t\tcc.addAll(addresses);\n\t}", "private static <T> Set<T> union(Collection<T> c1, Collection<T> c2) {\n return Stream.concat(c1.stream(), c2.stream()).collect(Collectors.toUnmodifiableSet());\n }", "public static String concatenar(Object[] lista){\n String cadena = \"\";\n for(Object item: lista){\n cadena += item.toString();\n }\n return cadena;\n }", "public static Object[] arrayConcatenate(Object[] input, Object[] a1, Object[] a2) {\r\n\t\tint i = 0;\r\n\t\tfor(int j = 0; j < a1.length; j++) {\r\n\t\t\tinput[i] = a1[j];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tfor(int j = 0; j < a2.length; j++) {\r\n\t\t\tinput[i] = a2[j];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn input;\r\n\t}", "private String[] combine(String array1[], String array2[]) {\n\t\tint length = array1.length + array2.length;\r\n\t\tString result[] = new String[length];\r\n\t\tSystem.arraycopy(array1, 0, result, 0, array1.length);\r\n\t\tSystem.arraycopy(array2, 0, result, array1.length, array2.length);\r\n\t\treturn result;\r\n\t}", "@Override\n public UnitConverter concatenate(final UnitConverter converter) {\n ArgumentChecks.ensureNonNull(\"converter\", converter);\n if (equals(converter.inverse())) {\n return IdentityConverter.INSTANCE;\n }\n // Delegate to c1 and c2 because they may provide more intelligent 'concatenate' implementations.\n return c2.concatenate(c1.concatenate(converter));\n }", "@Override\n public void combineCons(ArrayList<Note> list) {\n }", "public Expression concat(Expression expr) {\r\n\t\telements.addAll(expr.elements);\r\n\t\treturn this;\r\n\t}", "public String join(String conjunction, String[] list) {\n\t\treturn join(conjunction, Arrays.asList(list));\n\t}", "public List<String> merge(List<String> list1, List<String> list2){\n List<String> res = new ArrayList<>();\n for (String l1 : list1){\n for (String l2 : list2){\n res.add(l1+l2);\n }\n }\n return res;\n }", "public static String concat(List<String> list, String seperator) {\n StringBuilder builder = new StringBuilder();\n\n for (String elem : list) {\n builder.append(elem);\n builder.append(seperator);\n }\n\n if (builder.length() > 0)\n builder.delete(builder.length() - seperator.length(), builder.length());\n\n return builder.toString();\n }", "@NonNull\n @SafeVarargs\n static IntConsList<Integer> concat(@NonNull IntConsList<Integer> first, @NonNull IntConsList<Integer>... rest) {\n Objects.requireNonNull(first, ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS_0);\n Objects.requireNonNull(rest, ConsUtil.MSG_ARG_ARRAY_REST_IS_NULL);\n if (rest.length == 0) {\n return first;\n }\n IntConsList<Integer> result = rest[rest.length - 1];\n if (result == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + rest.length);\n }\n for (int i = rest.length - 2; i >= -1; i--) {\n IntConsList<Integer> cons;\n if (i == -1) {\n cons = first;\n } else {\n if (rest[i] == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + (i + 1));\n }\n cons = rest[i].intReverse();\n }\n while (cons != Nil.INSTANCE) {\n result = new IntConsListImpl(cons.intHead(), result);\n cons = cons.intTail();\n }\n }\n return result;\n }", "private OtherChargesDTO[] combineLrcGsc(OtherChargesDTO[] lrcDTO, OtherChargesDTO[] gscDTO){\n\t\tint gscLen = 0;\n\t\tint lrcLen = 0;\n\t\tint finalLen = 0;\n\t\tArrayList<OtherChargesDTO> listGsc = null;\n\t\tOtherChargesDTO[] others = null;\n\t\t\n\t\tlrcLen = lrcDTO.length;\n\t\tgscLen = gscDTO.length;\n\t\tlistGsc = new ArrayList<OtherChargesDTO>(Arrays.asList(gscDTO));\n\t\tfor (int i = 0; i < lrcLen; i++) {\n\t\t\tfor (int j = 0; j < gscLen; j++) {\n\t\t\t\tif (gscDTO[j].getStationCode().equals(lrcDTO[i].getStationCode())) {\n\t\t\t\t\tlrcDTO[i].setGsc(gscDTO[j].getGsc());\n\t\t\t\t\tlistGsc.remove(gscDTO[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfinalLen = lrcLen + listGsc.size();\n\t\tothers = new OtherChargesDTO[finalLen];\n\t\tOtherChargesDTO newGSCDTO = null;\n\t\tfor (int k = 0, l = 0; k < finalLen; k++) {\n\t\t\tothers[k] = new OtherChargesDTO();\n\t\t\tif (k < lrcLen) {\n\t\t\t\tothers[k] = lrcDTO[k];\n\t\t\t} else {\n\t\t\t\tnewGSCDTO = (OtherChargesDTO) listGsc.get(l);\n\t\t\t\tothers[k].setStationCode(newGSCDTO.getStationCode());\n\t\t\t\t//others[k].setLrCharge(0);\n\t\t\t\tothers[k].setGsc(newGSCDTO.getGsc());\n\t\t\t\tl++;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn others;\t\t\n\t}", "public static byte[] concat(final byte[] bytes1, final byte[] bytes2) {\n\t\tfinal byte[] result = new byte[bytes1.length + bytes2.length];\n\t\tSystem.arraycopy(bytes1, 0, result, 0, bytes1.length);\n\t\tSystem.arraycopy(bytes2, 0, result, bytes1.length, bytes2.length);\n\t\treturn result;\n\t}", "public List<Instruccion> emite(List<Instruccion> cod1, Instruccion cod2) {\r\n\t\t\tcod1.add(cod2);\r\n\t\t\treturn cod1;\r\n\t}", "@NonNull\n @SafeVarargs\n static DoubleConsList<Double> concat(@NonNull DoubleConsList<Double> first, @NonNull DoubleConsList<Double>... rest) {\n Objects.requireNonNull(first, \"Null concat argument at position 0\");\n Objects.requireNonNull(rest, ConsUtil.MSG_ARG_ARRAY_REST_IS_NULL);\n if (rest.length == 0) {\n return first;\n }\n DoubleConsList<Double> result = rest[rest.length - 1];\n if (result == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + rest.length);\n }\n for (int i = rest.length - 2; i >= -1; i--) {\n DoubleConsList<Double> cons;\n if (i == -1) {\n cons = first;\n } else {\n if (rest[i] == null) {\n throw new NullPointerException(ConsUtil.MSG_NULL_CONCAT_ARG_AT_POS + (i + 1));\n }\n cons = rest[i].doubleReverse();\n }\n while (cons != Nil.INSTANCE) {\n result = new DoubleConsListImpl(cons.doubleHead(), result);\n cons = cons.doubleTail();\n }\n }\n return result;\n }", "public void updateCxlcConciliar(Integer cxlcCiclo, Integer cxlcConciliacionSicop, List<Integer> cxlcConciliar, String usuario) {\n String updateCxlcComprometer = super.getQueryDefinition(\"updateCxlcConciliar\");\n \n Map<String, Object> mapValues = new HashMap<String, Object>();\n mapValues.put(\"cxlcCiclo\", cxlcCiclo);\n mapValues.put(\"cxlcConciliacionSicop\", cxlcConciliacionSicop);\n mapValues.put(\"cxlcConciliar\", cxlcConciliar);\n mapValues.put(\"usuario\", usuario);\n \n SqlParameterSource namedParameters = new MapSqlParameterSource(mapValues);\n DataSource ds = super.getJdbcTemplate().getDataSource();\n NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(ds);\n \n super.getJdbcTemplate().setFetchSize(100);\n \n namedTemplate.update(updateCxlcComprometer, namedParameters);\n }", "public static String concat(Object s1, Object s2) {\n return String.valueOf(s1) + String.valueOf(s2);\n }", "public /*@ non_null @*/\n JMLListEqualsNode<E> concat(/*@ non_null @*/ JMLListEqualsNode<E> ls2)\n {\n return (next == null\n ? new JMLListEqualsNode<E>(val, ls2)\n : new JMLListEqualsNode<E>(val, next.concat(ls2))\n );\n }", "public static void generate_CLL(String Rchain_value,Connection con2) throws SQLException{\n\t\tStatement st=con2.createStatement();\n\t\t\n\t\t//select all nodes in given Rchain\n\t\t//should be Path_BayesNets\n\t\tResultSet rst=st.executeQuery(\"SELECT distinct child from Path_BayesNets where Rchain ='\"+Rchain_value+\"';\");\n\t\tArrayList<String> node_list=new ArrayList<String>();\n\t\t\n\t\twhile(rst.next()){\n\t\t\tnode_list.add(rst.getString(1));\n\t\t}\n\t\t\n\t\t//generate CLL table for every node\n\t\tfor(int i=0;i<node_list.size();i++){\n\t\t\tgenerate_CLL_node(node_list.get(i), Rchain_value,con2);\n\t\t\n\t\t}\n\t\t\n\t\tst.close();\t\n\t}", "public StringConcat(Block block, StringResult arg1, StringResult arg2) {\n\t\tsuper(block, arg1, arg2);\n\t}", "public static void main(String args[]) {\r\n\t\r\n\tString x=new String(\"kajol\");\r\n\tx.concat(\"kk\");\r\n\tSystem.out.println(x);\r\n\tString z=new String(\"kedia\");\r\n\tz=z.concat(\"k\");\r\n\tSystem.out.println(z);\r\n}", "public Language concatenate(final Language language) {\n if (this.isEmpty() || language.isEmpty())\n return new Language();\n final Language concatenatedLanguage = new Language();\n for (final String s1 : strings) {\n for (final String s2 : language.strings) {\n concatenatedLanguage.addString(s1+s2);\n }\n }\n return concatenatedLanguage;\n }", "public final CQLParser.concatFunction_return concatFunction() throws RecognitionException {\n CQLParser.concatFunction_return retval = new CQLParser.concatFunction_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n Token CONCAT139=null;\n CQLParser.arrayOperation_return e1 = null;\n\n CQLParser.arrayOperation_return e2 = null;\n\n\n Object CONCAT139_tree=null;\n\n try {\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:476:2: (e1= arrayOperation ( CONCAT e2= arrayOperation )? )\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:476:4: e1= arrayOperation ( CONCAT e2= arrayOperation )?\n {\n root_0 = (Object)adaptor.nil();\n\n pushFollow(FOLLOW_arrayOperation_in_concatFunction2304);\n e1=arrayOperation();\n\n state._fsp--;\n\n adaptor.addChild(root_0, e1.getTree());\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:476:22: ( CONCAT e2= arrayOperation )?\n int alt36=2;\n int LA36_0 = input.LA(1);\n\n if ( (LA36_0==CONCAT) ) {\n alt36=1;\n }\n switch (alt36) {\n case 1 :\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:476:23: CONCAT e2= arrayOperation\n {\n CONCAT139=(Token)match(input,CONCAT,FOLLOW_CONCAT_in_concatFunction2307); \n CONCAT139_tree = (Object)adaptor.create(CONCAT139);\n root_0 = (Object)adaptor.becomeRoot(CONCAT139_tree, root_0);\n\n pushFollow(FOLLOW_arrayOperation_in_concatFunction2312);\n e2=arrayOperation();\n\n state._fsp--;\n\n adaptor.addChild(root_0, e2.getTree());\n\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n \t\n \tcatch(RecognitionException re)\n \t{\t\n \t\treportError(re);\n \t\tthrow re;\n \t}\n finally {\n }\n return retval;\n }", "public void concatenateList (linkedList<E> M) {\n\r\n if(this.head == null){\r\n head = M.head;\r\n tail = M.tail;\r\n } else {\r\n tail.setNext(M.head);\r\n tail = M.tail;\r\n }\r\n\r\n }", "public String join() {\n String result = \"\";\n\n for(int i = 0; i < list.size(); i++) {\n result += list.get(i);\n if (i < list.size() - 1) {\n result += \", \";\n }\n }\n\n return result;\n }", "protected Pair<JilExpr,List<JilStmt>> doStringConcat(Expr.BinOp bop){\n \t\tString builderLab = \"$builder\" + stringbuilder_label++;\r\n \t\tPair<JilExpr,List<JilStmt>> lhs = doExpression(bop.lhs());\r\n \t\tPair<JilExpr,List<JilStmt>> rhs = doExpression(bop.rhs());\r\n \t\t\r\n \t\tList<JilStmt> stmts = lhs.second();\r\n \t\tstmts.addAll(lhs.second());\r\n \t\tstmts.addAll(rhs.second());\r\n \t\t\r\n \t\tType.Clazz builder = new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\"StringBuilder\");\r\n \t\t\t\t\t\t\r\n \t\tstmts.add(new JilStmt.Assign(new JilExpr.Variable(builderLab, builder),\r\n \t\t\t\tnew JilExpr.New(builder, new ArrayList<JilExpr>(),\r\n \t\t\t\t\t\tnew Type.Function(T_VOID), bop.attributes())));\t\t\t\t\t\r\n \t\t\r\n \t\tType lhs_t = lhs.first().type(); \r\n \t\tif(lhs_t instanceof Type.Primitive || isString(lhs_t)) {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(lhs.first());\r\n \t\t\tstmts.add(new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder), \"append\",\r\n \t\t\t\t\tparams, new Type.Function(new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\t\"StringBuilder\"), lhs.first().type()), new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\")));\r\n \t\t} else {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(lhs.first());\r\n \t\t\tstmts.add(new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder),\r\n \t\t\t\t\t\"append\", params, new Type.Function(new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\"),\r\n \t\t\t\t\tJAVA_LANG_OBJECT), new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\t\"StringBuilder\")));\t\r\n \t\t}\r\n \r\n \t\t// Now, do the right hand side\r\n \t\tJilExpr r;\r\n \t\tType rhs_t = rhs.first().type(); \r\n \t\tif(rhs_t instanceof Type.Primitive || isString(rhs_t)) {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(rhs.first());\r\n \t\t\tr = new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder), \"append\",\r\n \t\t\t\t\tparams, new Type.Function(new Type.Clazz(\"java.lang\",\r\n \t\t\t\t\t\"StringBuilder\"), rhs_t), new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\"));\r\n \t\t} else {\r\n \t\t\tArrayList<JilExpr> params = new ArrayList<JilExpr>();\r\n \t\t\tparams.add(rhs.first());\r\n \t\t\tr = new JilExpr.Invoke(new JilExpr.Variable(builderLab, builder),\r\n \t\t\t\t\t\"append\", params, new Type.Function(new Type.Clazz(\r\n \t\t\t\t\t\t\t\"java.lang\", \"StringBuilder\"), JAVA_LANG_OBJECT),\r\n \t\t\t\t\tnew Type.Clazz(\"java.lang\", \"StringBuilder\"));\r\n \t\t}\r\n \r\n \t\tr = new JilExpr.Invoke(r, \"toString\", new ArrayList<JilExpr>(),\r\n \t\t\t\tnew Type.Function(JAVA_LANG_STRING), JAVA_LANG_STRING);\r\n \t\t\r\n \t\treturn new Pair<JilExpr,List<JilStmt>>(r,stmts);\r\n \t}", "@Nonnull\r\n\tpublic static <T> Observable<T> concat(\r\n\t\t\t@Nonnull Observable<? extends T> first,\r\n\t\t\t@Nonnull Observable<? extends T> second) {\r\n\t\tList<Observable<? extends T>> list = new ArrayList<Observable<? extends T>>();\r\n\t\tlist.add(first);\r\n\t\tlist.add(second);\r\n\t\treturn concat(list);\r\n\t}", "public static String getLCS(String str1,String str2,int[][] lcs) {\r\n\t\tString LCS=new String();\r\n\t\tint i=lcs.length-1,j=lcs[0].length-1;\r\n\t\twhile(i>0 && j>0)\r\n\t\t{\r\n\t\t\tif (str1.charAt(i-1) == str2.charAt(j-1))\r\n\t\t\t{\r\n\t\t\t\tLCS= LCS + str1.charAt(i-1);\r\n\t\t\t\ti--; j--;\r\n\t\t\t}\r\n\t\t\telse if (lcs[i-1][j] < lcs[i][j-1])\r\n\t\t\t\tj--;\r\n\t\t\telse\r\n\t\t\t\ti--;\r\n\t\t}\r\n\t\treturn LCS;\r\n\t}", "public PhanSo congPS(PhanSo ps2){\n int a = tuSo*ps2.mauSo + ps2.tuSo*mauSo;\n int b = mauSo*ps2.mauSo;\n\n return new PhanSo(a,b);\n }", "public static byte[] concat(byte[] a, byte[] b) {\n\n if (b == null) {\n return a;\n }\n\n int aLen = a.length;\n int bLen = b.length;\n byte[] c = new byte[aLen + bLen];\n System.arraycopy(a, 0, c, 0, aLen);\n System.arraycopy(b, 0, c, aLen, bLen);\n return c;\n }", "public void add(Conseiller c) {\n\t\t\r\n\t}", "private ArrayList<String> concatColumns(ArrayList<String>... columns) {\n if (columns.length < 1) {\n return null;\n } else if (columns.length < 2) {\n return columns[0];\n } else {\n ArrayList<String> concatenated = new ArrayList<String>();\n for (ArrayList<String> column : columns) {\n for (String col : column) {\n concatenated.add(col);\n }\n }\n return concatenated;\n\n }\n }", "public String toCLang() {\n StringBuilder result = new StringBuilder();\n String tipo = \"\";\n\n if (type.equals(\"string\"))\n tipo = \"char* \";\n else {\n if (type.equals(\"bool\"))\n tipo = \"int \";\n else\n tipo = type;\n }\n for (Id id : identifierList) {\n result.append(tipo + \" \" + id.getName() + \", \");\n }\n\n int lastIndexComma = result.lastIndexOf(\",\");\n result.deleteCharAt(lastIndexComma);\n\n return result.toString();\n }", "public static String concat(List<String> nTriplesList) {\n\t\tStringBuffer buf = new StringBuffer();\n\t\tfinal int size = nTriplesList.size();\n\t\tfinal int maxCount = Constants.MAX_RESULT_COUNT;\n\t\tfor (int i = 0; i < size && i < maxCount; i++) {\n\t\t\tbuf.append(nTriplesList.get(i)).append(\"\\n\\n\\n\");\n\t\t}\n\t\tif (size > maxCount) {\n\t\t\tlogger.warn(\"max result count reached (ignoring \" + (size - maxCount) + \" results).\");\n\t\t}\n\t\treturn buf.toString();\n\t}", "public void addConcullor(Councillor c) {\r\n\t\tthis.councillors.add(c);\r\n\t}", "int[] concat(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n st[0] = s1;\r\n\t\tst[1] = t2;\r\n\t\t\r\n\t\taddEdge(t1, epssymbol, s2);\r\n\t\t\r\n\t\treturn st;\r\n\t}", "public Complex conjugate() {\r\n return new Complex(this.getReal(), this.getImag() * -1);\r\n }", "private void fixStringConcats(Element element) throws LookupException {\n for (InfixOperatorInvocation ioi : element.descendants(InfixOperatorInvocation.class)) {\n // args == right\n // target == left\n Type rightType = ioi.getActualParameters().get(0).getType();\n if (ioi.name().equals(\"+\") &&\n subtypeOf(rightType, TEXT) | subtypeOf(rightType, STRING)) {\n if (ioi.getTarget() instanceof Literal) {\n Literal lit = (Literal) ioi.getTarget();\n if (lit.text().isEmpty()) {\n ioi.replaceWith(ioi.getActualParameters().get(0));\n }\n }\n }\n }\n }", "public void joinTwoArrayList(ArrayList<E> array1 , ArrayList<E> array2){\n\t\tint length2 = array2.size();\n\t\tfor(int i=0 ; i<length2 ; i++){\n\t\t\tarray1.add(array2.getElement(i));\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\t\n\t\tLinkedList<Integer> l1 = new LinkedList<Integer>();\n\t\tLinkedList<Integer> l2 = new LinkedList<Integer>();\n\t\tl1.add(34);\n\t\tl1.add(67);\n\t\tl2.add(89);\n\t\tl2.add(45);\n\t\tl1.addAll(l2);\n\t\tSystem.out.println(l1);\n\n }", "private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}", "Nda<V> concatAt( int axis, Nda<V> other );", "public static String[] concatenateArray(String[] a, String[] b) {\n String[] r = new String[a.length + b.length];\n\n for (int i = 0; i < a.length; i++) {\n r[i] = a[i];\n }\n\n for (int i = 0; i < b.length; i++) {\n r[a.length + i] = b[i];\n }\n\n return r;\n }", "public ArrayList<Concert> getConcertList(){\n return concertList;\n }", "public Integer addStuffTogether(ArrayList<Integer> original1, ArrayList<Integer> original2) {\n Integer sum = 0;\n for (Integer i : original1) {\n sum += i;\n }\n for (Integer i : original2) {\n sum += i;\n }\n return sum;\n }", "@Override\n\tpublic void visit(Concat arg0) {\n\t\t\n\t}", "public static String concatString(String str1, String str2) {\n StringBuilder sb = new StringBuilder();\n if (str1 != null && !str1.isEmpty()) {\n sb.append(str1);\n }\n if (str2 != null && !str2.isEmpty()) {\n sb.append(str2);\n }\n return sb.toString();\n }", "public static void main(String[] args) {\n\tComplex c1 = new Complex(1,2);\r\n\tComplex c2 = new Complex(-2,-1);\r\n\t\r\n\t//Calculates the product of c1 and c2\r\n\tComplex product_c1c2 = Complex.multiply(c1, c2);\r\n\tSystem.out.println(\"The product of c1 and c2 is: \"+product_c1c2);\r\n \t\r\n\t//Calculates the ratio of c1 to c2 (c1/c2)\r\n\tComplex ratio_c1c2 = Complex.divide(c1, c2);\r\n\tSystem.out.println(\"The ratio of c1 to c2 is: \"+ratio_c1c2);\r\n\t\r\n\t//Calculates the product of c1 and I\r\n\tComplex product_c1I = Complex.multiply(c1, Complex.I);\r\n\tSystem.out.println(\"The product of c1 and I is: \"+product_c1I);\r\n\t\r\n\t//Calculates the ratio of c1 to 0\r\n\tComplex ratio_c1Zero = Complex.divide(c1, Complex.Zero);\r\n\tSystem.out.println(\"The ratio of c1 and 0 is: \"+ratio_c1Zero);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c1_conj = Complex.conj(c1);\r\n\tComplex product_c1c1conj = Complex.multiply(c1,c1_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c1c1conj);\r\n\t\r\n\t//Calculates the product of c1 with the conjugate of c1\r\n\tComplex c2_conj = Complex.conj(c2);\r\n\tComplex product_c2c2conj = Complex.multiply(c2,c2_conj);\r\n\tSystem.out.println(\"The product of c1 and c1* is: \"+product_c2c2conj);\r\n\t}", "public cCONS(Object... list)\r\n\t{\r\n\t\tinitCons(false, list);\r\n\t}", "@Test\n public void testConcat() {\n// System.out.println(\"---concat---\");\n// //Test1: concatenating two empty lists returns an empty list\n// ADTList instance = ADTList.create();\n// ADTList list = ADTList.create();\n// ADTList expResult = ADTList.create();\n// ADTList result = instance.concat(list);\n// assertEquals(expResult, result);\n// System.out.println(\"Test1 OK\");\n// \n// //Test2.1: concatenating an empty list with a non-empty list returns the non-empty list\n// ADTList instance2 = ADTList.create();\n// ADTList list2 = createTestADTListIns(6);\n// ADTList expResult2 = list2;\n// ADTList result2 = instance2.concat(list2);\n// assertEquals(expResult2, result2);\n// System.out.println(\"Test2.1 OK\");\n// \n// //Test2.2: concatenating a non-empty list with an empty list returns the non-empty list\n// ADTList instance3 = createTestADTListIns(6);\n// ADTList list3 = ADTList.create();\n// ADTList expResult3 = instance3;\n// ADTList result3 = instance3.concat(list3);\n// assertEquals(expResult3, result3);\n// System.out.println(\"Test2.2 OK\");\n// \n// //Test3: concatenating two non-empty lists returns a new list in the form [list1 list2].\n// ADTList instance4 = createTestADTList(1,1,2,2,3,3);\n// ADTList list4 = createTestADTList(4,1,5,2,6,3);\n// ADTList expResult4 = createTestADTListIns(6);\n// ADTList result4 = instance4.concat(list4);\n// assertEquals(expResult4, result4);\n// System.out.println(\"Test3 OK\");\n \n }", "public CommandConjure()\n\t{\n\t\t aliases = new ArrayList<String>();\n\t\t aliases.add(\"conjure\");\n\t\t aliases.add(\"conj\");\n\t}", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "private static byte[] concat(byte[]... arrays) {\n int length = 0;\n for (byte[] array : arrays) {\n length += array.length;\n }\n final byte[] res = new byte[length];\n int pos = 0;\n for (byte[] array : arrays) {\n System.arraycopy(array, 0, res, pos, array.length);\n pos += array.length;\n }\n return res;\n }", "String concat(String... text);", "@Override\n\tpublic void visit(Concat arg0) {\n\n\t}", "public RegexNode ReduceConcatenation()\n\t{\n\t\t// Eliminate empties and concat adjacent strings/chars\n\n\t\tboolean wasLastString;\n\t\tRegexOptions optionsLast;\n\t\tRegexOptions optionsAt;\n\t\tint i;\n\t\tint j;\n\n\t\tif (_children == null)\n\t\t{\n\t\t\treturn new RegexNode(RegexNode.Empty, _options);\n\t\t}\n\n\t\twasLastString = false;\n\t\toptionsLast = RegexOptions.forValue(0);\n\n\t\tfor (i = 0, j = 0; i < _children.size(); i++, j++)\n\t\t{\n\t\t\tRegexNode at;\n\t\t\tRegexNode prev;\n\n\t\t\tat = _children.get(i);\n\n\t\t\tif (j < i)\n\t\t\t{\n\t\t\t\t_children.set(j, at);\n\t\t\t}\n\n\t\t\tif (at._type == RegexNode.Concatenate && ((at._options.getValue() & RegexOptions.RightToLeft.getValue()) == (_options.getValue() & RegexOptions.RightToLeft.getValue())))\n\t\t\t{\n\t\t\t\tfor (int k = 0; k < at._children.size(); k++)\n\t\t\t\t{\n\t\t\t\t\tat._children.get(k)._next = this;\n\t\t\t\t}\n\n\t\t\t\t//_children.InsertRange(i + 1, at._children);\n\t\t\t\t_children.addAll(i + 1 , at._children);\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse if (at._type == RegexNode.Multi || at._type == RegexNode.One)\n\t\t\t{\n\t\t\t\t// Cannot merge strings if L or I options differ\n\t\t\t\toptionsAt = RegexOptions.forValue(at._options.getValue() & (RegexOptions.RightToLeft.getValue() | RegexOptions.IgnoreCase.getValue()));\n\n\t\t\t\tif (!wasLastString || optionsLast != optionsAt)\n\t\t\t\t{\n\t\t\t\t\twasLastString = true;\n\t\t\t\t\toptionsLast = optionsAt;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tprev = _children.get(--j);\n\n\t\t\t\tif (prev._type == RegexNode.One)\n\t\t\t\t{\n\t\t\t\t\tprev._type = RegexNode.Multi;\n\t\t\t\t\tprev._str = String.valueOf(prev._ch);\n\t\t\t\t}\n\n\t\t\t\tif ((optionsAt.getValue() & RegexOptions.RightToLeft.getValue()) == 0)\n\t\t\t\t{\n\t\t\t\t\tif (at._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str += (new Character(at._ch)).toString();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str += at._str;\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\tif (at._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str = (new Character(at._ch)).toString() + prev._str;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprev._str = at._str + prev._str;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if (at._type == RegexNode.Empty)\n\t\t\t{\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twasLastString = false;\n\t\t\t}\n\t\t}\n\n\t\tif (j < i)\n\t\t{\n\t\t\t//_children.removeRange(j, i - j + j);\n\t\t\tArrayExt.removeRange(_children, j, i - j + j);\n\t\t}\n\n\t\treturn StripEnation(RegexNode.Empty);\n\t}", "public void addBcc(List<String> addresses) {\n\t\tbcc.addAll(addresses);\n\t}", "public static void main(String[] args) {\n String string = \"test\";\n concat(string);\n System.out.println(string); // test \n}", "private static byte[] concatenateByteArrays(byte[] first, byte[] second) {\n int firstLength = first.length;\n int secondLength = second.length;\n\n byte[] ret = new byte[first.length + second.length];\n System.arraycopy(first, 0, ret, 0, first.length);\n System.arraycopy(second, 0, ret, first.length, second.length);\n\n return ret;\n }", "public static void main(String[] args) {\n //StringCircularBuffer buffer = new StringCircularBuffer(10);\n CircularBuffer buffer = new CircularBuffer(10);\n buffer.offer(\"a\");\n buffer.offer(\"b\");\n buffer.offer(\"cd\");\n //buffer.offer(1);\n String value = concatenate(buffer);\n //System.out.println(value);\n\n }", "public final ManchesterOWLSyntaxAutoComplete.conjunction_return conjunction() {\n ManchesterOWLSyntaxAutoComplete.conjunction_return retval = new ManchesterOWLSyntaxAutoComplete.conjunction_return();\n retval.start = input.LT(1);\n ManchesterOWLSyntaxAutoComplete.unary_return conjunct = null;\n ManchesterOWLSyntaxAutoComplete.unary_return u = null;\n try {\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:130:2:\n // ( ^( CONJUNCTION (conjunct= unary )+ ) | u= unary )\n int alt6 = 2;\n int LA6_0 = input.LA(1);\n if (LA6_0 == CONJUNCTION) {\n alt6 = 1;\n } else if (LA6_0 >= IDENTIFIER && LA6_0 <= ENTITY_REFERENCE\n || LA6_0 == NEGATED_EXPRESSION || LA6_0 >= SOME_RESTRICTION\n && LA6_0 <= ONE_OF) {\n alt6 = 2;\n } else {\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n NoViableAltException nvae = new NoViableAltException(\"\", 6, 0, input);\n throw nvae;\n }\n switch (alt6) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:131:2:\n // ^( CONJUNCTION (conjunct= unary )+ )\n {\n match(input, CONJUNCTION, FOLLOW_CONJUNCTION_in_conjunction328);\n if (state.failed) {\n return retval;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return retval;\n }\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:131:17:\n // (conjunct= unary )+\n int cnt5 = 0;\n loop5: do {\n int alt5 = 2;\n int LA5_0 = input.LA(1);\n if (LA5_0 >= IDENTIFIER && LA5_0 <= ENTITY_REFERENCE\n || LA5_0 == NEGATED_EXPRESSION\n || LA5_0 >= SOME_RESTRICTION && LA5_0 <= ONE_OF) {\n alt5 = 1;\n }\n switch (alt5) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:131:18:\n // conjunct= unary\n {\n pushFollow(FOLLOW_unary_in_conjunction334);\n conjunct = unary();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start)\n .setCompletions(conjunct.node\n .getCompletions());\n }\n }\n break;\n default:\n if (cnt5 >= 1) {\n break loop5;\n }\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n EarlyExitException eee = new EarlyExitException(5, input);\n throw eee;\n }\n cnt5++;\n } while (true);\n match(input, Token.UP, null);\n if (state.failed) {\n return retval;\n }\n }\n break;\n case 2:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:134:4:\n // u= unary\n {\n pushFollow(FOLLOW_unary_in_conjunction349);\n u = unary();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start).setCompletions(u.node\n .getCompletions());\n }\n }\n break;\n }\n if (state.backtracking == 1) {\n retval.node = (ManchesterOWLSyntaxTree) retval.start;\n }\n } catch (@SuppressWarnings(\"unused\") RecognitionException | RewriteEmptyStreamException exception) {}\n return retval;\n }" ]
[ "0.7436265", "0.5783339", "0.57699883", "0.56459516", "0.56148434", "0.55010927", "0.52782834", "0.5272584", "0.526601", "0.5257537", "0.5253442", "0.51780933", "0.5172641", "0.5140439", "0.5118318", "0.5056666", "0.5039516", "0.50333786", "0.50333786", "0.5033124", "0.50040996", "0.49874914", "0.4978253", "0.49183705", "0.48948416", "0.48881269", "0.48731437", "0.48600695", "0.48321882", "0.4806818", "0.47919792", "0.4774469", "0.47736213", "0.47688735", "0.47614908", "0.4743989", "0.4732712", "0.47295845", "0.47250426", "0.47102445", "0.46922523", "0.46887636", "0.46795535", "0.4652792", "0.46509063", "0.4648085", "0.46247888", "0.46208113", "0.4591559", "0.458711", "0.45819646", "0.45810467", "0.45804808", "0.4574958", "0.45625615", "0.4554528", "0.45370823", "0.45288584", "0.45175076", "0.45141962", "0.45013306", "0.44969457", "0.44928116", "0.44889387", "0.44787815", "0.4461581", "0.4455359", "0.44539037", "0.44427523", "0.4438047", "0.44160196", "0.4409396", "0.4404987", "0.4391332", "0.43874523", "0.4383435", "0.43748915", "0.43670452", "0.43559837", "0.43456304", "0.43360168", "0.43295345", "0.43255043", "0.43221104", "0.4305532", "0.4304823", "0.43007347", "0.42961425", "0.4292088", "0.4286057", "0.42849615", "0.42806035", "0.42790186", "0.42688692", "0.42679834", "0.42632774", "0.4261536", "0.42600146", "0.42560953", "0.42400005" ]
0.71113074
1
Equal. a and b are objects. t=true if a and b are equal and otherwise t=false.
public static <C> boolean EQUAL(LIST<C> L1, LIST<C> L2) { if ( isNull( L1 ) ) { return isNull(L2); } if ( isNull( L2 ) ) { return isNull(L1); } return L1.list.equals( L2.list ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static final boolean equal(Object a, Object b) {\n if (a == b)\n return true;\n if (a == null)\n return false;\n if (b == null)\n return false;\n return a.equals(b);\n }", "public static boolean equal(Object a, Object b) {\r\n\t\tif (a == b) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn a != null && b != null && a.equals(b);\r\n\t}", "static public boolean testEquality(Object a, Object b) {\r\n\t\tif (a == null && b == null) // undefined == undefined\r\n\t\t\treturn true;\r\n\t\tif ((a == null || b == null) && (a instanceof JSNull || b instanceof JSNull)) // undefined or null\r\n\t\t\treturn true;\r\n\t\tif ((a == null && b instanceof JSNull) || (a == null && b instanceof JSNull)) // anything == undefined\r\n\t\t\treturn true;\r\n\t\tif (a == null || b == null) // anything equals null\r\n\t\t\treturn false;\r\n\t\treturn a.equals(b);\r\n\t}", "@NeededForTesting\n public static boolean areObjectsEqual(Object a, Object b) {\n return a == b || (a != null && a.equals(b));\n }", "@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}", "public static boolean equalQuick(final Object a, final Object b) {\n \treturn a == b || ((a != null & b != null) && a.equals(b));\n }", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return a.equals(b);\n }", "@Test\n void testEquals() {\n final boolean expected_boolean = true;\n\n // Properties for the objects\n final String username = \"username\";\n final String name = \"their_name\";\n final String password = \"password\";\n\n // Create two LoginAccount objects\n LoginAccount first_account = new LoginAccount(username, name, password);\n LoginAccount second_account = new LoginAccount(username, name, password);\n\n // Variable to check\n boolean objects_are_equal = first_account.equals(second_account);\n\n // Assert that the two boolean values are the same\n assertEquals(expected_boolean, objects_are_equal);\n }", "static public boolean areEqual(Object aThis, Object aThat) {\r\n // System.out.println(\"Object\");\r\n return aThis == null ? aThat == null : aThis.equals(aThat);\r\n }", "@Test\n\tpublic void test_equals1() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tTvShow t2 = new TvShow(\"Sherlock\",\"BBC\");\n\tassertTrue(t1.equals(t2));\n }", "public static <T> boolean equals(T a, T b) {\n return (a == b) || (a != null && a.equals(b));\n }", "public abstract boolean doEquivalent(T t, T t2);", "boolean equalTo(ObjectPassDemo o) {\n return (o.a == a && o.b == b);\n }", "static <T> boolean argEquals(T a1,boolean a2, T b1,boolean b2) {\n return\n Null.equals(a1, b1) && //\n a2==b2; //\n }", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return false;\n }", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "public void testObjEqual()\n {\n assertEquals( true, Util.objEqual(null,null) );\n assertEquals( false,Util.objEqual(this,null) );\n assertEquals( false,Util.objEqual(null,this) );\n assertEquals( true, Util.objEqual(this,this) );\n assertEquals( true, Util.objEqual(\"12\",\"12\") );\n }", "boolean canEqual(Object obj);", "public final void testSameObjectEquals() {\n final Transaction copy = testTransaction1;\n assertTrue(testTransaction1.equals(copy)); // pmd doesn't like either\n // way\n\n }", "private static boolean equalityTest1(String a, String b)\n {\n return a == b;\n }", "public void testEqualsObject()\n {\n // Null check\n assertFalse(b1.equals(null));\n // Type mismatch\n assertFalse(b1.equals(\"a\"));\n\n // Reflexive\n assertTrue(b1.equals(b1));\n\n // In general, two empty boards\n assertTrue(b1.equals(b2));\n\n // Different contents\n b1.setCell(0, 0, Cell.RED1);\n assertFalse(b1.equals(b2));\n\n // Same Contents\n b2.setCell(0, 0, Cell.RED1);\n assertTrue(b1.equals(b2));\n\n // Some more complex cases\n b1.fromString(\"RRRBEEBBE\");\n assertFalse(b1.equals(b2));\n b2.fromString(\"RRRBEEBBE\");\n assertTrue(b1.equals(b2));\n\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@Test\n public void testEquals_1() {\n LOGGER.info(\"testEquals_1\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hello\");\n final boolean actual = atomString.equals(atom);\n assertTrue(actual);\n }", "public boolean equals(Tram t) {\n\t\t// if passed object is null, return false\n\t\tif (t == null)\n\t\t\treturn false;\n\t\t// if the classes of passed and compared objects are different, return false\n\t\telse if (this.getClass() != t.getClass())\n\t\t\treturn false;\n\t\t// if all the attributes of passed and compared objects are equal, return true;\n\t\t// otherwise, return false\n\t\telse\n\t\t\treturn (this.ticketPrice == t.ticketPrice && this.numOfStops == t.numOfStops && this.routeNum == t.routeNum\n\t\t\t\t\t&& this.beginOperationYear == t.beginOperationYear && this.lineName.equals(t.lineName)\n\t\t\t\t\t&& this.driverName.equals(t.driverName) && this.maxSpeed == t.maxSpeed);\n\t}", "public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}", "@Test\n\tpublic void testEqualsObject_True() {\n\t\tbook3 = new Book(DEFAULT_TITLE, DEFAULT_AUTHOR, DEFAULT_YEAR, DEFAULT_ISBN);\n\t\tassertEquals(book1, book3);\n\t}", "@Test\n public void testEquals_2() {\n LOGGER.info(\"testEquals_2\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hej\");\n final boolean actual = atomString.equals(atom);\n assertFalse(actual);\n }", "public static boolean isSameObject(Object a, Object b) {\n return Builtins.isSameObject(a, b);\n }", "@Test\n\tpublic void test_equals1() {\n\tTennisPlayer c1 = new TennisPlayer(11,\"Joe Tsonga\");\n\tTennisPlayer c2 = new TennisPlayer(11,\"Joe Tsonga\");\n\tassertTrue(c1.equals(c2));\n }", "private boolean notEquals(Object a, Object b)\n {\n if (a != null && b == null)\n return true;\n if (a == null && b != null)\n return true;\n if (a != null && !a.equals(b))\n return true;\n return false;\n }", "public abstract boolean equals(Object other);", "public static boolean preEq(Object a, Object b) {\n\t\treturn a != null && b != null && a.getClass().equals(b.getClass());\n\t}", "@Test\n public void testEquals_2()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n Object obj = new Project();\n\n boolean result = fixture.equals(obj);\n\n assertEquals(true, result);\n }", "@Test\n\tpublic void test_TCM__boolean_equals_Object() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\");\n\n assertFalse(\"attribute equal to null\", attribute.equals(null));\n\n final Object object = attribute;\n assertTrue(\"object not equal to attribute\", attribute.equals(object));\n assertTrue(\"attribute not equal to object\", object.equals(attribute));\n\n // current implementation checks only for identity\n// final Attribute clonedAttribute = (Attribute) attribute.clone();\n// assertTrue(\"attribute not equal to its clone\", attribute.equals(clonedAttribute));\n// assertTrue(\"clone not equal to attribute\", clonedAttribute.equals(attribute));\n\t}", "public boolean equals( Object obj );", "boolean newequals(DataBT a, DataBT b) \n\t {\n\t \tSystem.out.println(\"!!\");\n\t \t\n\t /*1. both empty */\n\t if ((IBinTree)a instanceof MtBT && (IBinTree)b instanceof MtBT)\n\t return true;\n\t System.out.println(\"1 \" + a.data);\n\t \t \n\t /* 2. both non-empty -> compare them */\n\t if ( !((IBinTree)a instanceof MtBT) && !((IBinTree)b instanceof MtBT)) {\n\n\t \tboolean check = (a.data == b.data);\n\t\t System.out.println(\"1112\");\n\t\t \n\t\t if(a.left instanceof MtBT && b.left instanceof MtBT);else\n\t\t if((a.left instanceof MtBT) != (a.left instanceof MtBT))check = false;else\n\t \tif(!newequals((DataBT)a.left, (DataBT)b.left))check = false;\n\t\t \n\t\t \n\t\t System.out.println(\"1113\");\n\t\t \n\t\t \n\t\t if(a.right instanceof MtBT && b.right instanceof MtBT);else\n\t\t\t if((a.right instanceof MtBT) != (a.right instanceof MtBT))check = false;else\n\t\t if(!newequals((DataBT)a.right, (DataBT)b.right))check = false;\n\n\t\t System.out.println(\"112\");\n\n\t\t return (check);\n\t }\n\t System.out.println(\"2\");\n\t \n\t /* 3. one empty, one not -> false */\n\t if ( ((IBinTree)a instanceof MtBT) && (!((IBinTree)b instanceof MtBT))) {\n\t \treturn false;\n\t }\n\t System.out.println(\"3\");\n\t return false;\n\t }", "@Test\n\tpublic void test_equals2() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tTvShow t2 = new TvShow(\"NotSherlock\",\"BBC\");\n\tassertFalse(t1.equals(t2));\n }", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }", "public void testEqualsObject() {\n\t\t\tTipoNodoLeisure tipo1 = new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.0\")); //$NON-NLS-1$\n\t\t\tTipoNodoLeisure tipo2= new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.1\")); //$NON-NLS-1$\n\t\t\tTipoNodoLeisure tipo3= new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.2\")); //$NON-NLS-1$\n\t\t\tif (tipo1 != tipo1)\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.3\")); //$NON-NLS-1$\n\t\t\tif (!tipo1.equals(tipo2))\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.4\"));\t\t\t //$NON-NLS-1$\n\t\t\tif (tipo1.equals(tipo3))\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.5\"));\t //$NON-NLS-1$\n\t\t}", "@Test\n public void testEquals() {\n System.out.println(\"Animal.equals\");\n Animal newAnimal = new Animal(252, \"Candid Chandelier\", 10, \"Cheetah\", 202);\n assertTrue(animal1.equals(newAnimal));\n assertFalse(animal2.equals(newAnimal));\n }", "public boolean isIdentical(Remote obj1, Remote obj2)\n {\n\torg.omg.CORBA.Object corbaObj1 = (org.omg.CORBA.Object)obj1;\n\torg.omg.CORBA.Object corbaObj2 = (org.omg.CORBA.Object)obj2;\n\n\treturn corbaObj1._is_equivalent(corbaObj2);\n }", "public boolean equals(AssignOpType t) {\n\t\treturn this.toString().equals(t.toString());\n\t}", "boolean equals(Object object);", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@Test\n public void testEquals() {\n Term t1 = structure(\"abc\", atom(\"a\"), atom(\"b\"), atom(\"c\"));\n Term t2 = structure(\"abc\", integerNumber(), decimalFraction(), variable());\n PredicateKey k1 = PredicateKey.createForTerm(t1);\n PredicateKey k2 = PredicateKey.createForTerm(t2);\n testEquals(k1, k2);\n }", "@Test\n\tpublic void testEqualsObject_False() {\n\t\tassertNotEquals(book1, book2);;\n\t}", "public boolean equals(Object object);", "@Test\n public void testEquals_1()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n Object obj = new Object();\n\n boolean result = fixture.equals(obj);\n\n assertEquals(false, result);\n }", "@Test\n public void testEquals01() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n SocialNetwork sn = new SocialNetwork();\n boolean result = sn.equals(otherObject);\n assertTrue(result);\n }", "@Test\n\tpublic void testEquals() {\n\t\tPMUser user = new PMUser(\"Smith\", \"John\", \"[email protected]\");\n\t\tPark a = new Park(\"name\", \"address\", user);\n\t\tPark b = new Park(\"name\", \"address\", user);\n\t\tPark c = new Park(\"name\", \"different address\", user);\n\t\tassertEquals(a, a);\n\t\tassertEquals(a, b);\n\t\tassertEquals(b, a);\n\t\tassertFalse(a.equals(c));\n\t}", "private static boolean equalityTest2(String a, String b)\n {\n return a.equals(b);\n }", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object object = null;\n Reserva instance = new Reserva();\n boolean expResult = false;\n boolean result = instance.equals(object);\n assertEquals(expResult, result);\n \n }", "boolean _is_equivalent(org.omg.CORBA.Object other);", "@Test\n public void testEquals02() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n boolean result = sn10.equals(otherObject);\n assertFalse(result);\n }", "protected boolean isEqual( Object lhs, Object rhs ){\r\n\t\tboolean x = lhs==null;\r\n\t\tboolean y = rhs == null;\r\n\t\t//XOR OPERATOR, only one is null\r\n\t\tif ((x || y) && !(x && y))\r\n\t\t\treturn false;\r\n\t\tif (lhs.equals(rhs))\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public boolean equal(Object obj1, Object obj2) {\n\t\treturn obj1.equals(obj2);\r\n\t}", "@Test\n @DisplayName(\"Test should detect inequality between unequal states.\")\n public void testShouldResultInInequality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Goodbye\");\n\n Assertions.assertThat(os1).isNotEqualTo(os2);\n }", "public boolean equals(Object obj);", "@Test\n public void equalsTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0, entity1);\n }", "public abstract boolean equals(Object o);", "boolean equals(Object obj);", "boolean equals(Object obj);", "public boolean equals(Object o);", "@Test\n public void testEquals() {\n assertFalse(jesseOberstein.equals(nathanGoodman));\n assertTrue(kateHutchinson.equals(kateHutchinson));\n }", "private boolean equals1(BinaryNode<AnyType> t, BinaryNode<AnyType> t1)\r\n\t{\r\n\t\tif(t==null && t1==null)\r\n\t\t\treturn true;\r\n\t\tif((t!=null && t1!=null)&&(t.element==t1.element))\r\n\t\t\treturn (equals1(t.left, t1.left)&& equals1(t.right, t1.right));\r\n\r\n\t\treturn false;\r\n\t}", "@Test\n\tpublic void testEquals1() {\n\t\tDistance d1 = new Distance(0, 0);\n\t\tDistance d2 = new Distance();\n\t\tassertEquals(false, d1.equals(d2));\n\t}", "public void testEqualsObject()\n {\n Mana meme = new Mana( myMise );\n Assert.assertEquals( myMise, meme );\n \n System.out.println( myMise.toString());\n Mana autre = new Mana( 49 );\n Assert.assertFalse( myMise.equals( autre ));\n autre = new Mana( 50 );\n Assert.assertTrue( myMise.equals( autre ));\n }", "@Test\n \tpublic void testEqual() {\n \t\tAssert.assertTrue(f1.equals(f1));\n \t}", "@Test\n public void equals_DifferentObjects_Test() {\n Assert.assertFalse(bq1.equals(ONE));\n }", "private boolean eq(int[] a,int[] b){\n\t\tboolean eq = true;\n\t\tif(a.length != b.length) return false;\n\t\tfor(int i=0;i<a.length;i++){\n\t\t\tif( a[i] != b[i] ){\n\t\t\t\teq = false;\n\t\t\t\tbreak;\n\t\t\t}else{\n\n\t\t\t}\n\t\t}\n\t\treturn eq;\n\t}", "@Test\r\n public void testEquals() {\r\n Articulo art = new Articulo();\r\n articuloPrueba.setCodigo(1212);\r\n art.setCodigo(1212);\r\n boolean expResult = true;\r\n boolean result = articuloPrueba.equals(art);\r\n assertEquals(expResult, result);\r\n }", "@JRubyMethod(name = \"==\", required = 1)\n public static IRubyObject op_equal(ThreadContext ctx, IRubyObject self, IRubyObject oth) {\n RubyString str1, str2;\n RubyModule instance = (RubyModule)self.getRuntime().getModule(\"Digest\").getConstantAt(\"Instance\");\n if (oth.getMetaClass().getRealClass().hasModuleInHierarchy(instance)) {\n str1 = digest(ctx, self, null).convertToString();\n str2 = digest(ctx, oth, null).convertToString();\n } else {\n str1 = to_s(ctx, self).convertToString();\n str2 = oth.convertToString();\n }\n boolean ret = str1.length().eql(str2.length()) && (str1.eql(str2));\n return ret ? self.getRuntime().getTrue() : self.getRuntime().getFalse();\n }", "public boolean differ(Object a, Object b) {\n Node set1 = find(getNode(a));\n Node set2 = find(getNode(b));\n\n return set1 != set2;\n }", "public static boolean areSame(AnnotatedTypeMirror t1, AnnotatedTypeMirror t2) {\n return t1.toString().equals(t2.toString());\n }", "public boolean equals(java.lang.Object other){\n return false; //TODO codavaj!!\n }", "@Test\n\tpublic void testEqualsVerdadeiro() {\n\t\t\n\t\tassertTrue(contato1.equals(contato3));\n\t}", "Equality createEquality();", "boolean hasSameAs();", "private static boolean areEqual (byte[] a, byte[] b) {\r\n int aLength = a.length;\r\n if (aLength != b.length)\r\n return false;\r\n for (int i = 0; i < aLength; i++)\r\n if (a[i] != b[i])\r\n return false;\r\n return true;\r\n }", "private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }", "static boolean bigint_eq(bigint a, bigint b)\n {\n if (a.bigint_sign != b.bigint_sign)\n return false;\n else if (a.bigint_len != b.bigint_len)\n return false;\n else\n {\n for (int i = 0; i < a.bigint_len; i++)\n if (a.bigint_chiffres[i] != b.bigint_chiffres[i])\n return false;\n return true;\n }\n }", "public final void testDifferentClassEquals() {\n final Account test = new Account(\"Test\");\n assertFalse(testTransaction1.equals(test));\n // pmd doesn't like either way\n }", "@Test\n public void testEqualsReturnsTrueOnIdenticalRecords() {\n boolean equals = record.equals(otherRecord);\n\n assertThat(equals, is(true));\n }", "@Test\n public void equals_returnsTrueIfNameIsTheSame_false() {\n Animal firstAnimal = new Animal(\"Deer\");\n Animal anotherAnimal = new Animal(\"Deer\");\n assertTrue(firstAnimal.equals(anotherAnimal));\n }", "public void testEquals()\n {\n // test passing null to equals returns false\n // (as specified in the JDK docs for Object)\n EthernetAddress x =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"equals(null) didn't return false\",\n x.equals((Object)null));\n \n // test passing an object which is not a EthernetAddress returns false\n assertFalse(\"x.equals(non_EthernetAddress_object) didn't return false\",\n x.equals(new Object()));\n \n // test a case where two EthernetAddresss are definitly not equal\n EthernetAddress w =\n new EthernetAddress(ANOTHER_VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == w didn't return false\",\n x == w);\n assertFalse(\"x.equals(w) didn't return false\",\n x.equals(w));\n\n // test refelexivity\n assertTrue(\"x.equals(x) didn't return true\",\n x.equals(x));\n \n // test symmetry\n EthernetAddress y =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"y.equals(x) didn't return true\",\n y.equals(x));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n \n // now we'll test transitivity\n EthernetAddress z =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertFalse(\"x == y didn't return false\",\n y == z);\n assertFalse(\"x == y didn't return false\",\n x == z);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"y.equals(z) didn't return true\",\n y.equals(z));\n assertTrue(\"x.equals(z) didn't return true\",\n x.equals(z));\n \n // test consistancy (this test is just calling equals multiple times)\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n }", "public void testEqualsObject()\n {\n EtatJeu meme = new EtatJeu( myEtat );\n Assert.assertEquals( myEtat, meme );\n \n EtatJeu autre = new EtatJeu();\n \n System.out.println( myEtat.toString());\n Assert.assertTrue( myEtat.equals( autre ));\n }", "@Override\n\tpublic boolean equal() {\n\t\treturn false;\n\t}", "public static boolean equal(final String a, final String b) {\n boolean result;\n if (a == null) {\n result = b == null;\n } else {\n result = a.equals(b);\n }\n return result;\n }", "public final void testNullObjectEquals() {\n assertFalse(testTransaction1.equals(null)); // needed for test\n // pmd doesn't like either way\n }", "@Test\n\tpublic void testEqualsFalso() {\n\t\t\n\t\tassertFalse(contato1.equals(contato2));\n\t}", "@Test\n void testEqualsTrue() {\n LoginRequest loginRequest1Copy = new LoginRequest(\"[email protected]\", \"pwd\");\n assertEquals(loginRequest1Copy, loginRequest1);\n }", "private void areEquals(FileInfo a, FileInfo b)\n\t{\n\t\t// will test a subset for now\n\n\t\tassertEquals(a.width,b.width);\n\t\tassertEquals(a.height,b.height);\n\t\tassertEquals(a.nImages,b.nImages);\n\t\tassertEquals(a.whiteIsZero,b.whiteIsZero);\n\t\tassertEquals(a.intelByteOrder,b.intelByteOrder);\n\t\tassertEquals(a.pixels,b.pixels);\n\t\tassertEquals(a.pixelWidth,b.pixelWidth,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.pixelHeight,b.pixelHeight,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.unit,b.unit);\n\t\tassertEquals(a.pixelDepth,b.pixelDepth,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.frameInterval,b.frameInterval,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.calibrationFunction,b.calibrationFunction);\n\t\tAssert.assertDoubleArraysEqual(a.coefficients,b.coefficients,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.valueUnit,b.valueUnit);\n\t\tassertEquals(a.fileType,b.fileType);\n\t\tassertEquals(a.lutSize,b.lutSize);\n\t\tassertArrayEquals(a.reds,b.reds);\n\t\tassertArrayEquals(a.greens,b.greens);\n\t\tassertArrayEquals(a.blues,b.blues);\n\t}", "public boolean isEqual(Cell a) \r\n\t{\r\n\t\tCellTicTacToe xo=(CellTicTacToe)a;\r\n if(this.tav==xo.getTav())\r\n {\r\n \t return true;\r\n }\r\n else\r\n \t return false;\r\n\t}", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object object = null;\n Paciente instance = new Paciente();\n boolean expResult = false;\n boolean result = instance.equals(object);\n assertEquals(expResult, result);\n\n }", "public boolean eq(final A a1, final A a2) {\n return f.f(a1).f(a2);\n }" ]
[ "0.747396", "0.7235944", "0.7174194", "0.71322244", "0.7020478", "0.6928014", "0.68555593", "0.6772668", "0.6768714", "0.6721156", "0.67174655", "0.6701181", "0.6665632", "0.66653264", "0.6663617", "0.6662005", "0.661443", "0.6594803", "0.6591346", "0.65650266", "0.6562761", "0.6548322", "0.6539208", "0.65226734", "0.65139204", "0.6509891", "0.6502575", "0.6494027", "0.64236075", "0.64114004", "0.6410965", "0.6398735", "0.6382068", "0.63641244", "0.6318928", "0.6307454", "0.6300292", "0.62933856", "0.6284901", "0.6283594", "0.62807673", "0.62714547", "0.62332547", "0.6227865", "0.62276757", "0.62110746", "0.6208566", "0.6196001", "0.6194509", "0.6188579", "0.6178318", "0.61749077", "0.61685646", "0.61685646", "0.61685646", "0.61685646", "0.61685646", "0.61594176", "0.6157619", "0.61498904", "0.6147601", "0.6147305", "0.6142787", "0.61403483", "0.6137013", "0.61279815", "0.612758", "0.612758", "0.6112168", "0.61105734", "0.61072123", "0.6105755", "0.6095131", "0.6094894", "0.60940695", "0.60916305", "0.6090833", "0.60813516", "0.60776097", "0.6071981", "0.60523885", "0.6046799", "0.60418725", "0.604182", "0.6037962", "0.60338724", "0.6030905", "0.59989125", "0.5985675", "0.5984191", "0.5976832", "0.59727436", "0.59716797", "0.5964143", "0.596348", "0.5962199", "0.59555566", "0.59540886", "0.594734", "0.5942753", "0.5931952" ]
0.0
-1
Extent. L is a list. n the number of cells of L.
public static <C> int EXTENT(LIST<C> L) { if ( isNull( L ) ) { return 0; } int n = 0; for ( C a : L.list ) { if ( a instanceof LIST ) { LIST<C> LP = null; try { LP = (LIST<C>) a; } catch(ClassCastException e) { } if ( isNull( LP ) ) { n++; } else { n += EXTENT( LP ); } } else { n++; } } return n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setExtent(int n) {\r\n\r\n int newExtent = Math.max(0, n);\r\n int value = getValue();\r\n if (value + newExtent > max) {\r\n\r\n newExtent = max - value;\r\n\r\n }\r\n setRangeProperties(value, newExtent, min, max, isAdjusting);\r\n }", "private static Point gridExtent(ImmutableList<Coordinate> coordinates) {\r\n int width = coordinates.stream()\r\n .mapToInt(c -> c.x + 1)\r\n .max()\r\n .orElseThrow(() -> new IllegalArgumentException(\"No coordinates\"));\r\n\r\n int height = coordinates.stream()\r\n .mapToInt(c -> c.y + 1)\r\n .max()\r\n .orElseThrow(() -> new IllegalArgumentException(\"No coordinates\"));\r\n\r\n return new Point(width, height);\r\n }", "Instance(int N,int L){\r\n\t\tthis.x=new ArrayList<Entry>();\r\n\t\tthis.y=new HashSet<Integer>();\r\n\t\tthis.N=N;\r\n\t\tthis.L=L;\r\n\t}", "private void powell(double[] p, double[][] xi, double ftol) {\r\n int ITMAX = 2000000000;\r\n Powell.search( p, xi, ftol, this, ITMAX, null );\r\n }", "@VTID(14)\n excel.XlPageBreakExtent getExtent();", "public List<Double> linespace(double min, double max, int n){\n List<Double> values = new ArrayList<Double>();\n double delta = (max - min) / (n - 1);\n for (int i = 0; i < n; i++){\n values.add(min + delta * i);\n }\n \n return values;\n }", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "private void grow(int n) {\n\t\tint newSize = length + n;\n\t\tif (newSize > limit) {\n\t\t\t// find smallest power of 2 greater than newSize\n\t\t\tlimit = (int) Math.pow(2, Math.ceil(Math.log(newSize) / LN2));\n\t\t\tfloat[] newBuffer = new float[limit];\n\t\t\tSystem.arraycopy(data, 0, newBuffer, 0, length);\n\t\t\tdata = newBuffer;\n\t\t}\n\t}", "public void grow(int n) {\r\n\t\t// implementation not shown\r\n\t}", "public ArraySetLong(int n) {\n\t\tnumElements = 0;\n\t\ttheElements = new long[n];\n\t}", "public VectorLinearList()\n {// use default capacity of 10\n this(10);\n }", "private void resize(int capacity) {\r\n assert capacity >= n;\r\n Item[] temp = (Item[]) new Object[capacity];\r\n for (int i = 0; i < n; i++) {\r\n temp[i] = list[(first + i) % list.length];\r\n }\r\n list = temp;\r\n first = 0;prior=list.length-1;\r\n last = n-1;latter=n;}", "public Squarelotron(int n){\n\t\t//defines size as n\n\t\tsize = n;\n\t\t//assigns the 2D array/matrix as n x n\n\t\tthis.squarelotron = new int[n][n];\n\t\t//loops from the 0 index to the last index in the rows\n\t\tfor(int i = 1; i <= size; i++){\n\t\t\t//loops through each row by defining the length of the row as the max length defined by n\n\t\t\tfor(int j = 0; j < n; j++){\n\t\t\t\t//fills in the matrix from 1 to the n squared\n\t\t\t\tsquarelotron[i-1][j] = (i*size)-size+j+1;\n\t\t\t\n\t\t}\n\t\t}\n\t}", "public final int dimension() { return _N; }", "List<Object> getCountExtent();", "public void addVertices(int n);", "public ItemList(int n) {\n\t\tlast = 0;\n\t\tsize = n;\n\t\tlist = new Item[n];\n\t}", "protected void make_it_order_n_squared( int latti ) {\n\t\tint ns_i, ns_j, ns_n;\n\t\t\n\t\tSystem.out.println(\" H Making lattice \"+latti+\" use a O(N^2) neighbour list...\\n\");\n\t\t\n\t\tfor( ns_i = 0; ns_i < n; ns_i++ ) {\n\t\t\tns_n = 0;\n\t\t\tfor( ns_j = 0; ns_j < n; ns_j++ ) {\n\t\t\t\tif( ns_i != ns_j ) {\n\t\t\t\t\tnns[latti][ns_i][ns_n] = ns_j;\n\t\t\t\t\tns_n++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnns[latti][ns_i][ns_n] = NO_MORE_NNS;\n\t\t}\n\t}", "public Laberinto(int N) {\n this.N = N;\n StdDraw.setCanvasSize(700,700);\n StdDraw.setXscale(0, N+2);\n StdDraw.setYscale(0, N+2);\n init();\n generar();\n }", "public static int bell(int n) {\n\n int[][] bell = new int[n + 1][];\n bell[0] = new int[1];\n bell[0][0] = 1;\n\n for (int i = 1; i <= n; i++) {\n bell[i] = new int[i + 1];\n bell[i][0] = bell[i - 1][i - 1];\n for (int j = 1; j <= i; j++)\n bell[i][j] = bell[i - 1][j - 1] + bell[i][j - 1];\n }\n return bell[n][0];\n }", "public void iterateRange(double xl, double yl,\n double xu, double yu, LinkedList<Point> l) {\n if (_subdivided) {\n if (isWithin(_nodeOrigin[0], _nodeOrigin[1], xl, yl, xu, yu)) {\n _northEast.iterateRange(xl, yl, xu, yu, l);\n _northWest.iterateRange(xl, yl, xu, yu, l);\n _southWest.iterateRange(xl, yl, xu, yu, l);\n _southEast.iterateRange(xl, yl, xu, yu, l);\n } else if (inOneQuadrant(\n _nodeOrigin[0], _nodeOrigin[1], xl, yl, xu, yu)) {\n QuadTree<Point> qt = quadrant(xl, yl);\n qt.iterateRange(xl, yl, xu, yu, l);\n } else {\n if (xl >= _nodeOrigin[0]) {\n _northEast.iterateRange(xl, yl, xu, yu, l);\n _southEast.iterateRange(xl, yl, xu, yu, l);\n } else if (yl > _nodeOrigin[1]) {\n _northEast.iterateRange(xl, yl, xu, yu, l);\n _northWest.iterateRange(xl, yl, xu, yu, l);\n } else if (xu > _nodeOrigin[0]) {\n _southWest.iterateRange(xl, yl, xu, yu, l);\n _southEast.iterateRange(xl, yl, xu, yu, l);\n } else {\n _southWest.iterateRange(xl, yl, xu, yu, l);\n _northWest.iterateRange(xl, yl, xu, yu, l);\n }\n }\n } else {\n Iterator<Point> it = _elements.iterator();\n while (it.hasNext()) {\n Point p = it.next();\n if (isWithin(x(p), y(p), xl, yl, xu, yu)) {\n l.add(p);\n }\n }\n }\n }", "int givePropSize(List<Integer[]> coordsInProp) throws Exception;", "public static double Lt0050(double x, int n)\n {\n double result = 1;\n if(n == 0)\n {\n return result;\n }\n if(n > 0)\n {\n result = x;\n for(int i = 1; i < n; i++)\n {\n result *= x;\n }\n }\n else\n {\n result = 1.0 / x;\n n = -n;\n for(int i = 1; i < n; i++)\n {\n result /= x;\n }\n }\n return result;\n }", "public void addBlockList(int n) {\n BlockList.add(n);\r\n }", "public int getMaxListLength();", "public int h(Variable n)\n {\n int h = n.getDomain().size();\n return h;\n }", "public int size(){return n;}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n List<ArrayList<Integer>> lines = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n int l = sc.nextInt();\n ArrayList<Integer> line = new ArrayList<>();\n for (int j = 0; j < l; j++) {\n line.add(sc.nextInt());\n }\n lines.add(line);\n }\n\n int k = sc.nextInt();\n for (int i = 0; i < k; i++) {\n int lineNumber = sc.nextInt();\n int elementNumber = sc.nextInt();\n\n if(lines.get(lineNumber - 1).size() >= elementNumber){\n System.out.println(lines.get(lineNumber - 1).get(elementNumber - 1));\n }else{\n System.out.println(\"ERROR!\");\n }\n }\n }", "private ArrayList<Location> getLocationsWithin(Location loc, int n)\n {\n ArrayList<Location> locs = new ArrayList<>();\n if (loc==null||!loc.isValid()||n<=0)\n return locs;\n int thisRow = loc.getRow();\n int thisCol = loc.getCol();\n for (int row=thisRow-n;row<=thisRow+n;row++)\n {\n for (int col=thisCol-n;col<=thisCol+n;col++)\n {\n Location temp = new Location(row,col);\n if (temp.isValid())\n locs.add(temp);\n }\n }\n return locs;\n }", "Exp getElemSizeExp();", "public Percolation(int n){\n\t\tif (n <= 0)\n\t\t\tthrow new IllegalArgumentException(\"input must be greater than 0\");\n\t\tstoreVar = n; \n\t\tgrid = new boolean[n*n + 2]; \n\t\tfullgrid = new boolean[n*n + 2];\n\t\tvirtualTop = 0; \n\t\tvirtualBottom = grid.length-1; \n\t\tgrid[0] = true; \n\t\tgrid[grid.length-1] = true; \n\t\tfullgrid[0] = true;\n\t\tunionFind = new WeightedQuickUnionUF(grid.length);\n\t\tbackwash = new WeightedQuickUnionUF(n*n + 1);\n\t\topenSites = 0;\n\n\t}", "public TempList(int n, T elem) {\n list = new ArrayList<T>(n > 0 ? n : 0);\n while (n > 0) {\n list.add(elem);\n n--;\n }\n }", "private boolean outOfBounds(long n) {\n return n < 0 || n >= getSize();\n }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "public List<List<Integer>> generate1(int n) {\n List<List<Integer>> listOfList = new ArrayList<>();\n\n List<Integer> list = null;\n for (int i = 1; i <= n; i++) {\n list = getPascalLine(i, list);\n listOfList.add(list);\n }\n return listOfList;\n }", "public int getxlength(){ \n return numcols*boxsize;\n }", "private static final void quantize_lines_xrpow_01(int l, final float istep, final float[] xr, int xroffset, final int[] ix, int ixoffset) {\n\t\tfinal float compareval0 = (1.0f - 0.4054f) / istep;\n\n\t\tfor( l += xroffset; xroffset < l; ) {\n\t\t\tfinal float xr_0 = xr[xroffset++];\n\t\t\tfinal float xr_1 = xr[xroffset++];\n\t\t\tfinal int ix_0 = (compareval0 > xr_0) ? 0 : 1;\n\t\t\tfinal int ix_1 = (compareval0 > xr_1) ? 0 : 1;\n\t\t\tix[ixoffset++] = ix_0;\n\t\t\tix[ixoffset++] = ix_1;\n\t\t}\n\t}", "public LinearXOverPerDimension( Environment _environment, Selection _selection ){\n super( _environment, _selection );\n }", "List<GridCoordinate> getCoordinates(int cellWidth, int cellHeight);", "public TreeItem(int n, Symbol l, TreeItem[] x) {\n\n\t\ttruncated = false;\n\t\tnumChildren = n;\n\t\tlabel = l;\n\t\tchildren = new TreeItem[n];\n\t\tfor (int i = 0; i < numChildren; i++) {\n\t\t\tchildren[i] = x[i];\n\t\t}\n\t\tdecideNorm = false;\n\t\tisNorm = isNormal();\n\t\tdecideNorm = true;\n\t\tisEmptyString = false;\n\t\tsetNumNodes();\n\t}", "public TileBoard(int n){\n\t\tsize = n;\n\t\tinitTiles();\n\t\torganizeTiles();\n\t\tsetUpInputListenerDelegator();\n\t}", "void updateLT (int size, LeapNode [][] pa, LeapNode [][] na, LeapNode[] n, LeapNode[][] newNode, int[] maxHeight,\n\t\t\t\t\t\t\t\tboolean[] changed){\n\t}", "public TempList(int n) {\n list = new ArrayList<T>(n >= 0 ? n : 0);\n }", "public IsingLattice(int[][] lattice1, int dimension) {\n this.lattice = lattice1;\n this.m = dimension;\n }", "public int length() { return 1+maxidx; }", "@Override\n\tpublic void add(int n) {\n\t\tvalues[size] = n; //add value to the list\n\t\tsize++; //increment size\n\t\tif (size == values.length){ //if the list is full expand it\n\t\t\tresize();\n\t\t}\n\t}", "public Extent getLoadedExtent() {\n return loadedExtent;\n }", "public void addToNeighbours(Tile N) {\n \r\n neighbours.add(N);\r\n }", "public Percolation(int n)\r\n {\r\n //Throw an IllegalArgumentException in the constructor if n ≤ 0.\r\n if (n <= 0) throw new IllegalArgumentException(\"error range\");\r\n\r\n dimension = n;\r\n uf = new WeightedQuickUnionUF(dimension*dimension + 2);\r\n grids = new boolean[dimension*dimension + 1]; // array elements are false\r\n\r\n }", "public Percolation(int n) {\n\t\tif (n <= 0) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tsize = n;\n\t\tgrid = new boolean[n][n];\n\t\tuf = new WeightedQuickUnionUF(n * n + 2);\n\t}", "public long getExtent() {\n\t\tlong sum = 0;\n\t\tfor (ChrInfo info : infoMap.values()) {\n\t\t\tsum += info.length;\n\t\t}\n\t\treturn sum;\n\t}", "public int getSize()\n {\n return ll.getSize();\n }", "public void grow(int n)\n \t{\n \t\tif (n <= this.getLength())\n \t\t\treturn;\n \n \t\tint delta = n - this.getLength();\n \n \n \t\tint oldNumBytes = getLengthInBytes();\n \n \t\t/*\n \t\t** If we have enough space in the left over bits,\n \t\t** then all we need to do is change the modulo.\n \t\t*/\n \t\tif ((oldNumBytes != 0) &&\n \t\t (8 - this.bitsInLastByte) >= delta)\n \t\t{\n \t\t\tthis.bitsInLastByte += delta;\n \t\t\tlengthAsBits = n;\n \t\t\treturn;\n \t\t}\n \n \t\tint newNumBytes = FormatableBitSet.numBytesFromBits(n);\n \n \t\t// is there enough room in the existing array\n \t\tif (newNumBytes <= value.length) {\n \t\t\t// ensure the bits are zeroed\n \t\t\tfor (int i = oldNumBytes; i < newNumBytes; i++)\n \t\t\t\tvalue[i] = 0;\n \t\t} else {\n \n \n \t\t\t/*\n \t\t\t** We didn't have enough bytes in value, so we need\n \t\t\t** to create a bigger byte array and use that.\n \t\t\t*/\n \t\t\tbyte[] newValue = new byte[newNumBytes];\n \n \t\t\tSystem.arraycopy(value, 0, newValue, 0, oldNumBytes);\n \n \t\t\tvalue = newValue;\n \t\t}\n \t\tbitsInLastByte = numBitsInLastByte(n);\n \t\tlengthAsBits = n;\n \t}", "public Percolation(int n) {\n if (n <= 0) {\n throw new IllegalArgumentException(\"'n' cannot be less than 1\");\n }\n\n // grid\n // 0 --> blocked\n // 1 --> open\n // every index will be initialized with 0 by default\n this.grid = new int[n][n];\n this.openSitesCount = 0;\n this.gridSize = n;\n this.virtualTopSiteIndex = (gridSize * gridSize);\n this.virtualBottomSiteIndex = (gridSize * gridSize) + 1;\n // add 1 to accommodate virtual top site in union find data structure\n this.wquf = new WeightedQuickUnionUF((gridSize * gridSize) + 1);\n // add 2 to accommodate virtual sites in union find data structure\n this.wquf2 = new WeightedQuickUnionUF((gridSize * gridSize) + 2);\n }", "public void bindParameter(long l, int index) {\n bindParameter(new Long(l),index);\n }", "private boolean allLessThanN() {\n return this.matrix.stream()\n .allMatch(row -> row.stream()\n .allMatch(e -> e <= this.n));\n }", "public boolean isListLengthFixed();", "public LinearList(Location tr)\r\n {\r\n super(tr);\r\n }", "public ArraySetLong(long[] numbers, int n) {\n\t\tnumElements = n;\n\t\ttheElements = new long[n*2];\n\t\tfor (int i=0; i<n; i++) {\n\t\t\ttheElements[i] = numbers[i];\n\t\t}\n\t}", "public void setListSize(int value) {\n this.listSize = value;\n }", "public List<List<Integer>> nqueens(int n) {\n\t\tList<List<Integer>> result = new ArrayList<List<Integer>>();\n\t\t// cur will be a list of size n, and cur[i] is the column number where the queen\n\t\t// on row i positioned\n\t\tList<Integer> cur = new ArrayList<Integer>();\n\t\thelper(n, cur, result);\n\t\treturn result;\n\t}", "public ReducedFormList(double[] LatticeParamsExp)\r\n {\r\n\r\n DataBase = new ReducedCellInfo[ 45 ];\r\n\r\n for( int i = 0 ; i < 45 ; i++ )\r\n DataBase[i] = new ReducedCellInfo( i , LatticeParamsExp[0] , LatticeParamsExp[1] ,\r\n LatticeParamsExp[2] , LatticeParamsExp[3] , LatticeParamsExp[4] , LatticeParamsExp[5] );\r\n\r\n }", "QuantityExtentType getQuantityExtent();", "public MyArrayList(int n) throws IllegalArgumentException\n\t{\n\t\t// just to verify that the size is valid\n\t\tif (n<0)\n\t\t\tthrow new IllegalArgumentException();\n\t\tmyArray = new Object[n];\n\t}", "public LinearList(Location bl, Location tr)\r\n {\r\n super(bl, tr);\r\n }", "public LinearList(Location bl, Location br, Location tl, Location tr)\r\n {\r\n super(bl, br, tl, tr);\r\n }", "public static void forEach(int m, int n, ForEach2D l) {\n for (int i = 0; i < m; ++i) {\n for (int j = 0; j < n; ++j) {\n l.loop(i, j);\n }\n }\n }", "public void insert(L l);", "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 }", "public void add(double n){\n list [index] = n;\n index ++;\n if (index==length){\n if(!hasFilled){\n hasFilled = true;\n }\n index=0;\n }\n }", "public InfLinearAxis(int size) {\n super(size);\n }", "public void setHeight(int l){\n \theight = l;\n }", "public InfLinearAxis(int size, double min, double max) {\n super(size,min,max);\n }", "public int getExtent() {\r\n Object extentValue = extent.getValue();\r\n return extentValue == null\r\n ? getMinimum()\r\n : ((Integer) extentValue).intValue();\r\n\r\n }", "Gt(ExpList e)\r\n\t{\r\n\t\texpList = e;\r\n\t}", "public abstract int getNbMinColumns( );", "private void addListChangeListener(ActionListener<EntityList.EntityListEvent> l) {\n if (isIndexSelector() && getLeafEntity() instanceof EntityList) {\n EntityList el = (EntityList)getLeafEntity();\n el.addActionListener(l);\n }\n if (parent != null) {\n parent.addListChangeListener(l);\n }\n }", "TileDirectoryExtended(GvrsFileSpecification spec) {\n this.nRowsOfTiles = spec.nRowsOfTiles;\n this.nColsOfTiles = spec.nColsOfTiles;\n }", "public void setMaximum(int n) {\r\n int newMin = Math.min(n, min);\r\n int newValue = Math.min(n, getValue());\r\n int newExtent = Math.min(n - newValue, getExtent());\r\n setRangeProperties(newValue, newExtent, newMin, n, isAdjusting);\r\n }", "ArrayList<Integer> getStepCounterTileX();", "final Locatable extent ()\n {\n return _goal.extent();\n }", "protected List<Question> getListNumOfQuestions(List<Question> q, int n) {\n \tList<Question> finalQuestions = new ArrayList<Question>();\n \tfor (int i = 0; i < n; i++) {\n finalQuestions.add(q.get(i));\n }\n return finalQuestions;\n }", "private void addToPT(int n, String x) {\n\t\twhile (pT.size() < n + 1)\n\t\t\tpT.add(new ArrayList<String>());\n\t\tpT.get(n).add(x);\n\t}", "public int numberOfEllipsoids() { \r\n if (list.size() == 0) {\r\n return 0; \r\n }\r\n return list.size(); \r\n }", "public Percolation(int n){\n if(n <= 0) throw new IllegalArgumentException(\"n must be at least one.\");\n this.n = n;\n this.size = (n * n) + 2;\n weightedUnion = new WeightedQuickUnionUF(size);\n openings = new boolean[size];\n }", "@Override\r\n\tpublic int getRowCount() {\n\t\treturn 25;\r\n\t}", "public FloorCrate(ArrayList<Item> ary, int x, int y){\r\n super(null, \"You shouldn't be reading this.\", x, y);\r\n addAll(ary);\r\n description = isEmpty() ? new Description(\"tile\", \"There is nothing interesting here.\") :\r\n get(size()-1).description;\r\n }", "public static void enumm(int n, List<Integer> l, Set<String> set) {\n\t\tif (evaluar(l)) {\n\t\t\tSystem.out.println(\"-----\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < l.size(); i++) {\n\t\t\t\tif (l.get(i) <= 1)continue;\n\t\t\t\tint x = l.get(i);\n\t\t\t\tl.remove(i);\n\t\t\t\tfor (int j = 1; j <= n / 2; j++) {\n\t\t\t\t\tint d = x - (j);\n\t\t\t\t\tif (d < 1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tArrayList<Integer> it = new ArrayList<>(l);\n\t\t\t\t\tit.add(d);\n\t\t\t\t\tit.add(j);\n\t\t\t\t\tCollections.sort(it);\n\t\t\t\t\t// it.sort((s1,s2)->s1.compareTo(s2));\n\t\t\t\t\tset.add(it.toString());\n\t\t\t\t\tenumm(n, it, set);\n\t\t\t\t}\n\t\t\t\tl.add(i, x);\n\t\t\t}\n\t\t}\n\t}", "public Extent getExtent()\n {\n return this.getCurrentData().getExtent();\n }", "public Percolation(int n) {\n if (n < 1) {\n throw new IllegalArgumentException();\n }\n this.n = n;\n this.virtualTop = n * n;\n this.virtualBottom = n * n + 1;\n this.open = new boolean[n * n];\n this.quickUnion = new WeightedQuickUnionUF(virtualBottom);\n this.backwashQuickUnion = new WeightedQuickUnionUF(virtualBottom + 1);\n this.count = 0;\n }", "public int getSize(){\n\treturn Cells.size();\n }", "public abstract long getCompleteListSize();", "public static long[][] power(long F[][], long n){\n if(n == 0){\n return new long[][]{{1,1},{1,0}};\n }\n if(n == 1){\n return F;\n }\n if(n % 2 == 0){\n return power(multiply(F,F), n/2);\n }else{\n return multiply(F, power(multiply(F,F), (n-1)/2));\n }\n }", "public String getExtent() {\n return Formatter.formatDoubleStr(minX, 4) + \" \" + Formatter.formatDoubleStr(minY, 4)\n + \" \" + Formatter.formatDoubleStr(maxX, 4) + \" \" + Formatter.formatDoubleStr(maxY, 4);\n }", "protected int get_max_litter_size()\n {\n return max_litter_size;\n }", "public Percolation(int n) {\n\n if (n <= 0)\n throw new IllegalArgumentException(\"Size n cannot be 0 or less than 0\");\n // Create the grid and store the grid size\n mGridSize = n;\n mGrid = new boolean[n][n];\n\n mOpenSites = 0;\n\n for (int i = 0; i < n; i++) {\n mGrid[i] = new boolean[n];\n for (int j = 0; j < n; j++)\n mGrid[i][j] = false;\n }\n\n // Initialize the WeightedQuickUnionFind\n // 2 for extra virtual nodes - one at the top\n // and one at the bottom (index 0 and index n^2 + 1 respectively)\n mUnionFind = new WeightedQuickUnionUF(n * n + 2);\n }", "public int size (){\n return N;\n }", "public Collection<N> neighbors();", "public IntList(int size){\n\t\tprime = new ArrayList<Integer>(size);\n\t}", "public static IntList incrList(IntList L, int x) {\n /* Your code here. */\n IntList newList = null;\n for (int i = L.size() - 1; i > -1; i--) { //construct the newList backwardly, iteratively\n newList = new IntList(L.get(i) + x, newList);\n }\n return newList;\n }" ]
[ "0.59436387", "0.5293044", "0.51633334", "0.50700843", "0.50336885", "0.49174008", "0.49100474", "0.48886782", "0.4801832", "0.47672066", "0.4757295", "0.4749807", "0.47475857", "0.4745389", "0.47300404", "0.4727076", "0.47158173", "0.4693661", "0.46867257", "0.4682313", "0.46651566", "0.46645215", "0.46326083", "0.46276796", "0.45982602", "0.45974284", "0.45896953", "0.4576454", "0.45715117", "0.45518178", "0.45510793", "0.45448735", "0.45402843", "0.45346045", "0.45186585", "0.4518283", "0.45092887", "0.45064414", "0.45028442", "0.45003027", "0.44867057", "0.44860998", "0.44758868", "0.44691056", "0.4462608", "0.4460295", "0.44588825", "0.44564304", "0.44504637", "0.44429544", "0.44285157", "0.442618", "0.4422866", "0.44216177", "0.44088948", "0.44088936", "0.43946022", "0.4392993", "0.439127", "0.43912375", "0.43904892", "0.43872276", "0.43851656", "0.43841124", "0.43821117", "0.43800238", "0.4366728", "0.4362867", "0.4353544", "0.43513235", "0.43498394", "0.43420044", "0.4339592", "0.43387467", "0.43352666", "0.4331851", "0.43309078", "0.43308607", "0.43283018", "0.43259662", "0.43227065", "0.4319653", "0.4317536", "0.43173486", "0.43102154", "0.4307578", "0.43065563", "0.43064702", "0.43028596", "0.42989466", "0.4297341", "0.42971018", "0.42962602", "0.42951658", "0.4294322", "0.42923927", "0.4285795", "0.4284767", "0.4279707", "0.42782834" ]
0.5172792
2
List, 1 element. a in an object. L is the list (a).
public static <C> LIST<C> LIST1(C a) { LIST<C> L = new LIST<C>(); L.list.addFirst( a ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "Object getTolist();", "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "Listof<X> toList();", "public List<New> list();", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "ListType createListType();", "public static <T> List<T> clone(List<T> a) {\n\t\tList<T> newList = new ArrayList<T>();\n\t\t\n\t\tfor (T elt : a)\n\t\t\tnewList.add(elt);\n\t\t\n\t\treturn newList;\n\t}", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "private static AbstractList construct(LinkedList arg) {\n if (arg.isEmpty())\n return new EmptyList();\n else {\n Object fst = arg.pollFirst();\n //FIXME: The stupid bug in Gson.\n if (fst instanceof Double) fst = ((Double) fst).intValue();\n return new Cons(fst, construct(arg));\n }\n }", "public static List<RDFNode> asJavaList(Resource l) {\n List<RDFNode> result = new ArrayList<RDFNode>();\n Model m = l.getModel();\n while (!l.equals(RDF.nil)) {\n Statement first = l.getProperty(RDF.first);\n Statement rest = l.getProperty(RDF.rest);\n if (first == null) {\n result.add(Vocab.missingListElement.inModel(m));\n } else {\n result.add(first.getObject());\n }\n if (rest == null) {\n result.add(Vocab.missingListTail.inModel(m));\n break;\n }\n l = rest.getResource();\n }\n return result;\n }", "List<Object> buscar(Object o);", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "public Lista<Lado> obtener_Lista() {\n\t\treturn this.list;\n\t}", "public Lista listar() {\n Lista listaAux = new Lista();\r\n if (this.raiz != null) {\r\n listaAux = listarAux(this.raiz, listaAux);\r\n }\r\n return listaAux;\r\n }", "List<E> list();", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "List<Note> list();", "public static <C> C LELT(LIST<C> L, int i) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(i);\n }\n return x;\n }", "public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }", "public RDFList createRDFList(List<Expression> list, int arobase) {\r\n RDFList rlist = new RDFList(newBlankNode(), list); \r\n if (arobase == L_DEFAULT){\r\n arobase = listType;\r\n }\r\n switch (arobase){\r\n \r\n case L_LIST: \r\n rlist = complete(rlist);\r\n break;\r\n \r\n case L_PATH:\r\n rlist = path(rlist);\r\n break;\r\n }\r\n return rlist;\r\n }", "List<?> getList();", "void mo100444b(List<C40429b> list);", "abstract List<T> getReuslt();", "public DList2 list(){\r\n return this.list;\r\n }", "public T caseList(List object)\n {\n return null;\n }", "public boolean isList();", "public boolean isList();", "a(List list) {\n super(1);\n this.$sortedList = list;\n }", "int mo13159a(List<Log> list);", "public R visit(com.biosimilarity.lift.lib.scalar.Absyn.Listed p, A arg)\n {\n\n for (Expression x : p.listexpression_) {\n }\n\n return null;\n }", "public List getList();", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "public ListVisualiser(SLList l) { \n // Assign SLList pum with argument SLList l\n pum = l;\n }", "public XSListSimpleType asList() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: idiv \n // 1: laload \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ---- ------------------------------------------\n // 0 2 0 this Lcom/sun/xml/xsom/impl/ListSimpleTypeImpl;\n // \n // The error that occurred was:\n // \n // java.lang.ArrayIndexOutOfBoundsException\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "public static void clientFunc(){\n List list = new ArrayList(); //rawtype list\n list.add(10);\n list.add(\"jenkins\");\n list.add(new Object());\n\n //unsafe classcast exception at runtime\n //rawtypes are unsafe\n List<String> stringList = list;\n\n ListIterator listIterator = list.listIterator();\n while(listIterator.hasNext()){\n System.out.println(listIterator.next());\n }\n }", "protected List getList() {\n/* 88 */ return (List)getCollection();\n/* */ }", "abstract void makeList();", "public JsonCursor collect(String name, List l) {\n // Check if array exists\n JsonArray res = peekObject().getArray(name);\n if (res == null)\n return this;\n\n for (int i = 0; i < res.size(); i++) {\n l.add(res.get(i));\n }\n\n return this;\n }", "interface List { // List ADT\npublic void clear(); // Remove all Objects from list\npublic void insert(Object item); // Insert Object at curr position\npublic void append(Object item); // Insert Object at tail of list\npublic Object remove(); // Remove/return current Object\npublic void setFirst(); // Set current to first position\npublic void next(); // Move current to next position\npublic void prev(); // Move current to prev position\npublic int length(); // Return current length of list\npublic void setPos(int pos); // Set current to specified pos\npublic void setValue(Object val); // Set current Object's value\npublic Object currValue(); // Return value of current Object\npublic boolean isEmpty(); // Return true if list is empty\npublic boolean isInList(); // True if current is within list\npublic void print(); // Print all of list's elements\n}", "public ExprList expr_list(ExprList el) {\n if (el == null) {\n el = new ExprList();\n }\n el.add(expr());\n expr_list_tail(el);\n return el;\n }", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "@Override\r\n public ListADT<T> toMutable() {\r\n return new ListADTImpl<T>(this.head);\r\n }", "public static <C> LIST<C> LIST2(C a, C b) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "void mo54419a(List<String> list);", "@VTID(41)\n com.exceljava.com4j.excel.ListObject getListObject();", "public abstract <T> List<T> list(Class<T> aClass);", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "private ArrayList<String> createList(JList aListComponent) {\n ArrayList<String> aList = new ArrayList<>();\n if (aListComponent.getModel().getSize() > 0) {\n for (int i=0; i < aListComponent.getModel().getSize();i++) {\n aList.add(aListComponent.getModel().getElementAt(i).toString());\n }\n }\n return aList;\n }", "public final void accept(List<l> list) {\n com.iqoption.core.data.b.c a = this.dlr.dlm;\n kotlin.jvm.internal.h.d(list, \"it\");\n a.setValue(list);\n }", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "protected abstract List<E> getList();", "public T(Object o){\r\n\t\tl = o;\r\n\t}", "public List(String name) {\n super(name);\n children = new ArrayList<>();\n }", "public static boolean ObjectPropertyList(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ObjectPropertyList\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, OBJECT_PROPERTY_LIST, \"<object property list>\");\n r = ObjectProperty(b, l + 1);\n r = r && ObjectPropertyList_1(b, l + 1);\n r = r && ObjectPropertyList_2(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "public void arrayList(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of ArrayList\");\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "public AList() {\n items = (TypeHere[]) new Object[100];\n size = 0;\n }", "public Lista getListaAt(int i) {\n Lista iter = new Lista(this);\n for (int j = 0; j < i; j++) {\n iter = iter.next;\n }\n return iter;\n }", "public static <C> LIST<C> INV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n Collections.reverse( L.list );\n return L;\n }", "public Lista() {\r\n }", "public List<Product> list();", "ListValue createListValue();", "public Lista obtener(int llave)\n {\n Lista retornar = new Lista[];\n if(!elementos[llave]==null)\n {\n retornar = elementos[llave];\n }\n return retornar;\n }", "private List<SimpleComponent> list() {\n\t\treturn this.list(null);\n\t}", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "IList<T> append(IList<T> l);", "@Test public void asListSimple() {\n @SuppressWarnings(\"null\") final @NotNull List<Integer> is = as.list(new int @NotNull [] { 12, 13, 14 });\n azzert.that(is.get(0), is(fluent.ly.box.it(12)));\n azzert.that(is.get(1), is(fluent.ly.box.it(13)));\n azzert.that(is.get(2), is(fluent.ly.box.it(14)));\n azzert.that(is.size(), is(3));\n }", "List<E> read();", "public List<Blog> list();", "public static String list2str(List<? extends Object> l) {\n String rtn = \"{\";\n for (Object o : l) {\n rtn = rtn + o.toString() + \", \";\n }\n rtn = rtn + \"}\";\n return rtn;\n }", "public List<Loan> getLoan();", "public T caseElementList(ElementList object)\n {\n return null;\n }", "public abstract List<T> getList();", "private JList getAnalyzaList() {\n\t\tif (analyzaList == null) {\n\t\t\tanalyzaList = new JList();\n\t\t\tanalyzaList.setBounds(new Rectangle(400, 100, 39, 27));\n\t\t}\n\t\treturn analyzaList;\n\t}", "public abstract java.util.List extractListItems (Object obj, String countProp, String itemProp) \n\t throws SAFSException;", "a(ArrayList arrayList) {\n super(1);\n this.$result = arrayList;\n }", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "public String toString()\n {\n return ll.toString();\n }", "public IList<T> append(IList<T> l) {\n return l;\n }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "List<ParqueaderoEntidad> listar();", "private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }", "java.util.List<People>\n getUserList();", "Link getL();", "public void insert(L l);", "List<T> readList();", "public List<Object> toList() {\n int i = this.capacityHint;\n int i2 = this.size;\n ArrayList arrayList = new ArrayList(i2 + 1);\n Object[] head2 = head();\n int i3 = 0;\n while (true) {\n int i4 = 0;\n while (i3 < i2) {\n arrayList.add(head2[i4]);\n i3++;\n i4++;\n if (i4 == i) {\n head2 = head2[i];\n }\n }\n return arrayList;\n }\n }", "public DOCKSList getList() {\r\n return localList;\r\n }", "abstract protected Object newList( int capacity );", "public boolean isListable();", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "public List<E> clone();", "private static <L> List<L> zza(Object obj, long j, int i) {\n zzgn zzgn;\n List<L> list;\n List<L> zzc = zzc(obj, j);\n if (zzc.isEmpty()) {\n if (zzc instanceof zzgo) {\n list = new zzgn(i);\n } else if (!(zzc instanceof zzhr) || !(zzc instanceof zzge)) {\n list = new ArrayList<>(i);\n } else {\n list = ((zzge) zzc).zzah(i);\n }\n zziu.zza(obj, j, list);\n return list;\n }\n if (zzyp.isAssignableFrom(zzc.getClass())) {\n ArrayList arrayList = new ArrayList(zzc.size() + i);\n arrayList.addAll(zzc);\n zziu.zza(obj, j, arrayList);\n zzgn = arrayList;\n } else if (zzc instanceof zzir) {\n zzgn zzgn2 = new zzgn(zzc.size() + i);\n zzgn2.addAll((zzir) zzc);\n zziu.zza(obj, j, zzgn2);\n zzgn = zzgn2;\n } else if (!(zzc instanceof zzhr) || !(zzc instanceof zzge)) {\n return zzc;\n } else {\n zzge zzge = (zzge) zzc;\n if (zzge.zzch()) {\n return zzc;\n }\n zzge zzah = zzge.zzah(zzc.size() + i);\n zziu.zza(obj, j, zzah);\n return zzah;\n }\n return zzgn;\n }", "boolean m6609a(List<Log> list);", "public JList obtenirList() {\r\n\t\treturn list;\r\n\t}", "@Override\r\n\tpublic List<Object> findList(Object o) {\n\t\treturn null;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<T> getList() {\r\n\t\tgetEntityManager().flush();\r\n\t\treturn getEntityManager().createQuery(\r\n\t\t\t\t\"select OBJECT(o) from \" + getClassType().getSimpleName() + \" o order by o.id\")\r\n\t\t\t\t.getResultList();\r\n\t}" ]
[ "0.65538204", "0.6461382", "0.6460003", "0.62225896", "0.61684614", "0.60351515", "0.60071546", "0.5977009", "0.5880128", "0.5869337", "0.5861221", "0.5856423", "0.58222497", "0.58044523", "0.5797193", "0.57728755", "0.5706885", "0.5705572", "0.56885856", "0.56837523", "0.5681643", "0.5666309", "0.56600285", "0.56503177", "0.5640229", "0.562721", "0.56240404", "0.56198055", "0.56127626", "0.56127626", "0.5604179", "0.5596216", "0.55840904", "0.55744064", "0.5573003", "0.55723476", "0.55655783", "0.55648535", "0.55601555", "0.55598855", "0.5550107", "0.55362725", "0.5526927", "0.55259675", "0.5523241", "0.55148304", "0.55053", "0.5494904", "0.5479173", "0.5467454", "0.5457841", "0.54386747", "0.5425664", "0.54236376", "0.5421696", "0.54065853", "0.5403821", "0.53996736", "0.5395221", "0.53791517", "0.53784066", "0.5361707", "0.5355043", "0.5353519", "0.53504646", "0.53490937", "0.53417975", "0.5340674", "0.5336583", "0.53277695", "0.5327547", "0.5315569", "0.5308082", "0.5304713", "0.53010255", "0.53000146", "0.5299802", "0.5294409", "0.5290507", "0.5289989", "0.5287546", "0.52856374", "0.5283409", "0.52826416", "0.52819526", "0.5279062", "0.52788365", "0.5275986", "0.5270624", "0.526409", "0.5262204", "0.52613467", "0.5257205", "0.5256753", "0.5255592", "0.5250153", "0.5248395", "0.5242693", "0.5238439", "0.52375823" ]
0.70726115
0
List, 10 elements. a1, a2, a3, a4, a5, a6, a7, a8, a9 and a10 are objects. L is the list (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10).
public static <C> LIST<C> LIST10(C a1, C a2, C a3, C a4, C a5, C a6, C a7, C a8, C a9, C a10) { LIST<C> L = new LIST<C>(); L.list.addFirst( a10 ); L.list.addFirst( a9 ); L.list.addFirst( a8 ); L.list.addFirst( a7 ); L.list.addFirst( a6 ); L.list.addFirst( a5 ); L.list.addFirst( a4 ); L.list.addFirst( a3 ); L.list.addFirst( a2 ); L.list.addFirst( a1 ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TiraList() {\n this.list = new Object[8];\n this.nextindex = 0;\n this.startIndex = 0;\n }", "public List()\n {\n list = new Object [10];\n }", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "public NumericObjectArrayList() {\r\n list = new Copiable[10];\r\n count = 0;\r\n }", "public List() {\n this.list = new Object[MIN_CAPACITY];\n this.n = 0;\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "List() {\n final int ten = 10;\n list = new int[ten];\n size = 0;\n }", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList () {\n\t\tcapacity = 10;\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[capacity];\n\t}", "public ListDA() {\n elements = new Object[CAPACITY];\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public ArrayList() {\n\t\tthis.elements = new Object[5];\n\t\tthis.last = -1;\n\t}", "public AList() {\n items = (TypeHere[]) new Object[100];\n size = 0;\n }", "public MyArrayList ()\r\n {\r\n \tlist = new Object[100];\r\n \tnumElements = 0;\r\n }", "abstract protected Object newList( int capacity );", "@SuppressWarnings(\"unchecked\")\n public ArrayList() {\n list = (E[])new Object[DEFAULT_CAP];\n capacity = 10;\n size = 0;\n }", "public void arrayList(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of ArrayList\");\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "public MyArrayList() {\r\n\t\tthis.list=new Object[this.capacity];\r\n\t}", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public List<Limit> list();", "a(List list) {\n super(1);\n this.$sortedList = list;\n }", "public MyArrayList() {\n mMyArray = new Comparable[10];\n size = 10;\n head = tail = size / 3;\n }", "public ObjectList(final int initialCapacity) {\n super(initialCapacity);\n }", "public TempList(int n, T elem) {\n list = new ArrayList<T>(n > 0 ? n : 0);\n while (n > 0) {\n list.add(elem);\n n--;\n }\n }", "private static ArrayList<String> getOptimizedList(ArrayList<String> objList){\n\t\tArrayList<String> optimizedList = new ArrayList<String>();\r\n\t\tint limit = 1; // quantidade de objs escolhida da lista original (por exemplo, 2 objetos serao escolhidos aleatoriamente)\r\n\t\t\r\n\t\tRandom generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0; i<limit; i++){\r\n\t\t\toptimizedList.add(objList.get(generator.nextInt(objList.size())));\r\n\t\t}\r\n\t\t\r\n\t\treturn optimizedList;\r\n\t}", "public MyArrayList() {\n data = new Object[10];\n }", "public TempList(T... all) {\n list = new ArrayList<T>(all.length);\n for (int i = 0; i < all.length; i++)\n list.add(all[i]);\n }", "public BookList(ObservableList<Book> oList){\r\n //Instantiate the bookList attribute\r\n bookList = new ArrayList<Book>();\r\n //if the parameter oList is not null, then loop through it and create a new Book object from each element,\r\n //using the getters. The enhanced for-loop works great here See Chapter 7.13. Add the new Book to the attribute\r\n //called bookList\r\n if(oList != null){\r\n for(Book bk: oList){\r\n bookList.add(new Book(bk.getTitle(), bk.getPrice()));\r\n }\r\n }\r\n\r\n }", "public ArrayList() {\n arr = (T[]) new Object[10];\n size = 0;\n }", "static IntListList naturalRuns(IntList L) {\n if (L.tail == null) {\n return new IntListList(L, null);\n }\n else {\n IntList store = L;\n while (L.tail.head > L.head) {\n L = L.tail;\n if (L.tail == null) {\n return new IntListList(store, null);\n }\n }\n IntList help = L;\n L = L.tail;\n help.tail = null;\n return new IntListList(store, naturalRuns(L));\n }\n }", "public static void main(String[] args) {\n\r\n\t\tList<Integer> l = new ArrayList<Integer>();\r\n\t\t//List<Integer> l = new ArrayList<Integer>(Collection c); is also valid\r\n\t\t\r\n\t\tfor(int i=1;i<=10;i++){\r\n\t\t\tl.add(i);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(l);//[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\t//index based operations\r\n\t\t\r\n\t\tSystem.out.println(l.get(1));//2(element at position 1)\r\n\t\tSystem.out.println(l.set(1,12));//2(returns and replaces the element at position 1)\r\n\t\tSystem.out.println(l);//[1, 12, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\tl.add(1,11);//inserts 11 at position 1\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\tList<Integer> l1 = Arrays.asList(97,23,34);\r\n\t\tl.addAll(4,l1);//inserts collection elements at position 4\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 97, 23, 34, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\tSystem.out.println(l.remove(new Integer(4)));//true ( removes the first occurrence of object 4 )\r\n\t\tSystem.out.println(l.remove(4));//97 (removes the object at position 4)\r\n\t\r\n\t\tSystem.out.println(l.add(11));\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 23, 34, 5, 6, 7, 8, 9, 10,11]\r\n\t\t\r\n\t\tSystem.out.println(l.indexOf(new Integer(11)));//1\r\n\t\tSystem.out.println(l.lastIndexOf(new Integer(11)));//12\r\n\t\t\r\n\t\tSystem.out.println(l.subList(3, 8));//[3, 23, 34, 5, 6]\r\n\t\r\n\t\t\r\n\t}", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L))));\n\t\t}\n\t\treturn parts;\n\t}", "public List<New> list();", "public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }", "Object getTolist();", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public static <C> C LELT(LIST<C> L, int i) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(i);\n }\n return x;\n }", "public MyArrayList(int length) {\n data = new Object[length];\n }", "public static <T> List<T> m66049a(List<T> list) {\n return Collections.unmodifiableList(new ArrayList(list));\n }", "private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }", "public static ArrayList<Movie> fillList(ArrayList<Movie> list) {\n\t\tfor (int i = 1; i <= 100; i++) {\n\t\t\tlist.add(MovieIO.getMovie(i));\n\t\t}\n\t\treturn list;\n\t}", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n List<List<T>> parts = new ArrayList<List<T>>();\n final int N = list.size();\n for (int i = 0; i < N; i += L) {\n parts.add(new ArrayList<T>(\n list.subList(i, Math.min(N, i + L)))\n );\n }\n return parts;\n }", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "interface List { // List ADT\npublic void clear(); // Remove all Objects from list\npublic void insert(Object item); // Insert Object at curr position\npublic void append(Object item); // Insert Object at tail of list\npublic Object remove(); // Remove/return current Object\npublic void setFirst(); // Set current to first position\npublic void next(); // Move current to next position\npublic void prev(); // Move current to prev position\npublic int length(); // Return current length of list\npublic void setPos(int pos); // Set current to specified pos\npublic void setValue(Object val); // Set current Object's value\npublic Object currValue(); // Return value of current Object\npublic boolean isEmpty(); // Return true if list is empty\npublic boolean isInList(); // True if current is within list\npublic void print(); // Print all of list's elements\n}", "@SuppressWarnings(\"unchecked\")\r\n \tpublic List() {\r\n \t\titems = (T[]) new Object[INIT_LEN];\r\n \t\tnumItems = 0;\r\n \t\tcurrentObject = 0;\r\n \t}", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8,\n\t\t\tT item9, T item10, T... otherItems) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\tlist.add(item9);\n\t\tlist.add(item10);\n\t\tfor (T item : otherItems)\n\t\t\tlist.add(item);\n\t\treturn list;\n\t}", "public ArrayList() {\n\t\tthis(10, 75);\n\t}", "private static final <R> List<R> m65272q(@C6003d Object[] objArr) {\n ArrayList arrayList = new ArrayList();\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n arrayList.add(obj);\n }\n }\n return arrayList;\n }", "public ArrayList(int initialCapacity, int growthFactor) {\n\t\tthis.storedObjects = new Object[initialCapacity];\n\t\tthis.growthFactor = growthFactor;\n\t}", "public static List<RDFNode> asJavaList(Resource l) {\n List<RDFNode> result = new ArrayList<RDFNode>();\n Model m = l.getModel();\n while (!l.equals(RDF.nil)) {\n Statement first = l.getProperty(RDF.first);\n Statement rest = l.getProperty(RDF.rest);\n if (first == null) {\n result.add(Vocab.missingListElement.inModel(m));\n } else {\n result.add(first.getObject());\n }\n if (rest == null) {\n result.add(Vocab.missingListTail.inModel(m));\n break;\n }\n l = rest.getResource();\n }\n return result;\n }", "static List<C5826a> m23370a(C5826a aVar) {\n aVar.f18500b = aVar.f18502d.remaining();\n int c = ((aVar.f18500b - 1) / 131072) + 1;\n ArrayList arrayList = new ArrayList(c);\n arrayList.add(aVar);\n for (int i = 1; i < c; i++) {\n C5826a aVar2 = new C5826a(0);\n aVar2.f18499a = aVar.f18499a;\n aVar2.f18502d = aVar.f18502d.duplicate();\n aVar2.f18502d.position(aVar.f18502d.position() + (i * 131072));\n arrayList.add(aVar2);\n }\n return arrayList;\n }", "public MyArrayList(int i) {\n if(i <= 0) {\n System.out.println(\"Negative number given please try again\");\n return;\n }\n\n this.arrayList = new Object[i];\n this.elementsInArray = 0;\n this.size = i;\n }", "public List(int length, int x) {\n if (x == 1){\n list = new int[]{5, 4, 3, 2, 1, 10, 9, 8, 7, 6};\n }else if (x == 2) {\n list = new int[length];\n generateList();\n }else if (x == 3) {\n list = new int[length];\n }\n }", "private static <L> List<L> zza(Object obj, long j, int i) {\n zzgn zzgn;\n List<L> list;\n List<L> zzc = zzc(obj, j);\n if (zzc.isEmpty()) {\n if (zzc instanceof zzgo) {\n list = new zzgn(i);\n } else if (!(zzc instanceof zzhr) || !(zzc instanceof zzge)) {\n list = new ArrayList<>(i);\n } else {\n list = ((zzge) zzc).zzah(i);\n }\n zziu.zza(obj, j, list);\n return list;\n }\n if (zzyp.isAssignableFrom(zzc.getClass())) {\n ArrayList arrayList = new ArrayList(zzc.size() + i);\n arrayList.addAll(zzc);\n zziu.zza(obj, j, arrayList);\n zzgn = arrayList;\n } else if (zzc instanceof zzir) {\n zzgn zzgn2 = new zzgn(zzc.size() + i);\n zzgn2.addAll((zzir) zzc);\n zziu.zza(obj, j, zzgn2);\n zzgn = zzgn2;\n } else if (!(zzc instanceof zzhr) || !(zzc instanceof zzge)) {\n return zzc;\n } else {\n zzge zzge = (zzge) zzc;\n if (zzge.zzch()) {\n return zzc;\n }\n zzge zzah = zzge.zzah(zzc.size() + i);\n zziu.zza(obj, j, zzah);\n return zzah;\n }\n return zzgn;\n }", "public MyArrayList(int capacity) {\r\n\t\t//checks if the capacity of the list exceeds the minimum capacity required by the array\r\n\t\tif (capacity > 4)\r\n\t\t\tthis.capacity=capacity;\r\n\t\tthis.list=new Object[this.capacity];\r\n\t\t//this()\r\n\t}", "a(ArrayList arrayList) {\n super(1);\n this.$result = arrayList;\n }", "public static void main(String[] args) {\n\r\n\t\tArrayList<Integer> a1 = new ArrayList<Integer>(); //can store any type of object\r\n\t\ta1.add(1);\r\n\t\ta1.add(2);\r\n\t\ta1.add(3);\r\n\t\ta1.add(4);\r\n\t\ta1.add(5);\r\n\t\tSystem.out.println(\"Elements of a1 are : \" + a1);\r\n\t\t\r\n\t\tfor(int a:a1)\r\n\t\t{\r\n\t\t\tSystem.out.println(a);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public ItemList(int n) {\n\t\tlast = 0;\n\t\tsize = n;\n\t\tlist = new Item[n];\n\t}", "ListType createListType();", "void mo100444b(List<C40429b> list);", "public VectorLinearList()\n {// use default capacity of 10\n this(10);\n }", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "public static void main(String[] args) {\n List<Integer> id = new ArrayList<>();\r\n for(int i=0 ; i<=10 ;i++){\r\n \t id.add(i);\r\n }\r\n System.out.println(id);\r\n\t}", "public ArrayList(int initCapacity) {\n elements = new Object[initCapacity];\n }", "public List<Object> toList() {\n int i = this.capacityHint;\n int i2 = this.size;\n ArrayList arrayList = new ArrayList(i2 + 1);\n Object[] head2 = head();\n int i3 = 0;\n while (true) {\n int i4 = 0;\n while (i3 < i2) {\n arrayList.add(head2[i4]);\n i3++;\n i4++;\n if (i4 == i) {\n head2 = head2[i];\n }\n }\n return arrayList;\n }\n }", "public Liste(){\n\t\tsuper();\n\t\tthis.liste = new int[this.BASE_LENGTH];\n\t\tthis.nb = 0;\n\t}", "private Object[] getObjects(ArrayList objectList) {\n Object[] objects = new Object[objectList.size()];\n for(int i=0; i<objectList.size(); ++i)\n objects[i] = objectList.get(i);\n return objects;\n }", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "protected MyAbstractList(E[] objects) {\n for (int i = 0; i < objects.length; i++)\n add(objects[i]);\n }", "@BeforeEach\n public void createList() {\n myListOfInts = new ArrayListDIY<>(LIST_SIZE);\n listOfInts = new ArrayList<>(LIST_SIZE);\n\n getRandomIntStream(0,10).limit(LIST_SIZE)\n .forEach(elem -> {\n listOfInts.add(elem);\n myListOfInts.add(elem);\n });\n }", "public Lista()\n {\n empty=true;\n next = null;\n }", "public ArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "List<C45111a> mo107674a(Integer num);", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8, T item9) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\tlist.add(item9);\n\t\treturn list;\n\t}", "abstract void makeList();", "public OccList()\n {\n int capacity = 8;\n data = new Occ[capacity];\n // initialize data with empty occ\n for (int i=0; i<capacity; i++) data[i] = new Occ(); \n }", "public abstract List<T> mo2625k();", "public SimpleList(int capacity) {\n this.values = new Object[capacity];\n }", "@SuppressWarnings(\"unchecked\")\n public ArrayList(ArrayList<E> lst) {\n list = (E[])new Object[lst.size()];\n capacity = lst.capacity;\n size = lst.size;\n for(int i = 0; i < size; i++) {\n list[i] = lst.list[i];\n }\n }", "private static void iterateAllELementInLinkedList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\n\t\tfor (Integer i : list)\n\t\t\tSystem.out.println(i);\n\n\t}", "static /* synthetic */ List m17132a(List list) throws Exception {\n ArrayList arrayList = new ArrayList(list);\n Collections.sort(arrayList, f15631B0);\n return arrayList;\n }", "@Test\n\tpublic void createListWithInitialCapacity() {\n\t\tList<String> list1 = new ArrayList<>();\n\n\t\t// You can set capacity using constructor of ArrayList\n\t\tList<String> list2 = new ArrayList<>(20);\n\n\t\tassertTrue(list1.isEmpty());\n\t\tassertTrue(list2.isEmpty());\n\t\tassertTrue(list1.equals(list2));\n\t}", "ListOfBooks(){\n \tlist = new LinkedList<Book>();\n }", "public TempList(int n) {\n list = new ArrayList<T>(n >= 0 ? n : 0);\n }", "private void initList() {\n\n }", "public SimpleArrayList(int size) {\n this.values = new Object[size];\n }", "static void print5(ArrayList<? extends A> list) {\n\n\t}", "abstract List<T> getReuslt();", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "public List<Card> list();", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "@Test\n\tpublic void createListFromList() {\n\t\tList<String> list = new ArrayList<>();\n\t\tlist.add(\"AAPL\");\n\t\tlist.add(\"MSFT\");\n\n\t\t// Create a copy using constructor of ArrayList\n\t\tList<String> copy = new ArrayList<>(list);\n\n\t\tassertTrue(list.equals(copy));\n\t}", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "public MyArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }" ]
[ "0.6265448", "0.61348236", "0.60693264", "0.60358584", "0.60113406", "0.6010691", "0.58563", "0.5818642", "0.5807837", "0.5804645", "0.5787764", "0.5709417", "0.5705628", "0.5705628", "0.5687511", "0.56874084", "0.5665215", "0.5630513", "0.56276304", "0.56180763", "0.5617955", "0.5612173", "0.5608096", "0.5606136", "0.5551132", "0.5541453", "0.55392027", "0.5531223", "0.55307126", "0.5526229", "0.55034834", "0.5480489", "0.54659164", "0.54626447", "0.5461609", "0.5443529", "0.54375666", "0.5429862", "0.5405523", "0.5400652", "0.53912216", "0.5391042", "0.5382774", "0.5381167", "0.5377652", "0.53761864", "0.5366637", "0.5357291", "0.53443193", "0.5341799", "0.5340674", "0.5340173", "0.53398997", "0.5337032", "0.5326646", "0.5324282", "0.53164864", "0.530871", "0.5301244", "0.5300172", "0.5299796", "0.52931386", "0.52815545", "0.5271402", "0.5269808", "0.52676773", "0.52584964", "0.52561593", "0.52410585", "0.52383125", "0.52375144", "0.5232713", "0.52273685", "0.52240455", "0.52139103", "0.5213058", "0.52097356", "0.52053064", "0.5203699", "0.5202705", "0.5202352", "0.5188669", "0.5186504", "0.5185788", "0.5184474", "0.5180326", "0.5177686", "0.5169743", "0.51658726", "0.5161387", "0.51608515", "0.5155898", "0.51557386", "0.515008", "0.5146825", "0.51378834", "0.5135702", "0.51264805", "0.51263493", "0.5125964" ]
0.67606294
0
List, 2 elements. a and b are objects. L is the list (a,b).
public static <C> LIST<C> LIST2(C a, C b) { LIST<C> L = new LIST<C>(); L.list.addFirst( b ); L.list.addFirst( a ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static <T> List<T> pairList(T a, T b) {\n ArrayList<T> res = new ArrayList<T>();\n res.add(a);\n res.add(b);\n return res;\n }", "public static <C> LIST<C> COMP2(C a, C b, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public <A,B> List<B> mapList(List<A> list, Class<B> b) {\n\t\n\t\tif (list == null) {\n\t\t\treturn null;\n\t\t}\n\t\t\t\n\t\treturn list.stream().map(item -> map(item, b)).collect(Collectors.toList());\n\t}", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "ArrayList<Float> polaczListy (ArrayList<Float> L1, ArrayList<Float> L2)\n\t{\n\t\tint i=L1.size();\n\t\twhile(i<Stale.horyzontCzasowy)\n\t\t{\n\t\t\tL1.add(L2.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn L1;\n\t}", "Object getTolist();", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public <A,B> List<B> mapList(Iterable<A> iterable, Class<B> b) {\n\t\n\t\tif (iterable == null) {\n\t\t\treturn null;\n\t\t\t\n\t\t}\n\t\t\t\n\t\treturn StreamUtils.stream(iterable).map(item -> map(item, b)).collect(Collectors.toList());\n\t}", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "ListType createListType();", "private List<View> m9533a(List<View> list, List<View> list2) {\n LinkedList linkedList = new LinkedList();\n if (list != null && !list.isEmpty()) {\n int size = list.size();\n for (int i = 0; i < size; i++) {\n linkedList.add(list.get(i));\n }\n }\n if (list2 != null && !list2.isEmpty()) {\n int size2 = list2.size();\n for (int i2 = 0; i2 < size2; i2++) {\n linkedList.add(list2.get(i2));\n }\n }\n return linkedList;\n }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "Listof<X> toList();", "static <A, B> List<Pair<A, B>> pairs(List<A> as, List<B> bs) {\n return as.stream().flatMap(a -> bs.stream().map(b -> Pair.of(a, b))).collect(toList());\n }", "public interface ListTwoWays<T> {\n boolean isEmpty();\n\n void insertToHead(T element);\n\n void insertToTail(T element);\n\n T deleteFromHead();\n\n T deleteFromTail();\n\n T getFromHead();\n\n T getFromTail();\n}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic static void main(String[] args) {\n\r\n\t\tLinkedList<String> ll = new LinkedList<String>();\r\n\t\tll.add(\"My\");\r\n\t\tll.add(\"name\");\r\n\t\tll.add(\"is\");\r\n\t\tll.add(\"Sumit\");\r\n\t\r\n\t\tSystem.out.println(\"fisrt List:\"+ll);\r\n\t\t\r\n\t\tLinkedList<String> ll_sec = new LinkedList<String>();\r\n\t\tll_sec = (LinkedList<String>) ll.clone();\r\n\t\tSystem.out.println(\"Second List After cloning:\"+ll_sec);\r\n\t}", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "public static <T> List<T> createList(T item1, T item2) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\treturn list;\n\t}", "private static AbstractList construct(LinkedList arg) {\n if (arg.isEmpty())\n return new EmptyList();\n else {\n Object fst = arg.pollFirst();\n //FIXME: The stupid bug in Gson.\n if (fst instanceof Double) fst = ((Double) fst).intValue();\n return new Cons(fst, construct(arg));\n }\n }", "public List<New> list();", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "public static <T> List<T> mirrored(List<T> l) throws IllegalArgumentException {\n if (l.isEmpty()) {\n throw new IllegalArgumentException();\n }\n List<T> mirroredList1 = new ArrayList<T>(l);\n List<T> mirroredList2 = new ArrayList<T>(l);\n Collections.reverse(mirroredList2);\n mirroredList2 = mirroredList2.subList(1, mirroredList2.size());\n mirroredList1.addAll(mirroredList2);\n return mirroredList1;\n }", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "public static <C> LIST<C> CONC(LIST<C> L1, LIST<C> L2) {\n if ( isNull( L1 ) ) {\n return L2;\n }\n if ( isNull( L2 ) ) {\n return L1;\n }\n L1.list.addAll( L2.list );\n return L1;\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public static <C> C SECOND(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(2);\n }\n return x;\n }", "static List<StateRef> append(List<StateRef> l1, List<StateRef> l2) {\n l1.addAll(l2);\n return l1;\n }", "abstract List<T> getReuslt();", "abstract void makeList();", "public static <C> LIST<C> RED2(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(2,L.list.size()) );\n }\n return LP;\n }", "public DList2 list(){\r\n return this.list;\r\n }", "static void swap(List l, int i1, int i2) {\n\t\tObject tmp=l.get(i1);\n\t\tl.set(i1, l.get(i2));\n\t\tl.set(i2, tmp);\n\t}", "@Override\n\tpublic List<Couple> couplelist2() {\n\t\treturn st.selectList(\"couplens.list2\");\n\t}", "void mo100444b(List<C40429b> list);", "public static <C> LIST<C> LIST3(C a, C b, C c) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static void main(String[] args) {\n\t\t\t\n\t\tLinkedList<Integer> l1 = new LinkedList<Integer>();\n\t\tLinkedList<Integer> l2 = new LinkedList<Integer>();\n\t\tl1.add(34);\n\t\tl1.add(67);\n\t\tl2.add(89);\n\t\tl2.add(45);\n\t\tl1.addAll(l2);\n\t\tSystem.out.println(l1);\n\n }", "@Override\n\tpublic List<BookVO> list2() {\n\t\tList<BookVO> list2 =bookDAO.list2();\n\t\treturn list2;\n\t}", "public static <T> List<T> createList (T... args) {\n\tif (args == null) { return new ArrayList<T>(); };\n\treturn new ArrayList<T>(Arrays.asList(args));\n }", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "@Test\n public void testList() {\n SLNode one = new SLNode(1, null);\n SLNode twoOne = new SLNode(2, one);\n SLNode threeTwoOne = new SLNode(3, twoOne);\n\n SLNode x = SLNode.of(3, 2, 1);\n assertEquals(threeTwoOne, x);\n }", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}", "public static <T> List<T> clone(List<T> a) {\n\t\tList<T> newList = new ArrayList<T>();\n\t\t\n\t\tfor (T elt : a)\n\t\t\tnewList.add(elt);\n\t\t\n\t\treturn newList;\n\t}", "@Test\n\tpublic void createListFromList() {\n\t\tList<String> list = new ArrayList<>();\n\t\tlist.add(\"AAPL\");\n\t\tlist.add(\"MSFT\");\n\n\t\t// Create a copy using constructor of ArrayList\n\t\tList<String> copy = new ArrayList<>(list);\n\n\t\tassertTrue(list.equals(copy));\n\t}", "IList<T> append(IList<T> l);", "public ArrayList<Object> naturalJoin(ArrayList<Movie> list1, ArrayList<Person> list2)\r\n {\n return new ArrayList<Object>();\r\n }", "public static <T> List<T> createList(T item1) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\treturn list;\n\t}", "interface cl {\n void b(List<a> list, List<String> list2);\n}", "ArrayList deepCopyShapeList(List aShapeList){\n ArrayList newList = new ArrayList();\r\n\r\n if (aShapeList.size() > 0) {\r\n Iterator iter = aShapeList.iterator();\r\n\r\n while (iter.hasNext())\r\n newList.add(((TShape)iter.next()).copy());\r\n }\r\n return\r\n newList;\r\n}", "public Node createSecondList(Node head) {\n\t\tif (head != null) {\n\t\t\t\n\t\t\t//Copying a List\n\t\t\tNode temp = head;\n\t\t\tNode secondHead = new Node(head);\n\t\t\tNode temp1 = secondHead;\n\t\t\twhile (temp.getNext() != null) {\n\t\t\t\ttemp = temp.getNext();\n\t\t\t\ttemp1.setNext(new Node(temp));\n\t\t\t\ttemp1 = temp1.getNext();\n\t\t\t}\n\n\t\t\t//Revering new list\n\t\t\tNode firstNode = secondHead;\n\t\t\tNode secondNode = secondHead;\n\t\t\tNode result = null;\n\t\t\twhile (firstNode != null) {\n\t\t\t\tsecondNode = firstNode.getNext();\n\t\t\t\tfirstNode.setNext(result);\n\t\t\t\tresult = firstNode;\n\t\t\t\tfirstNode = secondNode;\n\t\t\t}\n\t\t\tsecondHead = result;\n\t\t\treturn secondHead;\n\t\t}\n\t\treturn null;\n\n\t}", "List<?> getList();", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }", "public static List<RDFNode> asJavaList(Resource l) {\n List<RDFNode> result = new ArrayList<RDFNode>();\n Model m = l.getModel();\n while (!l.equals(RDF.nil)) {\n Statement first = l.getProperty(RDF.first);\n Statement rest = l.getProperty(RDF.rest);\n if (first == null) {\n result.add(Vocab.missingListElement.inModel(m));\n } else {\n result.add(first.getObject());\n }\n if (rest == null) {\n result.add(Vocab.missingListTail.inModel(m));\n break;\n }\n l = rest.getResource();\n }\n return result;\n }", "public static <C> LIST<C> LIST4(C a, C b, C c, C d) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "public ArgList(Object arg1, Object arg2) {\n super(2);\n addElement(arg1);\n addElement(arg2);\n }", "public static ArrayList<Integer> mezclaListas(ArrayList<Integer> a1, ArrayList<Integer> a2) {\n ArrayList<Integer> listado = new ArrayList<>();\r\n int contador = 0;\r\n int size1 = a1.size();\r\n int size2 = a2.size();\r\n \r\n //El programa acaba cuando contador supere a los size\r\n while ((contador < size1) || (contador < size2)) {\r\n if (contador < size1) {\r\n listado.add(a1.get(contador));\r\n }\r\n if (contador < size2) {\r\n listado.add(a2.get(contador));\r\n }\r\n contador++;\r\n }\r\n \r\n return listado;\r\n }", "public void setList(DList2 list1){\r\n list = list1;\r\n }", "public ListNode mergeTwoListsWithExtraLinkedList(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy,temp;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n temp=new ListNode(l1.val);\n l1=l1.next;\n }\n else{\n temp=new ListNode(l2.val);\n l2=l2.next;\n }\n curr.next=temp;\n curr=curr.next;\n }\n while(l1!=null){\n curr.next=new ListNode(l1.val);\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=new ListNode(l2.val);\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }", "public static List<Object> deserializeList(ByteBuffer bb) {\n int length = deserializeInteger(bb);\n if (length == 0) {\n return new ArrayList<>();\n }\n String listObjectType = deserializeString(bb);\n List<Object> l = new ArrayList<>();\n for (int i = 0; i < length; i++) {\n if (listObjectType.equals(\"java.lang.String\")) {\n l.add(deserializeString(bb));\n } else if (listObjectType.equals(\"java.lang.Integer\")) {\n l.add(deserializeInteger(bb));\n } else if (listObjectType.equals(\"java.util.ArrayList\")) {\n l.add(deserializeList(bb));\n } else if (listObjectType.equals(\"commons.utils.Day\")) {\n l.add(deserializeDayEnum(bb));\n } else {\n l.add(deserializeObject(bb));\n }\n }\n return l;\n }", "public BookList(ObservableList<Book> oList){\r\n //Instantiate the bookList attribute\r\n bookList = new ArrayList<Book>();\r\n //if the parameter oList is not null, then loop through it and create a new Book object from each element,\r\n //using the getters. The enhanced for-loop works great here See Chapter 7.13. Add the new Book to the attribute\r\n //called bookList\r\n if(oList != null){\r\n for(Book bk: oList){\r\n bookList.add(new Book(bk.getTitle(), bk.getPrice()));\r\n }\r\n }\r\n\r\n }", "public static void m2(ArrayList<?> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\t//al.add(10);\n\t\t//al.add(10.5f);\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "public ListVisualiser(SLList l) { \n // Assign SLList pum with argument SLList l\n pum = l;\n }", "public static Object list(List<Object> items) {\n int size = (items == null) ? 0 : items.size();\n if(size > 0) {\n SPair result = new SPair();\n SPair sp = result;\n for(int i = 0; i<size; i++) {\n sp.setCar(items.get(i));\n if(i == size-1) {\n sp.setCdr(SEmptyList.getInstance());\n }\n else {\n SPair tmp = new SPair();\n sp.setCdr(tmp);\n sp = tmp;\n }\n }\n return result;\n }\n else\n return SEmptyList.getInstance();\n }", "public List<E> clone();", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "public List<Object> toList() {\n int i = this.capacityHint;\n int i2 = this.size;\n ArrayList arrayList = new ArrayList(i2 + 1);\n Object[] head2 = head();\n int i3 = 0;\n while (true) {\n int i4 = 0;\n while (i3 < i2) {\n arrayList.add(head2[i4]);\n i3++;\n i4++;\n if (i4 == i) {\n head2 = head2[i];\n }\n }\n return arrayList;\n }\n }", "@Override\n\tpublic List<Baidu> savaList(List<Baidu> bl) {\n\t\tbaiduDao.save(bl);\n\t\treturn bl;\n\t}", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "java.util.List<People>\n getFriendListList();", "public List getList();", "@NotNull\n private static List<P> list(P... ps) {\n List<P> result = new ArrayList<>();\n Collections.addAll(result, ps);\n return result;\n }", "public List getList(List oldList) {\n List newList = new ArrayList();\n Collections.copy(newList, oldList);\n return newList;\n }", "@Override\r\n public ListADT<T> toMutable() {\r\n return new ListADTImpl<T>(this.head);\r\n }", "public void showList(){\n\n List<Integer> lst1 = new ArrayList<Integer>();\n\n lst1.add(2);\n lst1.add(6);\n lst1.add(4);\n lst1.add(8);\n lst1.add(2);\n\n System.out.println(\"**********************************\");\n System.out.println(\"Arraylist:\" + lst1);\n\n //faster to add and remove\n List<Integer> lst2 = new LinkedList<Integer>();\n\n lst2.add(2);\n lst2.add(6);\n lst2.add(4);\n lst2.add(8);\n lst2.add(2);\n\n System.out.println(\"LinkedList: \" + lst2);\n System.out.println(\"********************************\");\n\n }", "public MemberList(List members)\n/* 10: */ {\n/* 11:10 */ this.members = members;\n/* 12: */ }", "protected abstract List<E> getList();", "@Override\n public List<E> asList() {\n ArrayList<E> result = null;\n\n while (top.next != null) {\n top = top.next;\n result.add(top.data);\n }\n return result;\n }", "public ArrayList<Object> product(ArrayList<Object> list1, ArrayList<Object> list2)\r\n {\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n retList.addAll(list1);\r\n retList.addAll(list2);\r\n return retList;\r\n }", "public IList<T> append(IList<T> l) {\n return l;\n }", "ArrayList<Edge> merge(ArrayList<Edge> l1, ArrayList<Edge> l2) {\n ArrayList<Edge> l3 = new ArrayList<Edge>();\n IComparator<Edge> c = new CompareEdges();\n while (l1.size() > 0 && l2.size() > 0) {\n if (c.apply(l1.get(0), l2.get(0))) {\n l3.add(l1.get(0));\n l1.remove(0);\n }\n else {\n l3.add(l2.get(0));\n l2.remove(0);\n }\n }\n while (l1.size() > 0) {\n l3.add(l1.get(0));\n l1.remove(0);\n }\n while (l2.size() > 0) {\n l3.add(l2.get(0));\n l2.remove(0);\n }\n return l3;\n }", "public LinearList(Location bl, Location tr)\r\n {\r\n super(bl, tr);\r\n }", "ListValue createListValue();", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "void testListMethods(Tester t) {\n IList<Integer> mt = new Empty<Integer>();\n IList<Integer> l1 = new Cons<Integer>(1,\n new Cons<Integer>(2, new Cons<Integer>(3, \n new Cons<Integer>(4, mt))));\n\n t.checkExpect(mt.len(), 0);\n t.checkExpect(l1.len(), 4);\n\n t.checkExpect(mt.append(l1), l1);\n t.checkExpect(l1.append(mt), l1);\n\n t.checkExpect(mt.getData(), null);\n t.checkExpect(l1.getData(), 1);\n\n t.checkExpect(l1.getNext(), new Cons<Integer>(2 , new Cons<Integer>(3 , \n new Cons<Integer>(4 , mt))));\n }", "public RDFList createRDFList(List<Expression> list, int arobase) {\r\n RDFList rlist = new RDFList(newBlankNode(), list); \r\n if (arobase == L_DEFAULT){\r\n arobase = listType;\r\n }\r\n switch (arobase){\r\n \r\n case L_LIST: \r\n rlist = complete(rlist);\r\n break;\r\n \r\n case L_PATH:\r\n rlist = path(rlist);\r\n break;\r\n }\r\n return rlist;\r\n }", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "List<Object> buscar(Object o);", "public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n ListNode newList;\n\n if(l1.val < l2.val) {\n newList = l1;\n\n l1 = l1.next;\n } else {\n newList = l2;\n l2 = l2.next;\n }\n\n ListNode head = newList;\n\n while (l1 != null && l2 != null) {\n if(l1.val < l2.val) {\n newList.next = l1;\n newList = newList.next;\n l1 = l1.next;\n } else {\n newList.next = l2;\n newList = newList.next;\n l2 = l2.next;\n }\n }\n\n if(l1 == null){\n newList.next = l2;\n } else {\n newList.next = l1;\n }\n\n return head;\n }", "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public abstract List<T> getList();", "public LinearList(Location bl, Location br, Location tl, Location tr)\r\n {\r\n super(bl, br, tl, tr);\r\n }", "public MutiList() {\n\t\tsuper();\n\t\tthis.myList = new ArrayList<>();\n\t}", "public List<Object> getList() {\n List<Object> returnList = new ArrayList<Object>();\n ListNode<String, Object> n = front;\n while(n != null) {\n returnList.add(n.value);\n n = n.next;\n }\n Collections.reverse(returnList);\n return returnList;\n }", "private static <T,S> void swap(List<T> x, List<S> a2, int a, int b) {\n\t\tT t = x.get(a);\n\t\tx.set(a, x.get(b));\n\t\tx.set(b,t);\n\t\tS t2 = a2.get(a);\n\t\ta2.set(a,a2.get(b));\n\t\ta2.set(b,t2);\n\t}" ]
[ "0.73503894", "0.650576", "0.6287755", "0.6273733", "0.6112813", "0.6078012", "0.6059259", "0.60570216", "0.5975102", "0.5974593", "0.59307414", "0.5897497", "0.58708894", "0.5801315", "0.57840234", "0.5776042", "0.5772432", "0.5772432", "0.5765626", "0.57246757", "0.570864", "0.57043296", "0.5686865", "0.5667492", "0.56296754", "0.5613899", "0.5592165", "0.55875224", "0.55602145", "0.5550889", "0.5545179", "0.5545016", "0.5525083", "0.55135685", "0.5501737", "0.54907465", "0.54874665", "0.5466434", "0.54570067", "0.5455542", "0.5449853", "0.54491556", "0.54448295", "0.544052", "0.5435958", "0.54250294", "0.5406742", "0.54029024", "0.54016703", "0.5397496", "0.53965616", "0.53939825", "0.53867644", "0.5386083", "0.53845906", "0.538328", "0.5378112", "0.5368928", "0.5353425", "0.53473276", "0.5343162", "0.5341622", "0.5332033", "0.53278697", "0.5320089", "0.5312023", "0.5311913", "0.5311818", "0.528341", "0.5279739", "0.52766246", "0.52743196", "0.52705055", "0.526876", "0.5268667", "0.5267174", "0.5267108", "0.5264268", "0.5263838", "0.5260936", "0.52531064", "0.52466184", "0.5233482", "0.52334756", "0.5230952", "0.52253705", "0.52223426", "0.5214845", "0.5208673", "0.52070045", "0.52047956", "0.51937515", "0.51927674", "0.51915365", "0.51892906", "0.51848495", "0.51723105", "0.51675653", "0.5166603", "0.5163089" ]
0.7197076
1
List, 3 elements. a1, a2 and a3 are objects. L=(a1,a2,a3).
public static <C> LIST<C> LIST3(C a, C b, C c) { LIST<C> L = new LIST<C>(); L.list.addFirst( c ); L.list.addFirst( b ); L.list.addFirst( a ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> RED3(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(3,L.list.size()) );\n }\n return LP;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public static <C> LIST<C> COMP3(C a, C b, C c, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> C THIRD(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(3);\n }\n return x;\n }", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }", "public static final ArrayList list (Object ... items) {\r\n ArrayList sequence = new ArrayList();\r\n for (int i=0; i<items.length; i++) {\r\n sequence.add(items[i]);\r\n }\r\n return sequence;\r\n }", "public static <T> List<T> createList(T item1, T item2, T item3) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\treturn list;\n\t}", "public static void m3(ArrayList<? extends Number> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "public static <C> LIST<C> COMP(C a, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( a );\n return LP;\n }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "public static List<RDFNode> asJavaList(Resource l) {\n List<RDFNode> result = new ArrayList<RDFNode>();\n Model m = l.getModel();\n while (!l.equals(RDF.nil)) {\n Statement first = l.getProperty(RDF.first);\n Statement rest = l.getProperty(RDF.rest);\n if (first == null) {\n result.add(Vocab.missingListElement.inModel(m));\n } else {\n result.add(first.getObject());\n }\n if (rest == null) {\n result.add(Vocab.missingListTail.inModel(m));\n break;\n }\n l = rest.getResource();\n }\n return result;\n }", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "public static <C> LIST<C> LIST4(C a, C b, C c, C d) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "public static <T> List<T> createList(T item1, T item2, T item3, T item4) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\treturn list;\n\t}", "public void arrayList(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of ArrayList\");\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "public static <C> void SRED(LIST<C> L, LIST<C> LP) {\n if ( ! isNull( L ) ) {\n L.list.subList(1,L.list.size()).clear(); \n if ( ! isEmpty( LP ) ) {\n L.list.addAll( LP.list );\n }\n }\n\n }", "public ArrayList a(boolean bl2) {\n synchronized (this) {\n ArrayList<Object> arrayList = new ArrayList<Object>();\n Object object = this.a;\n boolean bl3 = true;\n if (object != null) {\n object = ((cv)object).a(bl3);\n arrayList.addAll((Collection<Object>)object);\n }\n object = cz.b;\n synchronized (object) {\n Object object2 = cz.b;\n String string2 = ((cv)this).b;\n object2 = object2.get(string2);\n object2 = (cv)object2;\n if (object2 != null) {\n boolean bl4;\n Object object3 = ((cv)object2).a(bl3);\n object3 = ((ArrayList)object3).iterator();\n while (bl4 = object3.hasNext()) {\n int n10;\n object2 = object3.next();\n int n11 = arrayList.indexOf(object2 = (String)object2);\n if (n11 != (n10 = -1)) continue;\n arrayList.add(object2);\n }\n object3 = ((cv)this).b;\n arrayList.remove(object3);\n object3 = ((cv)this).b;\n arrayList.add(object3);\n }\n return arrayList;\n }\n }\n }", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L))));\n\t\t}\n\t\treturn parts;\n\t}", "public Immutable(int field1, MutableField field3, List<String> list) {\n this.field1 = field1;\n this.field3 = field3;\n this.list = Collections.unmodifiableList(list);\n //this.list.add(\"\"); // UnsupportedOperationException\n }", "public static Object list(List<Object> items) {\n int size = (items == null) ? 0 : items.size();\n if(size > 0) {\n SPair result = new SPair();\n SPair sp = result;\n for(int i = 0; i<size; i++) {\n sp.setCar(items.get(i));\n if(i == size-1) {\n sp.setCdr(SEmptyList.getInstance());\n }\n else {\n SPair tmp = new SPair();\n sp.setCdr(tmp);\n sp = tmp;\n }\n }\n return result;\n }\n else\n return SEmptyList.getInstance();\n }", "public void addALl(List<T> list){\n for(int i = 0; i < list.size(); i++){\n add(list.get(i));\n }\n }", "public static <C> C LELT(LIST<C> L, int i) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(i);\n }\n return x;\n }", "public static <C> void SFIRST(LIST<C> L, C a) {\n if ( ! isNull( L ) ) {\n L.list.set(0,a);\n }\n }", "public void addLVA(LV l) {\r\n ZugewieseneLV.add(l);\r\n }", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n List<List<T>> parts = new ArrayList<List<T>>();\n final int N = list.size();\n for (int i = 0; i < N; i += L) {\n parts.add(new ArrayList<T>(\n list.subList(i, Math.min(N, i + L)))\n );\n }\n return parts;\n }", "public static <T> List<T> m66049a(List<T> list) {\n return Collections.unmodifiableList(new ArrayList(list));\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\treturn list;\n\t}", "public ArgList(Object arg1, Object arg2, Object arg3) {\n super(3);\n addElement(arg1);\n addElement(arg2);\n addElement(arg3);\n }", "public tc a(List<lc> list) {\n long j2;\n LinkedList linkedList = new LinkedList(list);\n Collections.sort(linkedList);\n linkedList.add(new lc(-1, -1, -1));\n ArrayList arrayList = new ArrayList();\n long j3 = 0;\n int i2 = 0;\n while (true) {\n j2 = -9223372036854775807L;\n if (i2 >= a()) {\n break;\n }\n if (((lc) linkedList.peek()).a != i2) {\n long b2 = b(i2);\n if (b2 != -9223372036854775807L) {\n j3 += b2;\n }\n } else {\n ov a2 = a(i2);\n ov ovVar = new ov(a2.a, a2.b - j3, a(a2.c, linkedList), a2.d);\n arrayList.add(ovVar);\n }\n i2++;\n }\n long j4 = this.b;\n if (j4 != -9223372036854775807L) {\n j2 = j4 - j3;\n }\n tc tcVar = new tc(this.a, j2, this.c, this.d, this.e, this.f, this.g, this.h, this.k, this.i, this.j, arrayList);\n return tcVar;\n }", "public static <C> LIST<C> RED2(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(2,L.list.size()) );\n }\n return LP;\n }", "public ArrayList<String> mostraLlistaAtribs(){\n ArrayList<String> tauleta = new ArrayList<>();\n System.out.print(\"num atribs: \"+list.getNomLlista()+\"\\n\");\n String aux = list.getAtribs().get(0).getNom();\n for (int i=1; i<list.getAtribs().size(); i++){\n aux += \"\\t\" + list.getAtribs().get(i).getNom();\n }\n tauleta.add(aux);\n for (int j=0; j<list.getNumCasos(); j++) {\n aux = list.getAtribs().get(0).getCasos().get(j);\n for (int i = 1; i < list.getAtribs().size(); i++) {\n aux += \"\\t\" + list.getAtribs().get(i).getCasos().get(j);\n }\n tauleta.add(aux);\n }\n return tauleta;\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\treturn list;\n\t}", "public static <T> List<T> mirrored(List<T> l) throws IllegalArgumentException {\n if (l.isEmpty()) {\n throw new IllegalArgumentException();\n }\n List<T> mirroredList1 = new ArrayList<T>(l);\n List<T> mirroredList2 = new ArrayList<T>(l);\n Collections.reverse(mirroredList2);\n mirroredList2 = mirroredList2.subList(1, mirroredList2.size());\n mirroredList1.addAll(mirroredList2);\n return mirroredList1;\n }", "public static String list2str(List<? extends Object> l) {\n String rtn = \"{\";\n for (Object o : l) {\n rtn = rtn + o.toString() + \", \";\n }\n rtn = rtn + \"}\";\n return rtn;\n }", "public JsonCursor collect(String name, List l) {\n // Check if array exists\n JsonArray res = peekObject().getArray(name);\n if (res == null)\n return this;\n\n for (int i = 0; i < res.size(); i++) {\n l.add(res.get(i));\n }\n\n return this;\n }", "public static <C> LIST<C> REDUCT(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(i,L.list.size()) );\n }\n return LP;\n }", "public static StringList createFrom(String list1[], String list2[], String list3[]) {\n StringList list = new StringList(list1);\n list.merge(list2);\n list.merge(list3);\n return list;\n }", "public RDFList createRDFList(List<Expression> list, int arobase) {\r\n RDFList rlist = new RDFList(newBlankNode(), list); \r\n if (arobase == L_DEFAULT){\r\n arobase = listType;\r\n }\r\n switch (arobase){\r\n \r\n case L_LIST: \r\n rlist = complete(rlist);\r\n break;\r\n \r\n case L_PATH:\r\n rlist = path(rlist);\r\n break;\r\n }\r\n return rlist;\r\n }", "Object getTolist();", "public static /* synthetic */ int m28127a(List list, int i, int i2, C6080l lVar, int i3, Object obj) {\n if ((i3 & 1) != 0) {\n i = 0;\n }\n if ((i3 & 2) != 0) {\n i2 = list.size();\n }\n return m28126a(list, i, i2, lVar);\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\treturn list;\n\t}", "public static <T, U> List<?> copyListOfProperties(List<T> list, U u) {\n\t\tType listType = new TypeToken<List<U>>() {\n\t\t}.getType();\n\t\treturn modelMapper.map(list, listType);\n\t}", "public static void main(String[] args) {\nArrayList<String>mylist =new ArrayList<String>();\r\nmylist.add(\"anu\");\r\nmylist.add(\"ammu\");\r\nmylist.add(\"renu\");\r\nSystem.out.println(mylist);\r\nfor(int i=0;i<3;i++)\r\n{\r\n\tSystem.out.println(i+\"=\" + mylist.get(i));\r\n}\r\n\t}", "public AList() {\n items = (TypeHere[]) new Object[100];\n size = 0;\n }", "public static <T> List<T> reduceToSingleList3(Stream<List<T>> stream) {\n List<T> list = stream.reduce(new ArrayList<T>(), (list1, list2) -> {\n list1.addAll(list2);\n return list1;\n });\n return list;\n }", "private PyObject[] listtoarray(ArrayList<PyObject> a)\n {\n PyObject[] results = new PyObject[a.size()];\n int iter = 0;\n for (PyObject pt : a) {\n results[iter] = pt;\n iter++;\n }\n return results;\n }", "ListType createListType();", "public static <T> List<T> clone(List<T> a) {\n\t\tList<T> newList = new ArrayList<T>();\n\t\t\n\t\tfor (T elt : a)\n\t\t\tnewList.add(elt);\n\t\t\n\t\treturn newList;\n\t}", "public static <C> C FOURTH(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(4);\n }\n return x;\n }", "@Override\n\tpublic List<BookVO> list3() {\n\t\tList<BookVO> list3 =bookDAO.list3();\n\t\treturn list3;\n\t}", "private List<View> m9533a(List<View> list, List<View> list2) {\n LinkedList linkedList = new LinkedList();\n if (list != null && !list.isEmpty()) {\n int size = list.size();\n for (int i = 0; i < size; i++) {\n linkedList.add(list.get(i));\n }\n }\n if (list2 != null && !list2.isEmpty()) {\n int size2 = list2.size();\n for (int i2 = 0; i2 < size2; i2++) {\n linkedList.add(list2.get(i2));\n }\n }\n return linkedList;\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8, T item9) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\tlist.add(item9);\n\t\treturn list;\n\t}", "private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }", "public static void main(String[] args) {\t\n\t\t//List olusturma nasil yapilir?\n\t\t//1. yol\n\t\tArrayList<String> sl1= new ArrayList<>();\n\t\t\n\t\t//2. yol\n\t\tArrayList<String> sl2= new ArrayList<>();\n\t\tSystem.out.println(sl1+\"\"+sl2);\n\t\t//3. yol (bunu kullanacagiz)\n\t\tList<String> sl3=new ArrayList<>();\n\t\tSystem.out.println(sl3);\n\t\t\n\t\t//Liste eleman ekleme\n\t\t\n\t\tsl3.add(\"A\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\tsl3.add(\"B\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\tsl3.add(\"C\");\n\t\tSystem.out.println(sl3);\n\t\t\n\t\t//herhangi bir indexe eleman ekleme\n\t\t\n\t\tsl3.add(0, \"Mustafa\");\n\t\t System.out.println(sl3);//[Mustafa, A, X, B, C]\n\t\t \n\t\t //List'lerde eleman sayisini bulma nasil yapilir?\n\t\t System.out.println(sl3.size());//5\n\t\t \n\t\t //Bir list'in bos olup olmadigin nasil anlariz?\n\t\t System.out.println(sl3.isEmpty());//isEmpty() ==> bos ise true, dolu ise false verir\n\t\t \n\t\t //Bir list'den istenen elemani silme nasil yapilir?\n\t\t \n\t\t //1. Yol: index ile silme yapabilirsiniz.\n\t\t System.out.println(sl3.remove(0));\n\t\t System.out.println(sl3);//[A, X, B, C]\n\t\t \n\t\t //2. Yol: Eleman secip sil\n\t\t sl3.remove(\"X\");\n\t\t System.out.println(sl3);//[A, B, C]\n\t\t \n\t\t sl3.add(\"B\");//[A, B, C, B]\n\t\t System.out.println(sl3.remove(\"B\"));//true\n\t\t //Ayni elemandan 1 den fazla varsa ilkini siler\n\t\t System.out.println(sl3);//[A, C, B]\n\t\t \n\t\t \n\t\t System.out.println(sl3.remove(\"W\"));//false\n\t\t //Java'dan olmayan bir elemani remove etmesini isterseniz\n\t\t //remove edemez ve list'i aynen oldugu gibi birakir.\n\t\t System.out.println(sl3);//[A, C, B]\n\t\t \n\t\t //remove(index) ne return eder?\n\t\t // sl3 ==> [A, C, B]\n\t\t System.out.println(sl3.remove(1));//C\n\t\t System.out.println(sl3);//[A, B]\n\t\t \n\t\t//remove(eleman) ne return eder?\n\t\t// sl3 ==> [A, B] \n\t\t System.out.println(sl3.remove(\"A\"));//true\n\t\t //remove() methodunun icine tamsayi koyarsaniz \n\t\t //Java onu index kabul eder. \n\t\t //Bu yuzden elemanlari integer olan bir listteki elemanlari silmek icin \n\t\t //remove() methodunun sadece indexlisini kullanabilirsiniz.\n\n \n}", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "Listof<X> toList();", "@Test\n public void testList() {\n SLNode one = new SLNode(1, null);\n SLNode twoOne = new SLNode(2, one);\n SLNode threeTwoOne = new SLNode(3, twoOne);\n\n SLNode x = SLNode.of(3, 2, 1);\n assertEquals(threeTwoOne, x);\n }", "public static <T> Future<List<JsonObject>> futureL(final List<T> list, final String pojo) {\n return Future.succeededFuture(To.toJList(list, pojo));\n }", "public ListVisualiser(SLList l) { \n // Assign SLList pum with argument SLList l\n pum = l;\n }", "private static AbstractList construct(LinkedList arg) {\n if (arg.isEmpty())\n return new EmptyList();\n else {\n Object fst = arg.pollFirst();\n //FIXME: The stupid bug in Gson.\n if (fst instanceof Double) fst = ((Double) fst).intValue();\n return new Cons(fst, construct(arg));\n }\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\treturn list;\n\t}", "public OrderedSet (List l) {\n initialize();\n for ( ; l!=null; l=l.getNext())\n addLast(l.getInfo());\n }", "protected ArrayList<Object[]> genObjectArrayListFromIDElementList(ArrayList<? extends IDElement> pIDElementList) throws Exception{\r\n\t\tObject[] vElement;\r\n\t\tArrayList<Object[]> vRet;\r\n \t\t\r\n \t\tif (pIDElementList != null) {\r\n \t\t\tvRet = new ArrayList<Object[]>();\r\n \t\t\t\r\n \t\t\tfor (IDElement vCur : pIDElementList) {\r\n \t\t\t\tvElement = new Object[2];\r\n \t \t\t\t\r\n \t \t\t\tvElement[0] = vCur.getId();\r\n \t \t\t\tvElement[1] = vCur.getName();\r\n \t \t\t\t\r\n \t \t\t\tvRet.add(vElement);\r\n \t\t\t}\r\n \t\t} else throw new Exception(\"04; gOALfIDEL,Edi\");\r\n \t\t\r\n \t\treturn vRet;\r\n\t}", "private static final <R> List<R> m65272q(@C6003d Object[] objArr) {\n ArrayList arrayList = new ArrayList();\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n arrayList.add(obj);\n }\n }\n return arrayList;\n }", "void mo54419a(List<String> list);", "@NotNull\n private static List<P> list(P... ps) {\n List<P> result = new ArrayList<>();\n Collections.addAll(result, ps);\n return result;\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public static List<Object> elements(Tuple tuple) {\n return tuple.elements;\n }", "void mo29842a(IObjectWrapper iObjectWrapper, zzatk zzatk, List<String> list) throws RemoteException;", "public final void accept(List<l> list) {\n com.iqoption.core.data.b.c a = this.dlr.dlm;\n kotlin.jvm.internal.h.d(list, \"it\");\n a.setValue(list);\n }", "ArrayList getAttributes();", "public ArgList(Object arg1, Object arg2, Object arg3, Object arg4) {\n super(4);\n addElement(arg1);\n addElement(arg2);\n addElement(arg3);\n addElement(arg4);\n }", "public TempList(T... all) {\n list = new ArrayList<T>(all.length);\n for (int i = 0; i < all.length; i++)\n list.add(all[i]);\n }", "private ArrayList<String> simpleFormList(ArrayList<String> list){\n\t\tArrayList<String> simpleFormList = new ArrayList<String>();\n\t\tfor(String s : list){\n\t\t\tString pos = posMap.get(s);\n\t\t\tsimpleFormList.add(simpleForm(s,pos));\n\t\t}\n\t\treturn simpleFormList;\n\t}", "private static void format1(ArrayList<String> l) {\n\t\tArrayList<String> listContents = l;\n\t\tArrayList<Person> personList = new ArrayList<Person>();\n\t\tfor (int i = 0; i < listContents.size(); i++) {\n\t\t\tPerson person = new Person();\n\n\t\t\tperson.setFirstName(listContents.get(i).substring(0, 10).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setLastName(listContents.get(i).substring(10, 27).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setStartDate(listContents.get(i).substring(27, 35).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setAddress(listContents.get(i).substring(35, 45).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setAptNum(listContents.get(i).substring(45, 55).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setCity(listContents.get(i).substring(55, 65).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setState(listContents.get(i).substring(65, 67).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setCountry(listContents.get(i).substring(67, 70).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setZipCode(listContents.get(i).substring(70, 80).replaceFirst(\"\\\\s++$\", \"\"));\n\n\t\t\tpersonList.add(person);\n\t\t}\n\t\tselectSortingOption(personList);\n\t}", "a(ArrayList arrayList) {\n super(1);\n this.$result = arrayList;\n }", "public TiraList() {\n this.list = new Object[8];\n this.nextindex = 0;\n this.startIndex = 0;\n }", "private List<C4892c> m9768LA() {\n if (this.brz == null) {\n return new ArrayList();\n }\n if (this.brA != null && !this.brA.isEmpty()) {\n return this.brA;\n }\n C3981a aVar = new C3981a(new C3965h(this));\n C3982b bVar = new C3982b(new C3975i(this));\n C3987c cVar = new C3987c();\n UpgradeBroadcastReceiver cA = UpgradeBroadcastReceiver.m10244cA(VivaBaseApplication.m8749FZ());\n cA.getClass();\n this.brA = Arrays.asList(new C4892c[]{aVar, bVar, cVar, new C4128c(), new C3979a(new C3976j(this)), new HomeInterstitialPopF()});\n return this.brA;\n }", "public static <T> List<T> createList(T item1) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\treturn list;\n\t}", "ArrayList<Product> ListOfProducts();", "public static <T> List<T> immutableList(T... elements){\n return Collections.unmodifiableList(Arrays.asList(elements.clone()));\n }", "public MultiList(){}", "private Object[] transformPrioElementToList(PrioElement pPrioElement) throws Exception{\r\n\t\tObject[] vRet = new Object[3];\r\n\t\t\r\n\t\tif (pPrioElement != null) {\r\n\t\t\tvRet[0] = pPrioElement.getId();\r\n\t\t\tvRet[1] = pPrioElement.getName();\r\n\t\t\tvRet[2] = pPrioElement.getPriority();\r\n\t\t} else throw new Exception(\"04; tPriEtL,Edi\");\r\n\t\t\r\n\t\treturn vRet;\r\n\t}", "private ArrayList<String> createList(JList aListComponent) {\n ArrayList<String> aList = new ArrayList<>();\n if (aListComponent.getModel().getSize() > 0) {\n for (int i=0; i < aListComponent.getModel().getSize();i++) {\n aList.add(aListComponent.getModel().getElementAt(i).toString());\n }\n }\n return aList;\n }", "public static <C> LIST<C> INV(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n Collections.reverse( L.list );\n return L;\n }", "public abstract void mo56920a(List<C4122e> list);", "void mo100444b(List<C40429b> list);", "public List<String> getImmutableViewOfField3() {\n return List.of(field3);\n }", "private Object[] getObjects(ArrayList objectList) {\n Object[] objects = new Object[objectList.size()];\n for(int i=0; i<objectList.size(); ++i)\n objects[i] = objectList.get(i);\n return objects;\n }" ]
[ "0.6238501", "0.5927336", "0.5913764", "0.5877604", "0.5861876", "0.5698794", "0.5686152", "0.56546295", "0.56020457", "0.5569726", "0.5550479", "0.5546194", "0.55331045", "0.5527251", "0.5517762", "0.55049115", "0.5501676", "0.54699373", "0.546785", "0.545436", "0.5435255", "0.54069227", "0.537788", "0.537389", "0.5365084", "0.53437495", "0.53422505", "0.5332659", "0.53316444", "0.5312492", "0.5302371", "0.5297559", "0.526717", "0.5234257", "0.52335185", "0.52179337", "0.52158326", "0.5211103", "0.52013904", "0.5195998", "0.5175008", "0.51722157", "0.5163222", "0.51548845", "0.515113", "0.51461124", "0.5131353", "0.5126569", "0.51229846", "0.5118089", "0.51099735", "0.51081604", "0.51077205", "0.5103313", "0.50907594", "0.5087328", "0.5082389", "0.50707346", "0.50697905", "0.50517154", "0.5048299", "0.5046208", "0.50393134", "0.5034535", "0.50241655", "0.50189227", "0.5015662", "0.50113815", "0.49801135", "0.49793136", "0.49775857", "0.4971371", "0.49705845", "0.49695843", "0.496754", "0.49637523", "0.49621278", "0.49621278", "0.49585497", "0.4954922", "0.4951021", "0.49486402", "0.49461785", "0.49444255", "0.49349535", "0.49334934", "0.49279207", "0.49242127", "0.49224558", "0.49212915", "0.49166986", "0.49165407", "0.49145937", "0.4905654", "0.489964", "0.4893004", "0.48917428", "0.4889824", "0.487965", "0.48786816" ]
0.59710485
1
List, 4 elements. a1, a2, a3 and a4 are objects. L is the list (a1,a2,a3,a4).
public static <C> LIST<C> LIST4(C a, C b, C c, C d) { LIST<C> L = new LIST<C>(); L.list.addFirst( d ); L.list.addFirst( c ); L.list.addFirst( b ); L.list.addFirst( a ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\treturn list;\n\t}", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public void arrayList(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of ArrayList\");\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "protected ArrayList<Object[]> genObjectArrayListFromIDElementList(ArrayList<? extends IDElement> pIDElementList) throws Exception{\r\n\t\tObject[] vElement;\r\n\t\tArrayList<Object[]> vRet;\r\n \t\t\r\n \t\tif (pIDElementList != null) {\r\n \t\t\tvRet = new ArrayList<Object[]>();\r\n \t\t\t\r\n \t\t\tfor (IDElement vCur : pIDElementList) {\r\n \t\t\t\tvElement = new Object[2];\r\n \t \t\t\t\r\n \t \t\t\tvElement[0] = vCur.getId();\r\n \t \t\t\tvElement[1] = vCur.getName();\r\n \t \t\t\t\r\n \t \t\t\tvRet.add(vElement);\r\n \t\t\t}\r\n \t\t} else throw new Exception(\"04; gOALfIDEL,Edi\");\r\n \t\t\r\n \t\treturn vRet;\r\n\t}", "public ArgList(Object arg1, Object arg2, Object arg3, Object arg4) {\n super(4);\n addElement(arg1);\n addElement(arg2);\n addElement(arg3);\n addElement(arg4);\n }", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "@Override\n\tpublic List<BookVO> list4() {\n\n\t\tList<BookVO> list4 =bookDAO.list4();\n\t\treturn list4;\n\t\t\n\t}", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "public static <C> C FOURTH(LIST<C> L) {\n C x = null;\n if ( ! isNull( L ) ) {\n x = L.list.get(4);\n }\n return x;\n }", "public static void m4(ArrayList<? super Integer> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t\tal.add(345);\n\t}", "static void print5(ArrayList<? extends A> list) {\n\n\t}", "private <T extends IDElement> ArrayList<Object[]> transformElementListToList(ArrayList<T> pElementList, int pElementType) throws Exception{\r\n\t\tArrayList<Object[]> vRet = new ArrayList<Object[]>();\r\n\t\t\r\n\t\tif (pElementList!= null) {\r\n\t\t\tfor (T vCur : pElementList) {\r\n\t\t\t\tswitch(pElementType) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tvRet.add(transformProbElementToList((ProbElement)vCur));\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tvRet.add(transformPrioElementToList((PrioElement)vCur));\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Exception(\"02; tELtL,Edi\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else throw new Exception(\"04; tELtL,Edi\");\r\n\t\t\r\n\t\treturn vRet;\r\n\t}", "public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }", "public AList() {\n items = (TypeHere[]) new Object[100];\n size = 0;\n }", "private static final <R> List<R> m65272q(@C6003d Object[] objArr) {\n ArrayList arrayList = new ArrayList();\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n arrayList.add(obj);\n }\n }\n return arrayList;\n }", "private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "public abstract void mo56920a(List<C4122e> list);", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\treturn list;\n\t}", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\treturn list;\n\t}", "public TiraList() {\n this.list = new Object[8];\n this.nextindex = 0;\n this.startIndex = 0;\n }", "public List getList1(List<String> list,String a) {\n\t\tlist.add(a);\r\n\t\treturn list;\r\n\t}", "public static <C> LIST<C> LIST5(C a, C b, C c, C d, C e) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( e );\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static final ArrayList list (Object ... items) {\r\n ArrayList sequence = new ArrayList();\r\n for (int i=0; i<items.length; i++) {\r\n sequence.add(items[i]);\r\n }\r\n return sequence;\r\n }", "public static String list2str(List<? extends Object> l) {\n String rtn = \"{\";\n for (Object o : l) {\n rtn = rtn + o.toString() + \", \";\n }\n rtn = rtn + \"}\";\n return rtn;\n }", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L))));\n\t\t}\n\t\treturn parts;\n\t}", "Listof<X> toList();", "public ArrayList() {\n\t\tthis.elements = new Object[5];\n\t\tthis.last = -1;\n\t}", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "private Object[] getObjects(ArrayList objectList) {\n Object[] objects = new Object[objectList.size()];\n for(int i=0; i<objectList.size(); ++i)\n objects[i] = objectList.get(i);\n return objects;\n }", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "public abstract void mo56923b(List<C4122e> list);", "public static <T> List<T> m66049a(List<T> list) {\n return Collections.unmodifiableList(new ArrayList(list));\n }", "private static ArrayList<String> getOptimizedList(ArrayList<String> objList){\n\t\tArrayList<String> optimizedList = new ArrayList<String>();\r\n\t\tint limit = 1; // quantidade de objs escolhida da lista original (por exemplo, 2 objetos serao escolhidos aleatoriamente)\r\n\t\t\r\n\t\tRandom generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0; i<limit; i++){\r\n\t\t\toptimizedList.add(objList.get(generator.nextInt(objList.size())));\r\n\t\t}\r\n\t\t\r\n\t\treturn optimizedList;\r\n\t}", "public static List<Artist> makeChild4() {\n Artist q = new Artist(\"\", true);\n\n return Arrays.asList(q);\n }", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n List<List<T>> parts = new ArrayList<List<T>>();\n final int N = list.size();\n for (int i = 0; i < N; i += L) {\n parts.add(new ArrayList<T>(\n list.subList(i, Math.min(N, i + L)))\n );\n }\n return parts;\n }", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "public static List<RDFNode> asJavaList(Resource l) {\n List<RDFNode> result = new ArrayList<RDFNode>();\n Model m = l.getModel();\n while (!l.equals(RDF.nil)) {\n Statement first = l.getProperty(RDF.first);\n Statement rest = l.getProperty(RDF.rest);\n if (first == null) {\n result.add(Vocab.missingListElement.inModel(m));\n } else {\n result.add(first.getObject());\n }\n if (rest == null) {\n result.add(Vocab.missingListTail.inModel(m));\n break;\n }\n l = rest.getResource();\n }\n return result;\n }", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "public static void main(String[] args) {\n\r\n\t\tArrayList<Integer> a1 = new ArrayList<Integer>(); //can store any type of object\r\n\t\ta1.add(1);\r\n\t\ta1.add(2);\r\n\t\ta1.add(3);\r\n\t\ta1.add(4);\r\n\t\ta1.add(5);\r\n\t\tSystem.out.println(\"Elements of a1 are : \" + a1);\r\n\t\t\r\n\t\tfor(int a:a1)\r\n\t\t{\r\n\t\t\tSystem.out.println(a);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public final void mo81945a(List<MediaModel> list) {\n C7573i.m23587b(list, \"list\");\n if (!C7573i.m23585a((Object) mo81943a(), (Object) list)) {\n super.mo81945a(list);\n }\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\treturn list;\n\t}", "void mo29842a(IObjectWrapper iObjectWrapper, zzatk zzatk, List<String> list) throws RemoteException;", "public void addALl(List<T> list){\n for(int i = 0; i < list.size(); i++){\n add(list.get(i));\n }\n }", "public void vector(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of Vector\");\r\n\t\tEnumeration<Student> enumeration = Collections.enumeration(list);\r\n\t\twhile (enumeration.hasMoreElements()) \r\n\t\t\tSystem.out.println(enumeration.nextElement()); \r\n\t}", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\treturn list;\n\t}", "Object getTolist();", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "a(List list) {\n super(1);\n this.$sortedList = list;\n }", "public static <T> List<T> clone(List<T> a) {\n\t\tList<T> newList = new ArrayList<T>();\n\t\t\n\t\tfor (T elt : a)\n\t\t\tnewList.add(elt);\n\t\t\n\t\treturn newList;\n\t}", "public ArrayList<String> a(ArrayList<View> arrayList) {\n ArrayList<String> arrayList2 = new ArrayList<>();\n int size = arrayList.size();\n for (int i = 0; i < size; i++) {\n View view = arrayList.get(i);\n arrayList2.add(p.e(view));\n p.a(view, (String) null);\n }\n return arrayList2;\n }", "public ArrayList<String> getObjects(){\n ArrayList<String> objs = new ArrayList<>();\n for (int i = 0; i < field.length; i++){\n objs.add(\"Asteroid\");\n }\n return objs;\n }", "public ArrayList<String> mostraLlistaAtribs(){\n ArrayList<String> tauleta = new ArrayList<>();\n System.out.print(\"num atribs: \"+list.getNomLlista()+\"\\n\");\n String aux = list.getAtribs().get(0).getNom();\n for (int i=1; i<list.getAtribs().size(); i++){\n aux += \"\\t\" + list.getAtribs().get(i).getNom();\n }\n tauleta.add(aux);\n for (int j=0; j<list.getNumCasos(); j++) {\n aux = list.getAtribs().get(0).getCasos().get(j);\n for (int i = 1; i < list.getAtribs().size(); i++) {\n aux += \"\\t\" + list.getAtribs().get(i).getCasos().get(j);\n }\n tauleta.add(aux);\n }\n return tauleta;\n }", "public List<Anime> listAll(){\n return List.of(new Anime(1L,\"DB2\"), new Anime(2L,\"Berseke\"));\n }", "void mo29846a(IObjectWrapper iObjectWrapper, zzxz zzxz, String str, String str2, zzamv zzamv, zzady zzady, List<String> list) throws RemoteException;", "List<Area> list();", "public List<New> list();", "public ListDA() {\n elements = new Object[CAPACITY];\n }", "public static Object list(List<Object> items) {\n int size = (items == null) ? 0 : items.size();\n if(size > 0) {\n SPair result = new SPair();\n SPair sp = result;\n for(int i = 0; i<size; i++) {\n sp.setCar(items.get(i));\n if(i == size-1) {\n sp.setCdr(SEmptyList.getInstance());\n }\n else {\n SPair tmp = new SPair();\n sp.setCdr(tmp);\n sp = tmp;\n }\n }\n return result;\n }\n else\n return SEmptyList.getInstance();\n }", "void mo54419a(List<String> list);", "void mo100444b(List<C40429b> list);", "public List<Object> toList() {\n int i = this.capacityHint;\n int i2 = this.size;\n ArrayList arrayList = new ArrayList(i2 + 1);\n Object[] head2 = head();\n int i3 = 0;\n while (true) {\n int i4 = 0;\n while (i3 < i2) {\n arrayList.add(head2[i4]);\n i3++;\n i4++;\n if (i4 == i) {\n head2 = head2[i];\n }\n }\n return arrayList;\n }\n }", "static /* synthetic */ List m17132a(List list) throws Exception {\n ArrayList arrayList = new ArrayList(list);\n Collections.sort(arrayList, f15631B0);\n return arrayList;\n }", "public ListState(DartObjectImpl[] elements) {\n this.elements = elements;\n }", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "a(ArrayList arrayList) {\n super(1);\n this.$result = arrayList;\n }", "public final void accept(List<? extends com.iqoption.fragment.c.a.a.j> list) {\n a aVar = this.dhx.dhv.dhu;\n kotlin.jvm.internal.i.e(list, \"list\");\n aVar.aU(list);\n }", "public final void mo99835a(List<MyMediaModel> list) {\n int i;\n if (C23477d.m77081a((Collection<T>) list)) {\n i = 0;\n } else {\n i = list.size();\n }\n if (MvChoosePhotoActivity.this.f104229s < i) {\n MvChoosePhotoActivity.m128158b(list);\n }\n MvChoosePhotoActivity.this.f104229s = i;\n MvChoosePhotoActivity.this.f104227q = list;\n MvChoosePhotoActivity.this.mo99820a(list);\n }", "public static void fill(java.util.List arg0, java.lang.Object arg1)\n { return; }", "private static <L> List<L> zza(Object obj, long j, int i) {\n zzgn zzgn;\n List<L> list;\n List<L> zzc = zzc(obj, j);\n if (zzc.isEmpty()) {\n if (zzc instanceof zzgo) {\n list = new zzgn(i);\n } else if (!(zzc instanceof zzhr) || !(zzc instanceof zzge)) {\n list = new ArrayList<>(i);\n } else {\n list = ((zzge) zzc).zzah(i);\n }\n zziu.zza(obj, j, list);\n return list;\n }\n if (zzyp.isAssignableFrom(zzc.getClass())) {\n ArrayList arrayList = new ArrayList(zzc.size() + i);\n arrayList.addAll(zzc);\n zziu.zza(obj, j, arrayList);\n zzgn = arrayList;\n } else if (zzc instanceof zzir) {\n zzgn zzgn2 = new zzgn(zzc.size() + i);\n zzgn2.addAll((zzir) zzc);\n zziu.zza(obj, j, zzgn2);\n zzgn = zzgn2;\n } else if (!(zzc instanceof zzhr) || !(zzc instanceof zzge)) {\n return zzc;\n } else {\n zzge zzge = (zzge) zzc;\n if (zzge.zzch()) {\n return zzc;\n }\n zzge zzah = zzge.zzah(zzc.size() + i);\n zziu.zza(obj, j, zzah);\n return zzah;\n }\n return zzgn;\n }", "public static <C> LIST<C> RED3(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(3,L.list.size()) );\n }\n return LP;\n }", "ListType createListType();", "public List() {\n this.list = new Object[MIN_CAPACITY];\n this.n = 0;\n }", "public static <C> LIST<C> COMP3(C a, C b, C c, C d, LIST<C> L) {\n LIST<C> LP = L;\n if ( L == null ) {\n LP = new LIST<C>();\n }\n LP.list.addFirst( d );\n LP.list.addFirst( c );\n LP.list.addFirst( b );\n LP.list.addFirst( a );\n return LP;\n }", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "private List<View> m9533a(List<View> list, List<View> list2) {\n LinkedList linkedList = new LinkedList();\n if (list != null && !list.isEmpty()) {\n int size = list.size();\n for (int i = 0; i < size; i++) {\n linkedList.add(list.get(i));\n }\n }\n if (list2 != null && !list2.isEmpty()) {\n int size2 = list2.size();\n for (int i2 = 0; i2 < size2; i2++) {\n linkedList.add(list2.get(i2));\n }\n }\n return linkedList;\n }", "public final void accept(List<l> list) {\n com.iqoption.core.data.b.c a = this.dlr.dlm;\n kotlin.jvm.internal.h.d(list, \"it\");\n a.setValue(list);\n }", "private static void format1(ArrayList<String> l) {\n\t\tArrayList<String> listContents = l;\n\t\tArrayList<Person> personList = new ArrayList<Person>();\n\t\tfor (int i = 0; i < listContents.size(); i++) {\n\t\t\tPerson person = new Person();\n\n\t\t\tperson.setFirstName(listContents.get(i).substring(0, 10).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setLastName(listContents.get(i).substring(10, 27).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setStartDate(listContents.get(i).substring(27, 35).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setAddress(listContents.get(i).substring(35, 45).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setAptNum(listContents.get(i).substring(45, 55).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setCity(listContents.get(i).substring(55, 65).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setState(listContents.get(i).substring(65, 67).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setCountry(listContents.get(i).substring(67, 70).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setZipCode(listContents.get(i).substring(70, 80).replaceFirst(\"\\\\s++$\", \"\"));\n\n\t\t\tpersonList.add(person);\n\t\t}\n\t\tselectSortingOption(personList);\n\t}", "public RDFList createRDFList(List<Expression> list, int arobase) {\r\n RDFList rlist = new RDFList(newBlankNode(), list); \r\n if (arobase == L_DEFAULT){\r\n arobase = listType;\r\n }\r\n switch (arobase){\r\n \r\n case L_LIST: \r\n rlist = complete(rlist);\r\n break;\r\n \r\n case L_PATH:\r\n rlist = path(rlist);\r\n break;\r\n }\r\n return rlist;\r\n }", "ArrayList<Product> ListOfProducts();", "abstract protected Object newList( int capacity );", "@Override // com.google.android.gms.internal.vision.zzgp\n public final <L> List<L> zza(Object obj, long j) {\n return zza(obj, j, 10);\n }", "public static <T> List<T> of(T... elements) {\n final LinkedList<T> linkedList = new LinkedList<>();\n Arrays.stream(elements).forEach(linkedList::add);\n return linkedList;\n }", "public static void main(String[] args) {\n\t\tList<Object> arrayList = new ArrayList<Object>();\n\t\tarrayList.add(2);\n\t\tarrayList.add(2);\n\t\tarrayList.add(\"test\");\n\t\tarrayList.add(true);\n\t\tarrayList.add(2.9);\n\t\t\n\t\tSystem.out.println(arrayList);\n\t\t\n\t\tIterator<Object> itr = arrayList.iterator();\n\t\t//Iterator interface reference can be created if we import the package java.util.Iterator\n\t\t//itr is a reference of interface called Iterator. hasNext() and next are two of its methods.\n\t\t//hasNext() - Returns true if the iteration has more elements. \n\t\t//next() - Returns the next element in the iteration.\n\t\twhile(itr.hasNext()){ //iterator will go in forward direction \n\t\t\tSystem.out.println(itr.next());\n\t\t\titr.remove();\n\t\t}\n\t\t\n\t\tSystem.out.println(arrayList);\n\t\tSystem.out.println(\"----------------------------------\");\n\t\t\n\t\tList<String> arrayList1 = new ArrayList<String>();\n\t\tarrayList1.add(\"Test1\");\n\t\tarrayList1.add(\"Test2\");\n\t\tarrayList1.add(\"Test3\");\n\t\tarrayList1.add(\"Test4\");\n\t\tarrayList1.add(\"Test5\");\n\t\t\n\t\tSystem.out.println(arrayList1);\n\t\t\n\t\tIterator<String> itr1 = arrayList1.iterator();\n\t\twhile(itr1.hasNext()){ //iterator will go in forward direction \n\t\t\tSystem.out.println(itr1.next());\n\t\t\t//itr1.remove();\n\t\t}\n\t\t\n\t\tSystem.out.println(arrayList1);\n\t\tSystem.out.println(\"----------------------------------\");\n\t\t\n\t\t//Create objects of class Person\n\t\tPerson p1 = new Person(25,2000);\n\t\tPerson p2 = new Person(30,3500);\n\t\tPerson p3 = new Person(35,10000);\n\t\t\n\t\tList<Person> arrayList3 = new ArrayList<Person>();\n\t\t//Insert objects into array list\n\t\tarrayList3.add(p1);\n\t\tarrayList3.add(p2);\n\t\tarrayList3.add(p3);\n\t\t\n\t\t//System.out.println(arrayList3);\n\t\t//Create class type iterator variable and call iterator method on array list\n\t\tIterator<Person> itr2 = arrayList3.iterator();\n\t\twhile(itr2.hasNext()){ //iterator will go in forward direction \n\t\t\t//Create class type object and store current data in list by casting to class type\n\t\t\tPerson pt = (Person) itr2.next();\n\t\t\tSystem.out.println(pt.age+ \" \"+ pt.salary);//Object.variable to access variables\n\t\t}\n\t\t\n\t\t//System.out.println(arrayList3);\n\t\tSystem.out.println(\"----------------------------------\");\n\t\t\n\t\t\n\t\t\n\t\tList<Object> linkedList = new LinkedList<Object>();\n\t\tlinkedList.add(20);\n\t\tlinkedList.add(77.77);\n\t\tlinkedList.add(\"String\");\n\t\tlinkedList.add(false);\n\t\tlinkedList.add('A');\n\t\t\n\t\t//Linked list iterator has 2 additional methods - hasPrevious and previous\n\t\t//itr3 is a reference of interface called ListIterator which extends Iterator interface\n\t\t//listIterator() is a method called from interface called List.\n\t\tListIterator<Object> itr3 = linkedList.listIterator();\n\t\twhile(itr3.hasNext()){ //iterator will go in forward direction \n\t\t\tSystem.out.println(itr3.next());\n\t\t}\n\t\t\n\t\twhile(itr3.hasPrevious()) { //This iterator will go in backward direction. However we need to traverse in forward direction first.\n\t\t\tSystem.out.println(itr3.previous());\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tObject[] oList = new Object[INIT_SIZE];\n\t\tlist = (E[]) oList;\n\t\tsize = INIT_SIZE;\n\t}", "@VTID(41)\n com.exceljava.com4j.excel.ListObject getListObject();", "public List(int length, int x) {\n if (x == 1){\n list = new int[]{5, 4, 3, 2, 1, 10, 9, 8, 7, 6};\n }else if (x == 2) {\n list = new int[length];\n generateList();\n }else if (x == 3) {\n list = new int[length];\n }\n }", "void mo29841a(IObjectWrapper iObjectWrapper, zzaiq zzaiq, List<zzaiw> list) throws RemoteException;", "public MyArrayList(int capacity) {\r\n\t\t//checks if the capacity of the list exceeds the minimum capacity required by the array\r\n\t\tif (capacity > 4)\r\n\t\t\tthis.capacity=capacity;\r\n\t\tthis.list=new Object[this.capacity];\r\n\t\t//this()\r\n\t}", "ArrayList getAttributes();", "private static void LessonCollections() {\n List<Employee> employeeList = new ArrayList<Employee>();\n\n //Create Employees from Employee objects constructor\n Employee emp1 = new Employee(\"Jordan\", \"Walker\");\n Employee emp2 = new Employee(\"Mark\", \"Tuttle\");\n Employee emp3 = new Employee(\"Wayne\", \"Henderson\");\n\n //Add them to employee list\n employeeList.add(emp1);\n employeeList.add(emp2);\n employeeList.add(emp3);\n\n //Create employee and add to list in one line\n employeeList.add(new Employee(\"Erick\", \"Jensen\"));\n\n //Get info from list\n System.out.println(employeeList.get(3).GetFullName());\n\n //Print all full names from employee list\n for(Employee e : employeeList) {\n System.out.println(e.GetFullName());\n }\n\n }", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "public List<Card> list();", "abstract void makeList();", "List<?> getList();", "private void grow() {\r\n\t\t\r\n\t\t Student [] newList = new Student[sizeOfList(list) + 4];\r\n\t int size = sizeOfList(list);\r\n\t \r\n\t for(int i = 0; i < size; i++) {\r\n\t \t newList[i] = list[i];\r\n\t }\r\n\t list = newList;\r\n\t}", "private static List<C31644f<?, R>> m102869a() {\n return new ArrayList<>();\n }" ]
[ "0.60464853", "0.5932842", "0.5841588", "0.57861847", "0.5780979", "0.56780523", "0.56314105", "0.55900604", "0.55688936", "0.5537401", "0.552836", "0.5511499", "0.54977363", "0.5486811", "0.5463111", "0.5438943", "0.5433648", "0.53973144", "0.53771", "0.5375682", "0.5372109", "0.5340486", "0.53321147", "0.5314582", "0.5301885", "0.5287394", "0.52814555", "0.5278432", "0.5270765", "0.52675825", "0.5257546", "0.5257546", "0.5256659", "0.5255095", "0.5251823", "0.5250808", "0.52363205", "0.52321965", "0.52078325", "0.5176566", "0.5173346", "0.5167985", "0.5166465", "0.5156937", "0.5154128", "0.513403", "0.512856", "0.5125313", "0.51208633", "0.5115072", "0.5112475", "0.51115286", "0.50988805", "0.5098289", "0.509191", "0.5091692", "0.5089383", "0.5079553", "0.50760007", "0.50732505", "0.507291", "0.5061674", "0.5057788", "0.505619", "0.50508505", "0.50444597", "0.5044031", "0.5041544", "0.50355595", "0.5031972", "0.502471", "0.5021206", "0.5018978", "0.50118524", "0.5005503", "0.5004419", "0.49920312", "0.49877152", "0.49869052", "0.49846163", "0.49835134", "0.4978697", "0.49731413", "0.4970637", "0.49602976", "0.4957866", "0.49474782", "0.49446374", "0.49411502", "0.4930429", "0.49275547", "0.49272472", "0.49268946", "0.49224386", "0.49197787", "0.49192053", "0.4916183", "0.49150902", "0.49104783", "0.49101448" ]
0.6530204
0
List, 5 elements. a1,a2,a3,a4 and a5 are objects. L is the list (a1,a2,a3,a4,a5).
public static <C> LIST<C> LIST5(C a, C b, C c, C d, C e) { LIST<C> L = new LIST<C>(); L.list.addFirst( e ); L.list.addFirst( d ); L.list.addFirst( c ); L.list.addFirst( b ); L.list.addFirst( a ); return L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void print5(ArrayList<? extends A> list) {\n\n\t}", "public ArrayList() {\n\t\tthis.elements = new Object[5];\n\t\tthis.last = -1;\n\t}", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\treturn list;\n\t}", "public static void m5(ArrayList<? super B> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\t//al.add(345);\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "public void arrayList(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of ArrayList\");\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\treturn list;\n\t}", "public ElementIterator(List l) {\n\t myList = l;\n\t }", "public static void main(String[] args) {\n ArrayList<Object> ar = new ArrayList<Object>();\n ar.add(100);\n ar.add(100);\n ar.add(\"testing\");\n ar.add('c');\n ar.add(12.36);\n ar.add(true);\n\n System.out.println(ar);\n System.out.println(ar.get(4));\n System.out.println(ar.size());\n System.out.println(\"LI = \"+ 0);\n System.out.println(\"HI = \" + (ar.size()-1));\n\n ar.add(500);\n ar.add(400);\n System.out.println(ar.size());\n\n }", "@Override\n\tpublic List<BookVO> list5() {\n\t\tList<BookVO> list5 =bookDAO.list5();\n\t\treturn list5;\n\t}", "private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }", "public AList() {\n items = (TypeHere[]) new Object[100];\n size = 0;\n }", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "public TiraList() {\n this.list = new Object[8];\n this.nextindex = 0;\n this.startIndex = 0;\n }", "public static <C> LIST<C> RED4(LIST<C> L, int i) {\n LIST<C> LP = null;\n if ( ! isNull( L ) ) {\n LP = new LIST<C>( L.list.subList(42,L.list.size()) );\n }\n return LP;\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\treturn list;\n\t}", "private static final <R> List<R> m65272q(@C6003d Object[] objArr) {\n ArrayList arrayList = new ArrayList();\n for (Object obj : objArr) {\n C14445h0.m62450a(3, \"R\");\n if (obj instanceof Object) {\n arrayList.add(obj);\n }\n }\n return arrayList;\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public List() {\n this.list = new Object[MIN_CAPACITY];\n this.n = 0;\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\treturn list;\n\t}", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "public List<New> list();", "public List()\n {\n list = new Object [10];\n }", "public SystemRecord[][] List(ArrayList<SystemRecord> list){\n\t\tif(list == null){\n\t\t\treturn null;\n\t\t}\n\t\telse{\n\t\t\tSystemRecord[][] nlist = new SystemRecord[(int)Math.ceil((double)list.size()/(double)5)][5];\n\t\t\tint i;\n\t\t\tint j = 0;\n\t\t\tint count = 0;\n\t\t\tSystem.out.println(\"length: \" + list.size());\n\t\t\tfor(i = 0 ; i < list.size() ; i++){\n\t\t\t\tif( i < 5 ){\n\t\t\t\t\tnlist[j][i] = (SystemRecord)list.get(i);\n\t\t\t\t\tif(i == 4){\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnlist[j][i % 5] = list.get(i);\n\t\t\t\t\tcount++;\n\t\t\t\t\tif( count == 5){\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn nlist;\t\n\t\t}\n\t\n\t}", "Object getTolist();", "a(List list) {\n super(1);\n this.$sortedList = list;\n }", "@SuppressWarnings(\"unchecked\")\n public ArrayList() {\n list = (E[])new Object[DEFAULT_CAP];\n capacity = 10;\n size = 0;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tObject[] oList = new Object[INIT_SIZE];\n\t\tlist = (E[]) oList;\n\t\tsize = INIT_SIZE;\n\t}", "protected MyAbstractList(E[] objects) {\n for (int i = 0; i < objects.length; i++)\n add(objects[i]);\n }", "public ArrayList61B() {\n\t\tthis.size = 1;\n\t\tthis.arrayList = (E[]) new Object[this.size];\n\t}", "public ListState(DartObjectImpl[] elements) {\n this.elements = elements;\n }", "public static <T> List<T> m66049a(List<T> list) {\n return Collections.unmodifiableList(new ArrayList(list));\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList () {\n\t\tcapacity = 10;\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[capacity];\n\t}", "public CircleOfFifths(){fillArrayLists();}", "public static void main(String[] args) {\n\r\n\t\tArrayList<Integer> a1 = new ArrayList<Integer>(); //can store any type of object\r\n\t\ta1.add(1);\r\n\t\ta1.add(2);\r\n\t\ta1.add(3);\r\n\t\ta1.add(4);\r\n\t\ta1.add(5);\r\n\t\tSystem.out.println(\"Elements of a1 are : \" + a1);\r\n\t\t\r\n\t\tfor(int a:a1)\r\n\t\t{\r\n\t\t\tSystem.out.println(a);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "abstract protected Object newList( int capacity );", "@SuppressWarnings(\"unchecked\")\n public ArrayList(ArrayList<E> lst) {\n list = (E[])new Object[lst.size()];\n capacity = lst.capacity;\n size = lst.size;\n for(int i = 0; i < size; i++) {\n list[i] = lst.list[i];\n }\n }", "protected ArrayList<Object[]> genObjectArrayListFromIDElementList(ArrayList<? extends IDElement> pIDElementList) throws Exception{\r\n\t\tObject[] vElement;\r\n\t\tArrayList<Object[]> vRet;\r\n \t\t\r\n \t\tif (pIDElementList != null) {\r\n \t\t\tvRet = new ArrayList<Object[]>();\r\n \t\t\t\r\n \t\t\tfor (IDElement vCur : pIDElementList) {\r\n \t\t\t\tvElement = new Object[2];\r\n \t \t\t\t\r\n \t \t\t\tvElement[0] = vCur.getId();\r\n \t \t\t\tvElement[1] = vCur.getName();\r\n \t \t\t\t\r\n \t \t\t\tvRet.add(vElement);\r\n \t\t\t}\r\n \t\t} else throw new Exception(\"04; gOALfIDEL,Edi\");\r\n \t\t\r\n \t\treturn vRet;\r\n\t}", "public final void mo99835a(List<MyMediaModel> list) {\n int i;\n if (C23477d.m77081a((Collection<T>) list)) {\n i = 0;\n } else {\n i = list.size();\n }\n if (MvChoosePhotoActivity.this.f104229s < i) {\n MvChoosePhotoActivity.m128158b(list);\n }\n MvChoosePhotoActivity.this.f104229s = i;\n MvChoosePhotoActivity.this.f104227q = list;\n MvChoosePhotoActivity.this.mo99820a(list);\n }", "List<E> list();", "private List<View> m9533a(List<View> list, List<View> list2) {\n LinkedList linkedList = new LinkedList();\n if (list != null && !list.isEmpty()) {\n int size = list.size();\n for (int i = 0; i < size; i++) {\n linkedList.add(list.get(i));\n }\n }\n if (list2 != null && !list2.isEmpty()) {\n int size2 = list2.size();\n for (int i2 = 0; i2 < size2; i2++) {\n linkedList.add(list2.get(i2));\n }\n }\n return linkedList;\n }", "public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }", "LList2(int size) {\r\n\t\tthis();\r\n\t}", "public abstract void mo56920a(List<C4122e> list);", "ListType createListType();", "public static List<Artist> makeChild5() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }", "private static ArrayList<String> getOptimizedList(ArrayList<String> objList){\n\t\tArrayList<String> optimizedList = new ArrayList<String>();\r\n\t\tint limit = 1; // quantidade de objs escolhida da lista original (por exemplo, 2 objetos serao escolhidos aleatoriamente)\r\n\t\t\r\n\t\tRandom generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0; i<limit; i++){\r\n\t\t\toptimizedList.add(objList.get(generator.nextInt(objList.size())));\r\n\t\t}\r\n\t\t\r\n\t\treturn optimizedList;\r\n\t}", "Listof<X> toList();", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L))));\n\t\t}\n\t\treturn parts;\n\t}", "public static void clientFunc(){\n List list = new ArrayList(); //rawtype list\n list.add(10);\n list.add(\"jenkins\");\n list.add(new Object());\n\n //unsafe classcast exception at runtime\n //rawtypes are unsafe\n List<String> stringList = list;\n\n ListIterator listIterator = list.listIterator();\n while(listIterator.hasNext()){\n System.out.println(listIterator.next());\n }\n }", "public ArrayListEmployee5(int id,String name,String address,float salary) {\n this.id = id;\n this.name = name;\n this.address = address;\n this.salary = salary;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList1() {\n\t\telements = (E[]) new Object[CAPACITY];\n\t\tsize = 0;\n\t}", "private Object[] getObjects(ArrayList objectList) {\n Object[] objects = new Object[objectList.size()];\n for(int i=0; i<objectList.size(); ++i)\n objects[i] = objectList.get(i);\n return objects;\n }", "void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "public static <C> LIST<C> LIST10(C a1, C a2, C a3, C a4, C a5, C a6, C a7, C a8, C a9, C a10) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a10 );\n L.list.addFirst( a9 );\n L.list.addFirst( a8 );\n L.list.addFirst( a7 );\n L.list.addFirst( a6 );\n L.list.addFirst( a5 );\n L.list.addFirst( a4 );\n L.list.addFirst( a3 );\n L.list.addFirst( a2 );\n L.list.addFirst( a1 );\n return L;\n }", "public static String list2str(List<? extends Object> l) {\n String rtn = \"{\";\n for (Object o : l) {\n rtn = rtn + o.toString() + \", \";\n }\n rtn = rtn + \"}\";\n return rtn;\n }", "public static <C> LIST<C> LIST4(C a, C b, C c, C d) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( d );\n L.list.addFirst( c );\n L.list.addFirst( b );\n L.list.addFirst( a );\n return L;\n }", "public static <C> LIST<C> LIST1(C a) {\n LIST<C> L = new LIST<C>();\n L.list.addFirst( a );\n return L;\n }", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n List<List<T>> parts = new ArrayList<List<T>>();\n final int N = list.size();\n for (int i = 0; i < N; i += L) {\n parts.add(new ArrayList<T>(\n list.subList(i, Math.min(N, i + L)))\n );\n }\n return parts;\n }", "public abstract void mo56923b(List<C4122e> list);", "public MyArrayList ()\r\n {\r\n \tlist = new Object[100];\r\n \tnumElements = 0;\r\n }", "public ListDA() {\n elements = new Object[CAPACITY];\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\treturn list;\n\t}", "public static <T> List<T> immutableList(T... elements){\n return Collections.unmodifiableList(Arrays.asList(elements.clone()));\n }", "public static <C> LIST<C> RED(LIST<C> L) {\n if ( isNull( L ) ) {\n return L;\n }\n LIST<C> LP = L;\n // ok: LP = new LIST<C>( L.list.subList(1,L.list.size()) );\n if ( L.iter == null ) {\n LP = new LIST<C>( L.list );\n LP.iter = LP.list.iterator();\n C x = LP.iter.next();\n //System.out.println(\"x = \" + x);\n } // else noop\n return LP;\n }", "public SimpleArrayList(int size) {\n this.values = new Object[size];\n }", "void mo54419a(List<String> list);", "public MyArrayList() {\r\n\t\tthis.list=new Object[this.capacity];\r\n\t}", "public List(int length, int x) {\n if (x == 1){\n list = new int[]{5, 4, 3, 2, 1, 10, 9, 8, 7, 6};\n }else if (x == 2) {\n list = new int[length];\n generateList();\n }else if (x == 3) {\n list = new int[length];\n }\n }", "abstract void makeList();", "public T caseElementList(ElementList object)\n {\n return null;\n }", "public static <T> List<T> createList(T item1, T item2, T item3, T item4, T item5, T item6, T item7, T item8, T item9) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tlist.add(item1);\n\t\tlist.add(item2);\n\t\tlist.add(item3);\n\t\tlist.add(item4);\n\t\tlist.add(item5);\n\t\tlist.add(item6);\n\t\tlist.add(item7);\n\t\tlist.add(item8);\n\t\tlist.add(item9);\n\t\treturn list;\n\t}", "public final void mo99835a(List<MyMediaModel> list) {\n int i;\n if (C23477d.m77081a((Collection<T>) list)) {\n i = 0;\n } else {\n i = list.size();\n }\n if (MvChoosePhotoActivity.this.f104228r < i) {\n MvChoosePhotoActivity.m128156a(\"choose_upload_content\");\n }\n MvChoosePhotoActivity.this.f104228r = i;\n MvChoosePhotoActivity.this.f104226p = list;\n MvChoosePhotoActivity.this.mo99820a(list);\n }", "private void listExample()\n\t{\n\n\t\tArrayList <String> alist = new ArrayList<String>();//doesn't have to be string- can be Duck, or Mouse, or Apostrophe\n\t\talist.add(\"banana\"); //adds \"banana\" to the end of the list\n\t\talist.add(\"strawberry\");\n\t\talist.add(\"blueberry\");\n\t\talist.add(\"blackberry\");\n\t\t\n\t\tJOptionPane.showMessageDialog(null,alist);\n\t\t\n\t\talist.add(2, \"apple\"); //adds it in spot 2 (3rd position)\n\t\t\n\t\tJOptionPane.showMessageDialog(null,alist);\n\t\t\n\t\t\n\t\talist.remove(\"blueberry\"); \n\t\t/**\n\t\t * .remove returns what was in the spot that was just taken out--and shrinks down by one\n\t\t * .set also returns this value but it replaces the value with something else\n\t\t */\n\t\talist.remove(0); //removes 1st element\n\t\tJOptionPane.showMessageDialog(null,alist);\n\t\t\n\t\tfor (String str:alist)\n\t\t\tJOptionPane.showMessageDialog(null, str); //shows each individually\n\t\t\n\t\talist.set(1, \"coconut\"); //alist.set(index, element) --replaces\n\t\t\n\t\tint numberOfItems = alist.size();\n\t\talist.clear();\n\n\t\n\t}", "public static void main(String[] args) {\n\r\n\t\tList<Integer> l = new ArrayList<Integer>();\r\n\t\t//List<Integer> l = new ArrayList<Integer>(Collection c); is also valid\r\n\t\t\r\n\t\tfor(int i=1;i<=10;i++){\r\n\t\t\tl.add(i);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(l);//[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\t//index based operations\r\n\t\t\r\n\t\tSystem.out.println(l.get(1));//2(element at position 1)\r\n\t\tSystem.out.println(l.set(1,12));//2(returns and replaces the element at position 1)\r\n\t\tSystem.out.println(l);//[1, 12, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\tl.add(1,11);//inserts 11 at position 1\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 4, 5, 6, 7, 8, 9, 10]\r\n\t\tList<Integer> l1 = Arrays.asList(97,23,34);\r\n\t\tl.addAll(4,l1);//inserts collection elements at position 4\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 97, 23, 34, 4, 5, 6, 7, 8, 9, 10]\r\n\t\t\r\n\t\tSystem.out.println(l.remove(new Integer(4)));//true ( removes the first occurrence of object 4 )\r\n\t\tSystem.out.println(l.remove(4));//97 (removes the object at position 4)\r\n\t\r\n\t\tSystem.out.println(l.add(11));\r\n\t\tSystem.out.println(l);//[1, 11, 12, 3, 23, 34, 5, 6, 7, 8, 9, 10,11]\r\n\t\t\r\n\t\tSystem.out.println(l.indexOf(new Integer(11)));//1\r\n\t\tSystem.out.println(l.lastIndexOf(new Integer(11)));//12\r\n\t\t\r\n\t\tSystem.out.println(l.subList(3, 8));//[3, 23, 34, 5, 6]\r\n\t\r\n\t\t\r\n\t}", "private Object[] buildList(int size) {\n list.clear();\n int expectedSize = ArrayList.INITIAL_CAPACITY;\n while (expectedSize < size) {\n expectedSize *= 2;\n }\n Object[] expected = new Object[expectedSize];\n\n for (int i = 0; i < size; i++) {\n String data = i + \"a\";\n list.addToBack(data);\n expected[i] = data;\n }\n return expected;\n }", "@Test\n public void testList() {\n SLNode one = new SLNode(1, null);\n SLNode twoOne = new SLNode(2, one);\n SLNode threeTwoOne = new SLNode(3, twoOne);\n\n SLNode x = SLNode.of(3, 2, 1);\n assertEquals(threeTwoOne, x);\n }", "public static void m4(ArrayList<? super Integer> al)\n\t{\n\t\t//al.add(\"Marshal Mathers\");\n\t\t//al.add(\"Slim Shady\");\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t\tal.add(345);\n\t}", "public void asignar_Lista(Lista<Lado> l) {\n\t\tthis.list = l;\n\t}", "@Test\r\n\tvoid testRemove5() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\ttest.add(1);\r\n\t\ttest.remove(1);\r\n\t\tassertNotEquals(0, test.list.length);\r\n\t}", "public static void main(String[] args) {\n\t\t List <String>L = new <String>List();\r\n\t\t \r\n\t\t //TEST isEmpty(), size(), add()\r\n\t\t //System.out.println(L.isEmpty());\r\n\t\t //System.out.println(L.size());\r\n\t\t L.add(1, \"a\");\r\n\t\t L.add(2, \"b\");\r\n\t\t L.add(3, \"c\");\r\n\t\t //L.add(3, 1);\r\n\t\t //System.out.println(L.isEmpty());\r\n\t\t //System.out.println(L.size());\r\n\t\t //L.add(2, \"d\");\r\n\t\t //L.add(4, \"e\");\r\n\t\t \r\n\t\t //TEST get()\r\n\t\t //System.out.println(L.get(0));\r\n\t\t //System.out.println(L.get(6));\r\n\t\t //System.out.println(L.get(2));\r\n\t\t System.out.println(L.get(3));\r\n\t\t \r\n\t\t //TEST remove()\r\n\t\t //only one line is uncommented per trial run\r\n\t\t //L.remove(0);\r\n\t\t //L.remove(1);\r\n\t\t //L.remove(2);\r\n\t\t //L.remove(5);\r\n\t\t //L.remove(7);\r\n\t\t //System.out.println(L.get(4));\r\n\t\t \r\n\t\t //TEST removeAll()\r\n\t\t //L.removeAll();\r\n\t\t //System.out.println(L.isEmpty());\r\n\t\t //System.out.println(L.get(1));\r\n\t}", "public S<T> list(String idView,List<Object> objects){\n\t\t\n\t\tidView =idView.intern();\n\t\tT aux = t;\n\t\tint resID = activity.getResources().getIdentifier(idView, \"layout\", activity.getPackageName());\n\t\tListView list = (ListView) t;\n\t\tSAdapter a = new SAdapter(resID,objects);\n\t\tlist.setAdapter(a);\n\t\t\n\t\tt = aux;\n\t\treturn this;\n\t}", "public TempList(int n, T elem) {\n list = new ArrayList<T>(n > 0 ? n : 0);\n while (n > 0) {\n list.add(elem);\n n--;\n }\n }", "public MyArrayList(int length) {\n data = new Object[length];\n }", "abstract List<T> getReuslt();", "public MyArrayList(int capacity) {\r\n\t\t//checks if the capacity of the list exceeds the minimum capacity required by the array\r\n\t\tif (capacity > 4)\r\n\t\t\tthis.capacity=capacity;\r\n\t\tthis.list=new Object[this.capacity];\r\n\t\t//this()\r\n\t}", "a(ArrayList arrayList) {\n super(1);\n this.$result = arrayList;\n }", "public static List<Object> elements(Tuple tuple) {\n return tuple.elements;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[INIT_SIZE];\n\t}", "void mo29842a(IObjectWrapper iObjectWrapper, zzatk zzatk, List<String> list) throws RemoteException;", "public static List<RDFNode> asJavaList(Resource l) {\n List<RDFNode> result = new ArrayList<RDFNode>();\n Model m = l.getModel();\n while (!l.equals(RDF.nil)) {\n Statement first = l.getProperty(RDF.first);\n Statement rest = l.getProperty(RDF.rest);\n if (first == null) {\n result.add(Vocab.missingListElement.inModel(m));\n } else {\n result.add(first.getObject());\n }\n if (rest == null) {\n result.add(Vocab.missingListTail.inModel(m));\n break;\n }\n l = rest.getResource();\n }\n return result;\n }", "@Test\n\tpublic void createListFromList() {\n\t\tList<String> list = new ArrayList<>();\n\t\tlist.add(\"AAPL\");\n\t\tlist.add(\"MSFT\");\n\n\t\t// Create a copy using constructor of ArrayList\n\t\tList<String> copy = new ArrayList<>(list);\n\n\t\tassertTrue(list.equals(copy));\n\t}", "public final void mo81945a(List<MediaModel> list) {\n C7573i.m23587b(list, \"list\");\n if (!C7573i.m23585a((Object) mo81943a(), (Object) list)) {\n super.mo81945a(list);\n }\n }", "public TempList(T... all) {\n list = new ArrayList<T>(all.length);\n for (int i = 0; i < all.length; i++)\n list.add(all[i]);\n }", "public NumericObjectArrayList() {\r\n list = new Copiable[10];\r\n count = 0;\r\n }", "List<C1111j> mo5868a();" ]
[ "0.6298018", "0.5987221", "0.5957067", "0.59065515", "0.58344054", "0.5804994", "0.5763832", "0.5733914", "0.5683057", "0.562965", "0.5628671", "0.5587071", "0.55081946", "0.54463005", "0.5443719", "0.5441558", "0.54138976", "0.5410302", "0.54013634", "0.54013634", "0.5369684", "0.5350736", "0.533114", "0.53030753", "0.5295812", "0.52938724", "0.5292606", "0.5281515", "0.52744377", "0.52707744", "0.5268287", "0.52678806", "0.5254788", "0.52545774", "0.5254252", "0.525147", "0.52374417", "0.5236592", "0.5231613", "0.52284485", "0.5226733", "0.52263063", "0.5223116", "0.5217602", "0.52157706", "0.52120435", "0.5211554", "0.52105665", "0.52076167", "0.52051026", "0.5202129", "0.5200996", "0.5198832", "0.5196471", "0.519218", "0.5187265", "0.5185577", "0.51610106", "0.5159577", "0.51571876", "0.51567274", "0.515583", "0.5149986", "0.51327163", "0.5121504", "0.51194847", "0.5118479", "0.51183915", "0.5110716", "0.5101582", "0.50967675", "0.5095881", "0.5083026", "0.5075639", "0.5072083", "0.5063999", "0.5059086", "0.5057354", "0.50554603", "0.5051998", "0.50511116", "0.50434697", "0.5042324", "0.50376743", "0.50369424", "0.50355196", "0.50346446", "0.5034505", "0.50293523", "0.50250155", "0.5021641", "0.50213414", "0.50185466", "0.5016092", "0.5015643", "0.50153685", "0.5011891", "0.50117874", "0.50115234", "0.5008983" ]
0.6432096
0
Order. L is a list. maximal depth of L.
public static <C> int ORDER(LIST<C> L) { if ( isNull( L ) ) { return 0; } int n = 0; for ( C a : L.list ) { if ( a instanceof LIST ) { LIST<C> LP = null; try { LP = (LIST<C>) a; } catch(ClassCastException e) { } if ( !isNull( LP ) ) { int o = ORDER( LP ); if ( o > n ) { // max n = o; } } } } return n+1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args){\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.right = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.right = new TreeNode(4);\n root.right.left = new TreeNode(4);\n root.right.right = new TreeNode(6);\n \n System.out.println(levelOrder(root)); // output: [[1], [2, 2], [6, 4, 4, 6]]\n }", "public void traverseLevelOrder() {\n\t\tlevelOrder(this);\n\t}", "static void levelOrder(BFNode root){\n\t Queue q = new LinkedList();\n\t q.add(root);\n\t BFNode aNode = null;\n\t while(!q.isEmpty()) {\n\t \t \taNode = (BFNode)q.remove();\n\t \t \tSystem.out.print(aNode.data);\n\t \t \tif (aNode.left!=null) q.add(aNode.left);\n\t if (aNode.right!=null) q.add(aNode.right);\n\t }\n\t \n\t }", "void printLevelOrder() {\n\t\tint h = height(root);\n\t\tint i;\n\t\tfor (i = h; i >= 1; i--)\n\t\t\tprintGivenLevel(root, i);\n\t}", "public List<T> levelorder() {\n ArrayList<T> list = new ArrayList<T>();\n Queue<BSTNode<T>> queue = new LinkedList<>();\n if (root != null) {\n queue.add(root);\n levelorderHelper(list, queue);\n }\n return list;\n }", "List<Integer> traverseLevelOrder(List<Integer> oList) \n\t{\n\t\tQueue<BSTMapNode> q = new LinkedList<BSTMapNode>();\n\t\tq.add(this);\n\t\t\n\t\twhile(!q.isEmpty())\n\t\t{\n\t\t\tBSTMapNode node = q.poll();\n\t\t\toList.add(node.getKey());\n\t\t\tif(node.left != null)\n\t\t\t{\n\t\t\t\tq.add(node.left);\n\t\t\t}\n\t\t\tif(node.right != null)\n\t\t\t{\n\t\t\t\tq.add(node.right);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn oList;\n\t}", "public List<List<Integer>> levelOrder(Node root) {\n if (root == null) return new ArrayList<>();\n \n List<List<Integer>> ans = new ArrayList<>();\n Queue<Node> queue = new LinkedList<>();\n \n queue.add(root);\n \n while (!queue.isEmpty()) {\n List<Integer> list = new ArrayList<>();\n for (int i = queue.size(); i > 0; i--) {\n Node curr = queue.poll();\n list.add(curr.val);\n \n for (Node child : curr.children) queue.add(child);\n }\n ans.add(list);\n }\n \n return ans;\n }", "public List<List<Integer>> levelOrder(Node root) {\n List<List<Integer>> res = new ArrayList<>();\n if (root == null) {\n return res;\n }\n Queue<Node> queue = new LinkedList<>();\n queue.offer(root);\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < size; ++i) {\n Node cur = queue.poll();\n if (cur.children.size() > 0) {\n for (Node node : cur.children) {\n queue.offer(node);\n }\n }\n list.add(cur.val);\n }\n res.add(list);\n }\n return res;\n }", "void printLevelOrder() \n { \n int h = height(this); \n int i; \n for (i=1; i<=h; i++) \n printGivenLevel(this, i); \n }", "static void levelOrder(Node root){\n Queue<Node> queue = new LinkedList<Node>();\r\n \r\n queue.add(root);\r\n while (!queue.isEmpty()) {\r\n Node head = queue.remove();\r\n\r\n if (head == null) {\r\n continue;\r\n }\r\n\r\n System.out.print(head.data + \" \");\r\n\r\n queue.add(head.left);\r\n queue.add(head.right);\r\n }\r\n System.out.println();\r\n \r\n }", "public List<List<Integer>> levelOrder(Node root) {\n List<List<Integer>> result = new LinkedList<>();\n if (root == null) {\n return result;\n }\n Queue<Node> inQueue = new LinkedList<>();\n Queue<Node> outQueue = new LinkedList<>();\n inQueue.add(root);\n while (!inQueue.isEmpty()) {\n List<Integer> tmp = new LinkedList<>();\n while (!inQueue.isEmpty()) {\n Node poll = inQueue.poll();\n if (poll.children != null) {\n outQueue.addAll(poll.children);\n }\n tmp.add(poll.val);\n }\n result.add(tmp);\n inQueue.addAll(outQueue);\n outQueue.clear();\n\n }\n return result;\n }", "public void treeOrder ()\n {\n treeOrder (root, 0);\n }", "public void levelOrder(Node node){\n\t\tArrayList<Node> queue = new ArrayList<Node>();\n\t\t\n\t\tif(node==nil){\n\t\t\treturn;\n\t\t}\n\t\tif(node != nil){\n\t\t\tqueue.add(node);\n\t\t}\n\t\t\n\t\twhile(!queue.isEmpty()){\n\t\t\tNode temp = (Node)queue.get(0);\n\t\t\tSystem.out.println(\" ID: \" + temp.id + \" Count: \" + temp.count + \" Colour: \" + temp.colour);\n\t\t\tqueue.remove(0);\n\t\t\tif(temp.left != nil){\n\t\t\t\tqueue.add(temp.left);\n\t\t\t}\n\t\t\tif(temp.right != nil){\n\t\t\t\tqueue.add(temp.right);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "static void levelOrder(Queue<Node> q1) \n\t{\n\t\tif(q1.isEmpty())\n\t\t\treturn;\n\t\tQueue<Node> q=new LinkedList<Node>();\n\t\twhile(!q1.isEmpty()) {\n\t\t\t\n\t\t\tNode temp=q1.poll();\n\t\t\tif(temp.left!=null) {\n\t\t\t\tq.add(temp.left);\n\t\t\t}\n\t\t\tif(temp.right!=null) {\n\t\t\t\tq.add(temp.right);\n\t\t\t}\n\t\t}\n\t\tif(!q.isEmpty())\n\t\t\tSystem.out.println(q.peek().key);\n\t\tlevelOrder(q);\n\t}", "static ArrayList <Integer> levelOrder(Node root) \n {\n ArrayList<Integer> list=new ArrayList<>();\n Queue<Node> queue = new LinkedList<Node>(); \n queue.add(root); \n while (!queue.isEmpty()) \n { \n \n /* poll() removes the present head. \n For more information on poll() visit \n http://www.tutorialspoint.com/java/util/linkedlist_poll.htm */\n Node tempNode = queue.poll(); \n list.add(tempNode.data); \n \n /*Enqueue left child */\n if (tempNode.left != null) { \n queue.add(tempNode.left); \n } \n \n /*Enqueue right child */\n if (tempNode.right != null) { \n queue.add(tempNode.right); \n } \n }\n return list;\n }", "public int order()\n\t{\n\t\treturn null == _children ? 0 : _children.size();\n\t}", "public List<Long> depthTraverse(){\n return depthTraverseGen(null);\n }", "public void levelOrder(){\n Iterator iter = iterator();\n while(iter.hasNext() == true) {\n System.out.println(iter.next());\n }\n }", "public static List<List<Integer>> levelOrder(TreeNode root) {\n Queue<TreeNode> queue = new LinkedList<>();\n Queue<TreeNode> visited = new LinkedList<>();\n queue.add(root);\n\n List<List<Integer>> result = new ArrayList<>();\n while (!queue.isEmpty()) {\n List<Integer> list = new ArrayList<>();\n while (!queue.isEmpty()) {\n TreeNode tn = queue.poll();\n list.add(tn.val);\n visited.add(tn);\n }\n int size = visited.size();\n\n while (size > 0){\n TreeNode treeNode = visited.poll();\n\n if (treeNode.left != null) {\n queue.add(treeNode.left);\n\n }\n if (treeNode.right != null) {\n queue.add(treeNode.right);\n }\n size--;\n }\n\n result.add(list);\n\n }\n\n return result;\n }", "public ArrayList<Integer> getOrdering() {\n return T.getRoot().getOrder();\n }", "void printLevelOrder(Node root)\n {\n int h = height(root);\n int i;\n for (i=1; i<=h; i++)\n printGivenLevel(root, i);\n }", "List<Integer> traverseInOrder(List<Integer> oList) \n\t{\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traverseInOrder(oList);\n\t\t}\n\t\n\t\toList.add(this.key);\n\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traverseInOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\n\t}", "public void printLevelOrder() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tSystem.out.println(\"Empty Tree\");\r\n\t\t} else {\r\n\t\t\tQueueLi<BinaryNode<AnyType>> q = new QueueLi<>();\r\n\t\t\tBinaryNode<AnyType> currentNode;\r\n\t\t\tq.enqueue(root);\r\n\t\t\twhile (!q.isEmpty()) {\r\n\t\t\t\tcurrentNode = q.dequeue();\r\n\t\t\t\tif (currentNode.left != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.left);\r\n\t\t\t\t} // if\r\n\t\t\t\tif (currentNode.right != null) {\r\n\t\t\t\t\tq.enqueue(currentNode.right);\r\n\t\t\t\t} // if\r\n\t\t\t\tSystem.out.print(currentNode.element + \" \");\r\n\t\t\t} // while\r\n\t\t} // else\r\n\t}", "Order(int t, int l) {\n this.t = t;\n this.l = l;\n }", "public Iterable<Integer> levelOrder() {\n\t\tLinkedList<Integer> keys = new LinkedList<Integer>();\n\t\tLinkedList<Node> queue = new LinkedList<Node>();\n\t\tqueue.add(root);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tNode n = queue.remove();\n\t\t\tif (n == null) continue;\n\t\t\tkeys.add(n.key);\n\t\t\tqueue.add(n.left);\n\t\t\tqueue.add(n.right);\n\t\t}\n\t\treturn keys;\n\t}", "public void printLevelOrder(Node tree){\n\t\tint h = height(tree);\n\t\tSystem.out.println(\"The height is \"+ h);\n\t\tfor(int i=1;i<=h;i++){\n\t\t\tprintGivenLevel(tree, i);\n\t\t}\n\t}", "public ArrayList<ArrayList<Integer>> levelOrder(TreeNode root) {\n ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n ArrayList<Integer> level = new ArrayList<Integer>();\n Queue<TreeNode> q = new LinkedList<TreeNode>();\n if(root == null) return res;\n q.add(root);\n int size = 1, cnt = 0;\n while(!q.isEmpty()){\n TreeNode x = q.poll();\n level.add(x.val);\n cnt++;\n if(x.left != null) q.add(x.left);\n if(x.right != null) q.add(x.right);\n if(cnt == size){\n size = q.size();\n cnt = 0;\n res.add(level);\n level = new ArrayList<Integer>();\n }\n }\n return res;\n }", "public void levelOrder(){\n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n\n \n while(queue.size() != 0){\n \n Node<T> node = queue.remove();\n // If the node is not null print it and enqueue its left and right child \n // if they exist\n if(node != null){\n System.out.print(node.data + \" ,\");\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // We have reached a new level \n // Check is queue is empty, if yes then we are done \n // otherwise print a new line and enqueue a new null for next level\n System.out.println();\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "public static void levelOrder(Node node){\r\n Queue<Node> qu = new ArrayDeque<>();\r\n qu.add(node);\r\n \r\n while(qu.size()>0){\r\n //1. get + remove\r\n Node rem = qu.remove();\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to Queue\r\n for(Node child : rem.children){\r\n qu.add(child);\r\n }\r\n }\r\n \r\n }", "List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}", "List<Integer> traversePostOrder(List<Integer> oList) \n\t{\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePostOrder(oList);\n\t\t}\n\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePostOrder(oList);\n\t\t}\n\t\t\n\t\toList.add(this.key);\n\t\t\n\t\treturn oList;\n\t}", "static void levelOrder(Node root) {\n // create a node queue\n Queue<Node> queue = new LinkedList<>();\n queue.add(root);\n while (!queue.isEmpty()) {\n Node node = queue.remove();\n // if node print value\n System.out.printf(\"%d \", node.data);\n // if left node not null add child node to the queue\n if (node.left != null)\n queue.add(node.left);\n // if right node not null add child node to the queue\n if (node.right != null)\n queue.add(node.right);\n }\n }", "private static boolean OrderByClause_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"OrderByClause_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = OrderByClause_0_0(b, l + 1);\n if (!r) r = OrderByClause_0_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public ArrayList<ArrayList<Integer>> levelOrder(TreeNode root){\n ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n ArrayList<Integer> level;\n Que<TreeNode> q = new Que<TreeNode>();\n \n if(root == null)\n return res;\n \n level = new ArrayList<Integer>();\n q.enque(root);\n level.add(root.val);\n res.add(level);\n int exp = 0;\n int cnt = 1;\n \n level = new ArrayList<Integer>();\n while(!q.isEmpty()){\n TreeNode x = q.deque();\n cnt--;\n \n if(x.left != null){\n q.enque(x.left);\n level.add(x.left.val);\n exp++;\n }\n \n if(x.right != null){\n q.enque(x.right);\n level.add(x.right.val);\n exp++;\n }\n \n if(cnt == 0){\n res.add(level);\n level = new ArrayList<Integer>();\n cnt = exp;\n exp = 0;\n }\n }\n \n res.remove(res.size()-1);\n \n return res;\n }", "public Iterable<Integer> levelOrder() {\n Queue<Integer> keys = new Queue<Integer>();\n Queue<TreeNode> queue = new Queue<TreeNode>();\n queue.enqueue(root);\n while (!queue.isEmpty()) {\n TreeNode x = queue.dequeue();\n if (x == null) {\n\t\t\t\t/* -1 stands for null node. */\n\t\t\t\tkeys.enqueue(-1);\n\t\t\t\tcontinue;\n\t\t\t}\n keys.enqueue(x.val);\n queue.enqueue(x.left);\n queue.enqueue(x.right);\n }\n return keys;\n }", "public void levelOrder(){\n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n Queue<Node> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n\n\n while(queue.size() != 0){\n\n Node node = queue.remove();\n // If the node is not null print it and enqueue its left and right child\n // if they exist\n if(node != null){\n System.out.print(node.data + \" ,\");\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // We have reached a new level\n // Check is queue is empty, if yes then we are done\n // otherwise print a new line and enqueue a new null for next level\n System.out.println();\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public Iterable<K> levelOrder() {\n Queue<K> keys = new Queue<>();\n Queue<Node> queue = new Queue<>();\n queue.enqueue(root);\n while (!queue.isEmpty()) {\n Node x = queue.dequeue();\n if (x == null) continue;\n keys.enqueue(x.key);\n queue.enqueue(x.left);\n queue.enqueue(x.right);\n }\n return keys;\n }", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "public myList<T> my_preorder();", "public void levelOrderTraversal(){\n System.out.println(\"levelOrderTraversal\");\n\n Queue<Node> queue = new ArrayCircularQueue<>();\n\n if(root!=null){\n queue.insert(root);\n }\n\n while(!queue.isEmpty()){\n Node node = queue.delete();\n System.out.print(node.getData() + \" \");\n if(node.getLeft()!=null){\n queue.insert(node.getLeft());\n }\n if(node.getRight()!=null){\n queue.insert(node.getRight());\n }\n }\n System.out.println();\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public String levelOrder() {\n\t\treturn head_.getRight().levelorder().toString();\n\t}", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "@Test\n public void levelOrder() throws Exception {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n\n Queue<Integer> expected = new LinkedList<Integer>();\n expected.add(110);\n expected.add(80);\n expected.add(150);\n expected.add(120);\n expected.add(40);\n BinarySearchTree.levelOrder(root);\n assertEquals(expected, BinarySearchTree.printQ);\n }", "private List<T> inOrder(Node<T> curr, List<T> list) { //Time Complexity: O(n)\n if (curr == null) {\n return list;\n }\n inOrder(curr.left, list);\n list.add(curr.data);\n inOrder(curr.right, list);\n return list;\n }", "public List<List<Integer>> levelOrder(TreeNode root) {\n List<List<Integer>> results = new ArrayList<>();\n traversal(root, results, 0);\n return results;\n }", "public void levelOrder(Node node) {\n\n if (node == null) {\n System.out.println(\"Tree is empty\");\n return;\n }\n\n Queue<Node> queue = new LinkedList<>();\n queue.add(node);\n\n do {\n\n node = queue.poll();\n\n System.out.print(node.value + \" \");\n\n if (node.left != null) {\n queue.add(node.left);\n }\n\n if (node.right != null) {\n queue.add(node.right);\n }\n\n } while (queue.peek() != null);\n }", "protected List topologicalSort() {\r\n LinkedList order = new LinkedList();\r\n HashSet knownNodes = new HashSet();\r\n LinkedList nextNodes = new LinkedList();\r\n\r\n for (Iterator i = graph.getNodes().iterator(); i.hasNext(); ) {\r\n BBNNode node = (BBNNode) i.next();\r\n if (node.getChildren().size() == 0) {\r\n nextNodes.addAll(node.getParents());\r\n knownNodes.add(node);\r\n order.addFirst(node);\r\n }\r\n }\r\n\r\n while (nextNodes.size() > 0) {\r\n BBNNode node = (BBNNode) nextNodes.removeFirst();\r\n if (knownNodes.contains(node)) continue;\r\n\r\n List children = node.getChildren();\r\n if (knownNodes.containsAll(children)) {\r\n order.addFirst(node);\r\n nextNodes.addAll(node.getParents());\r\n knownNodes.add(node);\r\n }\r\n }\r\n return order;\r\n }", "public static void levelOrderLinewise2(Node node){\r\n LinkedList<Node> mainq = new LinkedList<>(); //LinkedList is used because we can'nt add \"null\" in Queue, it gives NullPointerException\r\n \r\n //Adding root and null in mainq\r\n mainq.add(node);\r\n mainq.add(null);\r\n \r\n while(mainq.size()>0){\r\n //1. get + remove\r\n Node rem = mainq.remove();\r\n \r\n //If front element is null that means this level is completed hence we put \"enter\" and add Delimiter only when list size is >0.\r\n if(rem == null){\r\n System.out.println();\r\n \r\n //If size is more than 0 then again add \"null\", if we don't add below line, it will go in infinite loop\r\n if(mainq.size()>0){\r\n mainq.add(null);\r\n }\r\n }\r\n \r\n //In else condition we can print and add children for that node to list\r\n \r\n else{\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to mainq\r\n for(Node child : rem.children){\r\n mainq.add(child);\r\n }\r\n }\r\n }\r\n }", "public ArrayList<ArrayList<Integer>> levelOrder(TreeNode root) {\n ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n ArrayList<Integer> tmp = new ArrayList<Integer>();\n \n if(root == null) return res;\n \n LinkedList<TreeNode> q = new LinkedList<TreeNode>();\n q.add(root);\n int cnt = 0;\n int sum = 1;\n while(!q.isEmpty()){\n TreeNode x = q.poll();\n tmp.add(x.val);\n cnt++;\n if(x.left != null) q.add(x.left);\n if(x.right != null) q.add(x.right);\n if(cnt == sum){\n res.add(tmp);\n tmp = new ArrayList<Integer>();\n sum = q.size();\n cnt = 0;\n }\n }\n \n return res;\n }", "public ArrayList<Integer> inOrderTraversal() {\r\n\t\treturn inOrderTraversal(treeMinimum());\r\n\t}", "private void levelOrder(Node node) {\n\t\t// If input node / tree is null just return and end the program\n\t\tif (null == node)\n\t\t\treturn;\n\n\t\t// Queue to keep the Nodes in one level\n\t\tQueue<Node> toVisit = new LinkedList<Node>();\n\t\ttoVisit.add(node); // Adding the first Root node as passed\n\n\t\t// Pop and display Node data and add its children to the Queue till it is Empty\n\t\twhile (!toVisit.isEmpty()) {\n\t\t\tNode current = toVisit.remove();\n\t\t\tSystem.out.println(current.data);\n\n\t\t\t// Add child nodes to the queue if exists for current node\n\t\t\tif (null != current.left) {\n\t\t\t\ttoVisit.add(current.left);\n\t\t\t}\n\t\t\tif (null != current.right) {\n\t\t\t\ttoVisit.add(current.right);\n\t\t\t}\n\t\t}\n\n\t}", "public static List<List<Integer>> levelOrderTraversal(TreeNode root)\n\t{\n\t\tList<List<Integer>> res=new ArrayList<List<Integer>>();\n if(root==null) return res;\n Queue<TreeNode> q=new LinkedList<TreeNode>();\n q.add(root);\n int cur=1;//to track current level and next level\n int next=0;\n res.add(new ArrayList<Integer>());\n while(!q.isEmpty()){\n TreeNode temp=q.poll();\n cur--;//since polling so decrement\n res.get(res.size()-1).add(temp.data);//res.get(0).add,res.get(1).add\n if(temp.left!=null){\n q.add(temp.left);\n next++;//next level incrementing\n }\n if(temp.right!=null){\n q.add(temp.right);\n next++;\n }\n if(cur==0){//entering into next level so create new list\n cur=next;\n if(next!=0)//if next level nodes all are null no need to create new list\n res.add(new ArrayList<Integer>());\n next=0;\n }\n }\n return res;\n\t}", "public void printSortedList() {\n if (root == null) {\n System.out.print(\"Empty Tree.\");\n return;\n } else {\n LNRTraversal(root);\n }\n }", "private void getLevelByLevel(Node root, int level, ArrayList<LinkedList<Node>> arrL) {\n\t\tif(root == null) {\n\t\t\treturn;\n\t\t}\n\t\tLinkedList<Node> n = null;\n\t\tif(arrL.size() == level) {\n\t\t\t n = new LinkedList<>();\n\t\t\tn.add(root);\n\t\t\tarrL.add(n);\n\t\t} else {\n\t\t\tn = arrL.get(level);\n\t\t\tn.add(root);\n\t\t}\n\t\tgetLevelByLevel(root.left, level+1, arrL);\n\t\tgetLevelByLevel(root.right, level+1, arrL);\n\t\t\n\t}", "int order();", "@Override\r\n\tpublic List<Order> ListOrder() {\n\t\treturn null;\r\n\t}", "static boolean OrderModifier(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"OrderModifier\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = OrderModifier_0(b, l + 1);\n r = r && OrderModifier_1(b, l + 1);\n r = r && OrderModifier_2(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public abstract List<TreeNode> orderNodes(List<? extends TreeNode> nodes);", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public List<T> inOrder() { //Time Complexity: O(1)\n List<T> list = new ArrayList<>();\n return inOrder(root, list);\n }", "public void levelOrderTraversalBruteForce(){\n System.out.println(\"levelOrderTraversalBruteForce\");\n\n for(int level = 1; level <=height(); level++){\n printLevel(level);\n }\n System.out.println();\n }", "public static void levelOrderLinewise1(Node node){\r\n Queue<Node> mainq = new ArrayDeque<>();\r\n Queue<Node> childq = new ArrayDeque<>();\r\n \r\n //Adding root in mainq\r\n mainq.add(node);\r\n \r\n while(mainq.size()>0){\r\n //1. get + remove\r\n Node rem = mainq.remove();\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to Childq\r\n for(Node child : rem.children){\r\n childq.add(child);\r\n }\r\n \r\n //Check if size of mainq got 0 then print \"enter\" and swap the mainq and childq\r\n if(mainq.size()==0){\r\n System.out.println();\r\n Queue<Node> temp = new ArrayDeque<>();\r\n temp = mainq;\r\n mainq = childq;\r\n childq = temp;\r\n }\r\n }\r\n }", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "public static boolean OrderSpecList(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"OrderSpecList\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, ORDER_SPEC_LIST, \"<order spec list>\");\n r = OrderSpec(b, l + 1);\n r = r && OrderSpecList_1(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "@Override\n public Iterator<E> getLevelOrderIterator() {\n return new LevelOrderIterator();\n }", "private static void inOrdPutList(Node root, List<Integer> arLi)\n {\n if(root == null)\n return;\n \n inOrdPutList(root.left, arLi); arLi.add(root.data); inOrdPutList(root.right,arLi);\n }", "public static List<List<Integer>> levelOrder(TreeNode root) {\n // Queue for implementing BFS\n Queue<TreeNode> nodeQueue = new LinkedList<TreeNode>();\n // Final list of list of nodes at each level\n List<List<Integer>> levelOrderTraversal = new LinkedList<List<Integer>>();\n\n // If root is null, no nodes in the tree, return the empty list of list of nodes for level-order traversal\n if(root == null) {\n return levelOrderTraversal;\n }\n\n // Enqueue initial node (root)\n nodeQueue.offer(root);\n while(!nodeQueue.isEmpty()) {\n // Get the fixed(!, important) size of the queue, which returns the node count in the current level.\n // Do not use queue.size() in the for loop later, as the size of queue will change.\n int nodeCountInLevel = nodeQueue.size(); // Number of nodes in the queue is fixed at this point, for the current level\n\n // Create Empty list of nodes for the current level\n List<Integer> nodesInLevel = new LinkedList<Integer>();\n\n // Iterate over all nodes in the current level, add them to nodesInLevel list, add their children to queue,\n // dequeue the node itself from the queue.\n for(int i=0; i < nodeCountInLevel; i++){\n // Get current node\n TreeNode currentNode = nodeQueue.peek();\n // Add left / right children of current node, if they are not null\n if(currentNode.left != null){\n nodeQueue.offer(currentNode.left);\n }\n if(currentNode.right != null){\n nodeQueue.offer(currentNode.right);\n }\n // Remove the current node from queue, and add it to final nodesInLevel list\n nodesInLevel.add(nodeQueue.poll().val);\n }\n // Add nodes in current level to final list of list of nodes\n levelOrderTraversal.add(nodesInLevel);\n }\n return levelOrderTraversal;\n }", "public List<List<Integer>> zigzagLevelOrderDfs(TreeNode root){\n return zigzagLevelOrder(0, root, new ArrayList());\n }", "public static void main(String[] args) {\n\t\tList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\t\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(4);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(5);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(6);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(7);\n\t\tlist.add(8);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(9);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(10);\n\t\tlist.add(11);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(Inorder(res));\n\t\tList<Integer> queries = new ArrayList<>();\n\t\tqueries.add(2);\n\t\tqueries.add(4);\n\t\tswapNodes(res, queries);\n\n\t}", "private static boolean OrderModifier_1(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"OrderModifier_1\")) return false;\n OrderModifier_1_0(b, l + 1);\n return true;\n }", "void traverseLevelOrder1() {\n\t\tint h = height(root);\n\t\tint i;\n\t\tfor (i = 1; i <= h; i++)\n\t\t\tprintGivenLevel(root, i);\n\t}", "private void levelorderHelper(ArrayList<T> list, Queue<BSTNode<T>> queue) {\n // poll -- returns the element at the front of the container\n BSTNode<T> current = queue.poll();\n if (current != null) {\n list.add(current.getData());\n if (current.getLeft() != null) {\n queue.add(current.getLeft());\n }\n if (current.getRight() != null) {\n queue.add(current.getRight());\n }\n levelorderHelper(list, queue);\n }\n }", "public static void levelOrderLinewiseZZ(Node node){\n Stack<Node> st1= new Stack<>();\n Stack<Node> st2= new Stack<>();\n\n int cnt=0;\n st1.push(node);\n\n while(st1.size()>0)\n {\n int n= st1.size();\n if(cnt%2==0){\n while(n>0) {\n Node nn=st1.pop();\n System.out.print(nn.data+\" \");\n for (int i = 0; i < nn.children.size(); i++) {\n st2.push(nn.children.get(i));\n }\n n--;\n }\n }\n else{\n while(n>0){\n Node nn=st1.pop();\n System.out.print(nn.data+\" \");\n for(int i=nn.children.size()-1;i>=0;i--)\n {\n st2.push(nn.children.get(i));\n }\n n--;\n }\n }\n System.out.println();\n cnt++;\n Stack<Node> temp=st1;\n st1=st2;\n st2=temp;\n }\n\n\n }", "public static <C> int EXTENT(LIST<C> L) {\n if ( isNull( L ) ) {\n return 0;\n }\n int n = 0;\n for ( C a : L.list ) {\n if ( a instanceof LIST ) {\n LIST<C> LP = null;\n try {\n LP = (LIST<C>) a; \n } catch(ClassCastException e) {\n }\n if ( isNull( LP ) ) {\n n++;\n } else {\n n += EXTENT( LP ); \n }\n } else {\n n++;\n }\n }\n return n;\n }", "public ArrayList<ArrayList<Integer>> zigzagLevelOrder(TreeNode root) {\n ArrayList<ArrayList<Integer>> list=new ArrayList<ArrayList<Integer>>(); \n if(root==null) return list; \n Stack<TreeNode> T=new Stack<TreeNode>(); \n Stack<TreeNode> S=new Stack<TreeNode>(); \n ArrayList<Integer> sub=new ArrayList<Integer>(); \n T.push(root);\n boolean reverse=false; \n while(!T.isEmpty())\n {\n TreeNode top=T.pop();\n sub.add(top.val);\n if(!reverse)\n {\n if(top.left!=null) S.push(top.left);\n if(top.right!=null) S.push(top.right);\n }else\n {\n if(top.right!=null) S.push(top.right);\n if(top.left!=null) S.push(top.left);\n }\n if(T.isEmpty())\n {\n list.add(sub);\n T=S;\n S=new Stack<TreeNode>();\n reverse=!reverse; \n sub=new ArrayList<Integer>(); \n }\n }\n return list; \n }", "public void arrange(Order order){\n for(int i=0; i<26; ++i){\n // arrange list of list; list by list\n ArrayList<Integer> list = check_list.get(i);\n for(int j=0; j<list.size(); ++j ){\n if(order == Order.ASCENDING){\n // ascending order\n for(int k=i; k<list.size()-1; ++k){\n int num1= list.get(k);\n int num2= list.get(k+1);\n // ascending order\n if(num2<num1){\n // swap\n list.set(k, num2);\n list.set(k+1, num1);\n }\n }\n }else if(order == Order.DESCENDING){\n // descending order\n for(int k=i; k<list.size()-1; ++k){\n int num1= list.get(k);\n int num2= list.get(k+1);\n // descending order\n if(num2>num1){\n // swap\n list.set(j, num2);\n list.set(k, num1);\n }\n }\n }\n }\n // put arranged list, back in its place\n check_list.set(i, list);\n }\n }", "@Test\n void solvesTestCase() {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n List<List<Integer>> traversal = new ZigZagLevelOrder().zigzagLevelOrder(root);\n assertThat(traversal.size()).isEqualTo(3);\n assertThat(traversal.get(0)).containsExactly(3);\n assertThat(traversal.get(1)).containsExactly(20, 9);\n assertThat(traversal.get(2)).containsExactly(15, 7);\n }", "public static void levelOrderLinewise3(Node node){\r\n Queue<Node> mainq = new ArrayDeque<>();\r\n \r\n //Adding root in mainq\r\n mainq.add(node);\r\n \r\n while(mainq.size()>0){\r\n \r\n //Size of queue is obtained and then we iterate it for size times, this will ensure for printing for same level\r\n int sz = mainq.size();\r\n \r\n while(sz > 0){\r\n //1. get + remove\r\n Node rem = mainq.remove();\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to mainq\r\n for(Node child : rem.children){\r\n mainq.add(child);\r\n }\r\n sz--;\r\n } \r\n //Above level completed so print \"Enter\"\r\n System.out.println();\r\n }\r\n }", "private List<Node<T>> nodeInOrder (Node<T> curr, List<Node<T>> list) {\n if (curr == null) {\n return list;\n }\n nodeInOrder(curr.left, list);\n list.add(curr);\n nodeInOrder(curr.right, list);\n return list;\n }", "public void list() {\n\t\ttraverseInOrder(root);\n\t}", "public myList<T> my_postorder();", "public List<List<Integer>> levelOrderII(Node root) {\n List<List<Integer>> res = new ArrayList<>();\n dfs(root, res, 0);\n return res;\n }", "public void inOrderTraverseRecursive();", "public List topologicalSort( ){\r\n return this.topologicalsorting.traverse();\r\n }", "public void sortChildsZ(){\n\t\tif(childList != null && childList.size() > 0){\n\t\t\tCollections.sort(childList);\n\t\t\tfor(Ent e: childList){\n\t\t\t\te.sortChildsZ();\n\t\t\t}\n\t\t}\n\t}", "public void inOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tinOrder(localRoot.leftChild);\r\n\t\t\tSystem.out.print(localRoot.data+\" \");\r\n\t\t\tinOrder(localRoot.rightChild);\r\n\t\t}\r\n\t}", "private void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n list.add(root.element);\n inorder(root.right);\n }", "@Override\n\tpublic int getOrder() {\n\t\treturn Ordered.HIGHEST_PRECEDENCE + 10000;\n\t}", "@Override\n\tpublic Iterator<T> iteratorLevelOrder() {\n\t\treturn null;\n\t}", "public String topologicalSort() {\n\t\t\n\t\tboolean[] visited = new boolean[V];\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\t\n\t\tfor(int i=0;i< V;i++) {\n\t\t\tif(!visited[i]) {\t\t\t\n\t\t\t\ttopologicalSortRec(list, list.get(i), stack, visited, i);\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tString result = \"\";\n\t\twhile(!stack.isEmpty()) {\n\t\t\tresult = result + (char)(stack.pop() + 'a');\n\t\t}\n//\t\tSystem.out.println(result);\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n\t\tBinary_Tree_Level_Order_Traversal_102 b=new Binary_Tree_Level_Order_Traversal_102();\n\t\tTreeNode root=new TreeNode(3);\n\t\troot.left=new TreeNode(9);\n\t\troot.right=new TreeNode(20);\n\t\troot.right.left=new TreeNode(15);\n\t\troot.right.right=new TreeNode(7);\n\t\tList<List<Integer>> res=b.levelOrder(root);\n\t\tfor(List<Integer> list:res){\n\t\t\tfor(Integer i:list){\n\t\t\t\tSystem.out.print(i+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }", "public LinkedList<PostingsList> sortByIncreasingFrequency(LinkedList<PostingsList> l){\n Collections.sort(l, new Comparator<PostingsList>(){\n @Override\n public int compare(PostingsList p1, PostingsList p2){\n if(p1.size() < p2.size()){\n return -1;\n }\n if(p1.size() > p2.size()){\n return 1;\n }\n return 0;\n }\n });\n return l;\n }", "ArrayList<String> orderedList(ArrayList<String> unOrderedList);", "public void levelOrderTraversal(TreeNode<T> root) {\n\t\tif(null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tLinkedList<TreeNode<T>> list = new LinkedList<TreeNode<T>>();\n\t\t\t\n\t\t\tlist.add(root);\n\t\t\t\n\t\t\twhile(!list.isEmpty()) {\n\t\t\t\tTreeNode<T> tempNode = list.removeFirst();\n\t\t\t\tSystem.out.println(tempNode);\n\t\t\t\t\n\t\t\t\tif(null != tempNode.getLeftChild()) {\n\t\t\t\t\tlist.addLast(tempNode.getLeftChild());\n\t\t\t\t}\n\t\t\t\t if(null != tempNode.getRightChild()) {\n\t\t\t\t\t list.addLast(tempNode.getRightChild());\n\t\t\t\t }\n\t\t\t\t tempNode = null; \n\t\t\t}\n\t\t}\n\t}", "public void descOrder(Node node, List<List<Integer>> list) {\n if (node != null) {\n descOrder(node.right, list);\n list.add(node.item);\n descOrder(node.left, list);\n }\n }", "public static void sort(LendItemArrayList list, int order){\n\t\t\n\t\tLendItem tempItem = new LendItem();\n\t\t\n\t\tfor (int i = 0; i < list.next - 1; i++) {\n\t\t\t\n\t\t\tfor (int j = 0; j < list.next - 1; j++) {\n\t\t\t\t\n\t\t\t\tif (compare(list.lendItems[j], list.lendItems[j+1], order) == 1) {\n\t\t\t\t\t\n\t\t\t\t\ttempItem = list.lendItems[j];\n\t\t\t\t\tlist.lendItems[j] = list.lendItems[j+1];\n\t\t\t\t\tlist.lendItems[j+1] = tempItem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void inorder()\n {\n inorderRec(root);\n }" ]
[ "0.6379123", "0.626354", "0.6241978", "0.62338436", "0.6231334", "0.6188527", "0.617469", "0.6114486", "0.6087084", "0.60832685", "0.6072685", "0.6051304", "0.60392153", "0.60301095", "0.60198563", "0.597864", "0.5936533", "0.59087867", "0.5838491", "0.58331704", "0.5821624", "0.5812071", "0.58076525", "0.5793081", "0.57816494", "0.57651246", "0.5764642", "0.57641417", "0.5760494", "0.5759828", "0.57549417", "0.57298416", "0.57297546", "0.572685", "0.5720497", "0.5712126", "0.5706423", "0.56884134", "0.568048", "0.5672394", "0.5671483", "0.5671313", "0.56679475", "0.56656915", "0.5663509", "0.56300414", "0.5627097", "0.56239337", "0.56197757", "0.5619347", "0.5588234", "0.55835754", "0.5582445", "0.55675924", "0.5560751", "0.55558556", "0.554091", "0.55403125", "0.55268246", "0.55222535", "0.55164707", "0.5504259", "0.5492875", "0.5490036", "0.54852927", "0.54830396", "0.54674774", "0.5461277", "0.5458859", "0.54533017", "0.5450096", "0.5439851", "0.543984", "0.5438341", "0.54332423", "0.5431829", "0.5422009", "0.54178077", "0.53841025", "0.53722423", "0.5363057", "0.53606784", "0.53290725", "0.53226817", "0.5322646", "0.53207016", "0.5302906", "0.52987516", "0.52891695", "0.527879", "0.5278", "0.5264727", "0.5263347", "0.52605027", "0.525283", "0.5246424", "0.52455974", "0.5225797", "0.522272", "0.5222113" ]
0.7243442
0
TODO Autogenerated method stub
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int arr[] = new int[n]; for(int i = 0 ; i < n ; i++) { arr[i] = sc.nextInt(); } int num = sc.nextInt(); int start = 0 , end = n-1; while(start<end) { int mid = (start + end)/2; if(arr[mid] < num) { start = mid+1; }else if(arr[mid] > num) { end = mid-1; }else if(arr[mid] == num) { System.out.println(1); return; } } System.out.println(-1); }
{ "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
account reactive service with proto messages
public interface AccountService { Mono<Account> findById(Int32Value id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "net.nyhm.protonet.example.proto.AccountProto.AccountOrBuilder getAccountOrBuilder();", "net.nyhm.protonet.example.proto.AccountProto.AccountOrBuilder getAccountOrBuilder();", "public interface AccountService {\n\tpublic Long getUserId(String name);\n\tpublic MessageSystem getMessageSystem();\n}", "public interface AccountService {\n\n Account createAccount(Account account);\n\n AccountDto.ResponseAccount getAccountById(Long accountId);\n\n}", "messages.Facademessages.Subscribe getSubscribe();", "public interface IntraWalletUserActor {\n\n /**\n * The metho <code>getPublicKey</code> gives us the public key of the represented intra wallet user\n *\n * @return the public key\n */\n String getPublicKey();\n\n /**\n * The method <code>getName</code> gives us the name of the represented intra wallet user\n *\n * @return the name of the intra user\n */\n String getName();\n\n /**\n * The method <code>getContactRegistrationDate</code> gives us the date when both intra wallet users\n * exchanged their information and accepted each other as contacts.\n *\n * @return the date\n */\n long getContactRegistrationDate();\n\n /**\n * The method <coda>getProfileImage</coda> gives us the profile image of the represented intra wallet user\n *\n * @return the image\n */\n byte[] getProfileImage();\n\n /**\n * The method <code>getContactState</code> gives us the contact state of the represented intra\n * wallet user\n *\n * @return the contact state\n */\n ConnectionState getContactState();\n\n}", "private void consumeAccountInfo() {\n Account[] accounts = mAccountManager.getAccountsByType(ACCOUNT_TYPE);\n Account account;\n if (accounts != null && accounts.length > 0) {\n account = accounts[0];\n } else {\n account = new Account(\"\", ACCOUNT_TYPE);\n }\n mAccountManager.getAuthToken(account, AUTH_TOKEN_TYPE, null, true, authTokenCallback, null);\n }", "public interface AccountService {\n @POST(\"authenticate/{provider}\")\n Call<TokenRes> authenticate(@Path(\"provider\") String provider, @Body AuthenticateForm authenticateForm);\n\n @POST(\"install\")\n Call<CreatedIdModelRes> install(@Body InstallForm installForm);\n\n @PUT(\"register\")\n Call<Void> register(@Body RegisterForm registerForm);\n}", "public interface ChatService {\n public Object requestRongToken(Member member) throws Exception;\n}", "public interface IAccountProfileService {\n void checkDataChange(int i);\n\n void checkLoginChange();\n\n void cleanProfileData(int[] iArr);\n\n void delKVProfileValue(int i, String str);\n\n boolean getKVProfileBool(int i, String str, boolean z);\n\n byte[] getKVProfileByte(int i, String str);\n\n int getKVProfileInt(int i, String str, int i2);\n\n long getKVProfileLong(int i, String str, long j);\n\n short getKVProfileShort(int i, String str, short s);\n\n String getKVProfileString(int i, String str, String str2);\n\n List<String> getKeys(int i);\n\n boolean isProfileClear(int i);\n\n boolean isProfileClear(int i, String str);\n\n void setKVProfileBool(int i, String str, boolean z);\n\n void setKVProfileByte(int i, String str, byte[] bArr);\n\n void setKVProfileInt(int i, String str, int i2);\n\n void setKVProfileLong(int i, String str, long j);\n\n void setKVProfileShort(int i, String str, short s);\n\n void setKVProfileString(int i, String str, String str2);\n\n void setListener(IAccountProfileListener iAccountProfileListener);\n}", "public interface UserAccountService {\n public void addUserAccount(UserAccount user);\n\n public UserAccount getUserAccount(String uid);\n\n public void update(UserAccount user);\n\n public String login(String uid, String pwd);\n\n public UserAccount getByid(Long id);\n\n public List<String> getUids(List<Long> ids);\n\n public List<Friend> search(final String key);\n}", "public interface UserServices {\n\n // @FormUrlEncoded\n @POST(\"users\")\n Observable<Response<User>> postRegisterUser(@Body UserRegisterParam param);\n\n @GET(\"users/{id}\")\n Observable<Response<User>> getUserProfile(@Path(\"id\") long id);\n\n @GET(\"users/balance\")\n Observable<Balance> getBalance();\n\n @POST(\"vouchers/check_balance_code\")\n @FormUrlEncoded\n Observable<StatusResponse> checkBalanceCode(@Field(\"code\") String code);\n\n @POST(\"users/add_voucher\")\n @FormUrlEncoded\n Observable<Balance> addVoucher(@Field(\"code\") String code);\n\n // @FormUrlEncoded\n @POST(\"sessions\")\n Observable<Response<User>> loginByEmail(@Body LoginUserParam param);\n\n @DELETE(\"sessions/{id}\")\n Observable<Response<SessionDeleteResponse>> logout(@Path(\"id\") long id);\n\n @POST(\"notifications/register_reg_token\")\n @FormUrlEncoded\n Observable<NotificationResponse> registerRegToken(@Field(\"reg_token\") String regToken);\n\n @POST(\"feedbacks\")\n @FormUrlEncoded\n Observable<StatusResponse> postFeedback(@Field(\"rate\") float rate, @Field(\"feed_back\") String feed);\n}", "public interface TokenClientService {\n\n /**\n * Method returns Token from auth provider\n *\n * @return New Auth Token from provider\n */\n Mono<GenericToken> getToken();\n\n}", "public interface InviteService extends Service, ActorService {\r\n\r\n @AsyncInvocation\r\n void save();\r\n @AsyncInvocation\r\n void insert(DbRow dbRow);\r\n @AsyncInvocation\r\n void update(DbRow dbRow);\r\n @AsyncInvocation\r\n void bindInviteCode(RoleInvitePo roleInvitePoFrom, RoleBeInvitePo roleBeInvitePo);\r\n\r\n}", "public interface BankAccountMessages {\n\n String withdraw();\n\n String transactionAmount();\n\n String transactionType();\n\n String deposit();\n\n String currentAmount();\n\n String viewAmount();\n\n String transactionHistory();\n\n String sid();\n\n String successTransaction();\n\n String transactionResponse();\n}", "frame.game.proto.User.UserInfo getUser();", "frame.game.proto.User.UserInfo getUser();", "public interface AccountServer {\r\n\t\r\n\t/**\r\n\t Method: newAccount\r\n\t Inputs: String type, String name, float balance\r\n\t Returns: boolean true if the account was created and stored, false otherwise\r\n\r\n\t Description: Create a new account object in the server. if an account already exists with the given name then a new account is not created and stored.\r\n\t*/\r\n\tpublic boolean\tnewAccount(String type, String name, float balance) throws IllegalArgumentException;\r\n\r\n\t\r\n\t/**\r\n\t Method: closeAccount\r\n\t Inputs: String\r\n\t Returns: boolean true if there was an account with this name and close was successful\r\n\r\n\t Description: Close an account \r\n\t*/\r\n\tpublic boolean\tcloseAccount(String name);\r\n\r\n\t/**\r\n\t * @param name name of the account \r\n\t * @return Account object or null if not found. \r\n\t */\r\n\tpublic Account\tgetAccount(String name);\r\n\r\n\t/** \r\n\t * @return a list of all Accounts inside the server \r\n\t */\r\n\tpublic List<Account> getAllAccounts();\r\n\r\n\t/** \r\n\t * @return a list of Accounts inside the server that are not CLOSED\r\n\t */\r\n\tpublic List<Account> getActiveAccounts();\r\n\r\n\t\r\n\t/**\r\n\t Method: saveAccounts\r\n\t Inputs: none\r\n\t Returns: void\r\n\r\n\t Description: Saves the state of the server\r\n\t*/\r\n\tpublic void\tsaveAccounts() throws IOException;\r\n}", "public AuthResponse registerAccount(Account acc){\n Call<AuthResponse> call = endpoints.registerAcc(acc);\n AuthResponse serverResponse = null;\n try {\n serverResponse = call.execute().body();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return serverResponse;\n }", "public interface EmailAccountService {\n\n RestfulResponse<PageDatas> listAccount(Integer pageNo, Integer pageSize, String search, String sortBy, Boolean isAscending);\n\n RestfulResponse<Long> addAccount(EmailHostAccountDto emailHostAccountDto);\n\n RestfulResponse<Long> updateAccount(EmailHostAccountDto emailHostAccountDto);\n\n RestfulResponse<Long> deleteAccount(Long id);\n\n EmailAccount getEmailAccount(String hostCode, Long hostSizeLimit);\n\n}", "public interface IAccountService {\n public TenantInfo getTenantInfo(String tenantAccount);\n public Map createUserInfo(TenantInfo tenant);\n public Map createUserDB(AdminUser adminUser,User user);\n public Map loginOfTenantInfo(TenantInfo tenant);\n public Map loginOfUser(User user);\n public Map getVerificationCode(Msg msg);\n\n}", "public AccountService getAccountService(){\n return accountService;\n }", "public interface UserService {\n\n /**\n * {mail}\n */\n @POST(\"user/auth\")\n Observable<BaseData> authNewMail(@Body User user);\n\n /**\n * {mail,pwd,authCode}\n */\n @POST(\"user/register\")\n Observable<BaseData> registerByAuth(@Body User user);\n\n @POST(\"user/login\")\n Observable<TokenResult> login(@Body User user);\n\n @POST(\"user/login\")\n Call<TokenResult> loginSync(@Body User user);\n\n /**\n * {mail}\n */\n //忘记密码验证\n @POST(\"user/findAuth\")\n Observable<BaseData> findAuth(@Body User user);\n\n /**\n * {mail,pwd,authCode}\n */\n //忘记密码修改\n @POST(\"user/find\")\n Observable<BaseData> findByAuth(@Body User user);\n\n //修改密码\n @PUT(\"user/\")\n Observable<TokenResult> changePwd(@Body String mail, @Body String oldPwd,\n @Body String newPwd);\n\n @GET(\"user/info/\")\n Observable<UserInfoResult> getUserInfo();\n\n @PUT(\"user/info/\")\n Observable<BaseData> updateUserInfo(@Body UserInfo userInfo);\n\n //key为要上传的文件名 格式为:avator/usermail.png\n @GET(\"http://182.254.247.206:8400/jobsapp/token\")\n Observable<Response<TokenResult>> getUploadToken(@Header(\"key\") String key,\n @Header(\"isFirst\") String isFirst);\n\n //更新的时候删除用户之前的头像\n @DELETE(\"182.254.247.206:8400/jobsapp/{usermail}\")\n Observable<Response> deleteAvator(\n @Path(\"usermail\") String mail);\n\n //收藏版块\n //获取收藏列表\n @GET(\"collection/\")\n Observable<CollectionResult> getCollections();\n\n @POST(\"collection/\")\n Observable<BaseData> addCollection(@Body Collection collection);\n\n @DELETE(\"collection/{id}/\")\n Observable<BaseData> removeCollection(@Path(\"id\") long id);\n\n @POST(\"posts\")\n Observable<BaseData> newPost(@Body PostContent postContent);\n\n @PUT(\"posts/{pid}\")\n Observable<BaseData> changePost(@Path(\"pid\") int pid, @Body PostContent postContent);\n\n @DELETE(\"posts/{pid}\")\n Observable<BaseData> deletePost(@Path(\"pid\") int pid);\n\n @POST(\"posts/{pid}/reply\")\n Observable<BaseData> replyPost(@Body ReplyBean replyBean, @Path(\"pid\") int pid);\n\n @DELETE(\"posts/{pid}/reply/{rid}\")\n Observable<BaseData> deletePostReply(@Path(\"pid\") int pid, @Path(\"rid\") int rid);\n\n @GET(\"posts\")\n Observable<PostListResult> getPostList();\n\n @GET(\"posts/{pid}\")\n Observable<PostDetailResult> getPostDetail(@Path(\"pid\") int pid);\n\n @POST(\"posts/collections/{pid}\")\n Observable<BaseData> collectPost(@Path(\"pid\") int pid,@Body PostData postData);\n\n @DELETE(\"posts/collections/{pid}\")\n Observable<BaseData> deletePostCollection(@Path(\"pid\")int pid);\n\n @GET(\"posts/collections\")\n Observable<PostListResult> getPostCollections();\n\n}", "grpc.messages.Messages.Employee getEmployee();", "grpc.messages.Messages.Employee getEmployee();", "messages.Facademessages.SubscribeOrBuilder getSubscribeOrBuilder();", "public interface AboutUnivStarService {\n\n @POST(\"/v1/m/user/setting/about\")\n Observable<AboutUnivStarBean> loadAboutUnivStarMessage();\n}", "@Path(\"account\")\n @Service({\"account\"})\n public ResponseMessage addAccount(Account account) {\n return asi.addAccount(account);\n }", "private void subscribe() {\r\n\r\n OnUpdatePlayerSubscription subscription = OnUpdatePlayerSubscription.builder().build();\r\n subscriptionWatcher = awsAppSyncClient.subscribe(subscription);\r\n subscriptionWatcher.execute(subCallback);\r\n }", "@PostMapping(\"/create\")\n public Mono<ResponseEntity<CurrentAccount>> create(@Valid @RequestBody CurrentAccount currentAccount){\n \tlog.info(\"Esta entrando a este metodo create\");\n \treturn currentAccountService.findCustomerById(currentAccount.getCustomer().getId())\n \t\t\t.flatMap(cst -> currentAccountService.verifyExpiredDebt(currentAccount.getCustomer().getId())\n \t\t\t\t\t\t\t.filter(expired -> expired)\n\t\t \t\t\t\t\t.flatMap(expired -> {\n\t\t \t \t\t\tlog.info(\"Encontro el customer \" + cst.getName());\n\t\t \t \t\t\treturn currentAccountService.verifyAccountNumber(currentAccount.getAccountNumber())\n\t\t \t \t\t\t\t\t.filter(optional -> {\n\t\t \t \t\t\t\t\t\tlog.info(\"El optional debe estar vacio \" + optional.isPresent());\n\t\t \t \t\t\t\t\t\treturn !optional.isPresent();\n\t\t \t \t\t\t\t\t})\n\t\t \t \t\t\t\t.flatMap(bankAccount -> {\n\t\t \t \t\t\t\t\t\tlog.info(\"El accountNumber es unico!\");\n\t\t \t\t return currentAccountService.countAccountBank(currentAccount.getCustomer().getId()) // Mono<Long> # Cuentas bancarias del Cliente\n\t\t \t\t .filter(count -> {\n\t\t \t\t switch (cst.getTypeCustomer().getValue()){\n\t\t \t\t case PERSONAL:\n\t\t \t\t return count < 1; // max 1 Cuenta por Cliente PERSONAL\n\t\t \t\t\n\t\t \t\t case EMPRESARIAL:\n\t\t \t\t return currentAccount.getHolders() != null & currentAccount.getHolders().size() > 0; // Cliente EMPRESARIAL debe tener 1 o mas titulares\n\t\t \t\t\n\t\t \t\t default: return false;\n\t\t \t\t }\n\t\t \t\t })\n\t\t \t\t .flatMap(c -> {\n\t\t \t\t switch (cst.getTypeCustomer().getValue()){\n\t\t \t\t case EMPRESARIAL:\n\t\t \t\t switch (cst.getTypeCustomer().getSubType().getValue()){\n\t\t \t\t case PYME: return currentAccountService.findCreditCardByCustomerId(cst.getId())\n\t\t \t\t .count()\n\t\t \t\t .filter(cntCCard -> cntCCard > 0)\n\t\t \t\t .flatMap(cntCCard -> {\n\t\t \t\t currentAccount.setCustomer(cst);\n\t\t \t\t currentAccount.setDate(LocalDateTime.now());\n\t\t \t\t currentAccount.setCommissionMaintenance(0.0);\n\t\t \t\t return currentAccountService.create(currentAccount);\n\t\t \t\t });\n\t\t \t\t }\n\t\t \t\t\n\t\t \t\t default: currentAccount.setCustomer(cst);\n\t\t \t\t currentAccount.setDate(LocalDateTime.now());\n\t\t \t\t return currentAccountService.create(currentAccount); // Mono<CurrentAccount>\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 .map(ca -> new ResponseEntity<>(ca, HttpStatus.CREATED));\n\t\t \t \t\t})\n \t\t\t\t\t)\n \t\t\t\t\t.defaultIfEmpty(new ResponseEntity<>(HttpStatus.BAD_REQUEST));\n \t\t\t\n \t\t\t\n \t\t\n\n }", "GenerateUserAccount () {\r\n }", "public interface VipAccountService {\n\n /**\n * 选举一个存量最多的账号\n *\n * @param type\n * @return\n */\n VipAccount vote(Integer type);\n\n int update(VipAccount vipAccount);\n\n int save(VipAccount vipAccount);\n\n VipAccount get(VipAccount vipAccount);\n\n List<VipAccount> listAll();\n\n int delete(VipAccount vipAccount);\n\n void reset();\n\n List<VipAccount> listVip(User user);\n\n}", "public interface TwilioService {\n String ACCOUNT_ID_TEST = \"ACCXXXX\";\n String ACCOUNT_TOKEN_TEST = \"ACXXX\";\n String FROM = \"XXXXX\";\n\n}", "Account apply();", "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}", "public interface LoginService {\n @POST(Properties.register)\n Observable<Result<UserId>>register(\n @Query(\"user_name\") String user_name,\n @Query(\"user_code\") String user_code,\n @Query(\"pass_word\") String pass_word\n );\n @POST(Properties.sendCode)\n Observable<CodeResultV3<Object>>sendCode(\n @Query(\"phone_no\") String phone,\n @Query(\"msgType\") int msgType\n\n );\n @POST(Properties.login)\n Observable<CodeResultV3<UserId>>login(\n @Query(\"phone_no\") String phone,\n @Query(\"phone_code\") String user_code\n\n );\n}", "public interface IAccountbService {\n\n int add(Accountb account);\n\n int update(Accountb account);\n\n int delete(int id);\n\n Accountb findAccountById(int id);\n\n List<Accountb> findAccountList();\n\n Accountb findAccountByName(String name);\n\n\n\n\n}", "private void handleAccountUpdateOnPre() {\n }", "public interface MessageListService {\n\n List<Conversation> getUserConversations(String uuid);\n}", "com.google.protobuf.ByteString\n getAccountBytes();", "void updateAccount(Account account);", "private GetAccount()\r\n/* 19: */ {\r\n/* 20:18 */ super(new APITag[] { APITag.ACCOUNTS }, new String[] { \"account\" });\r\n/* 21: */ }", "public interface ReactiveUserRepository extends ReactiveCrudRepository<Person, String> {\n\n}", "public interface MessageService {\n\n void add(String text, Account account, Account account1);\n\n Message findById(int id);\n\n Message findByUserId(int id);\n\n Message findByLogin(String login);\n\n List<Message> showAll(int id, int idi);\n\n List<Message> showAllToMe(int id, int idi);\n\n List<Message> showAllSortedMessageFromFriends(int myId);\n\n}", "public net.nyhm.protonet.example.proto.AccountProto.Account getAccount() {\n if (accountBuilder_ == null) {\n return account_ == null ? net.nyhm.protonet.example.proto.AccountProto.Account.getDefaultInstance() : account_;\n } else {\n return accountBuilder_.getMessage();\n }\n }", "public net.nyhm.protonet.example.proto.AccountProto.Account getAccount() {\n if (accountBuilder_ == null) {\n return account_ == null ? net.nyhm.protonet.example.proto.AccountProto.Account.getDefaultInstance() : account_;\n } else {\n return accountBuilder_.getMessage();\n }\n }", "@SuppressWarnings(\"unused\")\npublic interface AccountI extends Remote {\n String login(String id, String passwd) throws RemoteException;\n String signUp(String id, String passwd, String secureQuestion, String answer)throws RemoteException;\n String logOut(String userName) throws RemoteException;\n String forgetPassword(String username)throws RemoteException;\n String resetPassword(String username,String answer, String password)throws RemoteException;\n void startIO()throws RemoteException;\n int getRuntimeServer()throws RemoteException;\n int getFileServer() throws RemoteException;\n int getIOUniqueNumber()throws RemoteException;\n}", "public interface ResourceChangeForMaketService {\n\n void send(Object o,User operator);\n}", "Account() { }", "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}", "public void callForProfileData(){\n socket.emit(\"user\");\n }", "public void AddToAccountInfo();", "public interface MessageService {\r\n\r\n BaseResult addMessage(MessageVo vo, Account user,String oType,String url);\r\n\r\n BaseResult selectMessage(QueryMessageVo vo);\r\n\r\n BaseResult selectMessageDetail(String cusId);\r\n\r\n BaseResult delMessage(String cusId);\r\n\r\n BaseResult getCount(String acceptType,String cusKind);\r\n\r\n BaseResult updateMessage(MessageVo vo, Account user);\r\n}", "public interface Account {\n /**\n * Gets the id property: Fully qualified resource Id for the resource.\n *\n * @return the id value.\n */\n String id();\n\n /**\n * Gets the name property: The name of the resource.\n *\n * @return the name value.\n */\n String name();\n\n /**\n * Gets the type property: The type of the resource.\n *\n * @return the type value.\n */\n String type();\n\n /**\n * Gets the etag property: Resource Etag.\n *\n * @return the etag value.\n */\n String etag();\n\n /**\n * Gets the kind property: The Kind of the resource.\n *\n * @return the kind value.\n */\n String kind();\n\n /**\n * Gets the sku property: The resource model definition representing SKU.\n *\n * @return the sku value.\n */\n Sku sku();\n\n /**\n * Gets the identity property: Identity for the resource.\n *\n * @return the identity value.\n */\n Identity identity();\n\n /**\n * Gets the systemData property: Metadata pertaining to creation and last modification of the resource.\n *\n * @return the systemData value.\n */\n SystemData systemData();\n\n /**\n * Gets the tags property: Resource tags.\n *\n * @return the tags value.\n */\n Map<String, String> tags();\n\n /**\n * Gets the location property: The geo-location where the resource lives.\n *\n * @return the location value.\n */\n String location();\n\n /**\n * Gets the properties property: Properties of Cognitive Services account.\n *\n * @return the properties value.\n */\n AccountProperties properties();\n\n /**\n * Gets the region of the resource.\n *\n * @return the region of the resource.\n */\n Region region();\n\n /**\n * Gets the name of the resource region.\n *\n * @return the name of the resource region.\n */\n String regionName();\n\n /**\n * Gets the name of the resource group.\n *\n * @return the name of the resource group.\n */\n String resourceGroupName();\n\n /**\n * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner object.\n *\n * @return the inner object.\n */\n AccountInner innerModel();\n\n /** The entirety of the Account definition. */\n interface Definition\n extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate {\n }\n\n /** The Account definition stages. */\n interface DefinitionStages {\n /** The first stage of the Account definition. */\n interface Blank extends WithResourceGroup {\n }\n\n /** The stage of the Account definition allowing to specify parent resource. */\n interface WithResourceGroup {\n /**\n * Specifies resourceGroupName.\n *\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @return the next definition stage.\n */\n WithCreate withExistingResourceGroup(String resourceGroupName);\n }\n\n /**\n * The stage of the Account definition which contains all the minimum required properties for the resource to be\n * created, but also allows for any other optional properties to be specified.\n */\n interface WithCreate\n extends DefinitionStages.WithLocation,\n DefinitionStages.WithTags,\n DefinitionStages.WithKind,\n DefinitionStages.WithSku,\n DefinitionStages.WithIdentity,\n DefinitionStages.WithProperties {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n Account create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n Account create(Context context);\n }\n\n /** The stage of the Account definition allowing to specify location. */\n interface WithLocation {\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithCreate withRegion(Region location);\n\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithCreate withRegion(String location);\n }\n\n /** The stage of the Account definition allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n WithCreate withTags(Map<String, String> tags);\n }\n\n /** The stage of the Account definition allowing to specify kind. */\n interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n WithCreate withKind(String kind);\n }\n\n /** The stage of the Account definition allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The resource model definition representing SKU.\n *\n * @param sku The resource model definition representing SKU.\n * @return the next definition stage.\n */\n WithCreate withSku(Sku sku);\n }\n\n /** The stage of the Account definition allowing to specify identity. */\n interface WithIdentity {\n /**\n * Specifies the identity property: Identity for the resource..\n *\n * @param identity Identity for the resource.\n * @return the next definition stage.\n */\n WithCreate withIdentity(Identity identity);\n }\n\n /** The stage of the Account definition allowing to specify properties. */\n interface WithProperties {\n /**\n * Specifies the properties property: Properties of Cognitive Services account..\n *\n * @param properties Properties of Cognitive Services account.\n * @return the next definition stage.\n */\n WithCreate withProperties(AccountProperties properties);\n }\n }\n\n /**\n * Begins update for the Account resource.\n *\n * @return the stage of resource update.\n */\n Account.Update update();\n\n /** The template for Account update. */\n interface Update\n extends UpdateStages.WithTags,\n UpdateStages.WithKind,\n UpdateStages.WithSku,\n UpdateStages.WithIdentity,\n UpdateStages.WithProperties {\n /**\n * Executes the update request.\n *\n * @return the updated resource.\n */\n Account apply();\n\n /**\n * Executes the update request.\n *\n * @param context The context to associate with this operation.\n * @return the updated resource.\n */\n Account apply(Context context);\n }\n\n /** The Account update stages. */\n interface UpdateStages {\n /** The stage of the Account update allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n Update withTags(Map<String, String> tags);\n }\n\n /** The stage of the Account update allowing to specify kind. */\n interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n Update withKind(String kind);\n }\n\n /** The stage of the Account update allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The resource model definition representing SKU.\n *\n * @param sku The resource model definition representing SKU.\n * @return the next definition stage.\n */\n Update withSku(Sku sku);\n }\n\n /** The stage of the Account update allowing to specify identity. */\n interface WithIdentity {\n /**\n * Specifies the identity property: Identity for the resource..\n *\n * @param identity Identity for the resource.\n * @return the next definition stage.\n */\n Update withIdentity(Identity identity);\n }\n\n /** The stage of the Account update allowing to specify properties. */\n interface WithProperties {\n /**\n * Specifies the properties property: Properties of Cognitive Services account..\n *\n * @param properties Properties of Cognitive Services account.\n * @return the next definition stage.\n */\n Update withProperties(AccountProperties properties);\n }\n }\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @return the refreshed resource.\n */\n Account refresh();\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @param context The context to associate with this operation.\n * @return the refreshed resource.\n */\n Account refresh(Context context);\n\n /**\n * Lists the account keys for the specified Cognitive Services account.\n *\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account along with {@link Response}.\n */\n Response<ApiKeys> listKeysWithResponse(Context context);\n\n /**\n * Lists the account keys for the specified Cognitive Services account.\n *\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account.\n */\n ApiKeys listKeys();\n\n /**\n * Regenerates the specified account key for the specified Cognitive Services account.\n *\n * @param parameters regenerate key parameters.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account along with {@link Response}.\n */\n Response<ApiKeys> regenerateKeyWithResponse(RegenerateKeyParameters parameters, Context context);\n\n /**\n * Regenerates the specified account key for the specified Cognitive Services account.\n *\n * @param parameters regenerate key parameters.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account.\n */\n ApiKeys regenerateKey(RegenerateKeyParameters parameters);\n}", "void updateAccount();", "public interface LoginClient {\n @POST(\"login\")\n Call<FlashMessage> loginAccount(@Body User user);\n //public void getFeed(@Body User user, Callback<User> response);\n}", "public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public interface UserService {\n\n Future<Void> saveOne(JsonObject userJson, String userName);\n\n Future<List<JsonObject>> getLists();\n\n Future<JsonObject> findByAccount(String account);\n\n Future<Void> getMailCode(String account, String email);\n\n Future<Void> resetPassword(JsonObject body);\n\n}", "SubscriptionDetails subscribeToMessage(SubscribeToMessage cmd);", "public interface AccountInterface{\n\n @POST\n Call<LoginResultModel> postLogin(@Url String url, @Body LoginModel loginModel);\n\n @POST\n Call<Success2Model> postMemberSetting(@Url String url, @Body MemberSettingModel memberSettingModel);\n\n @GET(Utils.URL_MEMBER_SETTING)\n Call<MemberSettingResultModel> getUserTagList(@Query(\"fb_id\") String fb_id);\n \n @GET(Utils.URL_MEMBER_INFO)\n Call<MemberInfoModel> getMemberInfo(@Path(\"fb_id\") String fb_id);\n\n @GET(Utils.URL_GET_SETTING)\n Call<MemberSettingResultModel> getSetting(@Query(\"fb_id\") String fb_id);\n\n @POST\n Call<Success2Model> postEditAbout(@Url String url, @Body AboutModel aboutModel);\n\n @POST\n Call<SuccessTokenModel> getAccessToken(@Url String url, @Body AccessTokenModel accessTokenModel);\n\n @GET(Utils.URL_VERIFY_PHONE_NUMBER)\n Call<Success2Model> verifyPhoneNumber(@Path(\"fb_id\") String fb_id, @Path(\"phone\") String phone);\n\n @GET(Utils.URL_VERIFY_VERIFICATION_CODE)\n Call<Success2Model> verifyVerificationCode(@Path(\"fb_id\") String fb_id, @Path(\"token\") String token);\n\n @Multipart\n @POST(Utils.URL_UPLOAD)\n Call<SuccessUploadModel> upload4(@Part MultipartBody.Part photo, @Part(\"fb_id\") RequestBody fb_id);\n\n @GET(Utils.URL_CITY)\n Call<CityModel> getCityList();\n\n @POST(Utils.URL_DELETE_PHOTO)\n Call<Success2Model> deletePhoto(@Body ProfileDetailModel profileDetailModel);\n\n @POST(Utils.URL_POST_FRIEND_LIST)\n Call<Success2Model> postFriendList(@Path(\"fb_id\") String fb_id, @Path(\"friends_fb_id\") ArrayList<String> friendsFbId);\n\n @GET(Utils.URL_GET_INVITE_CODE)\n Call<InviteCodeResultModel> getInviteCode(@Path(\"fb_id\") String fbId);\n\n @GET(Utils.URL_UPDATE_MATCH_ME)\n Call<Success2Model> updateMatchMe(@Path(\"fb_id\") String fb_id, @Path(\"match_me\") String matchMe);\n\n}", "public interface BrokerInterface extends Remote {\n /**\n * Subscribes to a game\n * @param subscriber the interface on which the broker calls the dispatch message method\n * @param clientId the unique id of the client to find in which game it belongs\n * @throws RemoteException\n */\n public void subscribe(SubscriberInterface subscriber, UUID clientId) throws RemoteException;\n}", "private void updateAccountStatus() {\n\r\n }", "@Override\r\n\tpublic void NroAccount() {\n\t\t\r\n\t}", "public interface RawController {\n\n // NEW MESSAGE\n //\n // Add a new message to the model with a specific id. If the id is already\n // in use, the call will fail and null will be returned.\n Message newMessage(Uuid id, Uuid author, Uuid conversation, String body, Time creationTime);\n\n // NEW USER\n //\n // Add a new user to the server with a given username and password. If the input is\n // invalid or the username is already taken, the call will fail and an error code\n // will be returned.\n int newUser(String username, String password, Time creationTime);\n\n // LOGIN\n //\n // Login with a given id, username, and password. If the id is already in use, the\n // call will fail and null will be returned. If the username and password are invalid,\n // the call will fail and null will be returned.\n User login(Uuid id, String username, String password, Time creationTime);\n\n // NEW CONVERSATION\n //\n // Add a new conversation to the model with a specific if. If the id is\n // already in use, the call will fail and null will be returned.\n Conversation newConversation(Uuid id, String title, Uuid owner, Time creationTime);\n\n}", "public interface AuthenticatedUserApi {\n\n void sync(SyncStatusListener listener);\n\n void changePassword(String newPassword, ChangePasswordResponseListener listener);\n\n void changeEmail(String newEmail, ChangeEmailResponseListener listener);\n\n void changeMobile(String newMobileNumber, ChangeMobileResponseListener listener);\n\n void deleteAccount(DeleteAccountResponseListener listener);\n\n void changeUsername(String newUsername, ChangeUserNameResponseListener listener);\n\n void logout(LogoutResponseListener listener);\n\n}", "public interface GitHubService {\n\n // Retrofit\n @GET(\"users/{username}/following\")\n Call<List<GitHubUser>> getFollowing(@Path(\"username\") String username);\n\n // Retrofit + ReactiveX\n @GET(\"users/{username}/following\")\n Observable<List<GitHubUser>> getFollowingWithReactiveX(@Path(\"username\") String username);\n\n // Retrofit + ReactiveX\n @GET(\"users/{username}\")\n Observable<GitHubUserInfo> getUserInfoWithReactiveX(@Path(\"username\") String username);\n\n // Retrofit\n public static final Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(\"https://api.github.com/\")\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n // Retrofit + ReactiveX\n public static final Retrofit retrofitWithReactiveX = new Retrofit.Builder()\n .baseUrl(\"https://api.github.com/\")\n .addConverterFactory(GsonConverterFactory.create())\n .addCallAdapterFactory(RxJava2CallAdapterFactory.create())\n .build();\n}", "void subscribe(Player player);", "public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public interface AccountService {\n\n Double getBalanceByDate(Long id, Date date);\n\n List<Account> getAllByUser(String mobileNumber);\n}", "public interface DomainApi {\n @POST(\"/oauth/token\")\n Observable<AuthResult> auth(@Body AuthRequest authRequest);\n}", "private void sendRegistrationIdToBackend() {\n // Your implementation here.\n }", "messages.Clienthello.ClientHello getClientHello();", "public void treatment()\n {\n\t\tCommunicationManagerServer cms = CommunicationManagerServer.getInstance();\n\t\tDataServerToComm dataInterface = cms.getDataInterface();\n\t\t/** On récupère et stocke l'adresse IP du serveur\n\t\t */\n\t\tdataInterface.updateUserChanges(user);\n\n\t /** Création du message pour le broadcast des informations**/\n\t updatedAccountMsg message = new updatedAccountMsg(this.user);\n\t\tmessage.setPort(this.getPort());\n\t cms.broadcast(message);\n\t}", "Account.Update update();", "public net.nyhm.protonet.example.proto.AccountProto.AccountOrBuilder getAccountOrBuilder() {\n if (accountBuilder_ != null) {\n return accountBuilder_.getMessageOrBuilder();\n } else {\n return account_ == null ?\n net.nyhm.protonet.example.proto.AccountProto.Account.getDefaultInstance() : account_;\n }\n }", "public net.nyhm.protonet.example.proto.AccountProto.AccountOrBuilder getAccountOrBuilder() {\n if (accountBuilder_ != null) {\n return accountBuilder_.getMessageOrBuilder();\n } else {\n return account_ == null ?\n net.nyhm.protonet.example.proto.AccountProto.Account.getDefaultInstance() : account_;\n }\n }", "public interface IAccountManger {\n\n // 服务器错误\n static final int SERVER_FAIL = -999;\n // 验证码发送成功\n static final int SMS_SEND_SUC = 1;\n // 验证码发送失败\n static final int SMS_SEND_FAIL = -1;\n // 验证码校验成功\n static final int SMS_CHECK_SUC = 2;\n // 验证码错误\n static final int SMS_CHECK_FAIL = -2;\n // 用户已经存在\n static final int USER_EXIST = 3;\n // 用户不存在\n static final int USER_NOT_EXIST = -3;\n // 注册成功\n static final int REGISTER_SUC = 4;\n // 登录成功\n static final int LOGIN_SUC = 5;\n // 密码错误\n static final int PW_ERROR = -5;\n // 登录失效\n static final int TOKEN_INVALID = -6;\n void setHandler(Handler handler);\n\n /**\n * 下发验证码\n * @param phone\n */\n void fetchSmsCode(String phone);\n\n /**\n * 校验验证码\n * @param phone\n * @param smsCode\n */\n void checkSmsCode(String phone,String smsCode);\n\n /**\n * 检查用户是否存在\n * @param phone\n */\n void checkUserExist(String phone);\n\n /**\n * 注册\n * @param phone\n * @param password\n */\n void register(String phone,String password);\n\n /**\n * 登录\n * @param phone\n * @param password\n */\n void login(String phone,String password);\n\n void loginByToken();\n}", "interface Auth extends RconConnectionEvent, Cancellable {}", "public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "com.lxd.protobuf.msg.result.user.User.User_ getUser();", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n// ctx.pipeline().write(buffer);\n\n// System.out.println(\"received msg: \"+ msg.toString()\n// + \" ---current thread: \" + Thread.currentThread().getName());\n\n logger.info(\"received msg: \" + msg.toString());\n User user = (User) msg;\n user.setUserName(\"server-robbie\");\n ctx.pipeline().write(user);\n }", "public void openAccount(Account a) {}", "public interface ProfileAdminInteractor {\n void getUser(String id, final ResourceRequestCallback<User> callback);\n}", "public interface AccountInfoService extends IService<AccountInfo> {\n\n}", "Subscriptions() {\n // Will get filled in with set methods\n }", "public _AccountStub ()\n {\n super ();\n }", "public interface IMainListener {\n void onUsersReqComplete(Result<List<User>> result, Realm realm);\n}", "@Override\n public void messageReceived(IoSession session, Object message) throws Exception {\n Packet pacchetto = null;\n try {\n pacchetto = (Packet) message;\n } catch (Exception ex) {\n System.out.println(\"EXCEPTION Pacchetto non riconosciuto\");\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof RegistrationCVRequest) {\n RegistrationCVRequest req = (RegistrationCVRequest) pacchetto;\n try {\n session.write(new RegistrationCVResponse(db.insertCV(req.getCv())));\n } catch (Exception ex) {\n session.write(new RegistrationCVResponse(false));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof RegistrationVaccinatedRequest) {\n RegistrationVaccinatedRequest req = (RegistrationVaccinatedRequest) pacchetto;\n Vaccinazione v = req.getVaccinazione();\n String codVaccinazione;\n try {\n codVaccinazione = db.insertVaccination(v);\n } catch (Exception ex) {\n codVaccinazione = null;\n }\n RegistrationVaccinatedResponse response;\n if (codVaccinazione == null) {\n response = new RegistrationVaccinatedResponse(false, null);\n session.write(response);\n }\n else {\n response = new RegistrationVaccinatedResponse(true, Prettier.makeReadable(codVaccinazione));\n session.write(response);\n //Invio mail di conferma\n String email = req.getVaccinazione().getVaccinato().getEmail();\n if (email != null && !email.equals(\"\"))\n MailHelper.sendEmail(email, \"ID VACCINAZIONE PER \" + v.getVaccinato().getCodiceFiscale(), \"ID VACCINAZIONE: \" + Prettier.makeReadable(codVaccinazione));\n }\n\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof UserRegistrationRequest) {\n UserRegistrationRequest req = (UserRegistrationRequest) pacchetto;\n UserRegistrationResponse response;\n try {\n boolean esito = db.registerUser(req.getVaccinato(), Prettier.normalizeKey(req.getKey()));\n if (esito) setClientAuthenticated(session, req.getVaccinato().getCodiceFiscale());\n response = new UserRegistrationResponse(esito);\n } catch (Exception ex) {\n response = new UserRegistrationResponse(false);\n }\n session.write(response);\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof UserLoginRequest) {\n UserLoginRequest req = (UserLoginRequest) pacchetto;\n try {\n Vaccinato v = db.login(req.getUsername(), req.getPassword());\n if (v != null) {\n session.write(new UserLoginResponse(true, v));\n setClientAuthenticated(session, v.getCodiceFiscale());\n } else session.write(new UserLoginResponse(false));\n } catch (Exception ex) {\n session.write(new UserLoginResponse(false));\n }\n return;\n }\n /* OPERAZIONE VINCOLATA A LOGIN */\n if (pacchetto instanceof RegistrationEVRequest) {\n if (!isClientAuthenticated(session)) {\n session.write(new RegistrationEVResponse(false));\n return;\n }\n RegistrationEVRequest req = (RegistrationEVRequest) pacchetto;\n RegistrationEVResponse response;\n try {\n boolean esito = db.insertEvent(req.getEventoAvverso(), getAuthVaccinated(session));\n response = new RegistrationEVResponse(esito);\n } catch (Exception ex) {\n response = new RegistrationEVResponse(false);\n }\n session.write(response);\n return;\n }\n if(pacchetto instanceof UserDisconnectRequest){\n session.write(new UserDisconnectResponse(resetClientAuthenticated(session)));\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetCVByNameRequest) {\n GetCVByNameRequest req = (GetCVByNameRequest) pacchetto;\n List<CentroVaccinale> list = null;\n boolean esito = false;\n try {\n list = db.getCV(req.getNome());\n esito = true;\n } catch (Exception ignored) {\n } finally {\n session.write(new GetCVResponse(esito, list));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetCVByMunicipalityTypologyRequest) {\n GetCVByMunicipalityTypologyRequest req = (GetCVByMunicipalityTypologyRequest) pacchetto;\n List<CentroVaccinale> list = null;\n boolean esito = false;\n try {\n list = db.getCV(req.getMunicipality(), req.getTypology());\n esito = true;\n } catch (Exception ignored) {\n } finally {\n session.write(new GetCVResponse(esito, list));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetAllCVRequest) {\n GetAllCVRequest req = (GetAllCVRequest) pacchetto;\n List<CentroVaccinale> list = null;\n boolean esito = false;\n try {\n list = db.getCV();\n esito = true;\n } catch (Exception ignored) {\n } finally {\n session.write(new GetCVResponse(esito, list));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetVaccinationByKeyRequest) {\n GetVaccinationByKeyRequest req = (GetVaccinationByKeyRequest) pacchetto;\n try {\n Vaccinazione vaccinazione = db.getVaccinationById(Prettier.normalizeKey(req.getKey()));\n if (vaccinazione != null)\n session.write(new GetVaccinationByKeyResponse(true, vaccinazione));\n else\n session.write(new GetVaccinationByKeyResponse(false, null));\n } catch (Exception sqlexcp) {\n session.write(new GetVaccinationByKeyResponse(false, null));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetVaccinesRequest) {\n try {\n session.write(new GetVaccinesResponse(true, db.getVaccines()));\n } catch (Exception excp) {\n session.write(new GetVaccinesResponse(false, null));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetEVTypologiesRequest) {\n try {\n session.write(new GetEvTypologiesResponse(true, db.getEventTypes()));\n } catch (Exception excp) {\n session.write(new GetEvTypologiesResponse(false, null));\n }\n return;\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof GetReportRequest) {\n GetReportRequest req = (GetReportRequest) pacchetto;\n try {\n session.write(new GetReportResponse(true, db.generateReport(req.getCv())));\n } catch (Exception excp) {\n session.write(new GetReportResponse(false, null));\n }\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof CheckUserIdRequest) {\n try {\n session.write(new CheckUserIdResponse(db.checkUserIdExists(((CheckUserIdRequest) pacchetto).getUserId())));\n } catch (Exception excp) {\n session.write(new CheckUserIdResponse(false));\n }\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof CheckEmailRequest) {\n try {\n session.write(new CheckEmailResponse(db.checkEmailExists(((CheckEmailRequest) pacchetto).getEmail())));\n } catch (Exception excp) {\n session.write(new CheckEmailResponse(false));\n }\n }\n /* OPERAZIONE LIBERA */\n if (pacchetto instanceof CheckVaccinatedCVRequest) {\n CentroVaccinale cv = ((CheckVaccinatedCVRequest) pacchetto).getCentroVaccinale();\n try {\n Vaccinazione vaccinazione = db.getLastVaccination(getAuthVaccinated(session));\n session.write(new CheckVaccinatedCVResponse(cv.equals(vaccinazione.getCentroVaccinale())));\n } catch (Exception ex) {\n session.write(new CheckVaccinatedCVResponse(false));\n }\n }\n }", "public interface UserAccountService {\n\n\tpublic final static String BEAN_ID = \"userAccountService\";\n\n\tpublic UserAccount findById(ServiceContext ctx, Long id) throws UserAccountNotFoundException;\n\n\tpublic List<UserAccount> findAll(ServiceContext ctx);\n\n\tpublic UserAccount save(ServiceContext ctx, UserAccount entity);\n\n\tpublic void delete(ServiceContext ctx, UserAccount entity);\n\n}", "public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public interface RegisterInteractor {\n\n void register(String username,String email,String password,String repeatPassoword,OnRegisterFinishedListener listener);\n\n}", "public interface AccountTypeService extends GenericService<AccountType, Long> {\n}", "public interface AccountService {\n void deposit(Account account, double amount);\n\n void withdraw(Account account, double amount) throws NotEnoughFundsException;\n\n void transfer(Account fromAccount, Account toAccount, double amount) throws NotEnoughFundsException;\n\n\n}", "public interface ChatUserService {\n @GET(\"/api/user\")\n Call<ChatUserResponse> user();\n}", "public interface UserAppliedInvitationCodeApi {\n @POST(\"invited/detail\")\n Observable<UserAppliedInvitationCodeBean> userAppliedInvitationCode();\n}", "public interface InstantMsgService {\n\n\tpublic void sendMsg(List<String> receivers,String content,String sendUser);\n\tpublic List<InstantMsg> receiveMsgs(String receiveUser,boolean clean);\n\tpublic boolean hasMsg(String receiveUser);\n\tpublic IBaseDTO receiveMsg(String receiveUser,boolean clean);\n\tpublic List<IBaseDTO> userList();\n}", "public interface AccountGateway extends Gateway {\n Account save(Account account);\n\n void delete(Account account);\n\n Account findAccountByReference(String reference);\n\n List<Account> findAccountsWhereReferenceIn(List<String> references);\n\n List<Account> findAllAccounts();\n\n List<Account> findAccountsMatchingReference(String filterText);\n\n List<Account> findAccountsMatchingName(String filterText);\n\n}", "public interface ProvDomainMgr extends ReqMsgClient\n{\n\n /**\n * Returns the message model type that this domain manager provides. The\n * return value is one of the types defined in\n * {@linkplain com.reuters.rfa.rdm.RDMMsgTypes}.\n * \n * @return the message model type that this domain manager provides.\n */\n short getMsgModelType();\n\n /**\n * Returns the name of service that this domain manager provides.\n * \n * @return the name of service that this domain manager provides.\n */\n String getServiceName();\n\n /**\n * Returns an OMMPool used by this domain manager.\n * \n * @return an OMMPool used by this domain manager.\n */\n OMMPool getPool();\n\n /**\n * Sends an OMM message to a client.\n * \n * @param token the client request token\n * @param encmsg the OMM message to submit\n */\n void submit(Token token, OMMMsg encmsg);\n\n}" ]
[ "0.6756809", "0.6756809", "0.6099323", "0.6099323", "0.5877325", "0.5788913", "0.57066095", "0.5696846", "0.56912255", "0.5632148", "0.55934495", "0.55553114", "0.54836714", "0.5480304", "0.5422708", "0.5420736", "0.53967184", "0.53511053", "0.53511053", "0.53510785", "0.5343276", "0.5338081", "0.5311138", "0.52964604", "0.5291504", "0.52635103", "0.52635103", "0.5259694", "0.52517104", "0.5247428", "0.5243871", "0.5241473", "0.5222938", "0.5214756", "0.5180924", "0.5175264", "0.51561594", "0.515092", "0.51243055", "0.5123629", "0.5109506", "0.51073545", "0.51062703", "0.51048416", "0.5094639", "0.5094341", "0.5090495", "0.5090495", "0.5087292", "0.5085164", "0.5077135", "0.50743866", "0.5069798", "0.5066075", "0.5065997", "0.5057096", "0.5051012", "0.5049774", "0.5041989", "0.50395477", "0.50393677", "0.5033777", "0.502518", "0.50175", "0.5012835", "0.5009716", "0.5004999", "0.5004435", "0.4997775", "0.49974394", "0.49961334", "0.4994559", "0.49896857", "0.49839124", "0.49834186", "0.49828935", "0.49782735", "0.49782735", "0.4976783", "0.4974695", "0.4974223", "0.49715203", "0.49658412", "0.49645132", "0.49613836", "0.49590948", "0.49566054", "0.49559894", "0.49547142", "0.49488202", "0.49456522", "0.49452087", "0.49425527", "0.49381694", "0.49359772", "0.4932098", "0.49307305", "0.49301097", "0.49300292", "0.49243328" ]
0.6389555
2
On create new grouped code list.
public void onCreateNewGroupedCodeList(CreateNewGroupedCodeListEvent event);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ch.crif_online.www.webservices.crifsoapservice.v1_00.FinancialStatement addNewFinancialStatementsGroup();", "public void markCsgListCreate() throws JNCException {\n markLeafCreate(\"csgList\");\n }", "ManageCodeListDetailModel getGroupedCodeList(String key);", "protected void insertCode(SketchCode newCode) {\n ensureExistence();\n\n // add file to the code/codeCount list, resort the list\n //if (codeCount == code.length) {\n code = (SketchCode[]) PApplet.append(code, newCode);\n codeCount++;\n //}\n //code[codeCount++] = newCode;\n }", "private void createGrpClinicSelection() {\n\n\t}", "public void newGroup() {\n addGroup(null, true);\n }", "String getGroupingCode();", "public void setGroupList() {\n \n String path = \".\"; //curent folder\n String files; //files name\n File folder = new File(path); // get the folfer\n File[] listOfFiles = folder.listFiles(); //list of files\n for (int i = 0; i < listOfFiles.length; i++) {//this loop go trough the folder\n if (listOfFiles[i].isFile()) {\n files = listOfFiles[i].getName();\n if (files.endsWith(\".xls\") || files.endsWith(\".XLS\")) {//filter all the xls file\n if(!files.equalsIgnoreCase(\".xls\")){\n // add a new objet CompoundBook in a our xlsBook\n xlsBook.add(new CompoundBook(files));\n //add only the name of the file without the .xls extension\n groups.add(files.substring(0, files.lastIndexOf(\".\")));\n }\n }\n }\n }\n gList.setListData(groups); // set the group List on the GUI\n }", "private void createNewGroup() {\r\n if(selectedNode != null) { \r\n DefaultMutableTreeNode nextNode = (DefaultMutableTreeNode)selectedNode.getNextNode();\r\n if(selectedNode.isLeaf() && !selectedNode.getAllowsChildren()) {\r\n CoeusOptionPane.showInfoDialog(coeusMessageResources.parseMessageKey(\"maintainSponsorHierarchy_exceptionCode.1254\"));\r\n return;\r\n } else if(selTreePath.getPathCount() == 10) {\r\n CoeusOptionPane.showInfoDialog(coeusMessageResources.parseMessageKey(\"maintainSponsorHierarchy_exceptionCode.1255\"));\r\n return;\r\n }else if (nextNode != null && nextNode.isLeaf()) {\r\n CoeusOptionPane.showInfoDialog(\"The group '\"+selectedNode.toString()+\"' has sponsors assigned to it. \\nCannot create subgroups for this group.\");\r\n return;\r\n }else {\r\n nextNode = new DefaultMutableTreeNode(\"New Group - \"+(selectedNode.getLevel()+1)+\".\"+selectedNode.getChildCount(),true);\r\n model.insertNodeInto(nextNode, selectedNode, selectedNode.getChildCount());\r\n TreePath newSelectionPath = selTreePath.pathByAddingChild(nextNode);\r\n sponsorHierarchyTree.clearSelection();\r\n sponsorHierarchyTree.addSelectionPath(newSelectionPath);\r\n sponsorHierarchyTree.startEditingAtPath(newSelectionPath);\r\n newGroup = true;\r\n saveRequired = true;\r\n }\r\n }\r\n }", "public void setGroupcode(java.lang.Integer newGroup) {\n\tgroupcode = newGroup;\n}", "public void saveGroups() {\n String listOfCodes = \"\";\n for (Pair<String, Group> groupPair : savedGroups) {\n listOfCodes += \",\" + groupPair.first + \"|\" + groupPair.second.getCode();\n }\n prefs.setString(\"listOfCode\", listOfCodes);\n }", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak addNewCodeBreak();", "public void createGroup() {\n\t\tString name = JOptionPane\n\t\t\t\t.showInputDialog(\"Please Enter a new group name:\");\n\t\tif (name.equals(\"\"))\n\t\t\treturn;\n\n\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent();\n\t\tEllowFile pfile = (EllowFile) node.getUserObject(), file;\n\t\tif (pfile.isDirectory()) {\n\t\t\tfile = new EllowFile(pfile.getAbsolutePath() + \"\\\\\\\\\" + name);\n\t\t\tfile.mkdirs();\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t} else {\n\t\t\tfile = new EllowFile(pfile.getParent() + \"\\\\\\\\\" + name);\n\t\t\tfile.mkdirs();\n\t\t\tnode = ((DefaultMutableTreeNode) node.getParent());\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\n\t\t\tnode.getChildCount());\n\t\t}\n\t\tfile.parentProject = pfile.parentProject;\n\t\tpfile.parentProject.rebuild();\n\t\tmodel.nodeChanged(root);\n\t}", "public void actionPerformed(ActionEvent e) {\n String filename = JOptionPane.showInputDialog(null, \"Create a new group : \", \"Add a new coumpond\", 1);\n \n if (filename != null) {\n JOptionPane.showMessageDialog(null, \"You created the group : \" + filename, \"File created\", 1);\n //Create a new .xls file\n File file = new File(filename + \".xls\");\n CompoundBook.initEmptySheet(filename+\".xls\", 9);\n CompoundBook book = new CompoundBook(filename+\".xls\");\n //add the new group our xlsBook (objec) and the group list \n xlsBook.add(book); \n groups.add(filename);\n gList.setListData(groups);\n /*\n * To actually create a file specified by a\n * pathname, use boolean createNewFile() method of\n * Java File class.\n *\n * This method creates a new empty file specified if\n * the file with same name does not exists.\n *\n * This method returns true if the file with the\n * same name did not exist and it was created\n * successfully, false otherwise.\n */\n\n boolean blnCreated = false;\n try {\n blnCreated = file.createNewFile();\n } catch (IOException ioe) {\n System.out.println(\"Error while creating a new empty file :\" + ioe);\n }\n if (blnCreated) {\n JOptionPane.showMessageDialog(null, \"You created the file: \" + filename+\".xls\",\n \"Roseindia.net\", 1);\n }\n /*\n * If you run the same program 2 times, first time\n * it should return true. But when we run it second\n * time, it returns false because file was already\n * exist.\n */\n //System.out.println(\"Was file \" + file.getPath() + \" created ? : \" + blnCreated);\n\n }\n \n \n \n gAddActionPerformed(e);\n }", "@Override\n protected boolean createKeys(List<Object> list) {\n\n try {\n SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase();\n \n if (Objects.equals(CasePreferences.getGroupItemsInTreeByDataSource(), true)) {\n List<DataSource> dataSources = tskCase.getDataSources();\n \n Collections.sort(dataSources, new Comparator<DataSource>() {\n @Override\n public int compare(DataSource dataS1, DataSource dataS2) {\n String dataS1Name = dataS1.getName().toLowerCase();\n String dataS2Name = dataS2.getName().toLowerCase();\n return dataS1Name.compareTo(dataS2Name);\n }\n });\n \n List<DataSourceGrouping> keys = new ArrayList<>();\n dataSources.forEach((datasource) -> {\n keys.add(new DataSourceGrouping(datasource));\n });\n list.addAll(keys);\n \n list.add(new Reports());\n } else {\n List<AutopsyVisitableItem> keys = new ArrayList<>(Arrays.asList(\n new DataSources(),\n new Views(tskCase),\n new Results(tskCase),\n new Tags(),\n new Reports()));\n\n list.addAll(keys);\n }\n\n } catch (TskCoreException tskCoreException) {\n logger.log(Level.SEVERE, \"Error getting datas sources list from the database.\", tskCoreException);\n } catch (NoCurrentCaseException ex) {\n logger.log(Level.SEVERE, \"Exception while getting open case.\", ex); //NON-NLS\n }\n return true;\n }", "public void onGroupSelection(){\n getTimeList().clear();\n CycleTimeBean ctb = new CycleTimeBean();\n ctb.setGroupName(groupName);\n ctb.setCatName(catName);\n getTimeList().add(ctb);\n }", "public void addcode(String code){//להחליף את סטרינג למחלקה קוד או מזהה מספרי של קוד\r\n mycods.add(code);\r\n }", "private void setUpGroupBy(){\n\t\tEPPropiedad pro = new EPPropiedad();\n\t\tpro.setNombre(\"a1.p2\");\n\t\tpro.setPseudonombre(\"\");\n\t\texpresionesGroupBy.add(pro);\n\t\tpro = new EPPropiedad();\n\t\tpro.setNombre(\"a1.p3\");\n\t\tpro.setPseudonombre(\"\");\n\t\texpresionesGroupBy.add(pro);\n\t}", "public void create(ActionEvent actionEvent) {\n String grName = groupName.getText();\n ObservableList memList = addList.getCheckModel().getCheckedItems();\n\n if (memList == null) return;\n\n String memName = \"\";\n for (Object obj : memList ) {\n memName += obj.toString() + \"\\n\";\n }\n if (memName != \"\") {\n sender.requestNewGroup(grName, memName);\n chatUIController.newGr(grName);\n }\n return;\n }", "private void createClinicList(){\n\n ArrayList<Clinic> clinics = LogIn.clinicDAO.getAllClinics();\n for(Clinic cn : clinics){\n double avgRating = LogIn.rateDAO.getAvgRating(cn.getClinicID());\n clinicList.add(new ClinicItem(cn.getClinicName(), drawable.clinic_logo, \"Singapore\", Double.toString(avgRating)));\n }\n }", "void insert(LoanApplication icLoanApplication) {\n\t\tgroup.add(icLoanApplication);\n\t\t\n\t}", "public void getGroups() {\n String listOfCode = prefs.getString(\"listOfCode\");\n if (!listOfCode.isEmpty()) {\n for (String groupPair : listOfCode.split(\",\"))\n if (!groupPair.isEmpty()) {\n final String nickname = groupPair.substring(0, groupPair.indexOf('|'));\n String code = groupPair.substring(groupPair.indexOf('|') + 1);\n ServerAPI.groupInformation(code, new RequestHandler<Group>() {\n @Override\n public void callback(Group result) {\n if (result == null) {\n return;\n }\n savedGroups.add(new Pair<String, Group>(nickname, result));\n populateListView();\n }\n });\n }\n }\n }", "public void generateCodeItemCode() {\n\t\tcodeItem.generateCodeItemCode();\n\t}", "private void createNewListSection() {\n\t\tImageIcon image10 = new ImageIcon(sURLFCL1);\n\t\tImageIcon image11 = new ImageIcon(sURLFCL2);\n\t\tImageIcon image12 = new ImageIcon(sURLFCL3);\n\t\tjbCreateLists = new JButton(\"New PlayList\");\n\t\tjbCreateLists.setFont(new java.awt.Font(\"Century Gothic\",0, 15));\n\t\tjbCreateLists.setForeground(new Color(150,100,100));\n\t\tjbCreateLists.setIcon(image10);\n\t\tjbCreateLists.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tjbCreateLists.setVerticalTextPosition(SwingConstants.CENTER);\n\t\tjbCreateLists.setRolloverIcon(image11);\n\t\tjbCreateLists.setRolloverSelectedIcon(image12);\t\n\t\tjbCreateLists.setContentAreaFilled(false);\n\t\tjbCreateLists.setFocusable(false);\n\t\tjbCreateLists.setBorderPainted(false);\n\t}", "public static GroupList newInstance() {\n\t\tGroupList f = new GroupList();\n\t\tBundle b = new Bundle();\n\t\tf.setArguments(b);\n\t\treturn f;\n\t}", "private void newGroup()\n\t{\n\t\t// There is no need anymore to take care of the meta-data.\n\t\t// That is done once in DenormaliserMeta.getFields()\n\t\t//\n data.targetResult = new Object[meta.getDenormaliserTargetFields().length];\n \n for (int i=0;i<meta.getDenormaliserTargetFields().length;i++)\n {\n data.targetResult[i] = null;\n\n data.counters[i]=0L; // set to 0\n data.sum[i]=null;\n }\n\t}", "GroupsType createGroupsType();", "public void genLists() {\n\t}", "private static void insertOneGroupEntry(Cursor groupCursor, ArrayList<GroupInfo> groupList, Context context) {\n String title = groupCursor.getString(COL_TITLE);\n String titleDisplay = \"\";\n titleDisplay = title;\n\n GroupInfo pinfo = new GroupInfo();\n pinfo.groupId = -1;\n pinfo.title = title;\n pinfo.titleDisplay = titleDisplay;\n groupList.add(pinfo);\n }", "public com.walgreens.rxit.ch.cda.CE addNewEthnicGroupCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.CE target = null;\n target = (com.walgreens.rxit.ch.cda.CE)get_store().add_element_user(ETHNICGROUPCODE$20);\n return target;\n }\n }", "private List<Expression<?>> constructGroupBy(CriteriaBuilderImpl cb, AbstractQuery<?> q, Tree groupByDef) {\n \t\tfinal List<Expression<?>> groupBy = Lists.newArrayList();\n \n \t\tfor (int i = 0; i < groupByDef.getChildCount(); i++) {\n \t\t\tgroupBy.add(this.getExpression(cb, q, groupByDef.getChild(i), null));\n \t\t}\n \n \t\treturn groupBy;\n \t}", "protected abstract void createItemsForAddedObjects(Layout layout,\r\n boolean doLayout);", "private static void buildList() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (connection == null || connection.isClosed()) \r\n\t\t\t\tconnection = DataSourceManager.getConnection();\r\n\t\t\t\r\n\t\t\tstatement = connection.prepareStatement(LOAD_ALL);\r\n\t \tresultset = statement.executeQuery();\r\n\t \t\r\n\t \tgroups = getCollectionFromResultSet(resultset);\r\n\t \tresultset.close();\r\n\t statement.close();\r\n\t\t\t\r\n\t\t} catch (ClassNotFoundException | SQLException e) {\r\n\t\t\tlog.fatal(e.toString());\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t}", "public static List<ActionGroupCode> getActionGroupCodeList() {\n\n\t\tSession session = HibernateUtil.getSession();\n\t\tList<ActionGroupCode> list;\n\t\ttry {\n\t\t\tsession.beginTransaction();\n\n\t\t\tCriteria criteria = session.createCriteria(ActionGroupCode.class);\n\t\t\tcriteria.addOrder(Order.asc(\"id\"));\n\t\t\tlist = (List<ActionGroupCode>) criteria.list();\n\t\t\tsession.getTransaction().commit();\n\n\t\t\treturn list;\n\t\t} catch (Exception e) {\n\t\t\tsession.getTransaction().rollback();\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\n\t}", "public org.hl7.fhir.CodeableConcept addNewCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().add_element_user(CODE$6);\n return target;\n }\n }", "public void allocateGroupId(){\n\t\trecords.add(new pair(this.groupname,currentId));\n\t\tthis.groupid = currentId;\n\t\tcurrentId++;\n\t\tConnection c = null;\n\t\tStatement stmt = null;\n\t\ttry{\n\t\t\tSystem.out.println(\"group setup\");\n\t\t\tSystem.out.println(this.groupid);\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tc = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/ifoundclassmate\");\n\t\t\tc.setAutoCommit(false);\n\t\t\tstmt = c.createStatement();\n\t\t\tString sql = \"INSERT INTO GROUPS (GROUPID,GROUPNAME,DESCRIPTION) \"+\n\t\t\t\t\t\"VALUES (\" + this.groupid + \", \" + \"'\" +this.groupname + \"'\"\n\t\t\t\t\t+\" , \" + \"'\" + this.description + \"' \" + \");\" ;\n\t\t\tstmt.executeUpdate(sql);\n\t\t\t\n\t\t\tstmt.close();\n\t\t\tc.commit();\n\t\t\tc.close();\n\t\t} catch (Exception e ){\n\t\t\tSystem.out.println(e.getClass().getName() + e.getMessage() );\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}", "public void createListData()\n {\n List<SinhVien> listSinhvien=new ArrayList<>();\n for(int i=0;i<10;i++){\n SinhVien sv=new SinhVien(i+\"\",\"123\",\"0123\",i+1.0f);\n listSinhvien.add(sv);\n }\n PresenterImplDangXuat.onLoadSucess(listSinhvien);\n }", "@FXML\n\tprivate void createGroup(ActionEvent event){\n\t\tif(subgroup_menu.getValue().equals(\"--- INGEN ---\")){\n\t\t\tif(GroupName_field.getText().equals(\"\")){\n\t\t\t\tmakeDialog(\"Du må gi gruppen et navn.\");\n\t\t\t} else {\n\t\t\t\tDatabaseInterface db = new DatabaseInterface();\n\t\t\t\tdb.setGroup(GroupName_field.getText(), findInvited());\n\t\t\t\tStage stage = (Stage) create_btn.getScene().getWindow();\n\t\t\t stage.close();\n\t\t\t}\n\t//-------This kicks in if a user chose a group in the dropdown menu-----\\\\\n\t\t} else {\n\t\t\tif(GroupName_field.getText().equals(\"\")){\n\t\t\t\tmakeDialog(\"Du må gi gruppen et navn.\");\n\t\t\t} else {\n\t\t\t\tDatabaseInterface db = new DatabaseInterface();\n\t\t\t\tString supergroup_name = (String) subgroup_menu.getValue();\n\t\t\t\tint SubGroupId = db.setGroup(GroupName_field.getText(), findInvited()).getGroup_id();\n\t\t\t\tint SuperGroupId = getSupergroupID(supergroup_name);\n\t\t\t\tdb.setSubGroup(SuperGroupId, SubGroupId);\n\t\t\t\tStage stage = (Stage) create_btn.getScene().getWindow();\n\t\t\t stage.close();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void createGrpDateInfo() {\n\n\t\tgrpDateInfo = new Group(getShell(), SWT.NONE);\n\t\tgrpDateInfo.setBounds(new org.eclipse.swt.graphics.Rectangle(160, 180,\n\t\t\t\t280, 100));\n\n\t\tlblInstructions = new Label(grpDateInfo, SWT.NONE);\n\t\tlblInstructions.setBounds(new org.eclipse.swt.graphics.Rectangle(60,\n\t\t\t\t20, 160, 20));\n\t\tlblInstructions.setText(\"Select a Month and Year:\");\n\t\tlblInstructions.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\n\t\tcmbMonth = new CCombo(grpDateInfo, SWT.BORDER);\n\t\tcmbMonth.setBounds(new org.eclipse.swt.graphics.Rectangle(40, 50, 100,\n\t\t\t\t20));\n\t\tcmbMonth.setEditable(false);\n\t\tcmbMonth.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tString qs[] = { \"Quarter 1\", \"Quarter 2\", \"Quarter 3\", \"Quarter 4\" };\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tthis.cmbMonth.add(qs[i]);\n\t\t}\n\n\t\tint intMonth = 1;\n\t\tcmbMonth.setText(\"Quarter \" + intMonth);\n\t\tcmbMonth.setEditable(false);\n\t\tcmbMonth.setBackground(ResourceUtils.getColor(iDartColor.WHITE));\n\t\tcmbMonth.setVisibleItemCount(4);\n\n\t\t// cmdYear\n\t\tcmbYear = new CCombo(grpDateInfo, SWT.BORDER);\n\t\tcmbYear.setBounds(new org.eclipse.swt.graphics.Rectangle(160, 50, 80,\n\t\t\t\t20));\n\t\tcmbYear.setEditable(false);\n\t\tcmbYear.setBackground(ResourceUtils.getColor(iDartColor.WHITE));\n\t\tcmbYear.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\n\t\t// get the current date12\n\t\tCalendar rightNow = Calendar.getInstance();\n\t\tint currentYear = rightNow.get(Calendar.YEAR);\n\t\tfor (int i = currentYear - 2; i <= currentYear + 1; i++) {\n\t\t\tthis.cmbYear.add(Integer.toString(i));\n\t\t}\n\t\tcmbYear.setText(String.valueOf(Calendar.getInstance()\n\t\t\t\t.get(Calendar.YEAR)));\n\n\t}", "@Before(value = \"@createList\", order = 1)\n public void createList() {\n String endpoint = EnvironmentTrello.getInstance().getBaseUrl() + \"/lists/\";\n JSONObject json = new JSONObject();\n json.put(\"name\", \"testList\");\n json.put(\"idBoard\", context.getDataCollection(\"board\").get(\"id\"));\n RequestManager.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n Response response = RequestManager.post(endpoint, json.toString());\n context.saveDataCollection(\"list\", response.jsonPath().getMap(\"\"));\n }", "public CreateGroup() {\n initComponents();\n start();\n }", "protected int createGroup() {\n\t\tint id = _motherGroupID + 1;\n\t\twhile (_soundNodes.containsKey(id)) { id++; }\n\t\tcreateGroup(id);\n\t\treturn id;\n\t}", "private static void DoGroupBy()\n\t{\n\n\t\tArrayList<Attribute> inAtts = new ArrayList<Attribute>();\n\t\tinAtts.add(new Attribute(\"Int\", \"o_orderkey\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"o_custkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderstatus\"));\n\t\tinAtts.add(new Attribute(\"Float\", \"o_totalprice\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderdate\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderpriority\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_clerk\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"o_shippriority\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Str\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Float\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att4\"));\n\n\t\tArrayList<String> groupingAtts = new ArrayList<String>();\n\t\tgroupingAtts.add(\"o_orderdate\");\n\t\tgroupingAtts.add(\"o_orderstatus\");\n\n\t\tHashMap<String, AggFunc> myAggs = new HashMap<String, AggFunc>();\n\t\tmyAggs.put(\"att1\", new AggFunc(\"none\",\n\t\t\t\t\"Str(\\\"status: \\\") + o_orderstatus\"));\n\t\tmyAggs.put(\"att2\", new AggFunc(\"none\", \"Str(\\\"date: \\\") + o_orderdate\"));\n\t\tmyAggs.put(\"att3\", new AggFunc(\"avg\", \"o_totalprice * Int (100)\"));\n\t\tmyAggs.put(\"att4\", new AggFunc(\"sum\", \"Int (1)\"));\n\n\t\t// run the selection operation\n\t\ttry\n\t\t{\n\t\t\tnew Grouping(inAtts, outAtts, groupingAtts, myAggs, \"orders.tbl\", \"out.tbl\", \"g++\", \"cppDir/\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "private void createGroupCommand(Command root){\n\t\tif(codeReader.hasNext(END_GROUP))\n\t\t\tthrow new SLogoException(\"No arguments specified in grouping.\");\n\t\twhile(!codeReader.hasNext(END_GROUP)) {\n\t\t\ttry {\n\t\t\t\thandleSpecialCases(root);\n\t\t\t\tString s = codeReader.next();\n\t\t\t\troot.addChild(parseCommand(s));\n\t\t\t}\n\t\t\tcatch(NoSuchElementException n) {\n\t\t\t\tthrow new SLogoException(\"Unclosed Parenthesis.\");\n\t\t\t}\n\t\t}\n\t\tcodeReader.next();\n\t}", "@Override\r\n\tpublic void addProductGroup() {\r\n\t\tString newProductGroupName = getView().getProductGroupName();\r\n\t\tString supplyValue = getView().getSupplyValue();\r\n\t\tSizeUnits supplyUnit = getView().getSupplyUnit();\r\n\t\t\r\n\t\tProductGroup pg = new ProductGroup();\r\n\t\tpg.setName(newProductGroupName);\r\n\t\tUnitSize threeMounthSup = null;\r\n\t\ttry {\r\n\t\t\tthreeMounthSup = new UnitSize(supplyValue, supplyUnit.toString() );\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"fail in addProductGroupController\");\r\n\t\t}\r\n\t\t\r\n\t\tpg.setThreeMonthSup(threeMounthSup);\r\n\t\t\r\n\t\tpg.setContainer(_parent);\r\n\t\t\r\n\t\t_productGroupFacade.addProductGroup(pg);\r\n\t\t\r\n\t\tPersistor persistor = Configuration.getInstance().getPersistor();\r\n\t\tpersistor.insertProductContainer(pg);\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tResult createGroup = mFacePlus.createGroup(groupname.getText().toString(), groupname.getText().toString(), null);\n\t\t\t\tif(createGroup.type == Result.TYPE.FAILED){\n\t\t\t\t\tDebug.debug(TAG, \"err msg = \" + createGroup.data);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tGroup group = (Group) createGroup.data;\n\t\t\t\tLog.e(TAG,\"groupid = \"+group.getId());\n\t\t\t\tLog.e(TAG,group.toString());\n\t\t\t}", "@Override\n public void onGroupCreated(final String nickname, final String username) {\n final Context context = this;\n ServerAPI.createGroup(new RequestHandler<Group>() {\n @Override\n public void callback(final Group created) {\n if (created.getCode() != null) {\n ServerAPI.joinGroup(created.getCode(), username, prefs.getDeviceID(), new RequestHandler<Group>() {\n @Override\n public void callback(Group joined) {\n savedGroups.add(new Pair<String, Group>(nickname, joined));\n populateListView();\n saveGroups();//Save list to the SharedPreferences\n }\n });\n }\n }\n });\n }", "public SelectGroupDlg(Dialog parent, Vector list, boolean add) {\n super(parent,\"Choix du groupe à \"+DConst.BUT_ADD);\n _list= list;\n //_parent = parent;\n _sectionMod = (SectionModifDlg)parent;\n //_addGroup = add;\n if(add)\n jbInitAddGroup();\n else\n jbInitRemGroup();\n\n }", "Group(String name) {\n this(name, new ArrayList<>());\n }", "public void addToCode(String code){\r\n\t\tiCode+=getTabs()+code+\"\\n\";\r\n\t}", "private void buildGroups() {\n if(groups.size() == 1){\n Group aGroup = groups.get(0);\n for (Team team : teams) {\n aGroup.add(team);\n }\n return;\n }\n\n for (Team team : teams) {\n groups.get(getIndex()).add(team);\n }\n }", "public void setCreatedGroups(List<Group> createdGroups) {\n this.createdGroups = createdGroups;\n }", "PersonGroupListAdapter() {\n personGroupIdList = new ArrayList<>();\n\n Set<String> personGroupIds\n = StorageHelper.getAllPersonGroupIds(MainActivity.this);\n\n for (String personGroupId: personGroupIds) {\n personGroupIdList.add(personGroupId);\n if (mPersonGroupId != null && personGroupId.equals(mPersonGroupId)) {\n personGroupIdList.set(\n personGroupIdList.size() - 1,\n mPersonGroupListAdapter.personGroupIdList.get(0));\n mPersonGroupListAdapter.personGroupIdList.set(0, personGroupId);\n }\n }\n }", "@Override\n public void Mesibo_onGroupCreated(MesiboProfile profile) {\n toast(\"New Group Created: \" + profile.getName());\n addGroupMembers(profile);\n }", "public void genCode(CodeFile code) {\n\t\t\n\t}", "CodeSetType createCodeSetType();", "public static JSGroup newJSGroup(final int methodType) {\n final JSGroup group =\n (JSGroup)JSFactory.getFactory()\n .newValue(JSTypes.typeJSGroup);\n\n group.setProperty(JSPropertyNames.prodId, prodId);\n\n if ((methodType > ScheduleMethods.methodTypeNone) &&\n (methodType < ScheduleMethods.methodTypeUnknown)) {\n group.setProperty(JSPropertyNames.method,\n ScheduleMethods.methods[methodType]);\n }\n\n return group;\n }", "private void addProcedureCustomData(IacucProtocolStudyGroupBean selectedIacucProtocolStudyGroupBean, \n List<IacucProtocolStudyGroup> newStudyGroups, IacucProtocol protocol) {\n List<IacucProcedureCategoryCustomData> procedureCustomDataList = getIacucProcedureCustomData(selectedIacucProtocolStudyGroupBean.getProcedureCategoryCode());\n for(IacucProtocolStudyGroup iacucProtocolStudyGroup : newStudyGroups) {\n List<IacucProtocolStudyCustomData> protocolStudyCustomDataList = new ArrayList<IacucProtocolStudyCustomData>();\n for(IacucProcedureCategoryCustomData procedureCategoryCustomData : procedureCustomDataList) {\n if(procedureCategoryCustomData.isActive()) {\n IacucProtocolStudyCustomData newIacucProtocolStudyCustomData = new IacucProtocolStudyCustomData();\n newIacucProtocolStudyCustomData.setProcedureCustomAttributeId(procedureCategoryCustomData.getId());\n newIacucProtocolStudyCustomData.setIacucProcedureCategoryCustomData(procedureCategoryCustomData);\n protocolStudyCustomDataList.add(newIacucProtocolStudyCustomData);\n }\n }\n iacucProtocolStudyGroup.getIacucProtocolStudyCustomDataList().addAll(protocolStudyCustomDataList);\n }\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.FinancialStatement insertNewFinancialStatementsGroup(int i);", "OperandListGroup createOperandListGroup();", "GroupType createGroupType();", "GroupType createGroupType();", "private void populateListView() {\n List<String> groupNames = new ArrayList<String>();\n for (Pair<String, Group> pair : savedGroups) {\n groupNames.add(pair.first);\n }\n if (groupsListAdapter != null) {\n groupsListAdapter.clear();\n groupsListAdapter.addAll(groupNames);\n groupsListAdapter.notifyDataSetChanged();\n }\n }", "SectionList createSectionList();", "private List<OptionBean> populateView(HttpServletRequest request) {\n List<OptionBean> groups = new ArrayList<OptionBean>();\n for (SecurityGroup group : securityManager.getAllGroups()) {\n groups.add(new OptionBean(group.getName(), group.getId()));\n }\n\n Collections.sort(groups);\n request.setAttribute(\"groups\", groups);\n\n return groups;\n }", "@Override\n\tpublic void createVmList(int brockerId) {\n\t}", "public com.walgreens.rxit.ch.cda.StrucDocColgroup addNewColgroup()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocColgroup target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocColgroup)get_store().add_element_user(COLGROUP$4);\n return target;\n }\n }", "@Override\n protected void onCreate(KeyList<Ujo> list, InnerDataStore<Ujo> innerData) throws IllegalStateException {\n final Set<String> set = new HashSet<>(list.size());\n for (Key<Ujo,?> key : list) {\n final boolean unique = set.add(key.getName());\n Assert.isTrue(unique, \"The key name is not unique: {}\", key);\n }\n }", "public void handleNewCode() {\n // make sure the user didn't hide the sketch folder\n ensureExistence();\n\n // if read-only, give an error\n if (isReadOnly()) {\n // if the files are read-only, need to first do a \"save as\".\n Base.showMessage(_(\"Sketch is Read-Only\"),\n _(\"Some files are marked \\\"read-only\\\", so you'll\\n\" +\n \"need to re-save the sketch in another location,\\n\" +\n \"and try again.\"));\n return;\n }\n\n renamingCode = false;\n editor.status.edit(_(\"Name for new file:\"), \"\");\n }", "private void createGroup(View view) {\r\n\r\n // Creates necessary elements of the dialog with input limit of length 30\r\n final int MAX_LENGTH = 30;\r\n AlertDialog.Builder dialogGroup = new AlertDialog.Builder(getActivity());\r\n dialogGroup.setTitle(\"Create group\");\r\n final EditText editGroupName = new EditText(getActivity());\r\n editGroupName.setHint(\"Group name\");\r\n editGroupName.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);\r\n InputFilter[] FilterArray = new InputFilter[1];\r\n FilterArray[0] = new InputFilter.LengthFilter(MAX_LENGTH);\r\n editGroupName.setFilters(FilterArray);\r\n\r\n // Creates padding for the dialog (for aesthetic)\r\n final int AMOUNT_PADDING = 20;\r\n editGroupName.setSingleLine();\r\n FrameLayout container = new FrameLayout(getActivity());\r\n FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);\r\n params.topMargin = convertDpToPx(AMOUNT_PADDING);\r\n params.bottomMargin = convertDpToPx(AMOUNT_PADDING);\r\n params.leftMargin = convertDpToPx(AMOUNT_PADDING);\r\n params.rightMargin = convertDpToPx(AMOUNT_PADDING);\r\n editGroupName.setLayoutParams(params);\r\n container.addView(editGroupName);\r\n\r\n dialogGroup.setView(container);\r\n\r\n // Create group in database if they click \"create\"\r\n dialogGroup.setPositiveButton(\"Create\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n groupName = editGroupName.getText().toString().trim();\r\n\r\n AsyncHttpClient client = new AsyncHttpClient();\r\n\r\n JSONObject group;\r\n StringEntity entity;\r\n try {\r\n group = new JSONObject();\r\n group.put(\"action\", \"create\");\r\n group.put(\"groupName\", groupName);\r\n group.put(\"owner\", currentUser);\r\n entity = new StringEntity(group.toString(), \"UTF-8\");\r\n }\r\n catch (JSONException e) {\r\n throw new IllegalArgumentException(\"unexpected error\", e);\r\n }\r\n\r\n client.post(getActivity().getApplicationContext(), myURL, entity, \"application/json\", new AsyncHttpResponseHandler() {\r\n @Override\r\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\r\n int duration = Toast.LENGTH_SHORT;\r\n CharSequence message = \"Success!\";\r\n Toast.makeText(getActivity().getApplicationContext(), message, duration).show();\r\n\r\n // Refresh page so that it updates when you create group\r\n FragmentTransaction ft = getFragmentManager().beginTransaction();\r\n ft.detach(GroupsFragment.this).attach(GroupsFragment.this).commit();\r\n }\r\n\r\n @Override\r\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\r\n int duration = Toast.LENGTH_SHORT;\r\n CharSequence text;\r\n\r\n if (statusCode == 400) {\r\n text = \"Invalid group\";\r\n }\r\n else {\r\n text = \"Error \" + statusCode + \": \" + error;\r\n }\r\n Toast.makeText(getActivity().getApplicationContext(), text, duration).show();\r\n }\r\n });\r\n }\r\n });\r\n\r\n dialogGroup.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.cancel();\r\n }\r\n });\r\n\r\n dialogGroup.show();\r\n }", "public com.ext.portlet.model.ModelInputGroup create(long modelInputGroupPK);", "SaveUpdateCodeListResult saveorUpdateGroupedCodeList(ManageCodeListDetailModel currentDetails) throws CodeListNotUniqueException,\n\tCodeListOidNotUniqueException, InvalidLastModifiedDateException, ValueSetLastModifiedDateNotUniqueException;", "public GroupCreateBean() {\n\t\tsuper();\n\t\tthis.initializeNumbers();\t\t\n\t}", "private void createStationList(View view) {\n List<ByLineListContainer> lineItems = new ArrayList<>();\n final List<Line> lineVals = Lines.getInstance().values();\n for (Line line : lineVals) {\n ByLineListContainer newLineItem = new ByLineListContainer();\n newLineItem.lineColor = line;\n newLineItem.lineName = line.getLineName();\n lineItems.add(newLineItem);\n }\n //Create adapter\n ByListListAdapter adapter = new ByListListAdapter(getActivity(), 0, lineItems);\n GridView lineList = (GridView) view.findViewById(R.id.byLineList);\n\n //Set adapter\n lineList.setAdapter(adapter);\n }", "private void createRpBlockConsistencyGroups() {\n DbClient dbClient = this.getDbClient();\n List<URI> protectionSetURIs = dbClient.queryByType(ProtectionSet.class, false);\n\n Iterator<ProtectionSet> protectionSets =\n dbClient.queryIterativeObjects(ProtectionSet.class, protectionSetURIs);\n\n while (protectionSets.hasNext()) {\n ProtectionSet ps = protectionSets.next();\n Project project = dbClient.queryObject(Project.class, ps.getProject());\n\n BlockConsistencyGroup cg = new BlockConsistencyGroup();\n cg.setId(URIUtil.createId(BlockConsistencyGroup.class));\n cg.setLabel(ps.getLabel());\n cg.setDeviceName(ps.getLabel());\n cg.setType(BlockConsistencyGroup.Types.RP.toString());\n cg.setProject(new NamedURI(project.getId(), project.getLabel()));\n cg.setTenant(project.getTenantOrg());\n\n dbClient.createObject(cg);\n\n log.debug(\"Created ConsistencyGroup (id={}) based on ProtectionSet (id={})\",\n cg.getId().toString(), ps.getId().toString());\n\n // Organize the volumes by replication set\n for (String protectionVolumeID : ps.getVolumes()) {\n URI uri = URI.create(protectionVolumeID);\n Volume protectionVolume = dbClient.queryObject(Volume.class, uri);\n protectionVolume.addConsistencyGroup(cg.getId().toString());\n\n dbClient.persistObject(protectionVolume);\n\n log.debug(\"Volume (id={}) added to ConsistencyGroup (id={})\",\n protectionVolume.getId().toString(), cg.getId().toString());\n }\n }\n }", "Object onToCreate() {\n\t\t_mode = Mode.CREATE;\n\t\t_facilityId = null;\n\t\t_highlightFacilityId = null;\n\t\treturn getListAndEditorZones();\n\t}", "public String addNewProductGroup() {\n\t\tactionStartTime = new Date();\n\t\tresetToken(result);\n\t\tif ((StringUtil.isNullOrEmpty(groupCode) || StringUtil.isNullOrEmpty(groupName)) && maxQuantity == null && maxAmount == null) {\n\t\t\terrMsg = Configuration.getResourceString(ConstantManager.VI_LANGUAGE, \"common.user.input\");\n\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\tresult.put(ERROR, true);\n\t\t\treturn SUCCESS;\n\t\t}\n\t\terrMsg = ValidateUtil.validateField(groupCode, \"catalog.promotion.group.code\", 100, ConstantManager.ERR_REQUIRE, ConstantManager.ERR_EXIST_SPECIAL_CHAR_IN_CODE, ConstantManager.ERR_MAX_LENGTH);\n\t\tif (StringUtil.isNullOrEmpty(errMsg)) {\n\t\t\terrMsg = ValidateUtil.validateField(groupName, \"catalog.promotion.group.name\", 200, ConstantManager.ERR_REQUIRE, ConstantManager.ERR_EXIST_SPECIAL_CHAR_IN_SPECIAL, ConstantManager.ERR_MAX_LENGTH);\n\t\t}\n\t\tif (!StringUtil.isNullOrEmpty(errMsg)) {\n\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\tresult.put(ERROR, true);\n\t\t\treturn SUCCESS;\n\t\t}\n\t\ttry {\n\t\t\tif (groupMuaId != null && groupMuaId > 0 && groupKMId != null && groupKMId > 0) {\n\t\t\t\tProductGroup productGroupMua = promotionProgramMgr.getProductGroupById(groupMuaId);\n\t\t\t\tProductGroup productGroupKM = promotionProgramMgr.getProductGroupById(groupKMId);\n\t\t\t\tif (productGroupMua == null) {\n\t\t\t\t\terrMsg = ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM);\n\t\t\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\treturn SUCCESS;\n\t\t\t\t}\n\t\t\t\tif (productGroupKM == null) {\n\t\t\t\t\terrMsg = ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM);\n\t\t\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\treturn SUCCESS;\n\t\t\t\t}\n\t\t\t\tproductGroupMua.setProductGroupName(groupName);\n\t\t\t\tproductGroupMua.setMinQuantity(minQuantity);\n\t\t\t\tproductGroupMua.setMinAmount(minAmount);\n\t\t\t\tproductGroupMua.setMultiple(multiple != null && multiple ? 1 : 0);\n\t\t\t\tproductGroupMua.setRecursive(recursive != null && recursive ? 1 : 0);\n\t\t\t\tproductGroupMua.setOrder(stt);\n\t\t\t\tproductGroupMua.setQuantityUnit(quantityUnit);\n\t\t\t\tpromotionProgramMgr.updateProductGroup(productGroupMua, getLogInfoVO());\n\t\t\t\tproductGroupKM.setProductGroupName(groupName);\n\t\t\t\tproductGroupKM.setMaxQuantity(maxQuantity);\n\t\t\t\tproductGroupKM.setMaxAmount(maxAmount);\n\t\t\t\tproductGroupKM.setMultiple(multiple != null && multiple ? 1 : 0);\n\t\t\t\tproductGroupKM.setRecursive(recursive != null && recursive ? 1 : 0);\n\t\t\t\tproductGroupKM.setOrder(stt);\n\t\t\t\tproductGroupKM.setQuantityUnit(quantityUnit);\n\t\t\t\tpromotionProgramMgr.updateProductGroup(productGroupKM, getLogInfoVO());\n\t\t\t\tif (productGroupMua != null && productGroupMua.getPromotionProgram() != null) {\n\t\t\t\t\tpromotionProgramMgr.updateMD5ValidCode(productGroupMua.getPromotionProgram(), getLogInfoVO());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfinal List<String> lstZVMultiGroup = Arrays.asList(PromotionType.ZV01.getValue(), PromotionType.ZV02.getValue(), PromotionType.ZV03.getValue(), PromotionType.ZV04.getValue(), PromotionType.ZV05.getValue(), PromotionType.ZV06\n\t\t\t\t\t\t.getValue(), PromotionType.ZV09.getValue(), PromotionType.ZV21.getValue()\n\t\t\t\t//\t\t\t\t\t\tPromotionType.ZV25.getValue(),\n\t\t\t\t//\t\t\t\t\t\tPromotionType.ZV26.getValue(),\n\t\t\t\t//\t\t\t\t\t\tPromotionType.ZV27.getValue()\n\t\t\t\t);\n\t\t\t\tPromotionProgram pp = promotionProgramMgr.getPromotionProgramById(promotionId);\n\t\t\t\tif (pp == null) {\n\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\tresult.put(\"errMsg\", ValidateUtil.getErrorMsg(ConstantManager.ERR_NOT_EXIST_DB, promotionId));\n\t\t\t\t\treturn SUCCESS;\n\t\t\t\t}\n\t\t\t\tString type = pp.getType();\n\t\t\t\tif (!lstZVMultiGroup.contains(type)) {\n\t\t\t\t\tList<ProductGroup> lstGroupTmp = promotionProgramMgr.getListProductGroupByPromotionId(promotionId, ProductGroupType.MUA);\n\t\t\t\t\tif (lstGroupTmp != null && lstGroupTmp.size() > 0) {\n\t\t\t\t\t\terrMsg = R.getResource(\"promotion.program.multi.group.invalid\");\n\t\t\t\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\t\treturn SUCCESS;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tProductGroup productGroupMua = promotionProgramMgr.getProductGroupByCode(groupCode, ProductGroupType.MUA, promotionId);\n\t\t\t\tProductGroup productGroupKM = promotionProgramMgr.getProductGroupByCode(groupCode, ProductGroupType.KM, promotionId);\n\t\t\t\tif (productGroupMua != null) {\n\t\t\t\t\terrMsg = ValidateUtil.getErrorMsg(ConstantManager.ERR_EXIST, groupCode);\n\t\t\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\treturn SUCCESS;\n\t\t\t\t}\n\t\t\t\tif (productGroupKM != null) {\n\t\t\t\t\terrMsg = ValidateUtil.getErrorMsg(ConstantManager.ERR_EXIST, groupCode);\n\t\t\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\treturn SUCCESS;\n\t\t\t\t}\n\t\t\t\t//productGroupMua = promotionProgramMgr.createProductGroup(promotionId, groupCode, groupName, ProductGroupType.MUA, minQuantity, null, minAmount, null, multiple, recursive, stt, getLogInfoVO());\n\t\t\t\t//productGroupKM = promotionProgramMgr.createProductGroup(promotionId, groupCode, groupName, ProductGroupType.KM, null, maxQuantity, null, maxAmount, multiple, recursive, stt, getLogInfoVO());\n\t\t\t\tproductGroupMua = new ProductGroup();\n\t\t\t\tproductGroupMua.setProductGroupCode(groupCode);\n\t\t\t\tproductGroupMua.setProductGroupName(groupName);\n\t\t\t\tproductGroupMua.setPromotionProgram(pp);\n\t\t\t\tproductGroupMua.setGroupType(ProductGroupType.MUA);\n\t\t\t\tproductGroupMua.setMinQuantity(minQuantity);\n\t\t\t\tproductGroupMua.setMinAmount(minAmount);\n\t\t\t\tproductGroupMua.setMaxQuantity(null);\n\t\t\t\tproductGroupMua.setMaxAmount(null);\n\t\t\t\tproductGroupMua.setMultiple((multiple != null && multiple == true) ? 1 : 0);\n\t\t\t\tproductGroupMua.setRecursive((recursive != null && recursive == true) ? 1 : 0);\n\t\t\t\tproductGroupMua.setOrder(stt);\n\t\t\t\tproductGroupMua.setQuantityUnit(quantityUnit);\n\t\t\t\tproductGroupMua = promotionProgramMgr.createProductGroup(productGroupMua, getLogInfoVO());\n\n\t\t\t\tproductGroupKM = new ProductGroup();\n\t\t\t\tproductGroupKM.setProductGroupCode(groupCode);\n\t\t\t\tproductGroupKM.setProductGroupName(groupName);\n\t\t\t\tproductGroupKM.setPromotionProgram(pp);\n\t\t\t\tproductGroupKM.setGroupType(ProductGroupType.KM);\n\t\t\t\tproductGroupKM.setMinQuantity(minQuantity);\n\t\t\t\tproductGroupKM.setMinAmount(minAmount);\n\t\t\t\tproductGroupKM.setMaxQuantity(null);\n\t\t\t\tproductGroupKM.setMaxAmount(null);\n\t\t\t\tproductGroupKM.setMultiple((multiple != null && multiple == true) ? 1 : 0);\n\t\t\t\tproductGroupKM.setRecursive((recursive != null && recursive == true) ? 1 : 0);\n\t\t\t\tproductGroupKM.setOrder(stt);\n\t\t\t\tproductGroupKM.setQuantityUnit(quantityUnit);\n\t\t\t\tpromotionProgramMgr.createProductGroup(productGroupKM, getLogInfoVO());\n\t\t\t\tif (productGroupMua != null && productGroupMua.getPromotionProgram() != null) {\n\t\t\t\t\tpromotionProgramMgr.updateMD5ValidCode(productGroupMua.getPromotionProgram(), getLogInfoVO());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLogUtility.logErrorStandard(e, R.getResource(\"web.log.message.error\", \"vnm.web.action.program.PromotionCatalogAction.addNewProductGroup\"), createLogErrorStandard(actionStartTime));\n\t\t\tresult.put(\"errMsg\", ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM));\n\t\t\tresult.put(ERROR, true);\n\t\t\treturn SUCCESS;\n\t\t}\n\t\treturn SUCCESS;\n\t}", "public void makeNew() {\n\t\towner.switchMode(WindowMode.ITEMCREATE);\n\t}", "@Test\n public void testGroupModification() {\n app.getNavigationHelper().gotoGroupPage();\n\n if (! app.getGroupHelper().isThereAGroup()) {//якщо не існує ні одної групи\n app.getGroupHelper().createGroup(new CreateGroupData(\"Tol-AutoCreate\", \"Tol-AutoCreate\", null));\n }\n\n //int before = app.getGroupHelper().getGroupCount(); //count groups before test\n List<CreateGroupData> before = app.getGroupHelper().getGroupList(); // quantity of group before creation\n app.getGroupHelper().selectGroup(before.size() - 1);\n app.getGroupHelper().initGroupModification();\n CreateGroupData group = new CreateGroupData(before.get(before.size()-1).getId(),\"Change1-name\", \"Change2-header\", \"Change3-footer\");\n app.getGroupHelper().fillGroupData(group);\n app.getGroupHelper().submitGroupModification();\n app.getGroupHelper().returnToGroupPage();\n //int after = app.getGroupHelper().getGroupCount();\n List<CreateGroupData> after = app.getGroupHelper().getGroupList(); // quantity of group after creation\n //Assert.assertEquals(after, before);\n Assert.assertEquals(after.size(), before.size());\n\n before.remove(before.size() - 1);\n before.add(group); //add object to the list after creation/modification of a group\n Assert.assertEquals(new HashSet<>(before), new HashSet<>(after)); //compare two lists без учета порядка\n }", "protected void createGroup(int id, int parentGroupID) {\n\t\tsendMessage(\"/g_new\", new Object[] { id, 0, parentGroupID });\n\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public void createList() {\r\n items = new int[MAX_LIST];\r\n NumItems = 0;\r\n }", "private void createGroupDialog() {\n AlertDialog.Builder dialog = new AlertDialog.Builder(Objects.requireNonNull(this),\n R.style.AlertDialogTheme);\n dialog.setTitle(R.string.add_new_group_title);\n dialog.setMessage(R.string.add_new_group_description);\n\n View newGroupDialog = getLayoutInflater().inflate(R.layout.new_group_dialog, null);\n dialog.setView(newGroupDialog);\n\n AlertDialog alertDialog = dialog.create();\n setAddGroupButtonListener(alertDialog, newGroupDialog);\n\n alertDialog.show();\n }", "@Override\r\n\tpublic void getGroup(ShoppingList sl) {\r\n\r\n\t}", "private PaletteContainer createAndroid1Group() {\n\t\tPaletteGroup paletteContainer = new PaletteGroup(\n\t\t\t\tMessages.Android1Group_title);\n\t\tpaletteContainer.setId(\"createAndroid1Group\"); //$NON-NLS-1$\n\t\tpaletteContainer.add(createLayout1CreationTool());\n\t\tpaletteContainer.add(createButton2CreationTool());\n\t\tpaletteContainer.add(createTextField3CreationTool());\n\t\tpaletteContainer.add(createTextView4CreationTool());\n\t\tpaletteContainer.add(createAplication5CreationTool());\n\t\tpaletteContainer.add(createCreateString6CreationTool());\n\t\tpaletteContainer.add(createActivity7CreationTool());\n\t\tpaletteContainer.add(createMenu8CreationTool());\n\t\tpaletteContainer.add(createItem9CreationTool());\n\t\tpaletteContainer.add(createAction10CreationTool());\n\t\tpaletteContainer.add(createDialog11CreationTool());\n\t\treturn paletteContainer;\n\t}", "public org.isotc211.x2005.gco.CodeListValueType addNewMDScopeCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.isotc211.x2005.gco.CodeListValueType target = null;\n target = (org.isotc211.x2005.gco.CodeListValueType)get_store().add_element_user(MDSCOPECODE$0);\n return target;\n }\n }", "public boolean createGroup(GroupsGen group) {\n \n super.create(group);\n return true;\n }", "CodeType createCodeType();", "ListType createListType();", "public void markCsgListReplace() throws JNCException {\n markLeafReplace(\"csgList\");\n }", "public static NodoListaC creaInCoda() {\r\n\t\tNodoListaC a = new NodoListaC();\r\n\t\tNodoListaC p = a; //a rimane in testa alla lista\r\n\t\tp.info = 'A';\r\n\t\tp.next = new NodoListaC();\r\n\t\tp = p.next;\r\n\t\tchar c;\r\n\t\tfor (c = 'B'; c < 'Z'; c++) {\r\n\t\t p.info = c;\r\n\t\t p.next = new NodoListaC();\r\n\t \t p = p.next; \r\n\t\t}\r\n\t\tp.info = 'Z';\r\n\t\tp.next = null;\r\n\t\t\r\n\t\treturn a; \r\n\t}", "public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}", "public void addCsgList() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"csg-list\",\n null,\n childrenNames());\n }", "public SmilGroup() {\n\t\tsmilFiles = new LinkedList<D202SmilFile>();\n\t\tdiskUsage = -1;\n\t\tallFiles = new HashSet<FilesetFile>();\n\t\t//System.err.println(\"new group\");\n\t}", "ListItem createListItem();", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {\n View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.country_code_list_item, viewGroup, false);\n ViewHolder vh = new ViewHolder(v);\n v.setTag(i);\n return vh;\n }", "CodeBlock createCodeBlock();", "public TextController createContainerLayoutData(ControllerCore genCode) {\n\t\tcontainerLayoutDataTXT = new TextController(\"containerLayoutData\", getParentController(controlItemSCSCLC), genCode) {\n\t\t\t@Override\n\t\t\tpublic void initialize() {\n\t\t\t\tsetLinkedController(containerLayoutData$1LBL);\n\t\t\t\tsetProperty(\"containerLayoutData\");\n\t\t\t\tsuper.initialize();\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void createControl() {\n\t\t\t\tsuper.createControl();\n\t\t\t\tif (isValid()) {\n\t\t\t\t\tif (null != fieldBindManager)\n\t\t\t\t\t\tfieldBindManager = new XjcFieldBindingManager(this);\n\t\t\t\t\tgetControl().addFocusListener(new XjcFocusListener(this));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn containerLayoutDataTXT;\n\t}", "public void createGroup(String group_name){\r\n\t\t/* \r\n\t\t * Create a new entry in group database using the information\r\n\t\t * given by the parameters\r\n\t\t */\r\n\t\tSQLiteDatabase db = this.getWritableDatabase();\r\n \tContentValues values = new ContentValues();\r\n \t\r\n\t\tvalues.put(DBHelper.COLUMN_GROUPNAME, group_name);\r\n\t\t\r\n\t\tdb.insert(DBHelper.GROUP_TABLE_NAME, null, values);\r\n\t\tdb.close();\r\n\t}", "private void generateNewCards()\n {\n // Set the card sets to be drafted from.\n setsForDraft = new ArrayList<>();\n setsForDraft.add(M19_CARD_TABLE);\n\n // Generates sealed pool and places in openedCardPool.\n drawPacksFromSets();\n\n // Initialize a selectedCardPool that is empty, for the user to move cards into when desired.\n selectedCardPool = new ArrayList<>();\n }", "private void doCreateList() {\n String lengthStr = textfieldLength.getText();\n try {\n int length = Integer.parseInt(lengthStr);\n testSort.LegeArrayAn(length);\n } catch (Exception e) {\n testSort.LegeArrayAn(10);\n }\n switch(comboboxCase.getSelectedIndex()) {\n case 0:\n testSort.MischeArray(\"averagecase\");\n break;\n case 1:\n testSort.MischeArray(\"bestcase\");\n break;\n case 2:\n testSort.MischeArray(\"worstcase\");\n break;\n }\n int[] array = testSort.getZahlenfeld();\n Integer[] arrayObj = Arrays.stream(array).boxed().toArray(Integer[]::new);\n listUnsorted.setListData(arrayObj);\n listSorted.setListData(new Object[0]);\n }" ]
[ "0.58631074", "0.5852631", "0.5775123", "0.57570344", "0.57028836", "0.5638782", "0.55895716", "0.5543759", "0.55340207", "0.5531684", "0.54737824", "0.54436594", "0.5435627", "0.5425857", "0.53588027", "0.53580266", "0.53144455", "0.527495", "0.52603114", "0.5222885", "0.52148336", "0.5213659", "0.5207807", "0.5200128", "0.5196672", "0.5196017", "0.5173422", "0.51668936", "0.51428926", "0.5131427", "0.5083933", "0.50494516", "0.50444406", "0.503843", "0.5032715", "0.50320363", "0.5019328", "0.5018078", "0.5015032", "0.50108427", "0.50095713", "0.5007021", "0.499216", "0.4988899", "0.49885118", "0.4985948", "0.49802604", "0.49798465", "0.49742696", "0.49662328", "0.4955787", "0.4954479", "0.49490228", "0.49483973", "0.49452326", "0.49439585", "0.49387005", "0.49359506", "0.49329537", "0.4932427", "0.4923309", "0.4923309", "0.49089757", "0.49026412", "0.4894515", "0.48931873", "0.48873505", "0.48849085", "0.4875078", "0.4872834", "0.48662347", "0.48552695", "0.48509443", "0.48444137", "0.4842513", "0.48409632", "0.4836844", "0.48364455", "0.48329422", "0.48241717", "0.48223722", "0.4814936", "0.47912356", "0.47860202", "0.47801962", "0.47791132", "0.4778539", "0.47754857", "0.47677937", "0.47603637", "0.47591487", "0.47580478", "0.47559115", "0.47527266", "0.4737882", "0.4734797", "0.47334448", "0.47313166", "0.47235388", "0.47180995" ]
0.77724934
0
Repository class for Main domain objects All method names are compliant with Spring Data naming conventions so this interface can easily be extended for Spring Data See here: jpa.repositories.htmljpa.querymethods.querycreation
public interface MainRepository { Main getMain(Main main) throws DataAccessException; void putMain(Main main) throws DataAccessException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Repository\npublic interface UserRepository extends JpaRepository<User,Integer> {\n //implementation will be provided to run time\n}", "@Repository\npublic interface RepositoryMain extends CrudRepository<Roulette, Long>{\n\n}", "@Repository\npublic interface MainItemOrderedRepository extends CrudRepository<MainItemOrdered, Long> {\n\n /**\n * Run query like Select * from...\n *\n * @return List of ordered main item\n */\n public List<MainItemOrdered> findAll();\n\n /**\n * Run query like insert into ...\n *\n * @param mainItemOrdered Main item ordered\n * @return Ordered main item saved\n */\n public MainItemOrdered save(MainItemOrdered mainItemOrdered);\n\n /**\n * Run query like Delete from ...\n *\n * @param mainItemOrdered Oredered main item to delete\n */\n public void delete(MainItemOrdered mainItemOrdered);\n}", "public interface PersonRepository extends JpaRepository<Person, Long>, PersonRepositoryQuery {\n}", "public interface DataWarehouseRepository {\n\tList<DwPerson> searchPeople(String query);\n\n\tList<DwTerm> getTerms();\n\n\tDwPerson getPersonByLoginId(String loginId);\n\n\tDwCourse findCourse(String subjectCode, String courseNumber, String effectiveTermCode);\n\n\tList<DwCourse> searchCourses(String query);\n\n\tList<DwSection> getSectionsByTermCodeAndUniqueKeys(String termCode, List<String> uniqueKeys);\n\n\tList<DwSection> getSectionsBySubjectCodeAndYear(String subjectCode, Long year);\n\n\tList<DwSection> getSectionsBySubjectCodeAndTermCode(String subjectCode, String termCode);\n\n\tList<DwCensus> getCensusBySubjectCodeAndTermCode(String subjectCode, String termCode);\n\n\tList<DwCensus> getCensusBySubjectCodeAndCourseNumber(String subjectCode, String courseNumber);\n}", "@Repository\npublic interface WebsiteRepository extends JpaRepository<WebsiteEntity, Long> { }", "public interface EmployeeRepository extends JpaRepository<Employee, Integer> {\r\n\r\n}", "@Repository\npublic interface PersonRepository extends JpaRepository<Person, Long> {\n}", "@org.springframework.stereotype.Repository\npublic interface Repository<R> {\n\n List<R> getAll();\n\n List<R> getAll(Integer firstResult, Integer maxResults);\n\n List<R> getByExample(R example);\n\n R getUniqueByExample(R example);\n\n Long size();\n\n void insert(R record);\n\n void put(R record) throws DuplicateKeyException;\n\n void put(Collection<R> records);\n\n void insertAll(Collection<R> items);\n\n void update(R record);\n\n void updateAll(Collection<R> items);\n\n void remove(R entity);\n\n void refresh(R entity);\n\n void clear();\n\n void updateNow(R entity);\n\n /**\n * Generic Criteria builder for v2 REST endpoints\n * @param criteria - Criteria object\n * @param filter - Various Filters that need to be applied.\n */\n void applyGenericCriteria(Criteria criteria, ServiceFilterBean filter);\n\n}", "public interface AuthorRepository extends Repository<Author, Integer> {\n\n\t\n\tvoid save(Author author) throws DataAccessException;\n\n\t\n\t@Query(\"SELECT DISTINCT author FROM Author author WHERE author.lastName LIKE :lastName%\")\n\tpublic Collection<Author> findByLastName(@Param(\"lastName\") String lastName);\n\n\t//@Query(\"SELECT DISTINCT author FROM Author author WHERE author.user.username = :username\")\n\tpublic Optional<Author> findByUserUsername(String username);\n\t\n\t@Query(\"SELECT author FROM Author author WHERE author.id =:id\")\n\tpublic Author findById(@Param(\"id\") int id);\n\n\t\n\n}", "@Repository\npublic interface IStoreDao extends JpaRepository<Store,String> {\n}", "public interface RunnerRepository extends JpaRepository<Runner,Long> {\n}", "@Repository\npublic interface BookRepository extends JpaRepository<Book, Long> {\n\n}", "@Repository\npublic interface EmployeeRepository extends JpaRepository<Employee, Integer> {\n}", "public interface TypeRepositoryCustom extends JpaRepository<Type, Long> {\n\n}", "public interface IEmployeeRepository extends JpaRepository<Employee,Integer> {\r\n\tEmployee findById(int id);\r\n\r\n\t\r\n\t\r\n\r\n}", "interface ItemRepository extends JpaRepository<Item, Long> {\n\n}", "public interface AuthorRepository extends CrudRepository<Author, Long> {\n}", "public interface ISingleMenuRepository extends JpaRepository<SingleMenu, Long>, JpaSpecificationExecutor<SingleMenu> {\n}", "@Repository\npublic interface ProdutoRepository extends JpaRepository<Produto, Integer>{\n \t\n}", "@Repository\npublic interface CarDao extends JpaRepository<Car, Integer> {\n}", "@Repository\npublic interface SuiteRepository extends JpaRepository<SuiteRoom, Integer> {\n}", "public interface asalariadoRepository\r\nextends Repository<Asalariado,Integer> {\r\n void save(Asalariado asalariado);\r\n List<Asalariado> findAll();\r\n}", "public interface Repository {}", "public interface BusinessDao extends JpaRepository<Business, Long> {\r\n}", "@Repository\npublic interface ItemRepository extends JpaRepository<Item, Long>{\n\n}", "@Repository\n\npublic interface ProcesoDAO extends JpaRepository<Proceso, Long> {\n\n}", "@Repository\npublic interface TestRepository extends JpaRepository<Test, Integer>, JpaSpecificationExecutor<Test> {\n\n}", "public interface AuthorRepository extends CrudRepository<Author,Long> {\n}", "public interface AuthorRepository extends CrudRepository<Author,Long> {\n}", "public interface CarsRepository extends JpaRepository<Car, Long> {\n\n}", "public interface RoomRepository extends JpaRepository<Room, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface DocumentRepository extends JpaRepository<Document, Long> {\n\n\tList<Document> findAllByTypeDocument(TypeDocument type);\n\n}", "public interface PriceDao extends JpaRepository<Price, Integer> {\n}", "@Repository\npublic interface AdminRepository extends JpaRepository<Admin, String> {\n}", "@Repository\npublic interface BaseRepository {\n}", "public interface PublisherRepository extends CrudRepository <Publisher, Long> {\n\n}", "@Repository\npublic interface IOrderRepository extends JpaRepository<Order, Long> {\n}", "@Repository\npublic interface EditorRepository extends JpaRepository<Editor, Long> {\n}", "public interface RimWideRepository extends JpaRepository<RimWide, Long> {\n}", "@Repository\npublic interface PersonaRepository extends JpaRepository<Persona, Integer> {\n \n}", "public interface CompanyRepository extends JpaRepository<Company, String> {\n Company findByName(String name);\n}", "public interface TodoRepository extends JpaRepository<Todo,Integer> {\n\t//Service.retrieveTodos(Name). we have to create this \n\tList<Todo> findByUser(String user);\n\t\n\t\n\t\n\t//jpaRepository include these service but not the name above \n\t//Service.deleteTodo(id)\n\t//Service.retrieveTodo(id)\n\t//Service.updateTodo(todo)\n\t//Sevice.addTodo()\n\n}", "public interface EmployeeRepository extends CrudRepository<Employee, Long>{\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface DDbRepository extends JpaRepository<DDb, Long>, JpaSpecificationExecutor<DDb> {}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface HelpFullRepository extends JpaRepository<HelpFull, Long> {\n \n}", "public interface DbRepository<TEntity, TId> {\n\n DbClient getClient();\n String tableName();\n void create(TEntity entity);\n TEntity get(TId id);\n void save(TEntity entity);\n List<TEntity> find(String searchString);\n void remove(TEntity entity);\n List<TEntity> executeQuery(String query, Function<ResultSet, List<TEntity>> handler);\n int executeUpdate(String query);\n}", "@Repository\npublic interface LocationRepository extends JpaRepository<Location, Long> {\n}", "public interface EmployeeRepository extends ArangoRepository<Employee, String> {}", "@Repository\npublic interface CityRepository extends JpaRepository<City, Long> {\n}", "public interface IEmployeeRepository extends IRepository<Employee,Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface WaPersonalAddressRepository extends JpaRepository<WaPersonalAddress, Long> {\n}", "@Repository\npublic interface UserRepository extends CrudRepository<UserDao,Long> {\n\n UserDao findByName(String username);\n}", "@Repository\npublic interface IndianEmployeeRepository extends JpaRepository<IndianEmployees,Integer> {\n}", "@Repository\npublic interface ModelRepository extends JpaRepository<Citire, Long>{\n}", "@Repository\npublic interface IcalRepository extends JpaRepository<Ical, IcalPK>, JpaSpecificationExecutor<Ical> {\n\n}", "@Repository\npublic interface ProductRepository extends JpaRepository<Product, Long> {\n\n}", "@Repository\npublic interface PlayerRepository extends JpaRepository<Player, Long> {\n}", "public interface LiquorRepo extends CrudRepository<Liquor, Integer>, LiquorRepoCustom {\n Liquor findByName(String name);\n Liquor findByItemCode(String itemCode);\n ArrayList findAllByNameContaining(String name);\n ArrayList findAllByNameLikeIgnoreCase(String name);\n ArrayList findAllByItemCodeLikeIgnoreCase(String itemCode);\n ArrayList findAllByDistilleryLikeIgnoreCase(String distillery);\n}", "public interface PrimaryRepository extends MongoRepository<PrimaryMongoObject, String> {\n}", "public interface Repository {\n\n }", "public interface Repository {\n\n }", "public interface ReleaseRepository extends CrudRepository<Release, Long>, QueryDslPredicateExecutor {\n\n}", "@Repository\npublic interface RoomRepository extends JpaRepository<Room, Long> {\n\n\n}", "@Repository\n//JpaRepository<obj do tipo categoria, tipo do atributo identificador>--tipo especial do spring para acessar os dados\npublic interface PedidoRepository extends JpaRepository<Pedido, Integer> {\n\t\n\t@Transactional(readOnly=true)\n\tPage<Pedido> findByCliente(Cliente cliente, Pageable pageRequest);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface PRoulRepository extends JpaRepository<PRoul, Long> {\n}", "public interface CustomerRepository extends JpaRepository<Customer,Long> {\r\n public Customer findByNumberID(String numberID);\r\n public List<Customer> findByLastName(String lastName);\r\n public List<Customer> findByRegion(Region region);\r\n}", "@Repository\npublic interface AlliesRepository extends CrudRepository<AlliesDO, Long> {\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ContractDocumentEntryRowRepository extends JpaRepository<ContractDocumentEntryRow, Long> {\n\n}", "public interface ModeloRepository extends CrudRepository<Modelo, Long> {\n}", "@Repository\npublic interface IterationRepository extends BaseRepository<Iteration, String> {\n}", "@Repository\npublic interface UserRepository extends JpaRepository<User, Long> {\n}", "@Repository\npublic interface UserRepository extends JpaRepository<User, Long> {\n}", "@Repository\npublic interface UserRepository extends JpaRepository<User, Long> {\n}", "@Repository\npublic interface MenuItemRepository extends JpaRepository<MenuItem, Integer> { }", "@Repository\npublic interface EmployeeStoreRepository extends JpaRepository<EmployeeStore,String>{\n\n}", "public interface PostRepository extends CrudRepository<Post, Long> {\n}", "public interface ItemRepository extends JpaRepository<Item, Integer>,\n JpaSpecificationExecutor<Item> {\n}", "public interface OrderRepository extends JpaRepository<Order, String> {\n}", "public interface ItemRepository extends CrudRepository<Item, Long> {\n}", "@Repository\npublic interface WheelRepository extends JpaRepository<Wheel, Long>, JpaSpecificationExecutor<Wheel>{\n\n}", "public interface IQrcodeDao extends BaseRepository<Qrcode, Integer>, JpaSpecificationExecutor<Qrcode> {\n}", "public interface AuthorRepository extends CustomJpaRepository<Author, Long> {\n\n\tpublic Author findByAuthorName(String authorName);\n\n\tpublic Set<Author> findByAuthorBooks_Book_Id(Long bookId);\n}", "@Repository\r\npublic interface CustomerRepository extends JpaRepository<Customer, Long> {\r\n\r\n}", "@Repository\npublic interface ILoginRepository extends JpaRepository<Login, Long> {\n\n\t\n\t// Method declarations.\n\t/**\n\t * \n\t * <p>Method that find a user by user name.\n\t * \n\t * @param username User name\n\t * @return User name object.\n\t * */\n Login findByUserName (String username);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface MedicalRepository extends JpaRepository<Medical, Long> {\n\n}", "@Repository\npublic interface JusticeJpa extends JpaRepository<Justice, Long> {\n\n Justice findByJusticeCode(String justiceCode);\n}", "public interface AppExtraDao extends JpaRepository<AppExtra,Long> {\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ContentDocRepository extends JpaRepository<ContentDoc, Long> {\n}", "public interface LabelRepository extends JpaRepository<Label, String> {\n}", "@org.springframework.stereotype.Repository\npublic interface EntityRepository<R> {\n\n /* public R get(R entity);*/\n\n public List<R> getAll();\n\n public List<R> getAll(int limit);\n\n public List<R> getAll(Integer firstResult, Integer maxResults);\n\n public List<R> getByExample(final R example);\n\n public R getUniqueByExample(final R example);\n\n public void put(final R record) throws DuplicateKeyException;\n\n public void put(final Collection<R> records);\n\n public Entity getEntity(Entity entity);\n\n public Entity getEntityById(Entity entity);\n\n public Entity getEntityByName(Entity entity);\n\n public void insert(final R record);\n\n public void insertAll(final Collection<R> items);\n\n public void update(final R record);\n\n public void updateAll(final Collection<R> items);\n\n public void remove(final R entity);\n\n public Entity getByColumnName(String columnName, Object columnValue);\n\n public Collection<R> getByEntities(String columnName, Object columnValue);\n\n public void clear();\n\n public void refresh(final R entity);\n\n public Long size();\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface SaleRepository extends JpaRepository<Sale, Long> {}", "@Repository\npublic interface ClientRepository extends JpaRepository<Client, Long> {\n}", "interface NetworkRepository extends JpaRepository<Network, Long> {\n\n}", "@Repository\npublic interface FaresRepository extends JpaSpecificationExecutor<Fares>, JpaRepository<Fares,Long>,PagingAndSortingRepository<Fares,Long>,CrudRepository<Fares,Long> {\n}", "public interface IRepository<T> {\n Enumeration<T> findAll(Predicate<T> exp);\n T find(Predicate<T> exp);\n void add(T entity);\n void delete(T entity);\n void update(T entity);\n void saveChanges();\n}", "@Repository\npublic interface SnowboardSizeSpecsRepository extends JpaRepository<SnowboardSizeSpecs, Long> {\n\n /** \n * Gets a SnowboardSizeSpecs by it's id\n * @param id\n * @return a SnowboardSizeSpecs\n */\n SnowboardSizeSpecs findById(long id);\n\n}", "@SuppressWarnings(\"unused\")\npublic interface TaskRepository extends JpaRepository<Task,Long>, QueryDslPredicateExecutor<Task> {\n\n Task findByName(String name);\n}", "public interface AdditionRepository extends CrudRepository<Addition, String> {\r\n\r\n}", "@Repository\npublic interface ContactInformationDAO extends JpaRepository<Contact, Long> {\n\n}" ]
[ "0.69902205", "0.6965019", "0.67033464", "0.665901", "0.6556525", "0.653344", "0.6518989", "0.6512587", "0.65015745", "0.6486261", "0.64713675", "0.6463939", "0.64634037", "0.64618266", "0.6443021", "0.64343065", "0.64283913", "0.6418771", "0.6418369", "0.6409615", "0.6406872", "0.64030486", "0.63929164", "0.639146", "0.6389399", "0.6387883", "0.6384598", "0.6369546", "0.63503534", "0.63503534", "0.6349797", "0.6346425", "0.63378114", "0.633634", "0.63285357", "0.6321882", "0.63218373", "0.63191706", "0.6317886", "0.6316408", "0.63150865", "0.63148373", "0.6312865", "0.6308729", "0.63064975", "0.6302525", "0.6301408", "0.6298862", "0.6295649", "0.62918115", "0.6284443", "0.6277302", "0.6276397", "0.6273374", "0.62704206", "0.6269151", "0.626356", "0.62616634", "0.62612736", "0.626079", "0.62599653", "0.62599653", "0.6258901", "0.6257154", "0.6256412", "0.6255871", "0.6255088", "0.62542033", "0.62500554", "0.62479967", "0.62478304", "0.6244409", "0.6244409", "0.6244409", "0.6244067", "0.6242452", "0.6241314", "0.6236682", "0.6236406", "0.6229694", "0.62255955", "0.62251663", "0.62242335", "0.622416", "0.62207365", "0.6214394", "0.6209578", "0.6207417", "0.6207214", "0.62069494", "0.6205504", "0.62049437", "0.6204745", "0.6202457", "0.6202037", "0.6200319", "0.6198005", "0.61967546", "0.61964977", "0.61931956" ]
0.72288907
0
Create a new generator.
public UniformRandomGenerator(RandomGenerator generator) { this.generator = generator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Generator(){}", "public JsonGenerator createGenerator(OutputStream out)\n/* */ throws IOException\n/* */ {\n/* 1110 */ return createGenerator(out, JsonEncoding.UTF8);\n/* */ }", "public JsonGenerator createGenerator(Writer w)\n/* */ throws IOException\n/* */ {\n/* 1129 */ IOContext ctxt = _createContext(w, false);\n/* 1130 */ return _createGenerator(_decorate(w, ctxt), ctxt);\n/* */ }", "public JsonGenerator createGenerator(DataOutput out, JsonEncoding enc)\n/* */ throws IOException\n/* */ {\n/* 1169 */ return createGenerator(_createDataOutputWrapper(out), enc);\n/* */ }", "public JsonGenerator createGenerator(DataOutput out)\n/* */ throws IOException\n/* */ {\n/* 1181 */ return createGenerator(_createDataOutputWrapper(out), JsonEncoding.UTF8);\n/* */ }", "<R> Streamlet<R> newSource(Source<R> generator);", "public interface Generator<T> {\n T next();\n}", "public interface Generator<T> {\n T next();\n}", "public interface Generator<T> {\n T next();\n}", "public interface Generator<T> {\n T next();\n}", "public interface Generator<T> {\n T next();\n}", "public JsonGenerator createGenerator(OutputStream out, JsonEncoding enc)\n/* */ throws IOException\n/* */ {\n/* 1092 */ IOContext ctxt = _createContext(out, false);\n/* 1093 */ ctxt.setEncoding(enc);\n/* 1094 */ if (enc == JsonEncoding.UTF8) {\n/* 1095 */ return _createUTF8Generator(_decorate(out, ctxt), ctxt);\n/* */ }\n/* 1097 */ Writer w = _createWriter(out, enc, ctxt);\n/* 1098 */ return _createGenerator(_decorate(w, ctxt), ctxt);\n/* */ }", "public interface GeneratorInterface<T> {\n T next();\n}", "public Generator getGenerator(String theClass);", "public interface Generator<T> {\n\n T generate();\n\n}", "public IChunkProvider createChunkGenerator()\n {\n return new ChunkProviderXirk(this.worldObj, this.worldObj.getSeed(), false);\n }", "public ProcessorFactory getGenerator()\r\n\t{\r\n\t\treturn generator;\r\n\t}", "public JsonGenerator createGenerator(File f, JsonEncoding enc)\n/* */ throws IOException\n/* */ {\n/* 1151 */ OutputStream out = new FileOutputStream(f);\n/* */ \n/* 1153 */ IOContext ctxt = _createContext(out, true);\n/* 1154 */ ctxt.setEncoding(enc);\n/* 1155 */ if (enc == JsonEncoding.UTF8) {\n/* 1156 */ return _createUTF8Generator(_decorate(out, ctxt), ctxt);\n/* */ }\n/* 1158 */ Writer w = _createWriter(out, enc, ctxt);\n/* 1159 */ return _createGenerator(_decorate(w, ctxt), ctxt);\n/* */ }", "public PoissonGenerator() {\n\t}", "public IChunkProvider createChunkGenerator() {\n\t\treturn new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());\n\t}", "public BPELGeneratorImpl() {\r\n \t\tsuper(GENERATOR_NAME);\r\n \t}", "interface Generator {\n int[] generate(int size);\n }", "public static ReportGenerator createInstance()\r\n {\r\n return new ReportGenerator();\r\n }", "LoadGenerator createLoadGenerator();", "LoadGenerator createLoadGenerator();", "private SVGGraphics2D getGenerator() throws Exception {\n\t\tDOMImplementation dom = GenericDOMImplementation.getDOMImplementation();\n\t\tDocument doc = dom.createDocument(null, \"svg\", null);\n\t\tSVGGraphics2D generator = new SVGGraphics2D(doc);\n\t\treturn generator;\n\t}", "ValueGenerator createValueGenerator(String strategyName, String seqName, Properties props, ValueGenerationConnectionProvider connectionProvider);", "public boolean isGenerator();", "public InnovationGenerator() {\n this.atomicInteger = new AtomicInteger();\n }", "abstract T generate();", "@Override\n\tpublic void add(Generator generator) {\n\t}", "public Generateur() {\n }", "ObjectFactoryGenerator objectFactoryGenerator();", "private static KeyStrokeMapProvider getGenerator() {\n if (generator == null) {\n try {\n String gname =\n System.getProperty(\"abbot.keystroke_map_generator\",\n \"abbot.tester.KeyStrokeMap\");\n if (gname != null) {\n generator = (KeyStrokeMapProvider)\n Class.forName(gname).newInstance();\n }\n }\n catch(Exception e) {\n Log.warn(e);\n }\n }\n return generator;\n }", "@Override\n @Nonnull\n public EndChunkGenerator createChunkGenerator() {\n return new EndChunkGenerator(world, new DungeonBiomeProvider(), new EndGenerationSettings());\n }", "protected LLVMGenerator doGenerate(IAstModule mod) throws Exception {\n \t\treturn doGenerate(mod, false);\n \t}", "private PSUniqueObjectGenerator()\n {\n }", "public ICMGenerator() {\n super(Registry.ICM_PRNG);\n }", "static public InstanceGenerator create(String className, Instances training, Instances testing)\n {\n if(className == null || className.isEmpty() || className.equals(\"null\"))\n {\n log.warn(\"No instance generator set, using default\");\n className = \"autoweka.instancegenerators.Default\";\n }\n\n //Get one of these classifiers\n Class<?> cls;\n try\n {\n className = className.trim();\n cls = Class.forName(className);\n return (InstanceGenerator)cls.getDeclaredConstructor(Instances.class, Instances.class).newInstance(training, testing);\n }\n catch(ClassNotFoundException e)\n {\n throw new RuntimeException(\"Could not find class '\" + className + \"': \" + e, e);\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"Failed to instantiate '\" + className + \"': \" + e, e);\n }\n }", "Gen(T o) {\n\t\tob = o;\n\t}", "private RobotsGenerator() {\n throw new AssertionError();\n }", "Sequence createSequence();", "private CandidateGenerator() {\n\t}", "@Override\n\tpublic TaskIterator createTaskIterator() {\n\t\treturn new TaskIterator(new HyperTask(cy));\n\t}", "@Override\n\tpublic IChunkProvider createChunkGenerator()\n\t{\n\t\treturn new ChunkProviderHeaven(worldObj, worldObj.getSeed(), true);\n\t}", "public synchronized void generate () {\n\t\tgenerate( () -> {\n\t\t});\n\t}", "public InstanceGenerator(InstanceGenerator generator)\n {\n mTraining = new Instances(generator.mTraining);\n mTesting = new Instances(generator.mTesting);\n }", "protected abstract void generate();", "String[] getGenerators();", "public abstract Iterator<E> createIterator();", "public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(OutputStream out, JsonEncoding enc)\n/* */ throws IOException\n/* */ {\n/* 1214 */ return createGenerator(out, enc);\n/* */ }", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(OutputStream out)\n/* */ throws IOException\n/* */ {\n/* 1247 */ return createGenerator(out, JsonEncoding.UTF8);\n/* */ }", "private UniqueIdGenerator() {\n\n }", "public PARiverDataGenerator() {\n }", "public void generate() {\n\t}", "public static ReportGeneratorAsync getReportGenerator() {\n\n\t\tif (reportGenerator == null) {\n\n\t\t\treportGenerator = GWT.create(ReportGenerator.class);\n\n\t\t\tfinal AsyncCallback<Void> initReportGeneratorCallback = new AsyncCallback<Void>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\tClientsideSettings.getLogger().severe(\"Der ReportGenerator konnte nicht initialisiert werden!\");\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(Void result) {\n\t\t\t\t\tClientsideSettings.getLogger().info(\"Der ReportGenerator wurde initialisiert.\");\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treportGenerator.init(initReportGeneratorCallback);\n\t\t}\n\n\t\treturn reportGenerator;\n\t}", "public NameGenerator() {\n this.rand = new Random();\n }", "private SimpleIdGenerator() {\r\n }", "public ServiceGenerator\n createServiceGenerator(ServiceLocator locator);", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(Writer out)\n/* */ throws IOException\n/* */ {\n/* 1234 */ return createGenerator(out);\n/* */ }", "public SnippetGenerator(Random rand, RandomCodeGenerator codeGenerator) {\n super(rand, codeGenerator.getClazzFileContainer());\n\n snippets = GENERATORS.stream()\n .map(c -> {\n try {\n return c.getDeclaredConstructor().newInstance();\n } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {\n e.printStackTrace();\n return null;\n }\n })\n .collect(Collectors.toList());\n }", "public interface Generator\n{\n /**\n * Returns a new Shape instance according to this generator's \n * strategy.\n * @param width\n * the width the game grid\n * @return \n * a new Shape \n */\n Shape getNext(int width);\n}", "public abstract void generate();", "public static synchronized ReportGenerator getInstance()\r\n {\r\n if (generator == null)\r\n {\r\n generator = new ReportGenerator();\r\n }\r\n return generator;\r\n }", "public interface Generator {\r\n\r\n interface UUIDSource {\r\n\r\n String generateUUID();\r\n }\r\n\r\n void setDefaultArgType(SourceType sourceType);\r\n\r\n void setLanguageFromMapping(String language);\r\n\r\n void setNamespace(String prefix, String uri);\r\n\r\n String getLanguageFromMapping();\r\n\r\n public interface ArgValues {\r\n\r\n ArgValue getArgValue(String name, SourceType sourceType);\r\n }\r\n\r\n GeneratedValue generate(String name, ArgValues arguments);\r\n}", "public ToZeroRampGenerator() { \r\n }", "public interface StreamGenerator {\n Interpretation next();\n\n boolean hasNext();\n\n void reset();\n}", "protected JsonGenerator _createGenerator(Writer out, IOContext ctxt)\n/* */ throws IOException\n/* */ {\n/* 1361 */ WriterBasedJsonGenerator gen = new WriterBasedJsonGenerator(ctxt, this._generatorFeatures, this._objectCodec, out);\n/* */ \n/* 1363 */ if (this._characterEscapes != null) {\n/* 1364 */ gen.setCharacterEscapes(this._characterEscapes);\n/* */ }\n/* 1366 */ SerializableString rootSep = this._rootValueSeparator;\n/* 1367 */ if (rootSep != DEFAULT_ROOT_VALUE_SEPARATOR) {\n/* 1368 */ gen.setRootValueSeparator(rootSep);\n/* */ }\n/* 1370 */ return gen;\n/* */ }", "public GseqFactoryImpl() {\n\t\tsuper();\n\t}", "public GameGenerator() {\r\n\t\tthis.actionsCommand = new ArrayList<ICommand>();\r\n\t\tthis.invokerCommands = new ArrayList<InvokerCommand>();\r\n\t}", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "public Genret() {\r\n }", "public static PSUniqueObjectGenerator getInstance()\n {\n if ( null == ms_instance )\n ms_instance = new PSUniqueObjectGenerator();\n return ms_instance;\n }", "public Order generateNext();", "public interface Generator {\n ClazzGenerator generateClazzString();\n}", "public T next();", "public T next();", "public Generator<V> getDefaultValueGenerator();", "public KeyGenerator() {\n this.publicList = new SinglyLinkedList();\n this.privateList = new PrivateKey();\n }", "public void setDefaultValueGenerator(Generator<V> generator);", "static public InstanceGenerator create(String className, String datasetFileName)\n {\n if(className == null || className.isEmpty() || className.equals(\"null\"))\n {\n log.warn(\"No instance generator set, using default\");\n className = \"autoweka.instancegenerators.Default\";\n }\n\n //Get one of these classifiers\n Class<?> cls;\n try\n {\n className = className.trim();\n cls = Class.forName(className);\n return (InstanceGenerator)cls.getDeclaredConstructor(String.class).newInstance(datasetFileName);\n }\n catch(ClassNotFoundException e)\n {\n throw new RuntimeException(\"Could not find class '\" + className + \"': \" + e, e);\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"Failed to instantiate '\" + className + \"': \" + e, e);\n }\n }", "private void crearGen(int id){\n Random random = new Random();\n int longitud = random.nextInt(6) + 5;\n\n random = null;\n\n Gen gen = new Gen(id, longitud);\n agregarGen(gen);\n }", "FlowSequence createFlowSequence();", "public Iterator<T> iterator() {\r\n return byGenerations();\r\n }", "public Iterator<Item> iterator() { return new RandomIterator();}", "public static ExtendedRandom getRandomGenerator()\n {\n lastGeneratorUsed = ( lastGeneratorUsed + 1 ) % instances.length;\n return instances[lastGeneratorUsed];\n }", "SequenceFlow createSequenceFlow();", "@Override\n\tpublic Iterator<NumberInterface> createIterator() {\n\t\treturn numbers.iterator();\n\t}", "public SequenceIterator(NumberGenerator generator, int size) {\n index = 0;\n this.size = size;\n this.generator = generator;\n }", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/lib/IR/Module.cpp\", line = 70,\n FQN=\"llvm::Module::createRNG\", NM=\"_ZNK4llvm6Module9createRNGEPKNS_4PassE\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/Module.cpp -nm=_ZNK4llvm6Module9createRNGEPKNS_4PassE\")\n //</editor-fold>\n public RandomNumberGenerator /*P*/ createRNG(/*const*/ Pass /*P*/ P) /*const*/ {\n SmallString/*<32>*/ Salt/*J*/= new SmallString/*<32>*/(32, new StringRef(P.getPassName()));\n \n // This RNG is guaranteed to produce the same random stream only\n // when the Module ID and thus the input filename is the same. This\n // might be problematic if the input filename extension changes\n // (e.g. from .c to .bc or .ll).\n //\n // We could store this salt in NamedMetadata, but this would make\n // the parameter non-const. This would unfortunately make this\n // interface unusable by any Machine passes, since they only have a\n // const reference to their IR Module. Alternatively we can always\n // store salt metadata from the Module constructor.\n Salt.$addassign(path.filename(new StringRef(getModuleIdentifier())));\n \n return new RandomNumberGenerator(Salt.$StringRef());\n }", "private QueryGenerator() {\n }", "public Jewel generate()\r\n\t{\r\n\t\treturn new Jewel(rand.nextInt(maxType));\r\n\t}", "@Override\r\n\tpublic RandomGenerator_Exponential clone() {\r\n\t\tRandomGenerator_Exponential rg = new RandomGenerator_Exponential();\r\n\t\trg.lambda=lambda;\r\n\t\treturn rg;\r\n\t}", "static ContextRewrapNode build() {\n return ContextRewrapNodeGen.create();\n }", "public SequenceIterator(NumberGenerator generator, int size) {\n this.generator = generator;\n this.size = size;\n // Since the sequence starts from index 0, we initialize it to 0\n this.index = 0;\n \n }", "private ServiceGenerator() {\n }", "public GeneratorLover(String name) {\n super(name);\n }", "public abstract T next();", "public interface CodeGenerator<T, S> {\n\n\tvoid setProperties(T properties);\n\n\tSet<SourceFile<S>> generate(ParserDefinition lexerDefinition) throws CodeGenerationException;\n}" ]
[ "0.82688093", "0.6844001", "0.6842914", "0.67557436", "0.6710047", "0.6558444", "0.64893824", "0.64893824", "0.64893824", "0.64893824", "0.64893824", "0.64502573", "0.6383732", "0.63639903", "0.62867033", "0.616838", "0.6135685", "0.6099266", "0.6099032", "0.60609424", "0.604245", "0.6020353", "0.60154104", "0.6007278", "0.6007278", "0.5918812", "0.5918313", "0.58622694", "0.58343524", "0.5824248", "0.58053285", "0.57439226", "0.57118624", "0.56903434", "0.56597877", "0.5657172", "0.56483144", "0.5641139", "0.5625822", "0.5619314", "0.5600606", "0.5590597", "0.5548548", "0.55436754", "0.55147785", "0.54997796", "0.5479731", "0.54792815", "0.545473", "0.54509276", "0.54443544", "0.5443034", "0.54053247", "0.5403699", "0.5403149", "0.5400656", "0.53904235", "0.5390374", "0.53870964", "0.5371379", "0.53690785", "0.5365833", "0.53599745", "0.53575206", "0.5348361", "0.5346648", "0.5338482", "0.5338042", "0.5337839", "0.53271955", "0.5324704", "0.5318625", "0.53042364", "0.52985907", "0.5298204", "0.5293864", "0.5284313", "0.5284313", "0.5282387", "0.5279602", "0.52773273", "0.5252841", "0.52117443", "0.52103287", "0.51989657", "0.51984644", "0.5195245", "0.5173674", "0.5168773", "0.5158075", "0.5154938", "0.51475656", "0.5139243", "0.51374286", "0.5134546", "0.5131738", "0.5129226", "0.5114273", "0.5111962", "0.51100844" ]
0.51749617
87
Generate a random scalar with null mean and unit standard deviation. The number generated is uniformly distributed between &sqrt;(3) and +&sqrt;(3).
public double nextNormalizedDouble() { return SQRT3 * (2 * generator.nextDouble() - 1.0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double uniform() {\r\n return random.nextDouble();\r\n }", "public static double uniform() {\n return random.nextDouble();\n }", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public static double random() {\r\n return uniform();\r\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\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 long normalRandom(long mean) {\n\t\t// create random object \n Random ran = new Random(); \n // generating integer \n double nxt = ran.nextGaussian(); \n long wage = mean + (long)(mean * nxt);\n if(wage < 0 ) wage = 0;\n return wage;\n\t}", "public static double randomPositiveDouble() {\n return randomDouble(1, Double.MAX_VALUE);\n }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\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 sample_value() {\n checkHasParams();\n return -Math.log(Util.random()) / this.lambda;\n }", "public static double rand() {\n return (new Random()).nextDouble();\n }", "public static double generateDensity() {\n double lower = config.getDensityLowerBound();\n double upper = config.getDensityUpperBound();\n\n Random random = new Random();\n return lower + (upper - lower) * random.nextDouble();\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "public static double randomDouble() {\n return randomDouble(-Double.MAX_VALUE, Double.MAX_VALUE);\n }", "public double sampleStandardDeviation() {\n/* 288 */ return Math.sqrt(sampleVariance());\n/* */ }", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "private Vec3 calculateRandomValues(){\n\n Random rand1 = new Random();\n float randX = (rand1.nextInt(2000) - 1000) / 2000f;\n float randZ = (rand1.nextInt(2000) - 1000) / 2000f;\n float randY = rand1.nextInt(1000) / 1000f;\n\n return new Vec3(randX, randY, randZ).normalize();\n }", "@Test\n public void testSd() {\n System.out.println(\"sd\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(Math.sqrt(7/0.3), instance.sd(), 1E-7);\n }", "public static double random()\n {\n return _prng2.nextDouble();\n }", "public static double fastRandomDouble(){\n\t\treturn rdm.nextDouble();\n\t\t//return rdm.nextDoubleFast();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private double randomLandau(double mu, double sigma, Random aRandom) {\n\t \n if (sigma <= 0) return 0;\n \n double res = mu + landau_quantile(aRandom.nextDouble(), sigma);\n return res;\n }", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "public double doubleRandomNegativeNumbers() {\n\t\tdouble result = 0.0;\n\t\tresult = rnd.nextDouble() * (-10);\n\t\treturn result;\n\t}", "private void randomNormal(Vector3f v)\n // Create a unit vector. The x- and y- values can be +ve or -ve.\n // The z-value is positive, so facing towards the viewer.\n {\n float z = (float) Math.random(); // between 0-1\n float x = (float) (Math.random() * 2.0 - 1.0); // -1 to 1\n float y = (float) (Math.random() * 2.0 - 1.0); // -1 to 1\n v.set(x, y, z);\n v.normalize();\n }", "public static double doubleSample() {\n return random_.nextDouble();\n }", "public static double sample_value(double lambda) {\n return -Math.log(Util.random()) / lambda;\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static double random(double input){\n\t\treturn Math.random()*input;\n\t}", "public static double randn(double miu, double sigma, double min, double max) {\n\t\tdouble x, y, dScope;\n\t\tdo {\n\t\t\tx = rand(min, max);\n\t\t\ty = normal(x, miu, sigma);\n\t\t\tdScope = rand(0.0, normal(miu, miu, sigma));\n\t\t} while (dScope > y);\n\t\treturn x;\n\t}", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "public double sampleDouble() {\n double x = sample01();\n if ( x < (b-a)/(c-a))\n x = Math.sqrt(x*(b-a)*(c-a)) + a;\n else\n x = c- Math.sqrt((1-x)*(c-a)*(c-b));\n return x;\n }", "public static double randomNegativeDouble() {\n return randomDouble(-Double.MAX_VALUE, 0);\n }", "public Double generateRandomDouble() {\n\t\tRandom rand = new Random(Double.doubleToLongBits(Math.random()));\n\t\treturn rand.nextDouble();\n\t}", "public double randomValue(){\n\t\treturn _randomValue() + _randomValue() + _randomValue();\n\t}", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "public static double URV() {\r\n\t\tRandom randomGenerator = new Random();\r\n\t\treturn randomGenerator.nextDouble();\r\n\t}", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public static float fastRandomFloat(){\n\t\treturn rdm.nextFloat();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "public NormalGen (RandomStream s) {\n this (s, 0.0, 1.0);\n }", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "@Test\n public void testMean() {\n System.out.println(\"mean\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(7, instance.mean(), 1E-7);\n }", "public float nextLog ()\n {\n // Generate a non-zero uniformly-distributed random value.\n float u;\n while ((u = GENERATOR.nextFloat ()) == 0)\n {\n // try again if 0\n }\n\n return (float) (-m_fMean * Math.log (u));\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 Double randomDouble() {\n\n final Random random = new Random();\n return random.nextInt(100) / 100.0;\n }", "public static RuntimeValue normal(RuntimeValue m, RuntimeValue sd) throws RuntimeException {\n if (isDiscreteFloatSample(m) && hasSingleValue(m.getDiscreteFloatSample()) &&\n isDiscreteFloatSample(sd) && hasSingleValue(sd.getDiscreteFloatSample())) {\n return new RuntimeValue(\n RuntimeValue.Type.DISTRIBUTION,\n new NormalDistribution(m.getDiscreteFloatSample().single(), sd.getDiscreteFloatSample().single())\n );\n }\n\n throw new RuntimeException(\"Unable to create Normal distribution\");\n }", "public double sd() {\n\t\treturn Math.sqrt(var());\n\t}", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "float getRandomValue(float min, float max)\r\n\t{\n\t\tRandom r = new Random(/*SEED!!!*/);\r\n\t\t//get a float between 0 and 1 then multiply it by the min/max difference.\r\n\t\tfloat num = r.nextFloat();\r\n\t\tnum = num * (max-min) + min;\r\n\t\treturn num;\r\n\t}", "public double scalar() {\n //\n // The RG tensor already has the squared values...\n //\n return Math.sqrt(RG.trace());\n }", "static double expon(double mean) {\n return -mean * Math.log(Math.random());\n }", "private double getRandomDouble(double min, double max)\r\n\t{\r\n\t\tdouble randNum = Math.random() * (max - min) + min;\r\n\t\treturn randNum;\r\n\t}", "private float noise(Vector2 point) {\n\t\tVector2 bottomLeft = randomGrid[(int) point.x][(int) point.y];\n\t\tVector2 topLeft = randomGrid[(int) point.x][(int) point.y + 1];\n\t\tVector2 bottomRight = randomGrid[(int) point.x + 1][(int) point.y];\n\t\tVector2 topRight = randomGrid[(int) point.x + 1][(int) point.y + 1];\n\n\t\tfloat bottomLeftValue = bottomLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y));\n\t\tfloat topLeftValue = topLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y + 1));\n\t\tfloat bottomRightValue = bottomRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y));\n\t\tfloat topRightValue = topRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y + 1));\n\n\t\tfloat bottomValue = bottomLeftValue * (1 - point.x % 1) + bottomRightValue * (point.x % 1);\n\t\tfloat topValue = topLeftValue * (1 - point.x % 1) + topRightValue * (point.x % 1);\n\t\tfloat value = bottomValue * (1 - point.y % 1) + topValue * (point.y % 1);\n\n\t\treturn value;\n\t}", "public static double nextDouble (RandomStream s, double mu, double sigma) {\n return NormalDist.inverseF (mu, sigma, s.nextDouble());\n }", "public static double rng(double min, double max) {\r\n\r\n return (Math.random() * ((max - min) + 1)) + min;\r\n }", "public static int uniform(int N) {\r\n return random.nextInt(N);\r\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 double sampleVariance() {\n/* 262 */ Preconditions.checkState((this.count > 1L));\n/* 263 */ if (Double.isNaN(this.sumOfSquaresOfDeltas)) {\n/* 264 */ return Double.NaN;\n/* */ }\n/* 266 */ return DoubleUtils.ensureNonNegative(this.sumOfSquaresOfDeltas) / (this.count - 1L);\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 double getRandomX() {\r\n\t\treturn x1;\r\n\t}", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "@Override\n\t\t\tpublic double getAsDouble() {\n\t\t\t\treturn Math.random();\n\t\t\t}", "public double nextDouble(){\r\n\t\tlong rand = nextLong();\r\n\t\treturn (double)(rand & 0x000fffffffffffffL)/((double)0x000fffffffffffffL);\r\n\t}", "public double GenerateTime() {\r\n double d = R.nextDouble();\r\n double generatedtime=mean+range*(d-0.5);\r\n return generatedtime;\r\n }", "static double getNormalDistribution(double x) {\n return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(-1 * x * x / 2.0);\n }", "public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}", "public double getUnbiasedStandardDeviation() {\n return Math.sqrt(getUnBiasedVariance());\n }", "public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }", "public double std(double data[], double mean) {\r\n\t\tdouble std = 0;\r\n\t\ttry {\r\n\t\t\tfor(int i=0;i<data.length;i++) {\r\n\t\t\t\tstd =std+((data[i]-mean)*(data[i]-mean));\r\n\t\t\t}\r\n\t\t\tstd = Math.sqrt(std / (data.length-1));\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tDataMaster.logger.warning(e.toString());\r\n\t\t\t//e.printStackTrace();\r\n\t\t}\r\n\t\treturn std;\r\n\t}", "public double populationStandardDeviation() {\n/* 242 */ return Math.sqrt(populationVariance());\n/* */ }", "BlueSphere() {\n Random random = new Random();\n value[0] = random.nextInt(16) + 1;\n }", "public static int uniform( int N ) {\n return random.nextInt( N + 1 );\n }", "@Override\r\n\t\tpublic Double get() {\n\t\t\treturn Math.random();\r\n\t\t}", "public NormalGen (RandomStream s, double mu, double sigma) {\n super (s, new NormalDist(mu, sigma));\n setParams (mu, sigma);\n }", "public Position sampleRandomGaussianPosition();", "public int noise(int xin, int yin, int zin);", "public static double nextMidpointDouble( int n )\n {\n return getRandomGenerator().nextDouble() * n - n / 2;\n }", "public static float RandomFloat(float min, float max) {\n float a = (float) Math.random();\n float num = min + (float) Math.random() * (max - min);\n if(a < 0.5)\n return num;\n else\n return -num;\n }", "public static double randomDouble(double min, double max) {\r\n\t\tdouble diff = max - min;\r\n\t\treturn (Math.random() * diff) + min;\r\n\t}", "private double m9971g() {\n return (new Random().nextDouble() * 0.4d) - 22.4d;\n }", "public static int generatRandomPositiveNegitiveValue(int max , int min) {\n\t int ii = -min + (int) (Math.random() * ((max - (-min)) + 1));\n\t return ii;\n\t}", "public static float createRandomf(float min, float max){\n\t\tif (min == max){\n\t\t\treturn min;\n\t\t}\n\t\telse{\n\t\t\t//get new random generator (with new seed)\n\t\t\tRandom rand = new Random();\n\t\t\t//get random number.\n\t\t\treturn rand.nextFloat() * (max -min) + min;\n\t\t}\n\t}", "public static int randomNext() { return 0; }", "private static double randomDouble(final Random rnd) {\n return randomDouble(Double.MIN_EXPONENT, Double.MAX_EXPONENT, rnd);\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public static double nextGaussian(double mu, double sigma) {\n return randGen.nextGaussian()*sigma+mu;\n }", "public UniformVector() {\n super(3);\n this.min = new VectorN(3);\n this.max = new VectorN(1.0, 1.0, 1.0);\n this.idum = -1;\n this.rn = new RandomNumber(this.idum);\n fillVector();\n }", "public static double standardNormDensity(double x) {\r\n\t\t// return standardNormDistribution.density(x);\r\n\t\treturn Math.exp(-x * x / 2) / Math.sqrt(2 * Math.PI);\r\n\t}", "@Test\n\tpublic void testSquare() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble expResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\texpResult = Math.sqrt(tmpRndVal);\n\t\t\tassertEquals(ac.square(tmpRndVal), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers(); \n\t\t\texpResult = Math.sqrt(tmpRndVal);\n\t\t\tassertEquals(ac.square(tmpRndVal), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\texpResult = Math.sqrt(zero);\n\t\t\tassertEquals(ac.square(zero), expResult, 0);\n\t\t}\n\t\t\n\t}", "public double standarddeviation() {\n return Math.sqrt(variance());\n }", "private int genRandomWaveNum(int min, int max){\n int m = genRandomInt(min, max);\n return m;\n }", "public double stddev() {\n double sum = sampleMean;\n sum = 0;\n for (int i = 0; i < sites.length; i++) {\n// sum += (Double.parseDouble(sites[i] + \"\") / size - sampleMean) \n// * (Double.parseDouble(sites[i] + \"\") / size - sampleMean);\n sum += (sites[i]/size - sampleMean) \n * (sites[i]/size - sampleMean);\n }\n sampleStanDevi = Math.sqrt(sum / (times - 1));\n return sampleStanDevi;\n }", "public static double squareToUniformHemispherePdf(Tuple3d v) {\n // TODO: Fill in this method.\n return 0;\n }", "public double norm() {\n\t\treturn Math.sqrt(x * x + y * y + z * z);\n\t}", "float norm();", "public double getSd() {\n\t\tif (n <= 1)\n\t\t\treturn Double.NaN;\n\t\treturn Math.sqrt(s / (n - 1));\n\t}", "private static double randDouble(double lower, double upper) {\n\t\tRandom random = new Random();\n\t\treturn (random.nextDouble() * (upper - lower)) + lower;\n\t}" ]
[ "0.67865336", "0.67642844", "0.67279464", "0.6666359", "0.6662028", "0.65746355", "0.6363786", "0.62028915", "0.61638635", "0.6127528", "0.6125472", "0.6071064", "0.6051004", "0.6048811", "0.6043657", "0.60257125", "0.6010919", "0.60023034", "0.5950551", "0.5931928", "0.5921333", "0.5913415", "0.5901348", "0.58800393", "0.58508486", "0.5833528", "0.58289087", "0.5820412", "0.58195466", "0.58017266", "0.5793761", "0.57492584", "0.57224816", "0.5719416", "0.5710247", "0.5680847", "0.5678027", "0.56681895", "0.56573755", "0.5637654", "0.5630783", "0.5605181", "0.5602959", "0.5538016", "0.55103606", "0.5505016", "0.54815", "0.54808986", "0.5465019", "0.546169", "0.5459641", "0.54552543", "0.5452071", "0.5449673", "0.5420099", "0.5399021", "0.5395345", "0.5373118", "0.5373062", "0.5372021", "0.53715396", "0.536709", "0.5358044", "0.53573537", "0.535451", "0.5353055", "0.5352051", "0.53407985", "0.53217185", "0.53207207", "0.53191507", "0.53183305", "0.53124", "0.53120446", "0.53098935", "0.5304255", "0.5293936", "0.52876437", "0.52762014", "0.5263718", "0.5252617", "0.5248962", "0.52437794", "0.5238753", "0.5238278", "0.5236923", "0.5233581", "0.5231378", "0.5220648", "0.52054715", "0.5199821", "0.51966333", "0.5192331", "0.5185014", "0.51765364", "0.5176296", "0.51712364", "0.5164983", "0.5163117", "0.5158726" ]
0.6034058
15
Wake the sender thread upon receiving routing information for a given chunk.
protected void unlock() { synchronized ( lock ) { lock.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void run() {\n\t\ttry {\n\t\t\twhile (!abort) {\n\t\t\t\tlong dest = outgoingAddressBuffer.take();\n\t\t\t\tbyte[] msg = outgoingMessageBuffer.take();\n\t\t\t\tif (dest == 0) // Break signal\n\t\t\t\t{\n\t\t\t\t\tLog.d(TAG, \"Dest is 0\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twhile (rm.isDiscovering()) {\n\t\t\t\t\tThread.sleep(1000); // sleep while it is discovering\n\t\t\t\t}\n\n\t\t\t\tif (!dl.sendPacket(dest, msg)) { // Returns false if the route\n\t\t\t\t\t// is broken\n\t\t\t\t\t// FIXME: Same thread goes back and removes the destination.\n\t\t\t\t\t// un cool\n\t\t\t\t\tLog.d(TAG, \"A route is down - remove the entry \");\n\t\t\t\t\trm.BroadcastRouteDown(dest);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\tLog\n\t\t\t\t\t.e(\n\t\t\t\t\t\t\tTAG,\n\t\t\t\t\t\t\t\"Error in PacketHandlerOut - no outgoing messages will be sent!\",\n\t\t\t\t\t\t\te);\n\t\t}\n\t\tLog.d(TAG, \"PacketHandlerOut aborting\");\n\n\t}", "public void broadcast(android.os.Message r11) {\n /*\n r10 = this;\n monitor-enter(r10);\n r9 = r10.mReg;\t Catch:{ all -> 0x0036 }\n if (r9 != 0) goto L_0x0007;\n L_0x0005:\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n L_0x0006:\n return;\n L_0x0007:\n r4 = r11.what;\t Catch:{ all -> 0x0036 }\n r5 = r10.mReg;\t Catch:{ all -> 0x0036 }\n r3 = r5;\n L_0x000c:\n r9 = r3.senderWhat;\t Catch:{ all -> 0x0036 }\n if (r9 < r4) goto L_0x002f;\n L_0x0010:\n r9 = r3.senderWhat;\t Catch:{ all -> 0x0036 }\n if (r9 != r4) goto L_0x0034;\n L_0x0014:\n r7 = r3.targets;\t Catch:{ all -> 0x0036 }\n r8 = r3.targetWhats;\t Catch:{ all -> 0x0036 }\n r2 = r7.length;\t Catch:{ all -> 0x0036 }\n r0 = 0;\n L_0x001a:\n if (r0 >= r2) goto L_0x0034;\n L_0x001c:\n r6 = r7[r0];\t Catch:{ all -> 0x0036 }\n r1 = android.os.Message.obtain();\t Catch:{ all -> 0x0036 }\n r1.copyFrom(r11);\t Catch:{ all -> 0x0036 }\n r9 = r8[r0];\t Catch:{ all -> 0x0036 }\n r1.what = r9;\t Catch:{ all -> 0x0036 }\n r6.sendMessage(r1);\t Catch:{ all -> 0x0036 }\n r0 = r0 + 1;\n goto L_0x001a;\n L_0x002f:\n r3 = r3.next;\t Catch:{ all -> 0x0036 }\n if (r3 != r5) goto L_0x000c;\n L_0x0033:\n goto L_0x0010;\n L_0x0034:\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n goto L_0x0006;\n L_0x0036:\n r9 = move-exception;\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n throw r9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.os.Broadcaster.broadcast(android.os.Message):void\");\n }", "@Override\n public void run() {\n while (isRun) {\n try {\n Thread.sleep(1000); // sleep 1000ms\n Message message = Message.obtain();\n message.what = 1;\n handler.sendMessage(message);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void run() {\n while (!navigationPath.isEmpty()) {\n\n // the thread waits for beacon manager to notify it when a new Lbeacon ID is received\n synchronized (sync) {\n try {\n sync.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n Log.i(\"enter\", \"syncGo\");\n\n // if the received ID matches the ID of the next waypoint in the navigation path\n if (navigationPath.get(0)._waypointID.equals(currentLBeaconID)) {\n\n Log.i(\"enter\", \"equals\");\n\n\n // three message objects send messages to corresponding handlers\n Message messageFromInstructionHandler = instructionHandler.obtainMessage();\n Message messageFromCurrentPositionHandler = currentPositiontHandler.obtainMessage();\n Message messageFromWalkedPointHandler = walkedPointHandler.obtainMessage();\n Message messageFromProgressHandler = progressHandler.obtainMessage();\n\n // CurrentPositionHandler get the message of currently matched waypoint name\n messageFromCurrentPositionHandler.obj = navigationPath.get(0)._waypointName;\n\n // if the navigation path has more than three waypoints to travel\n if (navigationPath.size() >= 3) {\n\n // if the next two waypoints are in the same region as the current waypoint\n // get the turn direction at the next waypoint\n if (navigationPath.get(0)._regionID.equals(navigationPath.get(1)._regionID) &&\n navigationPath.get(1)._regionID.equals(navigationPath.get(2)._regionID)){\n messageFromInstructionHandler.obj =\n GeoCalulation.getDirectionFromBearing(navigationPath.get(0),\n navigationPath.get(1), navigationPath.get(2));\n }\n\n // if the next two waypoints are not in the same region\n // means that the next waypoint is the last waypoint of the region to travel\n else if (!(navigationPath.get(1)._regionID.equals(navigationPath.get(2)._regionID))) {\n messageFromInstructionHandler.obj = FRONT;\n }\n\n // if the current waypoint and the next waypoint are not in the same region\n // transfer through elevator or stairwell\n else if (!(navigationPath.get(0)._regionID.equals(navigationPath.get(1)._regionID))) {\n\n if (navigationPath.get(0)._nodeType == ELEVATOR_WAYPOINT)\n messageFromInstructionHandler.obj = ELEVATOR;\n else if(navigationPath.get(0)._nodeType == STAIRWELL_WAYPOINT)\n messageFromInstructionHandler.obj = STAIR;\n else if((navigationPath.get(0)._nodeType == CONNECTPOINT))\n messageFromInstructionHandler.obj =\n GeoCalulation.getDirectionFromBearing(navigationPath.get(0),\n navigationPath.get(1), navigationPath.get(2));\n else if(navigationPath.get(0)._nodeType == NORMAL_WAYPOINT){\n\n if(Setting.getPreferenceValue() == ELEVATOR_WAYPOINT)\n messageFromInstructionHandler.obj = ELEVATOR;\n else if(Setting.getPreferenceValue() == STAIRWELL_WAYPOINT)\n messageFromInstructionHandler.obj = STAIR;\n }\n\n }\n }\n // if there are two waypoints left in the navigation path\n else if (navigationPath.size() == 2) {\n\n // if the current waypoint and the next waypoint are not in the same region\n if (!(navigationPath.get(0)._regionID.equals(navigationPath.get(1)._regionID))) {\n\n if (navigationPath.get(0)._nodeType == ELEVATOR_WAYPOINT)\n messageFromInstructionHandler.obj = ELEVATOR;\n else if (navigationPath.get(0)._nodeType == STAIRWELL_WAYPOINT)\n messageFromInstructionHandler.obj = STAIR;\n }\n // else go straight to the final waypoint\n else\n messageFromInstructionHandler.obj = FRONT;\n\n }\n // if there is only one waypoint left, the user has arrived\n else if (navigationPath.size() == 1)\n messageFromInstructionHandler.obj = ARRIVED;\n\n\n // every time the received ID is matched,\n // the user is considered to travel one more waypoint\n walkedWaypoint++;\n\n // WalkedPointHandler get the message of number\n //of waypoint has been traveled in a region\n messageFromWalkedPointHandler.obj = walkedWaypoint;\n\n messageFromProgressHandler.obj = true;\n\n // send the newly updated message to three handlers\n walkedPointHandler.sendMessage(messageFromWalkedPointHandler);\n instructionHandler.sendMessage(messageFromInstructionHandler);\n currentPositiontHandler.sendMessage(messageFromCurrentPositionHandler);\n progressHandler.sendMessage(messageFromProgressHandler);\n }\n // if the received ID does not match the ID of waypoint in the navigation path\n else if (!(navigationPath.get(0)._waypointID.equals(currentLBeaconID))) {\n\n Log.i(\"enter\", \"not-equals\");\n\n\n // send a \"wrong\" message to the handler\n Message messageFromInstructionHandler = instructionHandler.obtainMessage();\n messageFromInstructionHandler.obj = WRONG;\n instructionHandler.sendMessage(messageFromInstructionHandler);\n }\n }\n }", "public void run() {\n byte[] buffer = new byte[256];\n int bytes;\n\n // Keep looping to listen for received messages\n while (true) {\n try {\n bytes = mmInStream.read(buffer); //read bytes from input buffer\n String readMessage = new String(buffer, 0, bytes);\n // Send the obtained bytes to the UI Activity via handler\n bluetoothIn.obtainMessage(handlerState, bytes, -1, readMessage).sendToTarget();\n } catch (IOException e) {\n break;\n }\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (!endFlag) {\n\t\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\t\tif (endTime - touchStartTime > 6000) {\n\t\t\t\t\tMessage msg = handler.obtainMessage();\n\t\t\t\t\tmsg.what = 0;\n\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n Message message = mHandler.obtainMessage(1);\n mHandler.sendMessage(message);\n }", "@Override\n public void run() {\n\n queryForRoutingManager();\n File f = IMbuffer.fetchFromIMInputBuffer();\n if (f.getName().startsWith(\"Responseto\")) {\n transfertopurge(f);\n }\n }", "public void run() {\n while(true)\n {\n try {\n Thread.sleep(1000);\n handler.sendEmptyMessage(0);\n\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }\n\n }", "@Override\n public void run() {\n try {\n Thread.sleep(1500);\n } catch (InterruptedException e2) {\n // TODO Auto-generated catch block\n e2.printStackTrace();\n }\n if(isTmp!=-1 && MainActivity2.linkLose==-1){\n Message message=new Message();\n message.what=15;\n MainActivity.hReceiver.sendMessage(message);\n\n }\n }", "private void wake() {\n /*\n r1 = this;\n boolean r0 = r1.blocked\n if (r0 != 0) goto L_0x0005\n return\n L_0x0005:\n monitor-enter(r1)\n r1.notifyAll() // Catch:{ Exception -> 0x000c }\n goto L_0x000c\n L_0x000a:\n r0 = move-exception\n goto L_0x000e\n L_0x000c:\n monitor-exit(r1) // Catch:{ all -> 0x000a }\n return\n L_0x000e:\n monitor-exit(r1) // Catch:{ all -> 0x000a }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.androidquery.callback.AbstractAjaxCallback.wake():void\");\n }", "@Override\n public void run() {\n //gets messages\n byte[] b = new byte[65000];\n try {\n multicastSocket = new MulticastSocket(mcastPort);\n multicastSocket.joinGroup(InetAddress.getByName(mscastAdress));\n\n while (true) {\n try {\n DatagramPacket received = new DatagramPacket(b, b.length);\n multicastSocket.receive(received);\n DealWithPacketBackup deal = new DealWithPacketBackup(received , multicastSocket , Peer.getPeerId());\n Peer.getExecutor().execute(deal);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void run()\n\t{\n\t\t// The instance of the received broadcast request. 11/29/2014, Bing Li\n\t\tSearchKeywordBroadcastRequest request;\n\t\t// The thread always runs until it is shutdown by the BoundNotificationDispatcher. 11/29/2014, Bing Li\n\t\twhile (!this.isShutdown())\n\t\t{\n\t\t\t// Check whether the notification queue is empty. 11/29/2014, Bing Li\n\t\t\twhile (!this.isEmpty())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Dequeue the request. 11/29/2014, Bing Li\n\t\t\t\t\trequest = this.getNotification();\n\t\t\t\t\t// Disseminate the broadcast request to the local node's children. 11/29/2014, Bing Li\n\t\t\t\t\tMemoryMulticastor.STORE().disseminateSearchKeywordRequestAmongSubMemServers(request);\n\t\t\t\t\t// Notify the binder that the thread's task on the request has done. 11/29/2014, Bing Li\n\t\t\t\t\tthis.bind(super.getDispatcherKey(), request);\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait for a moment after all of the existing requests are processed. 11/29/2014, Bing Li\n\t\t\t\tthis.holdOn(ServerConfig.NOTIFICATION_THREAD_WAIT_TIME);\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void sendToReadHandler(String s) {\n\n Message msg = Message.obtain();\n msg.obj = s;\n readHandler.sendMessage(msg);\n Log.i(TAG, \"[RECV] \" + s);\n }", "protected int route(byte buffer[], int source) {\n \n // Get the message level\n byte messageLevel = getMessageLevel( buffer );\n // get the messageID\n byte messageID[] = getMessageID( buffer );\n \n // Check that the message was not received before\n if( messageIsNew( messageID )){\n \trecordMessageID( messageID );\n }\n else{\n \treturn Constants.SUCCESS;\n }\n \n // If I am not the sender of the message\n // add it to the message queue\n if (messageLevel == Constants.MESSAGE_ALL && source != Constants.SRC_ME){\n // Add message to message queue\n \taddMessageToQueue( buffer );\n }\n else if (messageLevel == Constants.MESSAGE_TARGET){\n \tbyte[] target = getTarget( buffer );\n \tif (target == this.address) {\n \t\t//Add to the message queue\n \t\treturn Constants.SUCCESS; //DO NOT send to all threads.\n \t}\n }\n \n // Send the message to all the threads\n synchronized (this.rwThreads) {\n for (ReadWriteThread aThread : rwThreads) {\n Log.d(TAG, \"Writing to device on thread: \" + aThread.getName());\n aThread.write(buffer);\n }\n }\n \n return Constants.SUCCESS;\n }", "@Override\n\t\tpublic void run() {\n\n\t\t\twhile (isRun) {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(500);\n\n\t\t\t\t\tisRun = false;\n\t\t\t\t\thandler.sendEmptyMessage(2);\n\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\r\n\tpublic void run() {\r\n\t\ttry {\r\n\t\t\tthis.inputStream = socket.getInputStream();\r\n\t\t\tthis.outputStream = socket.getOutputStream();\r\n\t\t\t// Get the peer that is asking me for fragments.\r\n\t\t\tpeerState = torrentClient.getPeerStateList().getByAddress(\r\n\t\t\t\t\tsocket.getInetAddress().getHostAddress(), socket.getPort());\r\n\t\t\t// read handhake\r\n\t\t\tbyte[] received = new byte[68];\r\n\t\t\tinputStream.read(received);\r\n\t\t\t//Parse the handshake received\r\n\t\t\tHandsake handshakeMessage = Handsake\r\n\t\t\t\t\t.parseStringToHandsake(new String(received));\r\n\t\t\t// validate hash\r\n\t\t\tString torrentHash = new String(torrentClient.getMetainf()\r\n\t\t\t\t\t.getInfo().getInfoHash());\r\n\t\t\t//if the received handshake is correct send my handshake\r\n\t\t\tif (Handsake.isValidHandsakeForBitTorrentProtocol(handshakeMessage,\r\n\t\t\t\t\ttorrentHash)) {\r\n\t\t\t\t// send handshake\r\n\t\t\t\tHandsake handShakeToSend = new Handsake(torrentHash,\r\n\t\t\t\t\t\tthis.torrentClient.getPeerId());\r\n\t\t\t\tthis.outputStream.write(handShakeToSend.getBytes());\r\n\t\t\t\t// enviar bitfield\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.sendBitfield();\r\n\t\t\t\t\t// leer\r\n\t\t\t\t\tPeerProtocolMessage message = this.readNormalMessage();\r\n\t\t\t\t\t// Check if I have received an interested message\r\n\t\t\t\t\tif (message.getType().equals(\r\n\t\t\t\t\t\t\tPeerProtocolMessage.Type.INTERESTED)) {\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tpeerState = torrentClient.getPeerStateList()\r\n\t\t\t\t\t\t\t\t\t.getByAddress(\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getInetAddress()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getHostAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getPort());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setPeer_interested(true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// send unchoke to the peer\r\n\t\t\t\t\t\tthis.outputStream.write(new UnChokeMsg().getBytes());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setAm_choking(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Continue receiveing messages if the message type is Keep_alive, Request or Have.\r\n\t\t\t\t\t\tboolean continueReading = true;\r\n\t\t\t\t\t\twhile (continueReading) {\r\n\t\t\t\t\t\t\tmessage = this.readNormalMessage();\r\n\t\t\t\t\t\t\tcontinueReading = processMessage(message);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// if I have not received interested send unchoke\r\n\t\t\t\t\t\tthis.outputStream.write(new ChokeMsg().getBytes());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// close connection\r\n\t\t\tthis.inputStream.close();\r\n\t\t\tthis.outputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Sending thread closed\");\r\n\t\t\te.printStackTrace();\r\n\t\t\ttry {\r\n\t\t\t\tthis.inputStream.close();\r\n\t\t\t\tthis.outputStream.close();\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void run()\n {\n while (true) {\n if (isReadyToStop && (buffer.poll() == null)) {\n System.out.println(\"Thread stop\");\n producerClient.close();\n return;\n }\n try {\n Message msg = buffer.poll(config.getBufferPollTimeout());\n if (msg == null) {\n // ignore it\n continue;\n }\n System.out.println(\"Sent out: [\" + msg + \"]\");\n if (msg.getTopic().isPresent()) {\n String topic = msg.getTopic().get();\n Optional<Function<String, Integer>> function = funcMapBuffer.get(topic);\n function.ifPresent(stringLongFunction -> {\n int fiberId = stringLongFunction.apply(msg.getKey());\n msg.setFiberId(fiberId);\n producerClient.send(topic, fiberId, msg);\n });\n // else ignore this message\n }\n // else ignore this message\n }\n catch (InterruptedException ignored) {\n // if poll nothing, enter next loop\n }\n }\n }", "@Override\n public void run() {\n String message = router.toString() + \"/\" + router.toString() + \"/\" + 0 + \"/\" + router.getPort() + \"/\";\n Set<Map.Entry<Node, Double>> neighbours = router.getNeighbours().entrySet();\n for (Map.Entry<Node, Double> m : neighbours) {\n Node n = m.getKey();\n message += n.toString() + \" \" + m.getValue() + \" \" + n.getPort() + \"/\";\n }\n buffer.initLSA(router.toString(), message);\n\n Processor p = new Processor(network, processing_buffer, router, nodeSequence);\n new Thread(p).start();\n\n for (Node n : router.getNeighbours().keySet()) {\n heartBeat.put(n.toString(), 0);\n }\n\n receive();\n }", "@Override\n public void run() {\n System.out.println(\"hello\");\n loadunsendmessage();\n if(tmr==0){\n handler.postDelayed(this, 10000);\n }\n }", "public void run() {\n while (true) { \n \t\ttry {\n \t\t\tString line=br.readLine();\n\t\t\t\t\t\t\th.obtainMessage(RECIEVE_MESSAGE, line).sendToTarget();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n \n }\n }", "public void maintenancethread1() {\n while (true) {\n Thread maintenanceThread1 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n // This statement will request Routing manager to ascertain keys for which I am root node.\n\n queryForRoutingManager();\n File f = IMbuffer.fetchFromIMInputBuffer();\n if (f.getName().startsWith(\"Responseto\")) {\n transfertopurge(f);\n }\n }\n });\n maintenanceThread1.start();\n try {\n Thread.sleep(1800000);\n System.out.println(\"Thread going to sleep\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\twhile(isrun&&handler!=null){\n\t\t\ttry {\n\t\t\t\tMessage msg=handler.obtainMessage(timeupdate, new Date());\n\t\t\t\thandler.sendMessage(msg);\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }", "public void run() {\n byte[] buffer = new byte[1024]; // buffer store for the stream\n int bytes; // bytes returned from read()\n // Keep listening to the InputStream until an exception occurs\n while (true) {\n try {\n // Read from the InputStream\n bytes = mmInStream.available();\n if (bytes != 0) {\n SystemClock.sleep(100); //pause and wait for rest of data. Adjust this depending on your sending speed.\n bytes = mmInStream.available(); // how many bytes are ready to be read?\n bytes = mmInStream.read(buffer, 0, bytes); // record how many bytes we actually read\n mHandler.obtainMessage(MESSAGE_READ, bytes, -1, buffer)\n .sendToTarget(); // Send the obtained bytes to the UI activity\n }\n } catch (IOException e) {\n e.printStackTrace();\n\n break;\n }\n }\n }", "@Override\n public void finishMessageSending() {\n for (int i = 0; i < fragNum; ++i) {\n long bytesWriten = cacheOut[i].bytesWriten();\n cacheOut[i].finishSetting();\n cacheOut[i].writeLong(0, bytesWriten - SIZE_OF_LONG);\n\n if (bytesWriten == SIZE_OF_LONG) {\n logger.debug(\n \"[Finish msg] sending skip msg from {} -> {}, since msg size: {}\",\n fragId,\n i,\n bytesWriten);\n continue;\n }\n if (i == fragId) {\n nextIncomingMessageStore.digest(cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] digest msg to self of size: {}\",\n fragId,\n bytesWriten);\n } else {\n grapeMessager.sendToFragment(i, cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] send msg to [{}] of size: {}\",\n fragId,\n i,\n bytesWriten);\n }\n }\n // if (maxSuperStep > 0) {\n // grapeMessager.ForceContinue();\n // maxSuperStep -= 1;\n // }\n\n // logger.debug(\"[Unused res] {}\", unused);\n // logger.debug(\"adaptor hasNext {}, grape hasNext{}\", adaptorHasNext, grapeHasNext);\n // logger.debug(\"adaptor next {}, grape next {}\", adaptorNext, grapeNext);\n // logger.debug(\"adaptor neighbor {}, grape neighbor {}\", adaptorNeighbor,\n // grapeNeighbor);\n }", "@Override\n\tpublic void onReceive(final Context context, Intent intent) {\n\t\tLog.i(\"msg\", \"new message\");\n\t\tif (Constants.MoShi==3) {\n\t\t\tnew Thread(){\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsleep(3000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tSmsDao smsdao = new SmsDao(context);\n\t\t\t\t\tMap<String, String> data = smsdao.getSmsData();\n\t\t\t\t\t\n\t\t\t\t\tIntent itent = new Intent(Constants.ACTION_RING);\n\t\t\t\t\tif (data != null) {\n\t\t\t\t\t\titent.putExtra(\"data\", Constants.SMSINFO);\n\t\t\t\t\t\titent.putExtra(\"person\", data.get(\"person\"));\n\t\t\t\t\t\titent.putExtra(\"body\", data.get(\"body\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext.sendBroadcast(itent);\n\t\t\t\t};\n\t\t\t\t\n\t\t\t}.start();\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (Message message : pending) {\n\t\t\t\t\t\tif (canLCBdeliver(message)) {\n\t\t\t\t\t\t\tfifoBC.canDeliver(message);\n\t\t\t\t\t\t\tp.Pendinglock.lock();\n\t\t\t\t\t\t\tpending.remove(message);\n\t\t\t\t\t\t\tp.Pendinglock.unlock();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tSystem.out.println(\"Failed to sleep in deliver thread.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n void setRoute() throws ItemTooHeavyException {\n deliveryItem = tube.pop();\n if (deliveryItem.weight > itemWeightLimit) throw new ItemTooHeavyException();\n // Set the destination floor\n destination_floor = deliveryItem.getDestFloor();\n }", "@Override\n public void run() {\n send();\n }", "@Override\r\n public void run() {\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n int times = 0;\r\n\r\n while (!mStopped) {\r\n try {\r\n if (times == 0) {\r\n try {\r\n \t// Sometimes lag occurs. Therefore, from time to time\r\n \t// we just ignore a large chunk of data from input stream\r\n \t// in order to synchronize the communication.\r\n mInputStream.skip(1024000);\r\n } catch (Exception e) {}\r\n times = LAG_CUT_TIMEOUT;\r\n }\r\n times--;\r\n\r\n // Read from socket and send to the handler\r\n bytes = mInputStream.read(buffer);\r\n mReceiveHandler.receiveData(buffer, bytes);\r\n\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error receiving from the socket: \" + ioe.getMessage());\r\n mPeer.communicationErrorOccured();\r\n break;\r\n }\r\n }\r\n }", "@Override\n public void run() {\n reprocessPendingMessage();\n }", "@Override\r\n\tpublic void run() {\n\t\tbyte[] buffer = new byte[YapttaConstants.Network.DEFAULT_PACKET_BUFFER_SIZE];\r\n\t\tDatagramPacket packet = new DatagramPacket(buffer, buffer.length);\r\n\t\t\r\n\t\t// Loop until we're disconnected/stopped/etc\r\n\t\twhile(!haltRequested && socket != null && socket.isBound() && !socket.isClosed())\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\t// Block the socket until data is received\r\n\t\t\t\tsocket.receive(packet);\r\n\t\t\t\t\r\n\t\t\t\t// Deserialize the data\r\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(packet.getData(), 0, packet.getLength());\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(bais);\r\n\t\t\t\tAbstractMessage am = (AbstractMessage) ois.readObject();\r\n\t\t\t\t\r\n\t\t\t\t// Save who the sender was\r\n\t\t\t\tam.setSender(packet.getAddress());\r\n\t\t\t\t\r\n\t\t\t\t// Call the data received handler as appropriate\r\n\t\t\t\tif(callback != null) callback.messageReceived(am);\r\n\t\t\t\t\r\n\t\t\t\t// Clean-up\r\n\t\t\t\tois.close();\r\n\t\t\t\tbais.close();\r\n\t\t\t\t\r\n\t\t\t\t// ... then do it again!\r\n\t\t\t\t\r\n\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t// just try to roll with the error (but at least log it)... it's likely due to\r\n\t\t\t\t// disconnection and will end the thread when it checks the condition of the loop\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// if something other than timeout occurred, give more info\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock) {\n/* 571 */ return block(multicastAddress, sourceToBlock, newPromise());\n/* */ }", "@Override\n \t\t\tpublic void run ()\n \t\t\t{\n \t\t\t\tsynchronized ( heard )\n \t\t\t\t{\n \t\t\t\t\theard.clear ();\n \t\t\t\t}\n \t\t\t\t// re-transmit own until not in a block\n \t\t\t\tsynchronized ( own )\n \t\t\t\t{\n \t\t\t\t\tif ( !own.isEmpty () )\n \t\t\t\t\t{\n \t\t\t\t\t\tfor ( BitcoinPeer peer : network.getConnectPeers () )\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tInvMessage tm = (InvMessage) peer.createMessage (\"inv\");\n \t\t\t\t\t\t\tfor ( Tx t : own )\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tlog.debug (\"Re-broadcast \" + t.getHash ());\n \t\t\t\t\t\t\t\ttm.getTransactionHashes ().add (new Hash (t.getHash ()).toByteArray ());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tpeer.send (tm);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}", "private void sendReceiveRes(){\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\ttry {\r\n\t\t for (int i = 0; i < 30; i++) {\r\n\t\t Thread.sleep(3500);\r\n\t\t try { \r\n\t\t\t\t\t\t\tif(str!=\" \"){\r\n\t\t\t\t\t\t\t\tstr=bf.readLine();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t \r\n\t\t Message msg = new Message();\r\n\t\t handler.sendMessage(msg);\r\n\t\t }\r\n\t\t Intent intent=new Intent(main.this,end.class);\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tmain.this.finish();\r\n\t\t } catch (InterruptedException e) {\r\n\t\t\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t}", "public void deliverPacket(Packet packet_) {\n queue.enqueue(packet_);\n sender.wakeUp();\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);// 线程暂停2秒,单位毫秒\n\t\t\t\t\tMessage message = new Message();\n\t\t\t\t\tmessage.arg1 = 1;\n\t\t\t\t\thandler.sendMessage(message);// 发送消息\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock, ChannelPromise promise) {\n/* */ try {\n/* 582 */ return block(multicastAddress, \n/* */ \n/* 584 */ NetworkInterface.getByInetAddress(localAddress().getAddress()), sourceToBlock, promise);\n/* */ }\n/* 586 */ catch (SocketException e) {\n/* 587 */ promise.setFailure(e);\n/* */ \n/* 589 */ return (ChannelFuture)promise;\n/* */ } \n/* */ }", "@Override\r\n\t\tpublic void run() {\n\t\t\ttry {\r\n\t\t\t\twhile (mClient.mSelector.select() > 0) {\r\n\t\t\t\t\tif (DEBUG) Log.e(TAG, \" In while 135\");\r\n\t\t\t\t\tfor (SelectionKey next : mClient.mSelector.selectedKeys()) {\r\n\t\t\t\t\t\tif (next.isReadable()) {\r\n\t\t\t\t\t\t\tSocketChannel socketChannel = (SocketChannel) next.channel();\r\n\t\t\t\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(500);\r\n\t\t\t\t\t\t\tbuffer.clear();\r\n\t\t\t\t\t\t\tint length = socketChannel.read(buffer);\r\n//\t\t\t\t\t\t\tif (DEBUG) Log.e(TAG, Arrays.toString(buffer.array()));\r\n\t\t\t\t\t\t\tif (length == -1) continue;\r\n\t\t\t\t\t\t\tbuffer.flip();\r\n\t\t\t\t\t\t\tif (buffer.get(0) == MessageBean.MESSAGE_TYPE_TEXT) {\r\n\t\t\t\t\t\t\t\tMessageBean messageBean = MessageBean.createMessage(buffer.array());\r\n\t\t\t\t\t\t\t\t// send message to activity\r\n\t\t\t\t\t\t\t\tIntent intent = new Intent(ReceiveReceiver.ACTION);\r\n\t\t\t\t\t\t\t\tintent.putExtra(\"data\", messageBean.getByteArray());\r\n\t\t\t\t\t\t\t\tsendBroadcast(intent);\r\n\t\t\t\t\t\t\t\tnext.interestOps(SelectionKey.OP_READ);\r\n\t\t\t\t\t\t\t\tif (DEBUG) \r\n\t\t\t\t\t\t\t\t\tLog.e(TAG, \"message : \" + messageBean.getSendId() + \" \" + \r\n\t\t\t\t\t\t\t\t\t\t\tmessageBean.getReceiveId() + \" \" + messageBean.getSendMessageLength() + \" \" +\r\n\t\t\t\t\t\t\t\t\t\t\tmessageBean.getMessageText());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmClient.mSelector.selectedKeys().remove(next);\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} 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}", "public void returningToTheBar(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(2, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public void callTheWaiter(){\n Student s = (Student) Thread.currentThread();\n\n \tCommunicationChannel com = new CommunicationChannel (serverHostName, serverPortNumb);\n \tObject[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n \tstate_fields[0] = s.getID();\n \tstate_fields[1] = s.getStudentState();\n \t\n Message m_toServer = new Message(7, params, 0, state_fields, 2, null); \n Message m_fromServer; \n \n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n \n s.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public ChannelFuture block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock) {\n/* 525 */ return block(multicastAddress, networkInterface, sourceToBlock, newPromise());\n/* */ }", "void wakeUp();", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tBitmap bit = InputStream2Bimap( taskModel.hostInputStreamResult ) ; \n\t\t\t\t\tMessage msg = new Message(); \n\t\t\t\t\tmsg.obj = bit ; \n\t\t\t\t\tmsg.what = 3 ; \n\t\t\t\t\thandler.sendMessage(msg) ;\n\t\t\t\t}", "public void sendBreak() {\n\tsPort.sendBreak(1000);\n }", "public synchronized void bufferMessage() throws Exception\r\n {\r\n\r\n System.out.println(\"BUFFER: Message from future round received. Buffering message.\");\r\n // Wait until node moves to next round.\r\n wait();\r\n\r\n }", "public void sendRequest(byte[] request) {\n // send request\n try {\n //get file id and chunk number\n String[] req = new String(request).split(\" \",5);\n String fileID = req[3] , chunkNo = req[4];\n\n //create socket\n MulticastSocket socket = new MulticastSocket(this.mcastPort);\n\n socket.setTimeToLive(1);\n socket.joinGroup(InetAddress.getByName(mscastAdress));\n\n int time = new Random().nextInt(400);\n socket.setSoTimeout(time); //max time it will listen to\n\n //listen for x time\n long oldTime = System.currentTimeMillis();\n byte[] b = new byte[65000];\n\n DatagramPacket receive = new DatagramPacket(b,b.length);\n while(System.currentTimeMillis()-oldTime < time){\n\n try {\n socket.receive(receive);\n }catch (IOException e)\n {\n System.out.println(\"\\nReached time out - no one has sent PUTCHUNK!\");\n break;\n }\n\n String[] ms = new String(receive.getData()).split(\" \",6);\n\n if(ms[1]==\"PUTCHUNK\" && ms[3]==fileID && ms[4]==chunkNo){\n System.out.println(\"Someone already sent it!\");\n socket.close();\n return;//exit\n }\n }\n\n //sending request\n DatagramPacket replyPacket = new DatagramPacket(request, request.length, InetAddress.getByName(mscastAdress), mcastPort);\n socket.send(replyPacket);\n\n System.out.println(\"In PUTCHUNK - Sent packet, no one has sent it\");\n socket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }", "private synchronized void m16565c() {\n if (!(this.f14719b || this.f14723f.hasMessages(this.f14724g))) {\n this.f14723f.sendMessageDelayed(this.f14723f.obtainMessage(this.f14724g), 2000);\n }\n }", "@Override\n public void run() {\n graphIn = new Handler(Looper.getMainLooper()) {\n\n public void handleMessage(Message msg) {\n switch (msg.what) {\n case handlerState2:\n received = Boolean.parseBoolean((String) msg.obj);\n break;\n case handlerState4:\n sampleTime = Integer.parseInt((String) msg.obj);\n break;\n case handlerState1:\n ppgWaveBuffer.addAll((ArrayList) msg.obj);\n bluetoothIn.obtainMessage(handlerState5, \"ACK\").sendToTarget();\n break;\n\n }\n }\n };\n\n for (; ; ) {\n\n if (!VerifyActivity.isActivityVisible()) {\n ppgWaveBuffer.clear();\n break;\n }\n if (received == true && ppgWaveBuffer.size() != 0) {\n\n runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n if (ppgWaveBuffer.size() != 0) {\n graph.update(ppgWaveBuffer);\n }\n }\n });\n try {\n Thread.sleep(sampleTime + compensatoryTime);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n }", "private void fireChunkSent(final int chunkSize) {\n utils.logMonitorChunkSent(monitor, chunkSize);\n try {\n monitor.chunkSent(chunkSize);\n } catch (final Throwable cause) {\n utils.logMonitorError(monitor, cause);\n }\n }", "public void processBeaconMessage(String dataChunk) {\n String bleMessage = filterBleMessage(dataChunk);\n if (bleMessage.length() == 0) {\n System.out.println(\"No received data\");\n return;\n }\n\n if (careuOutputStream == null) {\n System.out.println(\"The socket connection is not yet open\");\n return;\n }\n\n //System.out.println(\"Processing Data: \" + bleMessage);\n try {\n careuOutputStream.writeUTF(bleMessage);\n } catch (IOException ex ) {\n ex.printStackTrace();\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (evictionThread.get() == this) {\n\t\t\t\tStoreRequest r = null;\n\t\t\t\ttry {\n\t\t\t\t\twhile (requestsBeingSending.get() >= getMaxSenderThreads()) {\n\t\t\t\t\t\tsynchronized(this) {\n\t\t\t\t\t\t\tif (requestsBeingSending.get() >= getMaxSenderThreads()) {\n\t\t\t\t\t\t\t\tthis.waiting = true;\n\t\t\t\t\t\t\t\tthis.wait(100);\n\t\t\t\t\t\t\t\tthis.waiting = false;\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\tr = writeQueue.poll(3, TimeUnit.SECONDS);\n\t\t\t\t\t\n\t\t\t\t\tif (r == null) {\n\t\t\t\t\t\tif (writeQueue.isEmpty() && requestsBeingSending.get() == 0 && writeQueue.isEmpty()) {\n\t\t\t\t\t\t\t// Preparing this thread to stop and stating a new one should be started\n\t\t\t\t\t\t\tevictionThread.compareAndSet(this, null);\n\t\t\t\t\t\t\tif (!writeQueue.isEmpty() || requestsBeingSending.get() != 0)\n\t\t\t\t\t\t\t\tevictionThread.compareAndSet(null, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t// Requests in preparation of sending are marked twice so that a \"0\" is\n\t\t\t\t\t\t// a bit less likely to be a false 0\n\t\t\t\t\t\trequestsBeingSending.incrementAndGet();\n\t\t\t\t\t\tr.send(this.sender, false);\n\t\t\t\t\t\trequestsBeingSending.decrementAndGet();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\tif (r == null) {\n\t\t\t\t\t\tlogger.log(Level.WARNING, \"Problem waiting for request out of write cache: \" + e.getMessage(), e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.log(Level.SEVERE, \"Problem while sending request out of write cache ; request \" + r + \" lost: \" + e.getMessage(), e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Stopping\n\t\t\tthis.running = false;\n\t\t\tthis.sender.shutdown();\n\t\t\ttry {\n\t\t\t\tthis.sender.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tlogger.log(Level.SEVERE, \"Problem while shutting down n-orm write retention cache: \" + e.getMessage(), e);\n\t\t\t}\n\t\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}", "private void go_to_bed() {\n if (state != State.ROAMING) {\n state = State.SLEEPING;\n }\n\n // Clean up our wifi locks, notifications, and worker thread.\n if(wifi_lock != null) {\n wifi_lock.release();\n }\n stopForeground(true);\n stopSelf();\n\n if(worker != null) {\n worker.interrupt();\n worker = null;\n }\n\n // The worker thread might be stuck on I/O with the server. In a minor violation of thread\n // isolation principles, we can force the thread to die faster by just yanking its socket\n // out from under it.\n if(keepalive_sock != null) {\n try {\n keepalive_sock.close();\n } catch (IOException e) {\n System.out.println(\"Socket shutdown error... ignored.\");\n }\n }\n\n // Finally, update the UI if it's awake.\n send_status_update();\n }", "public void onReceive(android.content.Context r7, android.content.Intent r8) {\n /*\n r6 = this;\n java.lang.String r7 = r8.getAction()\n int r0 = r7.hashCode()\n r1 = 672715421(0x2818d29d, float:8.4833645E-15)\n r2 = 2\n r3 = 0\n r4 = -1\n r5 = 1\n if (r0 == r1) goto L_0x0030\n r1 = 1178001221(0x4636df45, float:11703.817)\n if (r0 == r1) goto L_0x0026\n r1 = 1478749832(0x5823ee88, float:7.2097952E14)\n if (r0 == r1) goto L_0x001c\n goto L_0x003a\n L_0x001c:\n java.lang.String r0 = \"chatMessageSendqueueBackground\"\n boolean r7 = r7.equals(r0)\n if (r7 == 0) goto L_0x003a\n r7 = 0\n goto L_0x003b\n L_0x0026:\n java.lang.String r0 = \"chatMessageBroadcastSendqueueBackground\"\n boolean r7 = r7.equals(r0)\n if (r7 == 0) goto L_0x003a\n r7 = 1\n goto L_0x003b\n L_0x0030:\n java.lang.String r0 = \"chatMessageBroadcastChangequeueBackground\"\n boolean r7 = r7.equals(r0)\n if (r7 == 0) goto L_0x003a\n r7 = 2\n goto L_0x003b\n L_0x003a:\n r7 = -1\n L_0x003b:\n switch(r7) {\n case 0: goto L_0x00a1;\n case 1: goto L_0x0077;\n case 2: goto L_0x0040;\n default: goto L_0x003e;\n }\n L_0x003e:\n goto L_0x0181\n L_0x0040:\n java.lang.String r7 = \"broadcastClosed\"\n boolean r7 = r8.getBooleanExtra(r7, r3)\n me.bridgefy.entities.transport.AppEntityBroadcast r7 = p140me.bridgefy.entities.transport.AppEntityBroadcast.getAppEntityBroadcastChange(r7)\n me.bridgefy.service.a.a r8 = p140me.bridgefy.service.p144a.C3615a.m10678a()\n java.util.List r8 = r8.mo29652b()\n java.util.Iterator r8 = r8.iterator()\n L_0x0056:\n boolean r0 = r8.hasNext()\n if (r0 == 0) goto L_0x0181\n java.lang.Object r0 = r8.next()\n me.bridgefy.entities.BridgefyPeer r0 = (p140me.bridgefy.entities.BridgefyPeer) r0\n java.lang.String r0 = r0.getId()\n com.bridgefy.sdk.client.Device r0 = com.bridgefy.sdk.framework.controller.DeviceManager.getDeviceByUserId(r0)\n java.util.HashMap r1 = r7.toHashMap() // Catch:{ Exception -> 0x0072 }\n r0.sendMessage(r1) // Catch:{ Exception -> 0x0072 }\n goto L_0x0056\n L_0x0072:\n r0 = move-exception\n r0.printStackTrace()\n goto L_0x0056\n L_0x0077:\n java.lang.String r7 = \"bridgefyMessage\"\n java.lang.String r7 = r8.getStringExtra(r7) // Catch:{ Exception -> 0x009b }\n me.bridgefy.entities.Message r7 = p140me.bridgefy.entities.Message.create(r7) // Catch:{ Exception -> 0x009b }\n me.bridgefy.entities.transport.AppEntityMessage r8 = new me.bridgefy.entities.transport.AppEntityMessage // Catch:{ Exception -> 0x009b }\n r8.<init>(r7, r2) // Catch:{ Exception -> 0x009b }\n boolean r7 = p140me.bridgefy.main.C3608c.m10650c() // Catch:{ Exception -> 0x009b }\n r7 = r7 ^ r5\n r8.setKu(r7) // Catch:{ Exception -> 0x009b }\n java.util.HashMap r7 = r8.toHashMap() // Catch:{ Exception -> 0x009b }\n com.bridgefy.sdk.client.Message r7 = com.bridgefy.sdk.client.Bridgefy.createMessage(r7) // Catch:{ Exception -> 0x009b }\n com.bridgefy.sdk.client.Bridgefy.sendBroadcastMessage(r7) // Catch:{ Exception -> 0x009b }\n goto L_0x0181\n L_0x009b:\n r7 = move-exception\n r7.printStackTrace()\n goto L_0x0181\n L_0x00a1:\n android.os.Bundle r7 = r8.getExtras()\n java.lang.String r0 = \"userId\"\n r1 = 0\n java.lang.String r7 = r7.getString(r0, r1)\n if (r7 == 0) goto L_0x0181\n me.bridgefy.integration.b r0 = p140me.bridgefy.integration.C3549b.this\n me.bridgefy.a.d r0 = r0.f9294c\n java.util.ArrayList r0 = r0.mo28344c(r7)\n java.util.ArrayList r1 = new java.util.ArrayList\n r1.<init>()\n java.lang.String r2 = \"bridgefyMessage\"\n java.lang.String r8 = r8.getStringExtra(r2)\n if (r8 == 0) goto L_0x00fe\n me.bridgefy.entities.Message r8 = p140me.bridgefy.entities.Message.create(r8) // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r2 = r8.getMessageId() // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r3 = java.lang.String.valueOf(r4) // Catch:{ JsonSyntaxException -> 0x00f7 }\n boolean r2 = r2.equals(r3) // Catch:{ JsonSyntaxException -> 0x00f7 }\n if (r2 == 0) goto L_0x00e9\n java.util.UUID r2 = java.util.UUID.randomUUID() // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r2 = r2.toString() // Catch:{ JsonSyntaxException -> 0x00f7 }\n r8.setMessageId(r2) // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r2 = r8.getMessageId() // Catch:{ JsonSyntaxException -> 0x00f7 }\n r8.setOfflineId(r2) // Catch:{ JsonSyntaxException -> 0x00f7 }\n L_0x00e9:\n int r2 = r8.getType() // Catch:{ JsonSyntaxException -> 0x00f7 }\n if (r2 != r5) goto L_0x00f3\n r1.add(r8) // Catch:{ JsonSyntaxException -> 0x00f7 }\n goto L_0x00fe\n L_0x00f3:\n r0.add(r8) // Catch:{ JsonSyntaxException -> 0x00f7 }\n goto L_0x00fe\n L_0x00f7:\n java.lang.String r8 = \"MessageCenter\"\n java.lang.String r2 = \"Sending queue without any new message at the top.\"\n android.util.Log.w(r8, r2)\n L_0x00fe:\n java.util.Iterator r8 = r0.iterator()\n L_0x0102:\n boolean r2 = r8.hasNext()\n if (r2 == 0) goto L_0x0118\n java.lang.Object r2 = r8.next()\n me.bridgefy.entities.Message r2 = (p140me.bridgefy.entities.Message) r2\n int r3 = r2.getType()\n if (r3 != r5) goto L_0x0102\n r1.add(r2)\n goto L_0x0102\n L_0x0118:\n r0.remove(r1)\n int r8 = r1.size()\n if (r8 <= 0) goto L_0x0161\n me.bridgefy.service.a.a r8 = p140me.bridgefy.service.p144a.C3615a.m10678a()\n boolean r8 = r8.mo29651a(r7)\n if (r8 == 0) goto L_0x0146\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n android.content.Context r8 = r8.mo29428a()\n me.bridgefy.integration.b r2 = p140me.bridgefy.integration.C3549b.this\n me.bridgefy.ormlite.DatabaseHelper r2 = r2.f9297f\n me.bridgefy.service.d.b r8 = p140me.bridgefy.service.p147d.C3622b.m10715a(r8, r2)\n boolean r8 = r8.mo29663b()\n if (r8 != 0) goto L_0x0146\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10414a(r1)\n L_0x0146:\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n android.content.Context r8 = r8.mo29428a()\n me.bridgefy.integration.b r2 = p140me.bridgefy.integration.C3549b.this\n me.bridgefy.ormlite.DatabaseHelper r2 = r2.f9297f\n me.bridgefy.service.d.b r8 = p140me.bridgefy.service.p147d.C3622b.m10715a(r8, r2)\n boolean r8 = r8.mo29663b()\n if (r8 == 0) goto L_0x0161\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10415a(r1, r7)\n L_0x0161:\n int r8 = r0.size()\n if (r8 <= 0) goto L_0x0181\n me.bridgefy.service.a.a r8 = p140me.bridgefy.service.p144a.C3615a.m10678a()\n boolean r8 = r8.mo29651a(r7)\n if (r8 == 0) goto L_0x0177\n me.bridgefy.integration.b r7 = p140me.bridgefy.integration.C3549b.this\n r7.m10414a(r0)\n goto L_0x0181\n L_0x0177:\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10414a(r0)\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10415a(r0, r7)\n L_0x0181:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p140me.bridgefy.integration.C3549b.C3551a.onReceive(android.content.Context, android.content.Intent):void\");\n }", "public void visit(SendBlock sb);", "@Override\n\tpublic void DoGoToWaiting(int offset) {\n\t\t\n\t}", "public void deliverLocally(RoutingHeader routingHeader) {\n \n }", "void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }", "public void blockingReceiveSenderSide() throws OOBException {\n \t}", "@Override\n public void run() {\n while (LANSyncServer.IS_CLIENT_ALIVE) {\n try {\n LANSyncServer.smsserver.sendMessage(HandleProcess.REFRESH_REQUEST_MESSAGE);\n Thread.sleep(6000);\n } catch (InterruptedException ex) {\n Logger.getLogger(SyncRequestServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public void run()\r\n {\r\n System.out.println(\"I am here\");\r\n while (_keepGoing && datagramSocket!=null)\r\n {\r\n DatagramPacket packet = null;\r\n try { packet = getMessage(); }\r\n catch (Exception e) { /* ignore */ }\r\n if (packet == null) continue;\r\n\r\n String message = new String( packet.getData(), 0, packet.getLength(), UTF_16BE);\r\n System.out.println(\"Message :\"+message);\r\n InetAddress senderAddress = packet.getAddress();\r\n int senderPort = packet.getPort();\r\n\r\n if (_processor!=null)\r\n _processor.process(message, senderAddress, senderPort);\r\n }\r\n }", "@Override\n public void run() {\n byte[] buffer = new byte[1024];\n int bytes;\n while (true) {\n try {\n\n bytes = inputStream.read(buffer);\n String data = new String(buffer, 0, bytes);\n handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).sendToTarget();\n\n Log.i(this.toString(), \"en el run de Connection: \" + handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).toString());\n\n\n } catch (IOException e) {\n break;\n }\n }\n }", "private void wakeUp() {\r\n\t\t// Wake up scheduling thread\r\n\t\tsynchronized (this) {\r\n\t\t\tnotify();\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n //select randomly.\n java.util.Collections.shuffle(list);\n int[] cn = P.current_neighbors.clone();\n Arrays.sort(cn);\n for (int i = 0; i < num_peer; i++) {\n int ind2 = list.get(i);\n if (P.is_interested[ind2] && Arrays.binarySearch(cn, P.peer_id[ind2]) < 0 && P.peer_id[ind2] != P.id && P.sockets[ind2]!=null) {\n ind = ind2;\n P.current_neighbors[P.current_neighbors.length - 1] = P.peer_id[ind];\n break;\n }\n\n }\n }\n //send unchoke message.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n \n if (ind >= 0) //there is someone interested in my data.\n {\n P.send(P.peer_id[ind], msg);\n P.print(\"OptChoke unchoked peer with id \" + P.peer_id[ind]);\n }\n ind = -1;\n //print debugging info.\n \n //sleep some interval.\n try {\n Thread.sleep(1000 * P.optimistic_unchoking_interval);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "public void handler(){\n bluetoothIn = new Handler() {\n boolean tempSound = true;\n\n /**\n * handle message received from bluetooth\n * @param msg message received\n */\n public void handleMessage(Message msg) {\n switch (msg.what) {\n case handlerState:\n String readMessage = (String) msg.obj; // msg.arg1 = bytes from connect thread\n ReceivedData.setData(readMessage);\n break;\n\n case handlerState1:\n tempSound = Boolean.parseBoolean((String) msg.obj);\n ReceivedData.setSound(tempSound);\n break;\n\n case handlerState5:\n if(\"ACK\".equals ((String) msg.obj ))\n ReceivedData.clearPPGwaveBuffer();\n break;\n\n }\n ReceivedData.Process();\n }\n };\n\n}", "@Override\n public void run() {\n transmit_set();\n }", "public void sendAsync() {\n\t\tstartTime = System.currentTimeMillis();\n\t\t\n\t\tif(logMINOR) Logger.minor(this, \"Starting async send on \"+this);\n\t\tincRunningBlockTransmits();\n\t\t\n\t\ttry {\n\t\t\tsynchronized(_prb) {\n\t\t\t\t_unsent = _prb.addListener(myListener = new PartiallyReceivedBlock.PacketReceivedListener() {;\n\n\t\t\t\t\tpublic void packetReceived(int packetNo) {\n\t\t\t\t\t\tsynchronized(_senderThread) {\n\t\t\t\t\t\t\tif(_unsent.contains(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already in unsent: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(_sentPackets.bitAt(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already sent packet in packetReceived: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent+\" sent is \"+_sentPackets, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_unsent.addLast(packetNo);\n\t\t\t\t\t\t\ttimeAllSent = -1;\n\t\t\t\t\t\t\t_senderThread.schedule();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void receiveAborted(int reason, String description) {\n\t\t\t\t\t\tonAborted(reason, description);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t_senderThread.schedule();\n\t\t\t\n\t\t\tmfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\tmfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t_usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);\n\t\t\t\t_usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);\n\t\t\t} catch (DisconnectedException e) {\n\t\t\t\tonDisconnect();\n\t\t\t}\n\t\t\t\n\t\t} catch (AbortedException e) {\n\t\t\tonAborted(_prb._abortReason, _prb._abortDescription);\n\t\t}\n\t}", "@Override\n public void run() {\n try {\n boolean busy = true;\n while (busy) {\n AbstractBasicMessage msg = readMsg();\n if (msg != null) {\n busy = msg.operate(this.persistor, this.pushServer);\n }\n }\n } catch (IOException e) {\n // Treat an IOException as a termination of the message\n // exchange, and let this message-processing thread die.\n\n // CODE VON DOZENTEN...\n } catch (OperationNotSupportedException ex) {\n System.out.println(\"Error while reading incoming message\");\n ex.printStackTrace();\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\tbyte[] buff = new byte[HFConfigration.macTMsgPacketSize];\n\t\t\twhile (isAppRunning) {\n\t\t\t\ttry {\n\t\t\t\t\tDatagramPacket recv = new DatagramPacket(buff, buff.length);\n//\t\t\t\t\trecv.setPort(HFConfigration.localUDPPort);\n\t\t\t\t\tlocalBeatSocket.receive(recv);\n\t\t\t\t\tbyte[] data = ByteTool.copyOfRange(buff, 0,\n\t\t\t\t\t\t\trecv.getLength());\n\t\t\t\t\tString ip = recv.getAddress().getHostAddress();\n\t\t\t\t\tdecode(data, ip); Log.d(\"HFModuleManager:\", \"ip:\" + ip);\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} catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public synchronized void tellAt(){\n\t\tnotifyAll();\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\r\n\t\t\t\twhile (!socket.isClosed()) {\r\n\r\n\t\t\t\t\tString line;\r\n\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tsocket.receive(recPacket);\r\n\r\n\t\t\t\t\t\tline = new String(recPacket.getData(), 0 , recPacket.getLength());\r\n\r\n\t\t\t\t\t\tbyte id = Byte.parseByte(line.substring(0, line.indexOf(\" \")));\r\n\r\n\t\t\t\t\t\tString payload = line.substring(line.indexOf(\" \") + 1, line.length());\r\n\r\n\t\t\t\t\t\tpacketMan.getPacketById(id).onRecieve(id, payload);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.println(payload);\r\n\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\r\n\t\t\t\t\t\tdisconnect();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\tdispBlocks();\n\t\tsendData();\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(bLinked &&!isExit()){\r\n\t\t\t\tLog.d(\"123\", \"set heart beat threadid:\"+Thread.currentThread().getId());\r\n\t\t\t\tjni.talkSetHeartBeat();\r\n\t\t\t\tif(jni.talkGetRegisterState()!=1 ){\r\n\t\t\t\t\tLog.e(\"123\", \"心跳停止了\");\r\n\t\t\t\t\tbLinked = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbLinked = true;\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(interval*1000);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!bLinked){\r\n\t\t\t\thandler.sendEmptyMessage(MSG_NOT_LINK);\r\n\t\t\t}\r\n\t\t\theartThread = null;\r\n\t\t\tsuper.run();\r\n\t\t}", "public void handleMessage(Message msg) {\n int nRequestType = msg.what;\n switch(nRequestType)\n {\n case WIPER_START_PERIODIC_HI_FREQ_FIXES:\n lPeriod = lHighFreqPeriodMs; // hardcoded to 3.5 sec for now\n if(bIsWifiScanStopped == true){\n registerReceiver(mReceiver, mScanResultIntentFilter);\n bIsWifiScanStopped = false;\n }\n if(bIsNetworkSessionStopped == true){\n locationManager.requestLocationUpdates(locationProvider.getName(),lPeriod, (float)0, locationListener);\n bIsNetworkSessionStopped = false;\n }\n break;\n\n case WIPER_START_PERIODIC_KEEP_WARM:\n lPeriod = lLowFreqPeriodMs;// hardcoded to 5 sec for now\n //Start the Wifi scanner\n if(bIsWifiScanStopped == true){\n registerReceiver(mReceiver, mScanResultIntentFilter);\n bIsWifiScanStopped = false;\n }\n if(bIsNetworkSessionStopped == true){\n locationManager.requestLocationUpdates(locationProvider.getName(),lPeriod, (float)0, locationListener);\n bIsNetworkSessionStopped = false;\n }\n break;\n\n\n case WIPER_STOP_PERIODIC_FIXES:\n case WIPER_SUSPEND:\n if(bIsNetworkSessionStopped == false){\n locationManager.removeUpdates(locationListener);\n bIsNetworkSessionStopped = true;\n }\n if(bIsWifiScanStopped == false){\n unregisterReceiver(mReceiver);\n bIsWifiScanStopped = true;\n }\n break;\n\n case STOP_WIPER_SERVICE:\n if (Config.LOGD)\n {\n Log.d(TAG,\"Ending Wiper Service \");\n }\n stopSelf ();\n break;\n\n default:\n super.handleMessage(msg);\n }\n }", "private void sendNextBroadcast() {\n synchronized (this.mLock) {\n if (this.mBroadcastedInteractiveState == 0) {\n this.mPendingWakeUpBroadcast = false;\n this.mBroadcastedInteractiveState = 1;\n } else if (this.mBroadcastedInteractiveState == 1) {\n if (!(this.mPendingWakeUpBroadcast || this.mPendingGoToSleepBroadcast)) {\n if (this.mPendingInteractiveState != 2) {\n finishPendingBroadcastLocked();\n return;\n }\n }\n this.mPendingGoToSleepBroadcast = false;\n this.mBroadcastedInteractiveState = 2;\n } else {\n if (!(this.mPendingWakeUpBroadcast || this.mPendingGoToSleepBroadcast)) {\n if (this.mPendingInteractiveState != 1) {\n finishPendingBroadcastLocked();\n return;\n }\n }\n this.mPendingWakeUpBroadcast = false;\n this.mBroadcastedInteractiveState = 1;\n }\n this.mBroadcastStartTime = SystemClock.uptimeMillis();\n int powerState = this.mBroadcastedInteractiveState;\n }\n }", "public void run() {\n synchronized (this) {\n if (deliveryPending) return;\n }\n super.run();\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tLog.e(\"timer\",\"calling\");\n\t\t\t\tMessage message = mHandler.obtainMessage();\n\t\t\t\tmessage.sendToTarget();\n\n\t\t\t}", "@Override\n\t\tpublic void run() {\n\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\twait();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t}\n\t\t\t\tint detectDistanceFeedback = getDetectDistanceFeedback();\n\t\t\t\twhile (true) {\n\t\t\t\t\tSystemClock.sleep(50);\n\n\t\t\t\t\tdetectDistanceFeedback = getDetectDistanceFeedback();\n\n\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\tmsg.what = 2;\n\t\t\t\t\tmsg.obj = detectDistanceFeedback;\n\n\t\t\t\t\tif (detectDistanceFeedback != 2) {\n\t\t\t\t\t\thandler.sendMessage(msg);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (count++ >= 1) {\n\t\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\t\thandler.sendMessage(msg);\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\tLog.i(TAG, \"MDetectDistanceFeedback 333333\");\n\t\t\t}\n\n\t\t}", "@Override\n\tpublic void run() {\n\t\twhile (!stopThread) {\n\t\t\ttry {\n\t\t\t\t//String outputMessage = mmInStream.available() + \" bytes available\";\n\t\t\t\t//Log.i(TAG, outputMessage);\n\t\t\t\t// Read from the InputStream\n\t\t\t\twhile (mmInStream.available() > 0) {\n\n\t\t\t\t\tsynchronized (buffer) {\n\t\t\t\t\t\tif (bufferLast == buffer.length) {\n\t\t\t\t\t\t\tbyte temp[] = new byte[bufferLast << 1];\n\t\t\t\t\t\t\tSystem.arraycopy(buffer, 0, temp, 0, bufferLast);\n\t\t\t\t\t\t\tbuffer = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuffer[bufferLast++] = (byte) mmInStream.read();\n\t\t\t\t\t}\n\t\t\t\t\tbtSerialEvent();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tLog.e(TAG, e.getMessage());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n\t\t\twhile (running || !messages_to_send.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsend();\r\n\t\t\t\t\tread();\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Error! Sending or Reading failed. Reason: \" + e);\r\n\t\t\t\t\tcancel();\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\ttry {\r\n\t\t\t\tsocket.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}", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\twhile (keepListening) {\n\t\t\tbyte[] buffer = new byte[SocketMessengerConstants.MESSAGE_SIZE];\n\t\t\tDatagramPacket packet = new DatagramPacket(buffer, SocketMessengerConstants.MESSAGE_SIZE);\n\t\t\ttry {\n\t\t\t\tmulticastSocket.receive(packet);\n\t\t\t} catch (InterruptedIOException e) {\n\t\t\t\tcontinue;\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\te.printStackTrace();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString message = new String(packet.getData());\n\t\t\tSystem.out.println(\"Receiving a message: \" + message);\n\t\t\tmessage = message.trim();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(message, SocketMessengerConstants.MESSAGE_SEPARATOR);\n\t\t\tif (tokenizer.countTokens() == 2)\n\t\t\t\tmessageListener.messageReceived(tokenizer.nextToken(), tokenizer.nextToken());\n\t\t}\n\t\ttry {\n\t\t\tmulticastSocket.leaveGroup(multicastGroup);\n\t\t\tmulticastSocket.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public boolean process(Message msg, Connection root) throws Exception {\n return lockBroadCast(root, register);\n }", "@Override\n public void run(){\n while(true){\n ArrayList<Thread> threads = new ArrayList<Thread>();\n \n //construct the string\n String message = String.format(\"hb|%d|%d\", serverPort, sequence);\n\n //have a thread to send heart beat\n for(ServerInfo peer : serverStatus.keySet()){\n //pass it to the client runnable\n Thread thread = new Thread(new SenderRunnable(peer, message));\n threads.add(thread);\n thread.start();\n }\n\n //wait for the completion\n for(Thread thread : threads){\n try{\n thread.join();\n }catch(Exception e){}\n \n \n }\n\n //increment the sequence by 1\n sequence += 1;\n\n //sleep for 2 secs\n try{\n Thread.sleep(2000);\n }catch(InterruptedException e){\n //System.err.println(e);\n }\n\n }\n }", "private void m6941a() {\n getAsyncTaskQueue().a(new RoutesSelfFrag$1(this), new String[0]);\n }", "public void run() {\n\n try {\n startup();\n } catch (UnknownHostException e) {\n e.printStackTrace();\n currentPosition = destination;\n }\n\n while (currentPosition.longitude != destination.longitude && currentPosition.latitude != destination.latitude) {\n try {\n while ((routePositions.size() - 1) > nextRoutePositionIndex && currentPosition.getLongitude() != this.routePositions.get(nextRoutePositionIndex).getLongitude() && currentPosition.getLatitude() != this.routePositions.get(nextRoutePositionIndex).getLatitude()) {\n Thread.sleep(TIMEOUT);\n\n //diceBraking();\n properBraking();\n accelerate();\n calculateDirection(currentPosition, this.routePositions.get(nextRoutePositionIndex));\n currentPosition = drive(\n currentPosition.getLatitude(), currentPosition.getLongitude(),\n this.routePositions.get(nextRoutePositionIndex).getLatitude(), this.routePositions.get(nextRoutePositionIndex).getLongitude()\n );\n\n\n publishPosition();\n if (currentPosition.latitude == currentPosition.latitude && currentPosition.longitude == destination.longitude) {\n break;\n }\n System.out.println(\"id: \" + id + \" Pos: \" + currentPosition.latitude + \"|\" + currentPosition.longitude);\n }\n if (nextRoutePositionIndex < routePositions.size()) {\n nextRoutePositionIndex++;\n } else {\n break;\n }\n } catch (InterruptedException | MalformedURLException exc) {\n exc.printStackTrace();\n }\n\n }\n\n for (int i = 0; i < 100; i++) {\n System.out.println(\"FINISHED \" + id);\n }\n\n try {\n publishFinished();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void onReceive(Object arg0) throws Exception {\n\t\t\r\n\t}", "public void readForward() {\n\t\tiStream = new ByteArrayInputStream(marshalledBytes);\t\n\t\tdin = new DataInputStream(new BufferedInputStream(iStream));\n\t\ttry {\n\t\t\tint nRouteStops = din.readInt();\n\t\t\tint routeByteLength = din.readInt();\n\t\t\tbyte[] routeBytes = new byte[routeByteLength];\n\t\t\tdin.readFully(routeBytes);\n\t\t\tlong payload = din.readLong();\n\n\t\t\tArrayList<String> route = new ArrayList<String>();\n\t\t\tByteArrayInputStream bis = new ByteArrayInputStream(routeBytes);\n\t\t\tDataInputStream dis = new DataInputStream(bis);\n\t\t\tint nameLength; byte[] ipNameBytes; String ip;\n\t\t\tfor (int i=0; i< nRouteStops; i++ ) {\n\t\t\t\tnameLength = dis.readInt();\n\t\t\t\tipNameBytes = new byte[nameLength];\n\t\t\t\tdis.readFully(ipNameBytes);\n\t\t\t\tip = new String(ipNameBytes);\n\t\t\t\troute.add(ip);\n\t\t\t}\n\n\t\t\tif(nRouteStops == 0) {\n\t\t\t\tnode.addToReceiveSum(payload);\n\t\t\t\tnode.incrementReceiveTracker();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSocket senderSocket=null; Message message=null;\n\t\t\t\tnode.incrementRelayTracker();\n\t\t\t\tfor(int i =0; i<route.size();i++) {\n\t\t\t\t\tif (node.getConnections().getSocketWithName(route.get(i))!=null) {\n\t\t\t\t\t\tString nextStop = route.remove(i);\n\t\t\t\t\t\t message = new ForwardMessage(route,payload);\n\t\t\t\t\t\tsenderSocket = node.getConnections().getSocketWithName(nextStop);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnew TCPSender(senderSocket, message);\n\t\t\t}\n\t\t} catch (IOException e) { System.out.println(\"Failed to read message. \"); }\n\t}", "@Override\n public void run() {\n while (!bShutDown || !messageCache.isEmpty()) {\n try {\n while (!messageCache.isEmpty()) {\n HttpMessage httpMessage = messageCache.poll();\n if (httpMessage != null) {\n SendResult result = sendMessageWithHostInfo(\n httpMessage.getBodies(), httpMessage.getGroupId(),\n httpMessage.getStreamId(), httpMessage.getDt(),\n httpMessage.getTimeout(), httpMessage.getTimeUnit());\n httpMessage.getCallback().onMessageAck(result);\n }\n }\n TimeUnit.MILLISECONDS.sleep(proxyClientConfig.getAsyncWorkerInterval());\n } catch (Exception exception) {\n logger.error(\"exception caught\", exception);\n }\n }\n }", "void notifyBlockComplete(MessageSnapshot snapshot);", "private void messagePhone(final String message, final byte[] byteMap){\n\n new AsyncTask<Void, Void, List<Node>>(){\n\n @Override\n protected List<Node> doInBackground(Void... params) {\n return getNodes();\n }\n\n @Override\n protected void onPostExecute(List<Node> nodeList) {\n for(Node node : nodeList) {\n Log.e(\"WATCH\", \"......Phone: Sending Msg: to node: \" + node.getId());\n Log.e(\"WATCH\", \"Sending to: \" + message.toString());\n PendingResult<MessageApi.SendMessageResult> result = Wearable.MessageApi.sendMessage(\n mGoogleApiClient,\n node.getId(),\n message.toString(),\n byteMap\n );\n\n result.setResultCallback(new ResultCallback<MessageApi.SendMessageResult>() {\n @Override\n public void onResult(MessageApi.SendMessageResult sendMessageResult) {\n Log.e(\"DEVELOPER\", \"......Phone: \" + sendMessageResult.getStatus().getStatusMessage());\n\n }\n });\n }\n }\n }.execute();\n\n }", "public void loop() {\n try {\n Mail<T> mail = mailBox.remove();\n\n actor.setSender(mail.getSender());\n actor.receive(mail.getMessage());\n } catch (InterruptedException e) {\n }\n }", "public void run() \n\t\t{\n\t\t\tBundle dataBundle = new Bundle(); \n\t\t\t\n\t\t\tdataBundle.putSerializable( \"rts\", GTStore_sqlite.getNearByTripInfo(latDouble, longDouble));\n\t\t\tMessage msg = _handler.obtainMessage();\n\t\t\tmsg.setData( dataBundle );\n\t\t\t_handler.sendMessage( msg );\n }", "public void run() {\n\t\tbyte[] out;\n\t\tshort[] in = new short[0];\n\t\tint read;\n\t\tint consumed;\n\t\t\n\t\ttry {\n\t\t\tconnect();\n\t\t\tin = new short[sock.getReceiveBufferSize()];\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: Fire event to the model, so we can display something that lets the user know what happened.\n\t\t\tex.printStackTrace();\n\t\t\tdisconnect();\n\t\t}\n\t\t\n \t\twhile (sock != null && !sock.isClosed()) {\n\t\t\ttry {\n\t\t\t\tconsumed = 0;\n\t\t\t\t\n\t\t\t\t// Read up to in.length before we're invalid...\n\t\t\t\tinStream.mark(in.length);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tread = inStream.read(in);\n\t\t\t\t} catch (IOException ioe) {\n\t\t\t\t\tread = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Truncate the read buffer, and process it.\n\t\t\t\tif (read > 0) {\n\t\t\t\t\tshort[] truncIn = new short[read];\n\t\t\t\t\tSystem.arraycopy(in, 0, truncIn, 0, read);\n\t\t\t\t\t\n\t\t\t\t\tconsumed = consumeIncoming(truncIn);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// reset the mark, and then consume the bytes we've \n\t\t\t\t// processed.\n\t\t\t\tinStream.reset();\n\t\t\t\tif (consumed > 0) {\n\t\t\t\t\tinStream.skip(consumed);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Do I have data to write?\n\t\t\t\tout = outgoingBytes();\n\t\t\t\tif (out.length > 0) {\n\t\t\t\t\tsock.getOutputStream().write(out);\n\t\t\t\t\tsock.getOutputStream().flush();\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\tSystem.err.println(ex.toString());\n\t\t\t}\n\t\t\t// Play nice with thread schedulers.\n\t\t\tThread.yield();\n\t\t}\n\t}", "public synchronized void run() {\n\t\ttry {\n\t\t\tcnnode.BroadCastTable(cnnode.TimeStamp1,cnnode.RouteTable1);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\tThread.sleep(100);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcnnode.PrintRouteTable(cnnode.RouteTable1);\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tBitmap bit = InputStream2Bimap( taskModel.domainInputStreamResult ) ; \n\t\t\t\t\tMessage msg = new Message(); \n\t\t\t\t\tmsg.obj = bit ; \n\t\t\t\t\tmsg.what = 4 ; \n\t\t\t\t\thandler.sendMessage(msg) ;\n\t\t\t\t}", "@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\taController.acquireWakeLock(getApplicationContext());\n\n\t\t\t// Display message on the screen\n\t\t\t// lblMessage.append(newMessage + \"\\n\");\n\n\t\t\t// Toast.makeText(getApplicationContext(),\n\t\t\t// \"Got Message: \" + newMessage, Toast.LENGTH_LONG).show();\n\n\t\t\t// Releasing wake lock\n\t\t\taController.releaseWakeLock();\n\t\t}", "@Override\n public void run() {\n final long runtime = (System.currentTimeMillis() - mTimeStarted) / 1000;\n Log.d(TAG, \"Terminating beacon burst after \" + runtime + \" seconds.\");\n\n // clear message queue\n mHandler.removeCallbacksAndMessages(null);\n\n // update state\n mWifiBeaconingState = WifiBeaconingState.DISABLING;\n //TODO mBtBeaconingState = BtBeaconingState.DISABLING;\n\n // stop sending beacons\n mBeaconingManager.stopBeaconSenders();\n\n // if there are no locks, restore network to previous state\n if (!mBeaconingManager.isInternetLocked() && !mBeaconingManager.isWifiConnectionLocked()) {\n restoreNetworks();\n }\n\n // quit looper\n mHandler.getLooper().quit();\n mHandler = null;\n\n // notify internet callbacks\n mBeaconingManager.notifyInternetCallbacks();\n\n if (!aborted) {\n // we are finishing the beaconing period normally, notify BeaconingManager\n mBeaconingManager.onBeaconingIntervalFinished(mBeaconingId);\n }\n }" ]
[ "0.5861621", "0.53013414", "0.5300419", "0.52926695", "0.5280362", "0.52406347", "0.5207455", "0.518188", "0.51473093", "0.51407355", "0.5104282", "0.50649786", "0.50383157", "0.50107944", "0.5005783", "0.4947818", "0.49199477", "0.4906895", "0.49023122", "0.48938468", "0.4875096", "0.48572078", "0.48525724", "0.48462635", "0.48408723", "0.48236647", "0.48220116", "0.48204756", "0.47937727", "0.47859016", "0.47647837", "0.47638696", "0.47629663", "0.4759725", "0.47568285", "0.47513464", "0.47505307", "0.475039", "0.47414583", "0.47317165", "0.47274822", "0.47205126", "0.4704698", "0.47045746", "0.46978408", "0.46955493", "0.46938524", "0.4670663", "0.46699044", "0.4653995", "0.4653585", "0.4652501", "0.46361998", "0.4635184", "0.46287698", "0.46267593", "0.46235546", "0.4623219", "0.4620788", "0.46085593", "0.46083513", "0.46051157", "0.45934525", "0.4589359", "0.45886406", "0.4585967", "0.4584538", "0.4582808", "0.45826527", "0.4580308", "0.4576634", "0.45733434", "0.4569405", "0.4568857", "0.45666373", "0.4562138", "0.45593476", "0.4543121", "0.45409226", "0.45378584", "0.45374054", "0.4534311", "0.45323455", "0.45214805", "0.4512154", "0.45098773", "0.45048755", "0.4502512", "0.44987017", "0.44866523", "0.44836578", "0.44819424", "0.44806772", "0.447326", "0.44723013", "0.4462381", "0.44604385", "0.44552937", "0.44552597", "0.44538653", "0.44529843" ]
0.0
-1
Calling method checked for validity of routes;
protected void setRoutes(WriteFileResponse response) { routes[ response.getSequence() ] = response.getRoutingPath(); if ( ableToWrite && totalReceived.incrementAndGet() == routes.length ) { unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void invalidRoute() \n {\n validRoute = false;\n }", "boolean hasRoute();", "public boolean hasValidRoute() \n {\n return validRoute;\n }", "public boolean areRoutesValid() {\n return valid;\n }", "private boolean checkPermissions(HttpServletRequest request, RouteAction route) {\n\t\treturn true;\n\t}", "private void configureRoutesAndExceptions() {\n\n }", "@Override\n public void onAllRoutesCompleted() {\n\n }", "private void routeRequest(String routeId) throws Exception {\r\n WMBController controller = WMBController.getInstance();\r\n controller.getRouteAlerts(routeId, new Callback<List<RouteAlert>>() {\r\n @Override\r\n public void onResponse(Response<List<RouteAlert>> response, Retrofit retrofit) {\r\n List<RouteAlert> data = response.body();\r\n if (data.isEmpty()) {\r\n message.setVisibility(View.VISIBLE);\r\n } else {\r\n message.setVisibility(View.INVISIBLE);\r\n Collections.sort(data);\r\n loadRouteData(data);\r\n }\r\n }\r\n\r\n @Override\r\n public void onFailure(Throwable t) {\r\n // stuff to do when it doesn't work\r\n }\r\n });\r\n }", "protected boolean shouldStartRoutes() {\n return isStarted() && !isStarting();\n }", "@java.lang.Override\n public boolean hasRoute() {\n return stepInfoCase_ == 7;\n }", "@java.lang.Override\n public boolean hasRoute() {\n return stepInfoCase_ == 7;\n }", "@Test\n\tpublic void testWithAnUnexistenceRoute() {\n\t\tassertEquals(Trains.distanceRoute(\"A\", \"E\", \"D\"), \"NO SUCH ROUTE\");\n\t}", "@Override\n public void getRoutes(LoadRouteCallback callback) {\n\n\n }", "private void checkRequest(Request req) throws MethodNotAllowed, NotFound {\n if (!req.getHeader(\"Method\").equals(\"GET\") ||\n !req.getHeader(\"Version\").equals(\"HTTP/1.1\")) {\n throw new MethodNotAllowed();\n }\n if (req.getHeader(\"Path\").endsWith(\"/\")) {\n throw new NotFound();\n }\n }", "protected boolean isRouteDisplayed() {\n\t\treturn false;\n }", "public void checkAuthority() {\n }", "@Override\n\tprotected String doInBackground(String... params) {\n\t\tif (params[0] == \"getRoutes\") {\n\t\t\tString allRoutes = getRoutes();\n\t\t\treturn allRoutes;\n\t\t} else if (params[0] == \"getRouteInfo\") {\n\n\t\t} else if (params[0] == \"createRoute\") {\n\t\t\tLog.i(getClass().getSimpleName(), \"condition reached !!!!!!!!!\");\n\t\t\tcreateRoute(params[1], params[2], params[3], params[4], params[5],\n\t\t\t\t\tparams[6], params[7], params[8], params[9]);\n\n\t\t} else if (params[0] == \"updateRoute\") {\n\t\t\tLog.i(getClass().getSimpleName(), \"condition reached !!!!!!!!!\");\n\t\t\tupdateRoute(params[1], params[2], params[3], params[4], params[5],\n\t\t\t\t\tparams[6], params[7], params[8], params[9], params[10]);\n\n\t\t} else if (params[0] == \"deleteRoute\") {\n\t\t\tdeleteRoute(params[1]);\n\t\t}\n\n\t\treturn null;\n\t}", "Route route(String path);", "public Route getRoute();", "@Override\r\n\tprotected boolean isRouteDisplayed() {\n\t\treturn true;\r\n\t}", "boolean hasRouteDest();", "public void routingStarted(RoutingHeader routingHeader) {\n \n }", "public void routingStarted(RoutingHeader routingHeader) {\n \n }", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn true;\n\t}", "@Override\r\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\r\n\t}", "@Override\r\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\r\n\t}", "@Override\r\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\r\n\t}", "@Override\r\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\r\n\t}", "@Override\n public void onRoutePlanFailed() {\n\n }", "public void testRoute() {\r\n\t\tLog.i(\"JUNIT\", \"Routing test started\");\r\n\t\t// create route with known points\r\n\t\tRoute pr = new Route(new GeoLocation(49.904005, 10.859725),\r\n\t\t\t\tnew GeoLocation(49.902637, 10.870646));\r\n\t\tList<GeoLocation> listLocations = new LinkedList<GeoLocation>();\r\n\t\t// retrieve path\r\n\t\tlistLocations = pr.getPath();\r\n\r\n\t\t// check maneuver count == 7\r\n\t\t// assertEquals(listLocations.size(),7);\r\n\t\tassertTrue(listLocations.size() > 0);\r\n\t}", "@SneakyThrows\n private void invokeRequestRouting(Class<?> clazz, Injector injector) {\n log.info(MODULE_NAME + clazz.getName());\n Route route = clazz.getAnnotation(Route.class);\n String prefix = route.value();\n Object instance = injector.getInstance(clazz);\n clazz.getMethod(ROUTE_METHOD_NAME, String.class).invoke(instance, prefix);\n Method[] methods = clazz.getMethods();\n for (Method method : Arrays.asList(methods)) {\n if (method.isAnnotationPresent(RequestRouting.class)) {\n RequestRouting requestRouting = method.getAnnotation(RequestRouting.class);\n String path = requestRouting.path();\n int order = requestRouting.order();\n path = (StringUtils.isNotEmpty(prefix)) ? prefix + path : path;\n router.route(requestRouting.method(), path).order(order).handler(rc -> {\n try {\n method.invoke(instance, rc);\n } catch (Exception e) {\n log.error(MODULE_NAME + e.getMessage());\n }\n });\n }\n }\n }", "public void compute() {\r\n this.host = \".*\";\r\n this.hostPattern = new Pattern(host);\r\n // staticDir\r\n if (action.startsWith(\"staticDir:\")) {\r\n if (!method.equalsIgnoreCase(\"*\") && !method.equalsIgnoreCase(\"GET\")) {\r\n Logger.warn(\"Static route only support GET method\");\r\n return;\r\n }\r\n if (!this.path.endsWith(\"/\") && !this.path.equals(\"/\")) {\r\n Logger.warn(\"The path for a staticDir route must end with / (%s)\", this);\r\n this.path += \"/\";\r\n }\r\n this.pattern = new Pattern(\"^\" + path + \"({resource}.*)$\");\r\n this.staticDir = action.substring(\"staticDir:\".length());\r\n } else {\r\n // URL pattern\r\n // Is there is a host argument, append it.\r\n if (!path.startsWith(\"/\")) {\r\n String p = this.path;\r\n this.path = p.substring(p.indexOf(\"/\"));\r\n this.host = p.substring(0, p.indexOf(\"/\"));\r\n\r\n Matcher m = new Pattern(\".*\\\\{({name}.*)\\\\}.*\").matcher(host);\r\n\r\n if (m.matches()) {\r\n String name = m.group(\"name\");\r\n hostArg = new Arg();\r\n hostArg.name = name;\r\n }\r\n this.host = this.host.replaceFirst(\"\\\\{.*\\\\}\", \"\");\r\n this.hostPattern = new Pattern(host);\r\n }\r\n String patternString = path;\r\n patternString = customRegexPattern.replacer(\"\\\\{<[^/]+>$1\\\\}\").replace(patternString);\r\n Matcher matcher = argsPattern.matcher(patternString);\r\n while (matcher.find()) {\r\n Route.Arg arg = new Arg();\r\n arg.name = matcher.group(2);\r\n arg.constraint = new Pattern(matcher.group(1));\r\n args.add(arg);\r\n }\r\n\r\n patternString = argsPattern.replacer(\"({$2}$1)\").replace(patternString);\r\n this.pattern = new Pattern(patternString);\r\n // Action pattern\r\n patternString = action;\r\n patternString = patternString.replace(\".\", \"[.]\");\r\n for (Route.Arg arg : args) {\r\n if (patternString.contains(\"{\" + arg.name + \"}\")) {\r\n patternString = patternString.replace(\"{\" + arg.name + \"}\", \"({\" + arg.name + \"}\" + arg.constraint.toString() + \")\");\r\n actionArgs.add(arg.name);\r\n }\r\n }\r\n actionPattern = new Pattern(patternString, REFlags.IGNORE_CASE);\r\n }\r\n }", "public boolean handle(ExchangeHelper exchangeHelper) throws IOException {\n if (method == null || method == exchangeHelper.getMethod()) {\n System.out.println(String.format(\"%s request received on path '%s', using handler: %s\", exchangeHelper.getMethod(), exchangeHelper.getUriPath(), handler.getClass().getSimpleName()));\n\n //Run pre filters\n for (RouteFilter filter : preFilters) {\n if (!filter.doFilter(exchangeHelper)) {\n //We don't continue, but the request was handled\n return true;\n }\n }\n\n //OK, we are a route for that method\n handler.handle(exchangeHelper);\n\n //Run post filters\n for (RouteFilter filter : postFilters) {\n if (!filter.doFilter(exchangeHelper)) {\n //We don't continue, but the request was handled\n return true;\n }\n }\n\n //We handled that request\n return true;\n }\n\n //We did NOT handle that request\n return false;\n }", "@Override\n\tpublic void onCalculateRouteSuccess() {\n\t\tnaviActivity();\n\t}", "@Override\n public void init(Router router) {\n\n // /////////////////////////////////////////////////////////////////////\n // some default functions\n // /////////////////////////////////////////////////////////////////////\n // simply render a page:\n router.GET().route(\"/\").with(ApplicationController.class, \"index\");\n router.GET().route(\"/examples\").with(ApplicationController.class, \"examples\");\n\n // render a page with variable route parts:\n router.GET().route(\"/user/{id}/{email}/userDashboard\").with(ApplicationController.class, \"userDashboard\");\n\n router.GET().route(\"/validation\").with(ApplicationController.class, \"validation\");\n\n // redirect back to /\n router.GET().route(\"/redirect\").with(ApplicationController.class, \"redirect\");\n\n router.GET().route(\"/session\").with(ApplicationController.class, \"session\");\n \n router.GET().route(\"/flash_success\").with(ApplicationController.class, \"flashSuccess\");\n router.GET().route(\"/flash_error\").with(ApplicationController.class, \"flashError\");\n router.GET().route(\"/flash_any\").with(ApplicationController.class, \"flashAny\");\n \n router.GET().route(\"/htmlEscaping\").with(ApplicationController.class, \"htmlEscaping\");\n\n // /////////////////////////////////////////////////////////////////////\n // Json support\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/api/person.json\").with(PersonController.class, \"getPersonJson\");\n router.POST().route(\"/api/person.json\").with(PersonController.class, \"postPersonJson\");\n \n router.GET().route(\"/api/person.xml\").with(PersonController.class, \"getPersonXml\");\n router.POST().route(\"/api/person.xml\").with(PersonController.class, \"postPersonXml\");\n\n // /////////////////////////////////////////////////////////////////////\n // Form parsing support\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/contactForm\").with(ApplicationController.class, \"contactForm\");\n router.POST().route(\"/contactForm\").with(ApplicationController.class, \"postContactForm\");\n\n // /////////////////////////////////////////////////////////////////////\n // Cache support test\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/test_caching\").with(ApplicationController.class, \"testCaching\");\n \n // /////////////////////////////////////////////////////////////////////\n // Lifecycle support\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/udpcount\").with(UdpPingController.class, \"getCount\");\n \n // /////////////////////////////////////////////////////////////////////\n // Route filtering example:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/filter\").with(FilterController.class, \"filter\");\n router.GET().route(\"/teapot\").with(FilterController.class, \"teapot\");\n\n // /////////////////////////////////////////////////////////////////////\n // Route filtering example:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/injection\").with(InjectionExampleController.class, \"injection\");\n\n // /////////////////////////////////////////////////////////////////////\n // Async example:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/async\").with(AsyncController.class, \"asyncEcho\");\n\n // /////////////////////////////////////////////////////////////////////\n // I18n:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/i18n\").with(I18nController.class, \"index\");\n router.GET().route(\"/i18n/{language}\").with(I18nController.class, \"indexWithLanguage\");\n\n // /////////////////////////////////////////////////////////////////////\n // Upload showcase\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/upload\").with(UploadController.class, \"upload\");\n router.POST().route(\"/uploadFinish\").with(UploadController.class, \"uploadFinish\");\n \n \n //this is a route that should only be accessible when NOT in production\n // this is tested in RoutesTest\n if (!ninjaProperties.isProd()) {\n router.GET().route(\"/_test/testPage\").with(ApplicationController.class, \"testPage\");\n }\n\n router.GET().route(\"/assets/.*\").with(AssetsController.class, \"serve\");\n }", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean isRouteDisplayed() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void seeRoute() {\n\t\tRoute route = game.getIncidentRoutes();\n\t\tSystem.out.println(route);\n\t\tSystem.out.println(\"Total sailing days required is \"+ game.calculateSailingDays(route)+\" days\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"Choose your actions: \");\n\t\t\tSystem.out.println(\"(1) Go back!\");\n\t\t\tSystem.out.println(\"(2) Set Sail\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tstate = true;\n\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (game.isIslandReachable(route)) {\n\t\t\t\t\t\tif (game.checkMyShipHealth()) {\n\t\t\t\t\t\t\tgame.payCrew(route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"You should repair your ship first!\" + \"\\n\" + \"you will be redirected to store at your current Island\" + \"\\n\");\n\t\t\t\t\t\t\tgame.repairMyShip();\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\tSystem.out.println(\"This Island is not accessible because you don't have enough days left, you can choose other Island\");\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Test\r\n public void testGetRoute() {\r\n // Test 1 (Short Path)\r\n Path route = backend.getRoute(\"Observatory & Babcock\", \"Liden & Babcock\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 460)\r\n fail(\"Failed to get shortest path\");\r\n // Verify path starts at 'Observatory & Babcock' and ends at 'Liden & Babcock'\r\n if(!route.getPath().get(0).getName().equalsIgnoreCase(\"Observatory & Babcock\") ||\r\n !route.getPath().get(1).getName().equalsIgnoreCase(\"Liden & Babcock\"))\r\n fail(\"Failed to get shortest path\");\r\n\r\n //Test 2 (Short Path w/ POIs)\r\n route = backend.getRoute(\"Mills & Johnson\", \"Brooks & Johnson\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 441)\r\n fail(\"Failed to get shortest path\");\r\n // Verify point of interest\r\n if(!route.getPOI().get(0).equalsIgnoreCase(\"Grand Central\"))\r\n fail(\"Failed to find point of interest\");\r\n }", "public int finalizeRouteEnvironment();", "@Then(\"^I can create a route called \\\"([^\\\"]*)\\\"$\")\n public void iCanCreateARouteCalled(String routeName) throws Throwable {\n createStopPoint(sp1Name);\n createStopPoint2();\n createRoute(routeName);\n }", "@Test\n\tpublic void checkDistanceRouteABC() {\n\t\tassertEquals(Trains.distanceRoute(\"A\", \"B\", \"C\"), \"9\");\n\t}", "protected boolean isApplicable(SPRequest req) {\n\n Log.debug(\"isApplicable ? \" + req.getPath() + \" vs \" + getRoute());\n\n if (!req.getMethod().equals(getHttpMethod()))\n return false;\n\n String[] uri = req.getSplitUri();\n String[] tok = splitPath;\n if (uri.length != tok.length && splatIndex == -1)\n return false;\n\n if (uri.length <= splatIndex)\n return false;\n\n for (int i = 0; i < tok.length; i++) {\n if (tok[i].charAt(0) != ':' && tok[i].charAt(0) != '*' && !tok[i].equals(uri[i]))\n return false;\n }\n\n return true;\n }", "boolean hasRoute(Node to);", "@Override\n protected boolean isRouteDisplayed() {\n return false;\n }", "@Override\n protected boolean isRouteDisplayed() {\n return false;\n }", "public void registerRoute(RouteHandler handler) {\n Class<? extends RouteHandler> clazz = handler.getClass();\n if (clazz.isAnonymousClass()) {\n throw new RouteException(\"Handler class cannot be anonymous!\");\n }\n\n Method method = handler.getMethod();\n Route route = new Route(clazz, handler.getTemplate(), handler, method);\n List<Route> routes = methodRoutes.get(method);\n if (routes == null) {\n routes = new ArrayList<>();\n routes.add(route);\n methodRoutes.put(method, routes);\n } else {\n routes.add(route);\n }\n\n // we only need to sort if a route with variable segments is inserted\n if (route.getRouteTemplate().getParameterSegmentCount() != 0) {\n routes.sort((a, b) -> {\n int segCountA = a.getRouteTemplate().getParameterSegmentCount();\n int segCountB = b.getRouteTemplate().getParameterSegmentCount();\n return segCountA - segCountB;\n });\n }\n }", "public RouteResponse findRoute(RouteRequest routeRequest);", "private void checkAuthorization(RoutingContext context, List<CaptureMap> resolvedCaptureCollections,\n Handler<AsyncResult<Boolean>> handler) {\n AuthHandler auth = context.get(AuthenticationController.AUTH_HANDLER_PROP);\n if (auth != null && auth instanceof RedirectAuthHandlerBt) {\n MemberUtil.getCurrentUser(context, getNetRelay(), result -> {\n if (result.failed()) {\n handler.handle(Future.failedFuture(result.cause()));\n } else {\n IAuthenticatable member = result.result();\n if (member == null) {\n // this is an error\n handler.handle(Future.failedFuture(\n new IllegalArgumentException(\"This should not happen, we need an instance of IAuthenticatable here\")));\n } else {\n checkAuthorization(resolvedCaptureCollections, auth, member, handler);\n }\n }\n });\n } else {\n handler.handle(Future.succeededFuture(true));\n }\n }", "abstract protected boolean checkMethod();", "public boolean routeExists(String to) {\n\tRoutesMap routesMap = forwardTable.get(to);\n\tif(routesMap == null) {\n\t return false;\n\t}\n\treturn (routesMap.size() > 0);\n }", "public boolean isOnRoute() {\n\t\treturn onRoute;\n\t}", "@Override\n protected RouterFunction<ServerResponse> getRoutingFunction(ErrorAttributes errorAttributes) {\n return RouterFunctions.route(RequestPredicates.all(),this::errorHandler);\n }", "protected boolean requiresTravelerApprovalRouting() {\n //If there's travel advances, route to traveler if necessary\n return requiresTravelAdvanceReviewRouting() && !getTravelAdvance().getTravelAdvancePolicy();\n }", "@GET(\"/routecollection/{startLocation}\")\n void getRoutes(@Path(\"startLocation\")String startLocation, Callback<Routes> routes);", "public void configureRoutes() {\n Service http = Service.ignite();\n\n http.port( 6001 );\n\n http.after( ( (request, response) -> response.type(\"application/json\" ) ) );\n\n http.post( \"/accounts/authenticate\", this.authRoutes.authenticate );\n http.post( \"/restaurants/authenticate\", this.authRoutes.authenticateRestaurant );\n\n http.post( \"*\", (req, res) -> {\n res.status( HttpStatus.NOT_FOUND_404 );\n\n return \"{}\";\n } );\n }", "@Override\n\tpublic void run()\n\t{\n\t\tremoveOldRoutes();\n\t}", "protected abstract Builder processSpecificRoutingRule(Builder rb);", "void check()\n {\n final ScopeSymbolValidator validator = new ScopeSymbolValidator();\n for (ServiceMethod method : methods)\n validator.validate(method.getName(), method);\n }", "private void callHandler(String method, HttpServletRequest request, HttpServletResponse response) throws IOException {\n JsonElement payload = getPayload(request, response);\n RequestContext context = new RequestContext(\n request, response, urlVariables, request.getParameterMap(), payload);\n PathNode apiStructure = getApiStructure(method);\n\n if (request.getPathInfo() == null) {\n logger.warn(\"Received \" + method + \" request with empty path.\");\n return;\n }\n\n PathNode.PathNodeResult result = apiStructure.getBindingForSubPath(request.getPathInfo());\n if (result != null) {\n urlVariables.putAll(result.getArgValues());\n result.getApiSpec().apiInterface.call(context);\n }\n }", "@Override\n\tpublic void onCalculateMultipleRoutesSuccess(int[] arg0) {\n\n\t}", "boolean hasRoutingAppID();", "private void validate() {\n Validate.notNull(uriLocatorFactory);\n Validate.notNull(preProcessorExecutor);\n }", "public interface Route {\n boolean match(AreaPath path);\n\n Map<String, Object> getParameterValues();\n\n /**\n * target action path\n */\n ActionPath getActionPath();\n\n /**\n * target action processor\n */\n String getProcessor();\n\n /**\n * target action task\n */\n String getTask();\n}", "@Override\n public void validate() throws Exception {\n if (caller != null) {\n caller.callSampleApp();\n }\n\n // hit the mocked server to validate to if it receives data\n callMockedServer();\n }", "@Override\n\t\t\t\tpublic void onCalculateMultipleRoutesSuccess(int[] arg0) {\n\t\t\t\t\t\n\t\t\t\t}", "@Test(invocationCount = 1)\n public void testRouting()\n throws Exception {\n\n token.executeStep();\n\n Thread.sleep(LONG_WAITING_TIME_TEST);\n\n Assert.assertEquals(token.getCurrentNode(), endNode1, errorMessage());\n\n Mockito.verify(token).resume(Mockito.any(IncomingIntermediateProcessEvent.class));\n }", "@Test\n\tpublic void checkShortestRoute() {\n\t\tassertEquals(Trains.shortestRoute(\"A\",\"C\"), 9);\n\t\t//assertEquals(Trains.shortestRoute(\"B\",\"B\"), 9);\n\t}", "@Override\n protected void checkLocation() {\n // nothing\n }", "public Route routes() {\n return concat(\n pathPrefix(\"hello\", () ->\n concat(\n getHello(),\n path(PathMatchers.segment(), message -> concat(\n getAck(message)\n )\n )\n )\n ),\n pathPrefix(\"mission\", this::handleMission)\n );\n }", "private void setupRoutes() {\n\t\tpost(\"/messages\", (req, res) -> {\n\n\t\t\ttry {\n\t\t\t\tMessage newMessage = mapper.readValue(req.body(), Message.class);\n\t\t\t\t// Message newMessage = gson.fromJson(req.body(),\n\t\t\t\t// Message.class);\n\t\t\t\tif (!newMessage.isValid()) {\n\t\t\t\t\tres.status(HTTP_BAD_REQUEST);\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t\tservice.messagePost(newMessage);\n\t\t\t\tres.status(HTTP_OK_REQUEST);\n\t\t\t\treturn res;\n\t\t\t} catch (Exception e) {\n\t\t\t\tres.status(HTTP_BAD_REQUEST);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * \n\t\t */\n\t\tget(\"/messages/syntesis\", (request, response) -> {\n\t\t\treturn new Synthesis(1, 12l, 12l, 12L);\n\t\t} , new JsonTransformer());\n\n\t}", "public void setMethod(String method)\r\n {\r\n routing_method=method;\r\n }", "private boolean roadCheck(Road road) {\n\t\t\n\t\treturn false;\n\t}", "@Override\n\tpublic void onGetIndoorRouteResult(IndoorRouteResult arg0) {\n\n\t}", "public boolean hasRoute(Route route) {\n return routes.contains(route);\n }", "@RequestMapping\n public void othersRooms() throws MethodNotAllowedException {\n throw new MethodNotAllowedException();\n }", "@Override\n public Route route(AsyncRequest request) {\n R route = matchByUri(request);\n if (route == null) {\n route = matchAll(request);\n }\n if (route == null) {\n return null;\n }\n return route.route;\n }", "protected boolean isValidLogin(final String path, final String method) {\n return \"/apikey\".equals(path);\n }", "default void computeRoutes(\n com.google.maps.routing.v2.ComputeRoutesRequest request,\n io.grpc.stub.StreamObserver<com.google.maps.routing.v2.ComputeRoutesResponse>\n responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getComputeRoutesMethod(), responseObserver);\n }", "@Test\n\tpublic void checkNumberOfDifferentRoutes() {\n\t\tassertEquals(Trains.numberDifferentRoutes(\"C\",\"C\",30), 7);\n\t}", "private static boolean isNotLoopRoute( String s, String d ) {\n\t\tif ( !s.equals(d) ) return true; \n\t\tthrow new IllegalArgumentException(\"A route from '\"+s+\"' to it self is not possible\");\n\t}", "@Test\n void calculateRoute() {\n GPSObject n2 = new GPSObject(\"Centenary 2\");\n Location n1 = new Location(\"Centenary 2\",\"0\",n2);\n GPSObject n3 = new GPSObject(\"Thuto 1-5\");\n Location n4 = new Location(\"Thuto 1-5\",\"1\",n3);\n Locations loc = new Locations();\n assertNotNull(roo.calculateRoute(loc));\n }", "@Override\n\t\t\tpublic void handle(Request req, Response res) throws Exception {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String username = req.queryParams(\"user\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t\n\t\t\t\t//--- framework access ---//\n\t\t\t\tif (!Results.hasFrameworkAccess(op, path)) halt(404);\n\t\t\t\t//--- path exists? ---//\n\t\t\t\tif (!Directories.isExist(path)) halt(404);\n\t\t\t\t//--- section and path access ---//\n\t\t\t\tif (!AccessManager.hasAccess(username, path)) halt(401);\n\n\t\t\t}", "boolean updateRoute(RouteBean route);", "public interface PrivateApiRoutes {\n}", "void can_register_valid_racer() {\n }", "private void check() {\n Path pathroot = getPath();\n // check the path is file or directory\n checkFileOrDirectory(pathroot);\n }", "void onSucceedFindDirection(List<RouteBeetweenTwoPointsDTO> route);" ]
[ "0.6874613", "0.66570973", "0.6583172", "0.65481246", "0.60401106", "0.5655919", "0.5516416", "0.54973", "0.547578", "0.54584676", "0.5439637", "0.5427005", "0.5412428", "0.5356606", "0.53479654", "0.5330235", "0.5318731", "0.5309659", "0.5306227", "0.5278017", "0.5240219", "0.521034", "0.521034", "0.52045554", "0.5189171", "0.5189171", "0.5189171", "0.5189171", "0.51863766", "0.51832044", "0.51712877", "0.5158228", "0.5142742", "0.51329774", "0.51152515", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.5113555", "0.51110864", "0.5105529", "0.50964326", "0.5092284", "0.50882953", "0.5082457", "0.5066687", "0.5061327", "0.5061327", "0.50569105", "0.5056553", "0.5044269", "0.5021549", "0.5004159", "0.49858513", "0.49726817", "0.49647525", "0.49635744", "0.49619412", "0.4957344", "0.49507624", "0.49471438", "0.49291065", "0.49187815", "0.49125558", "0.491222", "0.4900432", "0.48991615", "0.4884786", "0.4869235", "0.48652613", "0.48634288", "0.48568723", "0.485519", "0.48520517", "0.48481065", "0.4845057", "0.4839066", "0.48375574", "0.48349252", "0.48316267", "0.4826125", "0.48222646", "0.48143142", "0.48022127", "0.47782144", "0.4770637", "0.47381535", "0.47280356", "0.47211546", "0.47166625" ]
0.0
-1
Iterate through the files and send them to the chunk servers a chunk at a time. A request to the controller will provide details of which servers to communicate with.
public void send(List<File> files) { SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS" ); int numberOfFiles = files.size(); LOG.info( "Started uploading " + numberOfFiles + " file(s) at " + sdf.format( System.currentTimeMillis() ) ); ConnectionUtilities connections = new ConnectionUtilities(); for ( File file : files ) { ableToWrite = true; totalReceived.set( 0 ); try ( InputStream is = new FileInputStream( file ) ) { processIndividualFile( file, is, connections ); } catch ( IOException | ClientWriteException | NumberFormatException e ) { LOG.error( "Unable to process the file " + file.getName() + ". " + e.getMessage() ); try { // sleep to allow stale messages to be send before reading next file TimeUnit.SECONDS.sleep( 1 ); } catch ( InterruptedException e0 ) { LOG.error( e0.getMessage() ); } --numberOfFiles; } catch ( InterruptedException e ) { LOG.error( e.getMessage() ); Thread.currentThread().interrupt(); } } LOG.info( "Finished uploading " + numberOfFiles + " file(s) at " + sdf.format( System.currentTimeMillis() ) + "\n" ); connections.setAbleToClear( true ); connections.closeCachedConnections(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\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\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void sendToNodes(Sm.RetrieveChunkResponse chunkResponse, ArrayList<Sm.StorageNode> toSend) {\n\n System.out.println(\"Nodes to send to: \" + toSend);\n\n if (toSend.size() != 0) {\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n PatrolMessagePipeline pipeline = new PatrolMessagePipeline();\n Bootstrap bootstrap = new Bootstrap()\n .group(workerGroup)\n .channel(NioSocketChannel.class)\n .option(ChannelOption.SO_KEEPALIVE, true)\n .handler(pipeline);\n\n// for (Sm.StorageNode node: toSend) {\n\n //create StoreChunkRequest\n Sm.StoreChunk chunk = Sm.StoreChunk.newBuilder()\n .setFileName(chunkResponse.getFilename())\n .setChunkId(chunkResponse.getChunkId())\n .setChunkSize(chunkResponse.getChunkSize())\n .setData(chunkResponse.getData())\n .setChunkName(chunkResponse.getChunkName())\n .build();\n\n Sm.StorageNodes nodes = Sm.StorageNodes.newBuilder()\n .addAllNodeList(toSend)\n .build();\n\n Sm.StorageNode primary = toSend.get(0);\n System.out.println(\"Primary: \" + primary.getIp());\n System.out.println(\"Primary: \" + primary.getPort());\n\n //Connect to the first replica\n ChannelFuture cf = bootstrap.connect(primary.getIp(), primary.getPort());\n cf.syncUninterruptibly();\n\n //Prepare Request & Wrap\n Sm.StoreChunkRequest request = Sm.StoreChunkRequest.newBuilder()\n .setChunk(chunk)\n .setNodes(nodes)\n .build();\n\n Sm.StorageMessageWrapper msgWrapper = Sm.StorageMessageWrapper.newBuilder()\n .setScRequest(request)\n .build();\n\n //Send\n Channel chan = cf.channel();\n PatrolInboundHandler handler = chan.pipeline().get(PatrolInboundHandler.class);\n Sm.StorageMessageWrapper response = handler.request(msgWrapper);\n\n if (response.getScResponse().getSuccess()) {\n System.out.println(\"StoreChunk successful?: \" + response.getScResponse().getSuccess());\n Controller.getInstance().updateReplicasAndChunkNames(toSend, chunk.getChunkName());\n }\n\n workerGroup.shutdownGracefully();\n }\n }", "private void sendWriteChunkRequest(File file, InputStream is,\n ConnectionUtilities connections, int numberOfChunks)\n throws NumberFormatException, IOException {\n byte[] message = new byte[ Constants.CHUNK_SIZE ];\n\n ProgressBar progress = new ProgressBar( file.getName() );\n\n WriteChunkRequest request = new WriteChunkRequest( file.getAbsolutePath(),\n 0, null, file.lastModified(), 1, null );\n\n int sequence = 0, length = 0;\n while ( ( length = is.read( message ) ) != -1 )\n {\n // Only send to the first connection, whom will forward the rest\n String[] initialConnection = routes[ sequence ][ 0 ].split( \":\" );\n TCPConnection connection =\n connections.cacheConnection( node, initialConnection, false );\n // Pad elements b[k] through b[b.length-1] with zeros\n Arrays.fill( message, length, Constants.CHUNK_SIZE, ( byte ) 0 );\n byte[][] messageToSend = new byte[][] { message };\n if ( Properties.SYSTEM_DESIGN_SCHEMA\n .equals( Constants.SYSTEM_TYPE_ERASURE ) )\n {\n messageToSend = ReedSolomonUtilities.encode( message );\n }\n request.setMessage( messageToSend );\n request.setRoutes( routes[ sequence ] );\n request.setSequence( sequence );\n connection.getTCPSender().sendData( request.getBytes() );\n\n progress.update( sequence, numberOfChunks );\n ++sequence;\n }\n }", "public void run() {\n\n ServerSocket ss = null;\n try {\n\n ss = new ServerSocket(port); // accept connection from other peers and send out blocks of images to others\n\n } catch (Exception e) {\n\n // e.printStackTrace();\n\n }\n\n while (true) {\n\n Socket s;\n\n try {\n\n s = ss.accept();\n\n new Thread(new uploader(s)).start(); // create an uploader thread for each incoming client\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }\n\n }", "public UploadHandle upload(List<File> files) throws Exception {\n \tMetadata md = new Metadata();\n \tfinal FileCollection fcol = new FileCollection(md);\n \tfor(File f: files) {\n \t\tFileMetaData mf = new FileMetaData(f.getName(), f.getLocalName(), \"\", null);\n \t\tmf.setGroups(f.getGroups());\n \t\tmd.md.file.add(mf);\n \t}\n NullOutputStream ostream = new NullOutputStream();\n fcol.tarit(ostream);\n long length = ostream.getLength();\n\n HttpResponse response = client.get(new URI(config.preallocurl()));\n String prealloc_file = this.read_http_entity(response.getEntity());\n String ingestServer = prealloc_file.split(\"\\n\")[0];\n String location = prealloc_file.split(\"\\n\")[1];\n ingestServer = ingestServer.split(\": \")[1];\n location = location.split(\": \")[1];\n \n PipedInputStream in = new PipedInputStream();\n final PipedOutputStream out = new PipedOutputStream(in);\n new Thread(\n new Runnable(){\n @Override\n public void run(){\n try {\n fcol.tarit(out);\n } catch (Exception ex) {\n Logger.getLogger(Connect.class.getName()).log(Level.SEVERE, null, ex);\n \n }\n }\n }\n ).start();\n \n InputStreamEntity entity = new InputStreamEntity(in, length);\n response = client.put(entity, new URI(\"https://\"+ingestServer+location));\n this.read_http_entity(response.getEntity());\n\n response = client.get(new URI(\"https://\"+ingestServer+config.finishurl()+location));\n String status_url = this.read_http_entity(response.getEntity());\n for(String line:status_url.split(\"\\n\")) {\n System.out.println(line);\n if(line.startsWith(\"Status: \"))\n status_url = line.split(\": \")[1];\n }\n System.out.println(status_url+\"/xml\");\n StatusHandler sturl = new StatusHandler();\n sturl.status_url = status_url+\"/xml\";\n sturl.timeout = 30;\n sturl.step = 5;\n UploadHandle ret = sturl;\n return ret;\n }", "@Override\r\n\tprotected void process(List<String> chunks) {\r\n\t\tfor (String data: chunks) {\r\n\t\t\thandleData(data);\r\n\t\t}\r\n\t}", "private void processIndividualFile(File file, InputStream is,\n ConnectionUtilities connections) throws IOException, InterruptedException,\n ClientWriteException, NumberFormatException {\n\n SimpleDateFormat sdf = new SimpleDateFormat( \"yyyy-MM-dd HH:mm:ss.SSS\" );\n LOG.debug( \"The file: \" + file.getAbsolutePath() + \" was last modified at \"\n + sdf.format( file.lastModified() ) );\n\n int filelength = ( int ) file.length();\n int numberOfChunks =\n ( int ) Math.ceil( ( double ) filelength / Constants.CHUNK_SIZE );\n\n routes = new String[ numberOfChunks ][];\n\n WriteFileRequest request = new WriteFileRequest( file.getAbsolutePath(), 0,\n filelength, numberOfChunks );\n for ( int sequence = 0; sequence < numberOfChunks; ++sequence )\n {\n request.setSequence( sequence );\n this.node.getControllerConnection().getTCPSender()\n .sendData( request.getBytes() );\n }\n // wait for response from controller containing routing information.\n synchronized ( lock )\n {\n lock.wait();\n }\n if ( !ableToWrite )\n {\n throw new ClientWriteException( \"The controller has not\"\n + \" received file chunk locations for the original file yet.\" );\n }\n sendWriteChunkRequest( file, is, connections, numberOfChunks );\n }", "@Override\n\tpublic void run() \n\t{\n\t\ttry\n\t\t{\t\t\t\n\t\t\tint [] blockSizes = {1,1024,65505};\n\t\t\tfor(int blk = 0; blk < blockSizes.length; blk++)\n\t\t\t{\n\t\t\t\tDataInputStream inpStream = new DataInputStream(clientSock.getInputStream());\n\t\t\t\tDataOutputStream opStream = new DataOutputStream(clientSock.getOutputStream());\n\n\t\t\t\tFile file = new File(\"ClientA.txt\");\n\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\n\t\t\t\tbufLen = blockSizes[blk];\n\t\t\t\t\n\t\t\t\tbyte[] buffContent = new byte[bufLen];\n\t\t\t\tint numRead = 0, totalBytes=0;\n\n\t\t\t\twhile ((numRead = inpStream.read(buffContent))!=-1) \n\t\t\t\t{\n\t\t\t\t\tfos.write(buffContent, 0, numRead);\n\t\t\t\t\ttotalBytes+=numRead;\n\t\t\t\t\tif (totalBytes == bufLen)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tnumRead = 0;\n\t\t\t\ttotalBytes = 0;\n\t\t\t\n\t\t\t\twhile((numRead = fis.read(buffContent))!=-1)\n\t\t\t\t{\t\t\n\t\t\t\t\topStream.write(buffContent,0,numRead);\n\t\t\t\t\ttotalBytes+=numRead;\n\t\t\t\t\tif (totalBytes == bufLen)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sendChunk(String fileName,ObjectOutputStream out)\n {\n FileInputStream fInput;\n BufferedInputStream bufInput;\n byte[] byteToSend = new byte[chunkSize];\n try\n {\n fInput = new FileInputStream(fileName);\n bufInput = new BufferedInputStream(fInput);\n int b;\n int i=0;\n b = bufInput.read(byteToSend,0,chunkSize);\n out.write(byteToSend,0,chunkSize);\n out.flush();\n bufInput.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File Chunk Not found Exception: Some chunk missing.\");\n }\n catch(IOException ex)\n {\n System.out.println(\"IOException while reading from the chunk file.\");\n }\n }", "private void ViewFiles(ByteBuffer packet) throws IOException{\n\t\t// (view files req c->s) [header | page (4)]\n\t\t// (initial response) [header | num files to expect | total num (4)]\n\t\t// (list of available clients s->c) [header | size(8) | num_peers(4) | id(4) | name(?)]xNum files\n\t\tMap<ServerFile, Integer> files = totalFiles();\n\t\t\n\t\t//read payload / construct response\n\t\tif (packet.capacity() < 4)\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"page not correctly specified\");\n\t\t\n\t\tint page = packet.getInt(0);\n\t\t\n\t\tint num_to_send = files.size();\n\t\tif (files.size() > (Constants.PAGE_SIZE * page))\n\t\t\tnum_to_send = Constants.PAGE_SIZE;\n\t\telse if (files.size() > (Constants.PAGE_SIZE * (page - 1)))\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\telse {\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\t\tpage = (files.size() / Constants.PAGE_SIZE) + 1;\n\t\t}\n\t\t\t\n\t\tbuf = Utility.addHeader(1, 8, client.getId());\n\t\tbuf.putInt(Constants.HEADER_LEN, num_to_send);\n\t\tbuf.putInt(Constants.HEADER_LEN + 4, files.size());\n\t\tbyte[] sendData = buf.array();\n\t\t\n\t\t// send response\n\t\tout.write(sendData);\n\t\tout.flush();\n\t\t\n\t\t//construct/send file infos\n\t\tIterator<ServerFile> it = files.keySet().iterator();\n\t\tfor (int count = 0; count < ((page - 1) * Constants.PAGE_SIZE); count++)\n\t\t\tit.next();\n\t\tfor (int count = 0; count < num_to_send; count++) {\n\t\t\tServerFile f = it.next();\n\t\t\tString sent_name = f.name() + '\\0';\n\t\t\tbuf = Utility.addHeader(1, sent_name.length() + 16, client.getId());\n\t\t\tbuf.putLong(Constants.HEADER_LEN, f.size());\n\t\t\tbuf.putInt(Constants.HEADER_LEN + 8, files.get(f)); \n\t\t\tbuf.putInt(Constants.HEADER_LEN + 12, f.id());\n\t\t\tbyte[] sent_name_bytes = sent_name.getBytes();\n\t\t\tfor (int i = 0; i < sent_name.length(); i++)\n\t\t\t\tbuf.put(Constants.HEADER_LEN + 16 + i, sent_name_bytes[i]);\n\t\t\tsendData = buf.array();\n\t\t\tout.write(sendData);\n\t\t\tout.flush();\n\t\t}\t\t\n\t\tSystem.out.println(client.getAddress() + \": Correctly processed file req\");\n\t}", "void sendChunkRequest(int chunkX, int chunkY);", "@Override\r\n public void run()\r\n {\r\n File server_Dir_Files = new File(client_Info.getDir());\r\n File[] server_Files = server_Dir_Files.listFiles();\r\n boolean check;\r\n ArrayList<String> user_Files = new ArrayList<>();\r\n try\r\n {\r\n DataInputStream data_Receive = new DataInputStream(client_Info.getUserSocket().getInputStream());\r\n\r\n int files_Number = data_Receive.readInt();\r\n for(int i = 0; i < files_Number; i++)\r\n {\r\n user_Files.add(data_Receive.readUTF());\r\n }\r\n\r\n for(int i = 0; i<server_Files.length; i++)\r\n {\r\n check = false;\r\n for(int j = 0; j<user_Files.size(); j++)\r\n {\r\n if(server_Files[i].getName().equals(user_Files.get(j)))\r\n {\r\n check = true;\r\n break;\r\n }\r\n }\r\n if(check == false)\r\n {\r\n Thread send_File = new ServerSendFile(client_Info, server_Files[i].getName());\r\n send_File.start();\r\n }\r\n }\r\n Thread.sleep(3000);\r\n }\r\n catch(IOException | InterruptedException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n last_Operation.clear();\r\n File old_Dir = new File(client_Info.getDir());\r\n File[] old_Dir_Files = old_Dir.listFiles();\r\n\r\n while(true)\r\n {\r\n try\r\n {\r\n Thread.sleep(3000);\r\n File new_Dir = new File(client_Info.getDir());\r\n File[] new_Dir_Files = new_Dir.listFiles();\r\n\r\n if(new_Dir_Files.length > old_Dir_Files.length)\r\n {\r\n for(int i = 0; i < new_Dir_Files.length; i++)\r\n {\r\n check = false;\r\n for(int j = 0; j < old_Dir_Files.length; j++)\r\n {\r\n if(new_Dir_Files[i].getName().equals(old_Dir_Files[j].getName()))\r\n {\r\n check = true;\r\n break;\r\n }\r\n }\r\n if(check == false)\r\n {\r\n if(last_Operation.size() > 1)\r\n {\r\n if(last_Operation.get(0).equals(\"send\") && last_Operation.get(1).equals(new_Dir_Files[i].getName()))\r\n {\r\n last_Operation.remove(0);\r\n last_Operation.remove(0);\r\n continue;\r\n }\r\n }\r\n else\r\n {\r\n Thread send_File = new ServerSendFile(client_Info, new_Dir_Files[i].getName());\r\n send_File.start();\r\n }\r\n }\r\n }\r\n }\r\n old_Dir = new_Dir;\r\n old_Dir_Files = old_Dir.listFiles();\r\n }\r\n catch(Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "@Override\n protected void process(List<String> chunks) {\n\n logger.debug(LOG_TAG + \".process()\");\n\n logger.info(chunks.get(chunks.size() - 1));\n\n if (newConnection) {\n // save email address for distributing communication message\n emailAddress = chunks.get(chunks.size() - 1);\n // send email address and remote address to server\n server.newConnection(chunks.get(chunks.size() - 1),\n socket.getRemoteSocketAddress().toString());\n\n // send 'welcome' message to client\n sendMessage(\"@welcome\");\n\n newConnection = false;\n\n return;\n }\n\n if (chunks.get(chunks.size() - 1).equals(\"@disconnect\")) {\n // send message to server\n server.removeConnection(clientId);\n\n // send 'goodbye' message to client\n sendMessage(\"@goodbye\");\n\n newConnection = true;\n\n return;\n }\n\n // communication message from client, distribute message\n // to all clients\n server.distributeMessage(emailAddress + \">\" + chunks.get(chunks.size() - 1));\n\n }", "@Override\n public void uploadMultipleFiles(ArrayList<File> files, Modpack modpack) {\n uploadStatus = \"Uploading file(s) to server!\";\n modpackUploadRepository.uploadMultipleFiles(files, modpack);\n }", "public void run() {\n\n try{\n\n // random block number\n int blockNo = new Random().nextInt(100);\n\n while (true){\n\n Thread.sleep(500);\n writer.reset();\n\n // upload image blocks in a round robin fashion\n if (blockNo < 99)\n blockNo++;\n else\n blockNo = 0;\n\n writer.writeObject(new Message(\"\", \"\", \"SEND_IMG_BLOCK\", blockNo, labels[blockNo].getIcon(), null));\n System.out.println(\"Send to IP: \" + s.getLocalAddress().getHostAddress() + \" Port: \" + s.getPort() + \" Block: \" + (blockNo));\n writer.flush();\n\n }\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }", "public void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket sock = ss.accept(); // 接受连接请求\n\t\t\t\tDataInputStream din = new DataInputStream(sock.getInputStream());\n\t\t\t\tbyte buffer[] = new byte[1024]; // 缓冲区\n\t\t\t\tint len = din.read(buffer);\n\t\t\t\tString filename = new String(buffer, 0, len); // 提取出想要获取的文件名\n\t\t\t\tSystem.out.println(\"Client01: received a file request from\" + sock.getInetAddress()+\":\"+sock.getPort()+\",filename:\"+ filename);\n\t\t\t\tDataOutputStream dout = new DataOutputStream(sock.getOutputStream());\n\t\t\t\tFileInputStream fis = new FileInputStream(new File(\"D:/networkExperiment/experiment04/host01/\" + filename));\n\t\t\t\tbyte b[] = new byte[1024];\n\t\t\t\tfis.read(b); // 从文件中将数据写入缓冲区\n\t\t\t\tdout.write(b); // 将缓冲区中的数据返回\n\t\t\t\tSystem.out.println(\"Client01: return file successfully!\");\n\t\t\t\tdout.close();\n\t\t\t\tsock.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\r\n\t\tint chunkCtr = 0;\r\n\t\t// args[1] -> Monitor IP\r\n\t\t// args[0] -> communication port with the individual clients\r\n\t\tserverSocket = new ServerSocket(Integer.parseInt(args[0]));\r\n\t\tSystem.out.println(\"Master Server \" + Inet4Address.getLocalHost().getHostAddress() + \" Started\");\r\n\t\tFile file = new File(\"Namespace.csv\");\r\n\r\n\t\t// monitor Communication\r\n\t\ttry {\r\n\t\t\tSocket monitorSocket = new Socket(args[1], 7777);\r\n\t\t\tDataInputStream in = new DataInputStream(monitorSocket.getInputStream());\r\n\t\t\tDataOutputStream out = new DataOutputStream(monitorSocket.getOutputStream());\r\n\t\t\tSystem.out.println(Inet4Address.getLocalHost().getHostAddress() + \" \" + args[0]);\r\n\t\t\tout.writeUTF(Inet4Address.getLocalHost().getHostAddress() + \" \" + args[0]);\r\n\t\t\tThread monitorthread = new Thread() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tThread.sleep(3000);\r\n\t\t\t\t\t\t\tout.writeUTF(clientCtr + \"\");\r\n\t\t\t\t\t\t} catch (IOException | InterruptedException e) {\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\r\n\t\t\tmonitorthread.start();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Unable to Connect to Monitor\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tPortMap.put(1, 9876);\r\n\t\tPortMap.put(2, 8765);\r\n\t\tPortMap.put(3, 7654);\r\n\t\tPortMap.put(4, 6543);\r\n\t\tPortMap.put(5, 5439);\r\n\t\tPortMap.put(6, 4398);\r\n\r\n\t\t// Chunk Interactions\r\n\t\tif (!file.exists()) {\r\n\t\t\tServerSocket chunkServerSocket;\r\n\t\t\tSocket chunkSocket = new Socket();\r\n\t\t\t// args[1] -> communication port with the individual chunks\r\n\t\t\tchunkServerSocket = new ServerSocket(5000);\r\n\t\t\tSystem.out.println(\"Waiting for chunk servers to proceed!\");\r\n\t\t\tFileOutputStream fout = new FileOutputStream(file);\r\n\t\t\twhile (chunkCtr < 6) {\r\n\t\t\t\tchunkCtr++;\r\n\t\t\t\tchunkSocket = chunkServerSocket.accept();\r\n\t\t\t\tSystem.out.println(\" Connected to: \" + chunkSocket.getInetAddress().getLocalHost().getHostAddress()\r\n\t\t\t\t\t\t+ \" Chunk Name: Chunk\" + chunkCtr);\r\n\t\t\t\tfout.write((chunkCtr + \",\" + chunkSocket.getInetAddress().getLocalHost().getHostAddress()).getBytes());\r\n\t\t\t\tfout.write(\"\\n\".getBytes());\r\n\t\t\t\tNamespaceMap.put(chunkCtr, chunkSocket.getInetAddress().getLocalHost().getHostAddress());\r\n\r\n\t\t\t}\r\n\t\t\tchunkSocket.close();\r\n\t\t\tchunkServerSocket.close();\r\n\r\n\t\t} else {\r\n\t\t\tBufferedReader buffReader = new BufferedReader(new FileReader(file));\r\n\t\t\tString str;\r\n\t\t\twhile ((str = buffReader.readLine()) != null) {\r\n\t\t\t\tNamespaceMap.put(Integer.parseInt(str.substring(0, 1)), (str.substring(2, str.length() - 1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tgenerateReplica();\r\n\r\n\t\tSystem.out.println(PortMap);\r\n\t\tSystem.out.println(NamespaceMap);\r\n\t\tSystem.out.println(ReplicationMap);\r\n\t\tSystem.out.println(\"Ready to receive request from Client\");\r\n\r\n\t\t// Client Communication\r\n\t\twhile (true) {\r\n\t\t\tclientSocket = serverSocket.accept();\r\n\t\t\tThread clientThread = new Thread() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tSystem.out.println(\"Interacting with Client: \"\r\n\t\t\t\t\t\t\t\t+ clientSocket.getInetAddress().getLocalHost().getHostAddress());\r\n\t\t\t\t\t\tclientCtr++;\r\n\t\t\t\t\t\tDataInputStream in = new DataInputStream(clientSocket.getInputStream());\r\n\t\t\t\t\t\tDataOutputStream out = new DataOutputStream(clientSocket.getOutputStream());\r\n\t\t\t\t\t\tString[] input = new String[2];\r\n\t\t\t\t\t\tinput = (in.readUTF()).split(\" \");\r\n\t\t\t\t\t\tSystem.out.println(\"Client: \" + input[0] + \" \" + input[1]);\r\n\t\t\t\t\t\tFile file = new File(input[0] + \"complete.txt\");\r\n\t\t\t\t\t\tchunkNum = (int) Math.ceil(((Integer.parseInt(input[1])) / 800)) + 1;\r\n\t\t\t\t\t\tif (!file.exists()) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Generating Complete file and Distributing it to the chunks\");\r\n\t\t\t\t\t\t\tString fl = runCrawler(input[0]);\r\n\t\t\t\t\t\t\tDataInputStream chunkIn;\r\n\t\t\t\t\t\t\tDataOutputStream chunkOut;\r\n\t\t\t\t\t\t\tFileInputStream fin = new FileInputStream(new File(fl));\r\n\t\t\t\t\t\t\tStringBuffer strBuff1 = new StringBuffer();\r\n\t\t\t\t\t\t\tStringBuffer strBuff2 = new StringBuffer();\r\n\t\t\t\t\t\t\tStringBuffer strBuff3 = new StringBuffer();\r\n\t\t\t\t\t\t\tStringBuffer strBuff4 = new StringBuffer();\r\n\t\t\t\t\t\t\tStringBuffer strBuff5 = new StringBuffer();\r\n\t\t\t\t\t\t\tStringBuffer strBuff6 = new StringBuffer();\r\n\t\t\t\t\t\t\tint lineCtr = 0;\r\n\r\n\t\t\t\t\t\t\twhile (lineCtr < 4800) {\r\n\t\t\t\t\t\t\t\tlineCtr++;\r\n\t\t\t\t\t\t\t\tif (lineCtr <= 800)\r\n\t\t\t\t\t\t\t\t\tstrBuff1.append((char) fin.read());\r\n\t\t\t\t\t\t\t\telse if (lineCtr > 800 && lineCtr <= 1600)\r\n\t\t\t\t\t\t\t\t\tstrBuff2.append((char) fin.read());\r\n\t\t\t\t\t\t\t\telse if (lineCtr > 1600 && lineCtr <= 2400)\r\n\t\t\t\t\t\t\t\t\tstrBuff3.append((char) fin.read());\r\n\t\t\t\t\t\t\t\telse if (lineCtr > 2400 && lineCtr <= 3200)\r\n\t\t\t\t\t\t\t\t\tstrBuff4.append((char) fin.read());\r\n\t\t\t\t\t\t\t\telse if (lineCtr > 3200 && lineCtr <= 4000)\r\n\t\t\t\t\t\t\t\t\tstrBuff5.append((char) fin.read());\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstrBuff6.append((char) fin.read());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// chunk 1\r\n\r\n\t\t\t\t\t\t\tSocket chunkSocket = new Socket(NamespaceMap.get(1), 3456);\r\n\t\t\t\t\t\t\tchunkIn = new DataInputStream(chunkSocket.getInputStream());\r\n\t\t\t\t\t\t\tchunkOut = new DataOutputStream(chunkSocket.getOutputStream());\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"1\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff1.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"2Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff2.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"3Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff3.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\t// chunk 2\r\n\t\t\t\t\t\t\tchunkSocket = new Socket(NamespaceMap.get(2), 4567);\r\n\t\t\t\t\t\t\tchunkIn = new DataInputStream(chunkSocket.getInputStream());\r\n\t\t\t\t\t\t\tchunkOut = new DataOutputStream(chunkSocket.getOutputStream());\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"2\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff2.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"3Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff3.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"4Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff4.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\t// chunk 3\r\n\t\t\t\t\t\t\tchunkSocket = new Socket(NamespaceMap.get(3), 5678);\r\n\t\t\t\t\t\t\tchunkIn = new DataInputStream(chunkSocket.getInputStream());\r\n\t\t\t\t\t\t\tchunkOut = new DataOutputStream(chunkSocket.getOutputStream());\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"3\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff3.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"4Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff4.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"5Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff5.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\t// chunk 4\r\n\t\t\t\t\t\t\tchunkSocket = new Socket(NamespaceMap.get(4), 6789);\r\n\t\t\t\t\t\t\tchunkIn = new DataInputStream(chunkSocket.getInputStream());\r\n\t\t\t\t\t\t\tchunkOut = new DataOutputStream(chunkSocket.getOutputStream());\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"4\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff4.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"5Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff5.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"6Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff6.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\t// chunk 5\r\n\t\t\t\t\t\t\tchunkSocket = new Socket(NamespaceMap.get(5), 7893);\r\n\t\t\t\t\t\t\tchunkIn = new DataInputStream(chunkSocket.getInputStream());\r\n\t\t\t\t\t\t\tchunkOut = new DataOutputStream(chunkSocket.getOutputStream());\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"5\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff5.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"1Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff1.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"6Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff6.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\t// chunk 6\r\n\t\t\t\t\t\t\tchunkSocket = new Socket(NamespaceMap.get(6), 8934);\r\n\t\t\t\t\t\t\tchunkIn = new DataInputStream(chunkSocket.getInputStream());\r\n\t\t\t\t\t\t\tchunkOut = new DataOutputStream(chunkSocket.getOutputStream());\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"6\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff6.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"1Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff1.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"Make chunk\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(input[0] + \"2Rep\");\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(strBuff2.toString());\r\n\t\t\t\t\t\t\tchunkOut.writeUTF(\"End chunk\");\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"Chunk: \" + chunkNum + \" : \" + PortMap.get(chunkNum) + \" \" + chunkNum);\r\n\t\t\t\t\t\t// out.writeUTF(\"localhost \"+PortMap.get(chunkNum));\r\n\t\t\t\t\t\t// out.writeUTF(NamespaceMap.get(chunkNum)+\"\r\n\t\t\t\t\t\t// \"+PortMap.get(chunkNum)+\" \"+chunkNum);\r\n\t\t\t\t\t\tout.writeUTF(NamespaceMap.get(chunkNum) + \" \" + PortMap.get(chunkNum) + \" complete\");\r\n\t\t\t\t\t\tSystem.out.println(\"Sent chunk: \" + NamespaceMap.get(chunkNum) + \" \" + PortMap.get(chunkNum));\r\n\t\t\t\t\t\tclientCtr--;\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\tSystem.err.println(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tclientThread.start();\r\n\t\t}\r\n\t}", "public void run() {\n String fileName;\n DataInputStream in;\n byte[] arr = new byte[5000];\n try {\n //getting the file name from client\n in = new DataInputStream(clientSocket.getInputStream());\n fileName = in.readUTF();\n // calling the function to send the file back to the client\n sendDataToClient(s3, fileName);\n //read file from disk\n FileInputStream fis = new FileInputStream(\"/home/ubuntu/\" + fileName);\n BufferedInputStream bis = new BufferedInputStream(fis);\n //output stream for socket\n BufferedOutputStream out = new BufferedOutputStream(clientSocket.getOutputStream());\n // if the file is for getting RTT\n if ( !fileName.equals(\"RTTFile.txt\") )\n System.out.println(\"\\n Serving file: \" + fileName + \"\\n\");\n // writing to streams\n int count;\n while ((count = bis.read(arr)) > 0) {\n out.write(arr, 0, count);\n }\n // flushing and closing all the open streams\n out.flush();\n out.close();\n fis.close();\n bis.close();\n clientSocket.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public synchronized void run() {\n\n try {\n\n while(true) {\n\n Thread.sleep(10000);\n\n Socket s = new Socket(server, 8999); // Request list in port 8999\n ObjectInputStream r = new ObjectInputStream(s.getInputStream());\n Message m = (Message) r.readObject();\n peerList = (PeerList) m.peerList; // Store new peer list\n\n for (int i = peerList.getSize() - 1; i >= 0; i--)\n new Thread(new download(peerList.getIP(i), peerList.getPort(i))).start(); // start thread to download image blocks from other peers\n\n }\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }", "@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private boolean sendChunk() throws IOException {\n // allocate Buffer\n final Buffer buffer = mm.allocate(chunkSize);\n // mark it available for disposal after content is written\n buffer.allowBufferDispose(true);\n\n // read file to the Buffer\n final int justReadBytes = (int) Buffers.readFromFileChannel(\n fileChannel, buffer);\n \n if (justReadBytes <= 0) {\n complete();\n return false;\n }\n\n // prepare buffer to be written\n buffer.trim();\n\n // write the Buffer\n outputStream.write(buffer);\n size -= justReadBytes;\n\n // check the remaining size here to avoid extra onWritePossible() invocation\n if (size <= 0) {\n complete();\n return false;\n }\n\n return true;\n }", "public static void customTest() throws IOException, NotBoundException, MessageNotFoundException {\n Client c = new Client();\n String fileName = \"file1\";\n\n char[] ss = \"[INITIAL DATA!]\".toCharArray(); // len = 15\n byte[] data = new byte[ss.length];\n for (int i = 0; i < ss.length; i++) {\n data[i] = (byte) ss[i];\n }\n\n c.write(fileName, data);\n\n c = new Client();\n ss = \"File 1 test test END\".toCharArray(); // len = 20\n data = new byte[ss.length];\n for (int i = 0; i < ss.length; i++) {\n data[i] = (byte) ss[i];\n }\n\n byte[] chunk = new byte[Configurations.CHUNK_SIZE];\n\n int seqN = data.length / Configurations.CHUNK_SIZE;\n int lastChunkLen = Configurations.CHUNK_SIZE;\n\n if (data.length % Configurations.CHUNK_SIZE > 0) {\n lastChunkLen = data.length % Configurations.CHUNK_SIZE;\n seqN++;\n }\n\n WriteAck ackMsg = c.masterStub.write(fileName);\n ReplicaServerClientInterface stub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + ackMsg.getLoc().getId());\n\n FileContent fileContent;\n @SuppressWarnings(\"unused\")\n ChunkAck chunkAck;\n //\t\tfor (int i = 0; i < seqN; i++) {\n System.arraycopy(data, 0 * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), 0, fileContent);\n\n System.arraycopy(data, 1 * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), 1, fileContent);\n\n // read here \n List<ReplicaLoc> locations = c.masterStub.read(fileName);\n System.err.println(\"[@CustomTest] Read1 started \");\n\n // TODO fetch from all and verify \n ReplicaLoc replicaLoc = locations.get(0);\n ReplicaServerClientInterface replicaStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + replicaLoc.getId());\n fileContent = replicaStub.read(fileName);\n System.err.println(\"[@CustomTest] data:\");\n System.err.println(new String(fileContent.getData()));\n\n // continue write \n for (int i = 2; i < seqN - 1; i++) {\n System.arraycopy(data, i * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), i, fileContent);\n }\n // copy the last chuck that might be < CHUNK_SIZE\n System.arraycopy(data, (seqN - 1) * Configurations.CHUNK_SIZE, chunk, 0, lastChunkLen);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), seqN - 1, fileContent);\n\n //commit\n ReplicaLoc primaryLoc = c.masterStub.locatePrimaryReplica(fileName);\n ReplicaServerClientInterface primaryStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + primaryLoc.getId());\n primaryStub.commit(ackMsg.getTransactionId(), seqN);\n\n // read\n locations = c.masterStub.read(fileName);\n System.err.println(\"[@CustomTest] Read3 started \");\n\n replicaLoc = locations.get(0);\n replicaStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + replicaLoc.getId());\n fileContent = replicaStub.read(fileName);\n System.err.println(\"[@CustomTest] data:\");\n System.err.println(new String(fileContent.getData()));\n\n }", "public void run()\n {\n try\n {\n // Load the manifest file\n File manifest = new File(UploaderMain.getManifestName());\n if (!manifest.exists())\n {\n ErrorPrinter.printError(ErrorCode.fileNotFound, \"manifest does not exist\");\n System.exit(0);\n }\n\n // Read names of files from manifest\n Map<String, File> files = new HashMap<String, File>();\n BufferedReader manifestReader = new BufferedReader(new FileReader(manifest));\n String line;\n long totalLength = 0;\n while ((line = manifestReader.readLine()) != null)\n {\n if (line.startsWith(\"//\") || line.trim().isEmpty()) continue; // ignore comments\n StringTokenizer token = new StringTokenizer(line, \"@\");\n String destinationName = token.nextToken();\n String localName = token.nextToken();\n File f = new File(localName);\n if (!f.exists())\n {\n \tErrorPrinter.printError(ErrorCode.fileNotFound, \"file \" + localName + \" not found\");\n \tcontinue;\n }\n totalLength += f.length();\n files.put(destinationName, f);\n }\n manifestReader.close();\n\n dOut.writeInt(files.size());\n dOut.writeLong(totalLength);\n\n for (String s : files.keySet())\n {\n File f = files.get(s);\n \n try\n {\n // Send the name and length of the file\n dOut.writeUTF(s);\n dOut.writeLong(f.length());\n\n // Send the file over the network\n FileInputStream reader = new FileInputStream(f);\n byte[] buffer = new byte[BUFFER_SIZE];\n int numRead;\n long numSent = 0;\n while (numSent < f.length())\n {\n numRead = reader.read(buffer);\n dOut.write(buffer, 0, numRead);\n numSent += numRead;\n }\n\n reader.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Error sending file \" + f.getName());\n }\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public void run() {\n xmitsInProgress++;\n try {\n Socket s = new Socket();\n s.connect(curTarget, READ_TIMEOUT);\n s.setSoTimeout(READ_TIMEOUT);\n DataOutputStream out = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));\n try {\n long filelen = data.getLength(b);\n DataInputStream in = new DataInputStream(new BufferedInputStream(data.getBlockData(b)));\n try {\n //\n // Header info\n //\n out.write(OP_WRITE_BLOCK);\n out.writeBoolean(true);\n b.write(out);\n out.writeInt(targets.length);\n for (int i = 0; i < targets.length; i++) {\n targets[i].write(out);\n }\n out.write(RUNLENGTH_ENCODING);\n out.writeLong(filelen);\n\n //\n // Write the data\n //\n while (filelen > 0) {\n int bytesRead = in.read(buf, 0, (int) Math.min(filelen, buf.length));\n out.write(buf, 0, bytesRead);\n filelen -= bytesRead;\n }\n } finally {\n in.close();\n }\n } finally {\n out.close();\n }\n LOG.info(\"Transmitted block \" + b + \" to \" + curTarget);\n } catch (IOException ie) {\n LOG.warn(\"Failed to transfer \"+b+\" to \"+curTarget, ie);\n } finally {\n xmitsInProgress--;\n }\n }", "public void run() {\n try {\n //first send the file name to the receiver\n out.flush();\n out.writeUTF(fileName);\n out.flush();\n //sends the destination folder name\n out.writeUTF(destFolder);\n out.flush(); //flushes the buffer\n //array of bytes that holds the file bytes\n byte[] file = readFile(srcFilePath +\"/\"+fileName);\n System.out.println(\"Sending file: \"+fileName+\" to folder: \"+destFolder);\n //sends the file\n out.write(file,0,file.length);\n out.flush();\n if(notifDownloader) {\n NodeInterface nodeStub = (NodeInterface) Naming.lookup(\"/\"+clientSocket.getInetAddress().toString()+\"/Node\");\n nodeStub.fileDownloaded(fileName);\n }\n } catch (IOException e) {\n System.out.println(\"readline: \" + e.getMessage());\n } catch (NotBoundException e) {\n //e.printStackTrace();\n System.err.println(\"There was an error notifying the downloader \"+e.getMessage());\n } finally{\n try{\n //closes the socket\n clientSocket.close();\n }catch(IOException e){\n System.out.println(\"problem closing the socket: \"+e.getMessage());\n }\n }\n }", "public void MultiSend(KeyPair kp) {\n Socket sock;\n PrintStream toServer;\n try {\n for (int i = 0; i < numProcesses; i++) {\n sock = new Socket(serverName, Ports.KeyServerPortBase + i);\n toServer = new PrintStream(sock.getOutputStream()); \n toServer.println(kp.getPublic()); //sending our Public key to every process\n toServer.flush();\n sock.close();\n }\n \n Thread.sleep(1000); //wait for keys to settle\n long current_time = System.currentTimeMillis(); //current time for Timestamp field\n File f = new File(\"BlockInput\" + Blockchain.PID + \".txt\");\n FileReader fr = new FileReader(f);\n BufferedReader br = new BufferedReader(fr);\n \n //read each line into input and place it into a block\n String realBlockA = System.currentTimeMillis() + \" \" + br.readLine(); \n String realBlockB = System.currentTimeMillis() + \" \" + br.readLine();\n String realBlockC = System.currentTimeMillis() + \" \" + br.readLine();\n String realBlockD = System.currentTimeMillis() + \" \" + br.readLine();\n String toConvertA = realBlockA;\n BlockRecord A = new BlockRecord();\n BlockRecord B = new BlockRecord();\n BlockRecord C = new BlockRecord();\n BlockRecord D = new BlockRecord();\n //converting each String read in from input into a Block\n A = BlockProcessing.toXML(realBlockA, Blockchain.PID);\n B = BlockProcessing.toXML(realBlockB, Blockchain.PID);\n C = BlockProcessing.toXML(realBlockC, Blockchain.PID);\n D = BlockProcessing.toXML(realBlockD, Blockchain.PID);\n \n for (int i = 0; i < numProcesses; i++) { //send block A to each process\n sock = new Socket(serverName, Ports.UnverifiedBlockServerPortBase + i);\n toServer = new PrintStream(sock.getOutputStream());\n toServer.println(realBlockA);\n toServer.flush();\n sock.close();\n }\n \n for (int i = 0; i < numProcesses; i++) { //send block B to each process\n sock = new Socket(serverName, Ports.UnverifiedBlockServerPortBase + i);\n toServer = new PrintStream(sock.getOutputStream());\n toServer.println(realBlockB);\n toServer.flush();\n sock.close();\n }\n \n for (int i = 0; i < numProcesses; i++) { //send block C to each process\n sock = new Socket(serverName, Ports.UnverifiedBlockServerPortBase + i);\n toServer = new PrintStream(sock.getOutputStream());\n toServer.println(realBlockC);\n toServer.flush();\n sock.close();\n }\n \n for (int i = 0; i < numProcesses; i++) { //send block D to each process\n sock = new Socket(serverName, Ports.UnverifiedBlockServerPortBase + i);\n toServer = new PrintStream(sock.getOutputStream());\n toServer.println(realBlockD);\n toServer.flush();\n sock.close();\n }\n \n } \n catch (Exception x) {\n x.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\ttry {\n\t\t\t\twelcomeSocket= new ServerSocket(50501);\n\t\t\t \twhile (true){\n\t\t\t\t \tSystem.out.println(\"Waiting for a client....\");\n\t\t\t\t\tSocket clientConnect = welcomeSocket.accept(); // connect client to socket\n\t\t\t\t\tSystem.out.println(\"A connection has been made.\");\n\t\t\t\t\tfor (int i=0;i<iter;i++){\n\t\t\t\t\t\tString [][] myFileListtemp=arr[i].GetFileList();\n\t\t\t\t\t\tint tempit=myFileListtemp[0].length-myFileList[0].length;\n\t\t\t\t\t\titerator=iterator+tempit;\n\t\t\t\t\t\tif (tempit!=0){\n\t\t\t\t\t\t\tfor (int i1=myFileList[0].length;i1<myFileListtemp[0].length;i1++){\n\t\t\t\t\t\t\t\tif (iterator >= myFileList[0].length) {\n\t\t\t\t\t\t\t\t\tupdateArray();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmyFileList[0][i]=myFileListtemp[0][i];\n\t\t\t\t\t\t\t\tmyFileList[1][i]=myFileListtemp[1][i];\n\t\t\t\t\t\t\t\tmyFileList[2][i]=myFileListtemp[2][i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tclientIp=clientConnect.getInetAddress().getHostAddress();\t\t\t\t\n\t\t\t\t\tBufferedReader inBuf = new BufferedReader(new InputStreamReader(clientConnect.getInputStream()));\n\t\t\t\t\tPrintWriter outBuf= new PrintWriter(new OutputStreamWriter(clientConnect.getOutputStream()),true);\n\t\t\t\t\tString clientport=inBuf.readLine();\n\t\t\t\t\tString name=inBuf.readLine();\n\t\t\t\t\twhile (!(name.equals(\"-\"))){\n\t\t\t\t\t\tmyFileList[0][iterator]=name;\n\t\t\t\t\t\tmyFileList[1][iterator]=clientIp;\n\t\t\t\t\t\tmyFileList[2][iterator]=clientport;\n\t\t\t\t\t\tname=inBuf.readLine();\n\t\t\t\t\t\titerator++;\n\t\t\t\t\t\tif (iterator >= myFileList[0].length) {\n\t\t\t\t\t\t\tupdateArray();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tarr[iter]=new ServerBThread(clientConnect,clientport);\n\t\t\t\t\tfor (int i=0;i<=iter;i++){\n\t\t\t\t\t\tarr[i].PutFileList(myFileList);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"File List Updated\");\n\t\t\t\t\tThread T = new Thread(arr[iter]);\n\t\t\t\t\tT.start();\n\t\t\t\t\titer++;\n\t\t\t\t\tif (iter >= arr.length) {\n\t\t\t\t\t\tupdateArrayth();\n\t\t\t\t\t}\n\t\t\t\t} \t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t}", "public synchronized void run() {\n try {\n String data = in.readUTF();\n String response = FileRequestService.handleRequest(data, sharedWriteQueueService);\n out.writeUTF(response);\n System.out.println(\"server wrote:\" + response);\n } catch(EOFException e) {\n System.out.println(\"EOF:\" + e.getLocalizedMessage() + \" \" + e);\n } catch(IOException e) {\n System.out.println(\"IO:\" + e.getLocalizedMessage() + \" \" + e);\n } finally { \n try {\n clientSocket.close();\n } catch (IOException e){\n System.out.println(\"close:\" + e.getMessage());\n }\n }\n }", "public void runDeal() {\n\t\ttry {\n\t\t\t// allocate array for up to 10 server threads\n\t\t\tsockServer = new SockServer[100];\n\t\t\texecutor = Executors.newFixedThreadPool(100); // create thread pool\n\t\t\tserver = new ServerSocket(23555, 100); // create ServerSocket\n\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\t// create a new runnable object to serve the next client to\n\t\t\t\t\t// call in\n\t\t\t\t\tsockServer[counter] = new SockServer(counter);\n\t\t\t\t\t// make that new object wait for a connection on that new\n\t\t\t\t\t// server object\n\t\t\t\t\tsockServer[counter].waitForConnection();\n\t\t\t\t\t// launch that server object into its own new thread\n\t\t\t\t\texecutor.execute(sockServer[counter]);\n\t\t\t\t\t// then, continue to create another object and wait (loop)\n\n\t\t\t\t} // end try\n\t\t\t\tcatch (EOFException eofException) {\n\t\t\t\t\tSystem.out.println(\"\\nServer terminated connection\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\t++counter;\n\t\t\t\t} // end finally\n\t\t\t} // end while\n\t\t} catch (IOException ioException) {\n\t\t\tSystem.out.println(\"\\nServer terminated connection\");\n\t\t}\n\t}", "List<MovilizerResponse> batchUploadFolderSync(Path folder);", "protected abstract boolean sendNextRequests();", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "@Override\r\n\tpublic void runSystem() throws IOException {\n\t\tclientWithHalf.setHalfFile(fileHalf);\r\n\t\tserverWithTotal.setTotalFile(fileTotal);\r\n\t\tclientWithHalf.connect(serverWithTotal);\r\n\t\tserverWithTotal.connect(clientWithHalf);\r\n\t\tclientWithHalf.sendCheckSumFile();\r\n\t\tserverWithTotal.receieveCheckSumFile();\r\n\t\tserverWithTotal.startMatch();\r\n\t\tserverWithTotal.sendBackData();\r\n\t\tclientWithHalf.rebuidFile();\r\n\t\tclientWithHalf.checkFileEqual();\r\n\t\tclientWithHalf.clearTempData();\r\n\t\tserverWithTotal.getConfirm();\r\n\t\tserverWithTotal.clearTempData();\r\n\t}", "public void sendFile(ByteString bs, String filename, int numOfChunks, int chunkId) {\n\t\tHeader.Builder hb = Header.newBuilder();\n\t\thb.setNodeId(999);\n\t\thb.setTime(System.currentTimeMillis());\n\t\thb.setDestination(-1);\n\t\t\n\t\tTask.Builder tb = Task.newBuilder();\n\t\ttb.setNoOfChunks(numOfChunks); //Num of chunks\n\t\ttb.setChunkNo(chunkId); //chunk id\n\t\ttb.setTaskType(Task.TaskType.WRITE);\n\t\ttry {\n\t\t\ttb.setSender(InetAddress.getLocalHost().getHostAddress());\n\t\t} catch (UnknownHostException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttb.setFilename(filename);\n\t\ttb.setChunk(bs);\n\t\t\n\t\tCommandMessage.Builder rb = CommandMessage.newBuilder();\n\t\trb.setHeader(hb);\n\t\trb.setTask(tb);\n\t\trb.setMessage(filename);\n\t\t\n\t\ttry {\n\t\t\t// direct no queue\n\t\t\t// CommConnection.getInstance().write(rb.build());\n\n\t\t\t// using queue\n\t\t\tCommConnection.getInstance().enqueue(rb.build());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"开始上传\");\n\t\t\t\t\tsocket=new Socket(ip,port);\n\t\t\t\t\tInputStream in=socket.getInputStream();\n\t\t\t\t\tOutputStream out=socket.getOutputStream();\n\t\t\t\t\tBufferedInputStream input=new BufferedInputStream(in);\n\t\t\t\t\twhile(true)\n\t\t\t\t\t{\n\t\t\t\t\t\tFileInputStream fis=new FileInputStream(file);\n\t\t\t\t\t\tDataInputStream dis=new DataInputStream(new BufferedInputStream(fis));\n\t\t\t\t\t\tbyte[] buf=new byte[8192];\n\t\t\t\t\t\tDataOutputStream ps=new DataOutputStream(out);\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\tint read=0;\n\t\t\t\t\t\t\tif(dis!=null){\n\t\t\t\t\t\t\t\tread=fis.read(buf);\n\t\t\t\t\t\t\t\tdownLoadFileSize+=read;\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(read==-1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttimer.cancel();\n\t\t\t\t\t\t\t\tMessage msg=new Message();\n\t\t\t\t\t\t\t\tBundle bundle=new Bundle();\n\t\t\t\t\t\t\t\tbundle.putInt(\"percent\",100 );\n\t\t\t\t\t\t\t\tmsg.setData(bundle);\n\t\t\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tps.write(buf,0,read);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tps.flush();\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tps.close();\n\t\t\t\t\t\tdis.close();\n\t\t\t\t\t\tsocket.close();\n\t\t\t\t\t\tSystem.out.println(\"上传完成\");\n\t\t\t\t\t\t \n\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} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public int send2FtpServer()\n\t{\n\t\tCoFile file = null;\n\t\tCoFile to = null;\n\t\tString filename = \"\";\n\t\tString dest_filename = \"\";\n\t\tString sum_line = \"\";\n\t\tboolean loadResult = false;\n\t\tboolean renameFileResult = false;\n\t\tfor (int i = 0; i < vFiles.size(); i++)\n\t\t{\n\t\t\tfilename = ((File) (vFiles.elementAt(i))).getName();\n\t\t\t/* source FtpFile remote file */\n\t\t\tfile = new LocalFile(FtpData.LOCAL_FOLDER, filename);\n\t\t\t// System.out.println(\"From: \" + file.toString());\n\t\t\t/* destination LocalFile home dir */\n\t\t\t// ---------------------count ftp file\n\t\t\t// site--------------------------------\n\t\t\tFile f = new File(FtpData.LOCAL_FOLDER + \"/\" + filename);\n\t\t\tString fileLength = String.valueOf(f.length());\n\t\t\t// System.out.println(\"file size: \" + fileLength);\n\t\t\t// ---------------------count ftp file\n\t\t\t// site--------------------------------\n\n\t\t\tto = new FtpFile(\"tmp_\" + filename, this.ftp);\n\n\t\t\t// System.out.println(\"To: \" + to.toString());\n\t\t\t/* download file */\n\t\t\tloadResult = CoLoad.copy(to, file);\n\t\t\tLogger.info(\"FTP-SIZE: \" + loadResult);\n\t\t\t// System.out.println(\"Load: \" + loadResult);\n\t\t\t// rename file sau khi ftp sang\n\t\t\t// System.out.print(\"Start rename file cdr: \" + \"tmp_\" + filename +\n\t\t\t// \"-->\" + filename);\n\t\t\trenameFileResult = this.ftp.mv( \"tmp_\" + filename, \"\" + filename);\n\t\t\t// System.out.println(\"Rename: \" + renameFileResult);\n\t\t\tLogger.info(\"FTP-RENAME: \" + renameFileResult);\n\t\t\tif (loadResult && renameFileResult)\n\t\t\t{ // ok -->delete file.\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tString sDateFolder = DateProc.Timestamp2YYYYMMDD(DateProc.createTimestamp(), \"\");\n\n\t\t\t\t\t// File dest_dir = new File(FtpData.SENT_FOLDER + \"\\\\\" +\n\t\t\t\t\t// sDateFolder);\n\t\t\t\t\tFile dest_dir = new File(FtpData.SENT_FOLDER_VMS + \"/\" + sDateFolder);\n\n\t\t\t\t\tboolean exists = dest_dir.exists();\n\t\t\t\t\tif (!exists)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Directory does not exist --> create it\n\t\t\t\t\t\tboolean success = dest_dir.mkdirs();\n\t\t\t\t\t}\n\t\t\t\t\t// fileTool.copy(FtpData.LOCAL_FOLDER + \"\\\\\" +\n\t\t\t\t\t// file.getName(),\n\t\t\t\t\t// FtpData.SENT_FOLDER + \"\\\\\" + sDateFolder + \"\\\\\" +\n\t\t\t\t\t// file.getName());\n\t\t\t\t\tfileTool.copy(FtpData.LOCAL_FOLDER + \"/\" + file.getName(), FtpData.SENT_FOLDER_VMS + \"/\" + sDateFolder + \"/\" + file.getName());\n\t\t\t\t\t\n\t\t\t\t\tLogger.info(\"backup file: from: \" + FtpData.LOCAL_FOLDER + \"/\" + file.getName() + \" to: \" + FtpData.SENT_FOLDER_VMS + \"/\" + sDateFolder\n\t\t\t\t\t\t\t+ \"/\" + file.getName());\n\t\t\t\t\tfile.delete();\n\t\t\t\t\tCdrFilename4vms.setNewFilenameVMS(filename);\n\t\t\t\t\tLogger.info(\"FTP : file name: \" + filename + \"# filesize: \" + fileLength + \" bytes\");\n\t\t\t\t}\n\t\t\t\tcatch (IOException ex)\n\t\t\t\t{\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\tLogger.info(\"FTP\", ex.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif ((loadResult = false) && (renameFileResult = true))\n\t\t\t\t\t{\n\t\t\t\t\t\t// DBTools.log_alert(Preference.sourceAddressList.toString(),\n\t\t\t\t\t\t// \"CDR->FTP\",\n\t\t\t\t\t\t// \"<-\" + Preference.mobileOperator +\n\t\t\t\t\t\t// \"-> ERROR: Khong ftp duoc file cuoc sang telcos!\",\n\t\t\t\t\t\t// 1, Preference.alert_person,\n\t\t\t\t\t\t// Preference.alert_mobile);\n\t\t\t\t\t\tDBTools.log_alert(\"Billing system\", \"-> ERROR: Khong ftp duoc file cuoc sang telcos! \", 1, 0, \"serious\", Preference.alert_person);\n\t\t\t\t\t}\n\t\t\t\t\telse if ((loadResult = true) && (renameFileResult = false))\n\t\t\t\t\t{\n\t\t\t\t\t\t// DBTools.log_alert(Preference.sourceAddressList.toString(),\n\t\t\t\t\t\t// \"CDR->FTP\",\n\t\t\t\t\t\t// \"<-\" + Preference.mobileOperator +\n\t\t\t\t\t\t// \"-> ERROR: Khong rename duoc file cuoc sau khi ftp sang telcos!\",\n\t\t\t\t\t\t// 1, Preference.alert_person,\n\t\t\t\t\t\t// Preference.alert_mobile);\n\t\t\t\t\t\tDBTools.log_alert(\"Billing system\", \"-> ERROR: Khong rename duoc file cuoc sau khi ftp ! \", 1, 0, \"serious\", Preference.alert_person);\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// DBTools.log_alert(Preference.sourceAddressList.toString(),\n\t\t\t\t\t\t// \"CDR->FTP\",\n\t\t\t\t\t\t// \"<-\" + Preference.mobileOperator +\n\t\t\t\t\t\t// \"-> ERROR: Loi ftp file cuoc\",\n\t\t\t\t\t\t// 1, Preference.alert_person, Preference.alert_mobile);\n\t\t\t\t\t\tDBTools.log_alert(\"Billing system\", \"-> ERROR: Loi ftp file cuoc ! \", 1, 0, \"serious\", Preference.alert_person);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.vFiles.size();\n\t}", "@Override\n\tpublic void transferFile() throws Exception {\n\t\tnew Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"开始上传\");\n\t\t\t\t\tsocket=new Socket(ip,port);\n\t\t\t\t\tInputStream in=socket.getInputStream();\n\t\t\t\t\tOutputStream out=socket.getOutputStream();\n\t\t\t\t\tBufferedInputStream input=new BufferedInputStream(in);\n\t\t\t\t\twhile(true)\n\t\t\t\t\t{\n\t\t\t\t\t\tFileInputStream fis=new FileInputStream(file);\n\t\t\t\t\t\tDataInputStream dis=new DataInputStream(new BufferedInputStream(fis));\n\t\t\t\t\t\tbyte[] buf=new byte[8192];\n\t\t\t\t\t\tDataOutputStream ps=new DataOutputStream(out);\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\tint read=0;\n\t\t\t\t\t\t\tif(dis!=null){\n\t\t\t\t\t\t\t\tread=fis.read(buf);\n\t\t\t\t\t\t\t\tdownLoadFileSize+=read;\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(read==-1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttimer.cancel();\n\t\t\t\t\t\t\t\tMessage msg=new Message();\n\t\t\t\t\t\t\t\tBundle bundle=new Bundle();\n\t\t\t\t\t\t\t\tbundle.putInt(\"percent\",100 );\n\t\t\t\t\t\t\t\tmsg.setData(bundle);\n\t\t\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tps.write(buf,0,read);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tps.flush();\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tps.close();\n\t\t\t\t\t\tdis.close();\n\t\t\t\t\t\tsocket.close();\n\t\t\t\t\t\tSystem.out.println(\"上传完成\");\n\t\t\t\t\t\t \n\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} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}).start();\n\t}", "public static void main(String[] args) {\n // NOTE: the port number and the files to receive need to be the same here and on client\n int port = 4000;\n int timesReceiveFile = 100;\n\n Server server = new Server(port);\n\n for (int i = 0; i < timesReceiveFile; i++) {\n server.awaitConnection();\n server.receiveData();\n server.closeConnection();\n }\n\n server.compareAllFiles();\n server.killServer();\n\n }", "public static void sendMessagesByDirectory(String directory, Pollable jmsInstance) throws IOException {\n List<File> files = getMessagesFromDirectory(directory);\n for (File file : files) {\n String text = FileUtils.readFileToString(file);\n String threadNumber = Long.toString(Thread.currentThread().getId());\n logger.info(String.format(\">> Ready to send one message[%s]\", file.getName()));\n jmsInstance.send(text, System.currentTimeMillis(), threadNumber, text.length(), \"Rex-thread\", \"\");\n logger.info(String.format(\">> Message has been sent.\"));\n }\n\n }", "private static void chunkedUploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {\n long size = localFile.length();\n\n // assert our file is at least the chunk upload size. We make this assumption in the code\n // below to simplify the logic.\n if (size < CHUNKED_UPLOAD_CHUNK_SIZE) {\n System.err.println(\"File too small, use upload() instead.\");\n System.exit(1);\n return;\n }\n\n long uploaded = 0L;\n DbxException thrown = null;\n\n ProgressListener progressListener = new ProgressListener() {\n long uploadedBytes = 0;\n @Override\n public void onProgress(long l) {\n printProgress(l + uploadedBytes, size);\n if (l == CHUNKED_UPLOAD_CHUNK_SIZE) uploadedBytes += CHUNKED_UPLOAD_CHUNK_SIZE;\n }\n };\n\n // Chunked uploads have 3 phases, each of which can accept uploaded bytes:\n //\n // (1) Start: initiate the upload and get an upload session ID\n // (2) Append: upload chunks of the file to append to our session\n // (3) Finish: commit the upload and close the session\n //\n // We track how many bytes we uploaded to determine which phase we should be in.\n String sessionId = null;\n for (int i = 0; i < CHUNKED_UPLOAD_MAX_ATTEMPTS; ++i) {\n if (i > 0) {\n System.out.printf(\"Retrying chunked upload (%d / %d attempts)\\n\", i + 1, CHUNKED_UPLOAD_MAX_ATTEMPTS);\n }\n\n try (InputStream in = new FileInputStream(localFile)) {\n // if this is a retry, make sure seek to the correct offset\n in.skip(uploaded);\n\n // (1) Start\n if (sessionId == null) {\n sessionId = dbxClient.files().uploadSessionStart()\n .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE, progressListener)\n .getSessionId();\n uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;\n printProgress(uploaded, size);\n }\n\n UploadSessionCursor cursor = new UploadSessionCursor(sessionId, uploaded);\n\n // (2) Append\n while ((size - uploaded) > CHUNKED_UPLOAD_CHUNK_SIZE) {\n dbxClient.files().uploadSessionAppendV2(cursor)\n .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE, progressListener);\n uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;\n printProgress(uploaded, size);\n cursor = new UploadSessionCursor(sessionId, uploaded);\n }\n\n // (3) Finish\n long remaining = size - uploaded;\n CommitInfo commitInfo = CommitInfo.newBuilder(dropboxPath)\n .withMode(WriteMode.ADD)\n .withClientModified(new Date(localFile.lastModified()))\n .build();\n FileMetadata metadata = dbxClient.files().uploadSessionFinish(cursor, commitInfo)\n .uploadAndFinish(in, remaining, progressListener);\n\n System.out.println(metadata.toStringMultiline());\n return;\n } catch (RetryException ex) {\n thrown = ex;\n // RetryExceptions are never automatically retried by the client for uploads. Must\n // catch this exception even if DbxRequestConfig.getMaxRetries() > 0.\n sleepQuietly(ex.getBackoffMillis());\n continue;\n } catch (NetworkIOException ex) {\n thrown = ex;\n // network issue with Dropbox (maybe a timeout?) try again\n continue;\n } catch (UploadSessionLookupErrorException ex) {\n if (ex.errorValue.isIncorrectOffset()) {\n thrown = ex;\n // server offset into the stream doesn't match our offset (uploaded). Seek to\n // the expected offset according to the server and try again.\n uploaded = ex.errorValue\n .getIncorrectOffsetValue()\n .getCorrectOffset();\n continue;\n } else {\n // Some other error occurred, give up.\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n }\n } catch (UploadSessionFinishErrorException ex) {\n if (ex.errorValue.isLookupFailed() && ex.errorValue.getLookupFailedValue().isIncorrectOffset()) {\n thrown = ex;\n // server offset into the stream doesn't match our offset (uploaded). Seek to\n // the expected offset according to the server and try again.\n uploaded = ex.errorValue\n .getLookupFailedValue()\n .getIncorrectOffsetValue()\n .getCorrectOffset();\n continue;\n } else {\n // some other error occurred, give up.\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n }\n } catch (DbxException ex) {\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n } catch (IOException ex) {\n System.err.println(\"Error reading from file \\\"\" + localFile + \"\\\": \" + ex.getMessage());\n return;\n }\n }\n\n // if we made it here, then we must have run out of attempts\n System.err.println(\"Maxed out upload attempts to Dropbox. Most recent error: \" + thrown.getMessage());\n }", "@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sendRequest(){\n fileServer.sendMessage(this.packet,new FileNode(ip,port));\n }", "private int sendImages(File[] imageFolderAndFiles, OutputStream out, InputStream in, float imagesPerSecond, int imageTotal, InetAddress serverAddress)\n\t{\t\t\n\t\tlong msPeriod = (long) (1000.0/imagesPerSecond);\n\t\t\n\t\tif (msPeriod < 1)\n\t\t\tmsPeriod = 1;\n\t\t\n\t\ttry\n\t\t{\n\t\t SendImageTask imageSendingTask = new SendImageTask(imageFolderAndFiles, out, in, imageTotal, serverAddress);\n\t\t\t\n\n\t\t\tsynchronized (imageSendingTask)\t\t// ensure that this thread has the lock on imageSendingTask before imageSendingTask can claim it\n\t\t\t{\n\t\t\t\timageSendingTimer.schedule(imageSendingTask, msPeriod, msPeriod);\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// release the lock so that the imageSendingTask can execute and wait for imageSendingTask to finish\n\t\t\t\t\timageSendingTask.wait();\n\t\t\t\t} catch (InterruptedException e)\n\t\t\t\t{\n\t\t\t\t\tLOGGER.fatal(\"Unable to wait for image sending to finish.\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t return imageSendingTask.getImagesSent();\n\t\t} catch (IOException e)\n\t\t{\n\t\t\tLOGGER.fatal(\"Unable to schedule the sending of images.\");\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "@RequestMapping(value = \"/siguiente1\", method = RequestMethod.POST)\r\n public ResponseEntity<String> uploadMultipleFileHandler(@RequestParam(\"inputNameModel\") String nameModelo,\r\n @RequestParam(\"filePaso1\") MultipartFile[] files) {\r\n \t\t\t\tString[] names = {\"modelIcon.png\", \"Fondo.png\", \"Mascara.png\"};\r\n\r\n for (int i = 0; i < files.length; i++) {\r\n MultipartFile file = files[i];\r\n String name = names[i];\r\n\r\n try {\r\n byte[] imageInByte = file.getBytes();\r\n\r\n // Creating the directory to store file\r\n String rootPath = System.getProperty(\"catalina.home\");\r\n File dir = new File(rootPath + File.separator + \"tmpFiles\"+ File.separator + nameModelo);\r\n if (!dir.exists()){\r\n\t\t\t\t\t\t\t\t//\tSystem.out.println( \"Ruta de las magenes: \");\r\n\t\t\t\t\t\t\t\t//\tSystem.out.println( rootPath + File.separator + \"tmpFiles\" + File.separator + nameModelo);\r\n\t\t\t\t\t\t\t\t\tdir.mkdirs();\r\n\t\t\t\t\t\t\t\t}\r\n\r\n // Create the file on server\r\n File serverFile = new File(dir.getAbsolutePath() + File.separator + name);\r\n BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(serverFile));\r\n stream.write(imageInByte);\r\n stream.close();\r\n\r\n //logger.info(\"Server File Location=\"\r\n // + serverFile.getAbsolutePath());\r\n\r\n System.out.println( \"You successfully uploaded file=\" + name);\r\n } catch (Exception e) {\r\n\t\t\t\t\t\t\t\treturn new ResponseEntity<String>(\"You failed to upload \" + name + \" => \" + e.getMessage(), HttpStatus.OK);\r\n }\r\n }\r\n\t\t\t\tString[] colors = null;\r\n\t\t\t\t//if ( files.length = 3){\r\n\t\t\t\t\tSystem.out.println( \"Si tenemos cargado mascara ...\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tMultipartFile f = files[2];\r\n\t\t\t\t\t\tbyte[] imageInByte = f.getBytes();\r\n\t\t\t\t\t\tInputStream in = new ByteArrayInputStream(imageInByte);\r\n\t\t\t\t\t\tBufferedImage image = ImageIO.read(in);\r\n\t\t\t\t\t\tcolors = convertTo2DWithoutUsingGetRGB(image);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\treturn new ResponseEntity<String>(\"Error al generar la lista de colores => \" + e.getMessage(), HttpStatus.OK);\r\n\t\t\t\t\t}\r\n\t\t\t\t//}\r\n \treturn new ResponseEntity<String>(\" >>>> FIN <<<<\", HttpStatus.OK);\r\n }", "@Override\n public void run()\n {\n try\n {\n InputStream fis = new FileInputStream(transferFile);\n OutputStream sos = socket.getOutputStream();\n\n logWriter.println(\"Sending the file...\");\n\n byte [] buffer = new byte[1024];\n int readBytes;\n while((readBytes = fis.read(buffer)) > -1) {\n sos.write(buffer, 0, readBytes);\n sos.flush();\n }\n\n fis.close();\n sos.close();\n socket.close();\n\n logWriter.println(\"File: \" + transferFile.getName());\n logWriter.println(transferFile.length() + \" bytes sent.\");\n logWriter.println(\"Data Connection Closed.\");\n\n } catch (IOException e)\n {\n e.printStackTrace(logWriter);\n }\n }", "public void doFiles(){\r\n serversDir = new File(rootDirPath+\"/servers/\");\r\n serverList = new File(rootDirPath+\"serverList.txt\");\r\n if(!serversDir.exists()){ //if server Directory doesn't exist\r\n serversDir.mkdirs(); //create it\r\n }\r\n updateServerList();\r\n }", "public List<FileUpload> getFileUploads(int numberOfFileUploads, Long startIndex) throws AppException;", "public void setChunkServers(HostID[] chunkServers)\n {\n this.chunkServers = chunkServers;\n }", "public void blockingSendSenderSide() throws OOBException {\n \t\tFileInputStream fis = null;\n \t\ttry {\n \t\t\tlog.debug(\"enter send scpmanager session is \" + session);\n \t\t\t// exec 'scp -t rfile' remotely\n \t\t\tString command = \"scp -p -t \" + rfile;\n \t\t\tChannel channel = session.openChannel(\"exec\");\n \t\t\t((ChannelExec) channel).setCommand(command);\n \t\t\t// get I/O streams for remote scp\n \t\t\tOutputStream out = channel.getOutputStream();\n \t\t\tInputStream in = channel.getInputStream();\n \t\t\tchannel.connect();\n \t\t\tif (checkAck(in) != 0) {\n \t\t\t\tSystem.exit(0);\n \t\t\t}\n \t\t\t// send \"C0644 filesize filename\", where filename should not include\n \t\t\t// '/'\n \t\t\tlog.debug(\"lfile value \" + lfile);\n \t\t\tlong filesize = (new File(lfile)).length();\n \t\t\tcommand = \"C0644 \" + filesize + \" \";\n \t\t\tif (lfile.lastIndexOf('/') > 0) {\n \t\t\t\tcommand += lfile.substring(lfile.lastIndexOf('/') + 1);\n \t\t\t} else {\n \t\t\t\tcommand += lfile;\n \t\t\t}\n \t\t\tcommand += \"\\n\";\n \t\t\tout.write(command.getBytes());\n \t\t\tout.flush();\n \t\t\tif (checkAck(in) != 0) {\n \t\t\t\tSystem.exit(0);\n \t\t\t}\n \n \t\t\t// send a content of lfile\n \t\t\tfis = new FileInputStream(lfile);\n \t\t\tbyte[] buf = new byte[1024];\n \t\t\twhile (true) {\n \t\t\t\tint len = fis.read(buf, 0, buf.length);\n \t\t\t\tif (len <= 0)\n \t\t\t\t\tbreak;\n \t\t\t\tout.write(buf, 0, len); // out.flush();\n \t\t\t}\n \t\t\tfis.close();\n \t\t\tfis = null;\n \t\t\t// send '\\0'\n \t\t\tbuf[0] = 0;\n \t\t\tout.write(buf, 0, 1);\n \t\t\tout.flush();\n \t\t\tif (checkAck(in) != 0) {\n \t\t\t\tSystem.exit(0);\n \t\t\t}\n \t\t\tout.close();\n \t\t\tchannel.disconnect();\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\ttry {\n \t\t\t\tif (fis != null)\n \t\t\t\t\tfis.close();\n \t\t\t} catch (Exception ee) {\n \t\t\t}\n \t\t}\n \t\tlog.debug(\"out send scpmanager\");\n \t}", "private void sendFileContents() {\n\t\t// mostramos un log\n\t\tthis.getLogger().debug(\"Sending file (\" + this.getFile().getName() + \": \" + this.getFile().length() + \" bytes)..\");\n\t\t// iniciamos una bandera\n\t\tint bytesRead = 0;\n\t\ttry {\n\t\t\t// abrimos el fichero\n\t\t\tfinal FileInputStream inFile = new FileInputStream(this.getFile());\n\t\t\t// creamos un buffer para el envio\n\t\t\tfinal byte[] buff = new byte[this.getConnection().getSendBufferSize()];\n\t\t\t// leemos el fichero\n\t\t\twhile ((bytesRead = inFile.read(buff)) > 0) {\n\t\t\t\t// enviamos el buffer por el socket\n\t\t\t\tthis.getConnection().getOutputStream().write(buff, 0, bytesRead);\n\t\t\t\t// vaciamos el buffer\n\t\t\t\tthis.getConnection().getOutputStream().flush();\n\t\t\t}\n\t\t\t// cerramos el fichero\n\t\t\tinFile.close();\n\t\t\t// vaciamos el fichero enviado\n\t\t\tthis.file = null;\n\t\t\t// mostramos un log\n\t\t\tthis.getLogger().info(\"File sent\");\n\t\t} catch (final SocketException e) {\n\t\t\t// mostramos el trace de la excepcion\n\t\t\tthis.getLogger().error(e);\n\t\t} catch (final FileNotFoundException e) {\n\t\t\ttry {\n\t\t\t\t// enviamos -1 para finalizar\n\t\t\t\tthis.getConnection().getOutputStream().write(-1);\n\t\t\t} catch (final IOException ignored) {}\n\t\t} catch (final IOException e) {\n\t\t\t// mostramos el trace de la excepcion\n\t\t\tthis.getLogger().error(e);\n\t\t}\n\t}", "private void sendFile(String fileName) throws IOException {\n // Read file from disk\n //\n fileReader = new MyFileReader();\n byte[] data = fileReader.readFile(fileName);\n //\n // Send binary data over the TCP/IP socket connection\n //\n for (byte i : data) {\n this.socket.getOutputStream().write(i);\n }\n\n System.out.println(\"\\r\\nSent \" + data.length + \" bytes to server.\");\n }", "public static List<Path> chunkImages(Path inputOoxmlFilePath, int chunkCount) throws IOException {\r\n List<Path> resultChunkPaths = new ArrayList<Path>();\r\n\r\n String ooxmlRootFolderName = \"\";\r\n\r\n for (int chunkNumber = 1; chunkNumber <= chunkCount; chunkNumber++) {\r\n Path resultFilePath = Paths\r\n .get(FileUtils.getAllExceptExtension(inputOoxmlFilePath.toString()) + \"_\" + chunkNumber + \"_of_\" + chunkCount + '.' + FileUtils.getFileExtension(inputOoxmlFilePath.toString()));\r\n\r\n // new copy of the original ooxml file for each 'chunk'\r\n Files.copy(inputOoxmlFilePath, resultFilePath, StandardCopyOption.REPLACE_EXISTING);\r\n\r\n // mount the zip file system\r\n try (FileSystem fs = FileSystems.newFileSystem(resultFilePath, null)) {\r\n\r\n Path mediaFolderInsideZipPath = getMediaDirectoryPath(fs);\r\n if (mediaFolderInsideZipPath == null) {\r\n throw new IOException(\"failed to find the media folder (e.g. ppt/media, word/media, Pictures) that contains the images in the ooxml file: \" + resultFilePath);\r\n }\r\n\r\n // list the contents of the /media/ folder\r\n try (DirectoryStream<Path> mediaDirectoryStream = Files.newDirectoryStream(mediaFolderInsideZipPath)) {\r\n // for every file in the /media/ folder\r\n // note: NOT expecting any subfolders\r\n for (Path mediaFilePath : mediaDirectoryStream) {\r\n if (BMPUtils.CHUNKABLE_IMAGE_FILE_EXTENSIONS.contains(FileUtils.getFileExtension(mediaFilePath.toString()))) {\r\n LOGGER.fine(\"Chunking image: \" + mediaFilePath);\r\n //String resultImageFileLoc = getAllExceptExtension(mediaFilePath) + \".bmp\";\r\n Path resultImageFilePath = mediaFilePath; //fs.getPath(resultImageFileLoc);\r\n try {\r\n OoxmlChunkUtils.writeImageChunk(mediaFilePath, resultImageFilePath, FileUtils.getFileExtension(mediaFilePath.toString()), chunkNumber, chunkCount);\r\n } catch (Exception e) {\r\n LOGGER.log(Level.WARNING, \"error writing chunk \" + chunkNumber + \" for image \" + resultImageFilePath, e);\r\n }\r\n }\r\n // else, any file that cannot be broken-down gets left as-is in every chunk\r\n }\r\n } catch (IOException e) {\r\n LOGGER.log(Level.WARNING, \"error getting zip contents at \" + mediaFolderInsideZipPath + \" inside \" + resultFilePath, e);\r\n }\r\n\r\n } catch (IOException e) {\r\n LOGGER.log(Level.WARNING, \"error mounting zip filesystem \" + resultFilePath, e);\r\n }\r\n resultChunkPaths.add(resultFilePath);\r\n }\r\n return resultChunkPaths;\r\n }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "public void syncLogsServers() {\n initExecService();\n try {\n log.info(\"Number of logs founded: \" + Files.list(Paths.get(saveLocation)).count());\n\n /**\n * Find the files in the directory. For each file found with the .log extension\n * start to read it and submit it to the thread pool of the executor\n */\n Files.list(Paths.get(saveLocation))\n .filter(Files::isRegularFile)\n .filter(file -> FilenameUtils.getExtension(file.getFileName().toString()).equals(LOG_EXTENSION))\n .forEach(file -> executorService.submit(()-> readFile(file, Charset.forName(\"UTF-8\"))));\n\n log.info(\"Proceed to terminate all thread\");\n\n shutdownAndAwaitTermination(executorService,\n 150,\n TimeUnit.MINUTES);\n\n executorService = null;\n } catch (Exception ex) {\n log.error(ex.getMessage(), ex);\n try {\n executorService.shutdownNow();\n shutdownAndAwaitTermination(executorService, 5, TimeUnit.MINUTES);\n executorService = null;\n } catch (Exception e2) {\n log.error(e2.getMessage(), e2);\n }\n }\n }", "protected abstract void transfer(UUID[] players, String server, IntConsumer response);", "int postFiles(String [] args,int startIndexInArgs) throws IOException {\n int filesPosted = 0;\n for (int j = 1; j < args.length; j++) {\n File srcFile = new File(args[j]);\n final StringWriter sw = new StringWriter();\n \n if (srcFile.canRead()) {\n info(\"POSTing file \" + srcFile.getName());\n postFile(srcFile, sw);\n filesPosted++;\n warnIfNotExpectedResponse(sw.toString(),SOLR_OK_RESPONSE);\n } else {\n warn(\"Cannot read input file: \" + srcFile);\n }\n }\n return filesPosted;\n }", "@Override\n\tprotected void process(List<Integer> chunks){\n\t\tString[] s= fileName.split(\"/\");\n\t\tthis.statuslbl.setText(\"Creating \"+s[s.length-1]+\", please wait...\");\n\t\tprogressBar.setValue(n);\n\t}", "public static void sendMessagesByNumber(int number, String directory, Pollable jmsInstance) throws IOException {\n List<File> files = JmsUtils.getMessagesFromDirectory(directory);\n for (int i = 0; i < number; i++) {\n int index = i % files.size();\n String text = FileUtils.readFileToString(files.get(index));\n String threadNumber = Long.toString(Thread.currentThread().getId());\n jmsInstance.send(text, System.currentTimeMillis(), threadNumber, text.length(), \"Rex-thread\", \"\");\n logger.info(String.format(\">> Message[%s] has been sent\", i));\n }\n }", "void mo54426b(int i, List<DownloadChunk> list);", "public void mergeChunks(String fileName,int numChunks)\n {\n FileInputStream fInput;\n BufferedInputStream bufInput;\n BufferedOutputStream bufOutput;\n FileOutputStream fOutput;\n try\n { \n fOutput = new FileOutputStream(fileName);\n bufOutput = new BufferedOutputStream(fOutput); \n for(int i=0;i<numChunks;i++)\n {\n fInput = new FileInputStream(fileName+ \".chunk.\" + i);\n bufInput = new BufferedInputStream(fInput);\n int b;\n while((b=bufInput.read())!= -1)\n {\n bufOutput.write(b);\n }\n\n }\n bufOutput.close();\n }\n\t\tcatch(FileNotFoundException ex)\n {\n System.out.println(\"File Not Found\");\n }\n catch(IOException ex)\n {\n System.out.println(\"Some IOException occurred\");\n }\n }", "void mo54414a(int i, List<DownloadChunk> list);", "@Override\n public void run() {\n Send enoughPeers = new Send(Send.ENOUGH_NODES, replicationDegree);\n Send ret = enoughPeers.writeAndRead(enoughPeers, p, Peer.PROTOCOL, p.centralizedChordManagerAddress,\n p.centralizedChordManagerPort);\n // CHECK IF THERE ARE ENOUGH NODES\n if (ret.enough) {\n MessageDigest md3 = null;\n try {\n md3 = MessageDigest.getInstance(\"SHA1\");\n } catch (NoSuchAlgorithmException e2) {\n e2.printStackTrace();\n }\n md3.reset();\n md3.update(path.getBytes());\n byte[] hashBytes3 = md3.digest();\n BigInteger hashNum3 = new BigInteger(1, hashBytes3);\n int key3 = Math.abs(hashNum3.intValue()) % Peer.numDHT;\n System.out.println(\"Generated key \" + key3 + \" for file: \" + path);\n FileModel file = new FileModel(path, replicationDegree, p.me);\n file.loadFileContent();\n p.initiatorPeerFiles.add(file);\n if (file.fileData.length != 0) {\n Peer destination = null;\n try {\n destination = ChordManager.find_successor(key3);\n // if dest is myself then i increase the retries by 1 because I'm sending the\n // file to myself first\n if (destination.getSslEnginePort() == p.getSslEnginePort()) {\n file.retries += 1;\n }\n } catch (Exception e1) {\n e1.printStackTrace();\n }\n SendFileThread thread = new SendFileThread(p.initiatorPeerFiles.get(p.initiatorPeerFiles.indexOf(file)),\n p, destination);\n thread.start();\n\n try {\n thread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n if (!file.replicationDegreeAchieved())\n System.out.println(\"File \" + path + \" was backed up with lower repDegree: \"\n + file.perceivedReplicationDegree + \" of: \" + file.perceivedReplicationDegree);\n else {\n System.out.println(\"File \" + path + \" was backed up with repDegree wanted\");\n }\n } else {\n System.err.println(\"File \" + path + \" was not backed up\");\n }\n } else {\n System.err.println(\"File \" + path + \" was not backed up replication degree of : \" + replicationDegree\n + \" could not be achived due to less number of peers available\");\n }\n }", "static public void readServerFiles(DbxClientV2 client) throws Exception\n\t{\n ListFolderResult result = client.files().listFolder(\"\");\n while (true) {\n for (Metadata metadata : result.getEntries()) {\n System.out.println(metadata.getPathLower());\n }\n if (!result.getHasMore()) {\n break;\n }\n result = client.files().listFolderContinue(result.getCursor()); \n }\n\t}", "@Override\n protected void process(List<String> chunks) {\n for (String message : chunks) {\n LOG.info(message);\n StatusDisplayer.getDefault().setStatusText(message);\n }\n\n }", "private void Download(ByteBuffer packet) throws IOException {\n\t\t// NO HEADER\n\t\t\n\t\t// allow only 1 download at a time, clear old threads\n\t\tfor (ServerFwding f : peer_threads){\n\t\t\tif (f.isAlive())\n\t\t\t\tf.interrupt();\n\t\t}\n\t\tpeer_threads.clear();\n\t\t\n\t\t//parse the req\n\t\tif (packet.capacity() < 4)\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"download request invalid\");\n\t\t\n\t\tint buf_id = packet.getInt(0);\n\t\t\n\t\tMap<ClientObj, Integer> clients_with_file = new HashMap<ClientObj, Integer>();\n\t\tfor (ClientObj c : clients){\n\t\t\tif (c.hasFile(buf_id) && c.getId() != client.getId())\n\t\t\t\tclients_with_file.put(c, 0);\n\t\t}\n\t\t\n\t\t// ask each client to prepare a port\n\t\tfor (ClientObj c : clients_with_file.keySet()) {\n\t\t\t//open connection with clients listener\n\t\t\tSocket peerConnection = c.getListenerSocket();\n\t\t\tOutputStream out_c = new BufferedOutputStream(peerConnection.getOutputStream());\n\t\t\t\n\t\t\t//construct packet\n\t\t\t//(for connect to a peer conn s->c) [header | file_id (4) | peer id (4) | port num]\n\t\t\tint peer_server_port = Utility.getValidPort();\n\t\t\tbuf = Utility.addHeader(Constants.PREPARE, 12, c.getId());\n\t\t\tbuf.putInt(Constants.HEADER_LEN, buf_id);\n\t\t\tbuf.putInt(Constants.HEADER_LEN + 4, client.getId());\n\t\t\tbuf.putInt(Constants.HEADER_LEN + 8, peer_server_port);\n\t\t\tbyte[] sendData = buf.array();\n\t\t\t\n\t\t\t// send response\n\t\t\tout_c.write(sendData);\n\t\t\tout_c.flush();\n\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\": sent peer client data (with server port \" +peer_server_port+\").\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint client_server_port = Utility.getValidPort();\n\t\t\t\tServerFwding peer_thread = new ServerFwding(\n\t\t\t\t\t\tclient_server_port, c.getId(), peer_server_port, buf_id);\n\t\t\t\tpeer_thread.start();\n\t\t\t\t\n\t\t\t\t// send peer info to client, await connection on thread\n\t\t\t\tbuf = Utility.addHeader(Constants.DOWNLOAD_REQ, 8, client.getId());\n\t\t\t\tbuf.putInt(Constants.HEADER_LEN, client_server_port);\n\t\t\t\tbuf.putInt(Constants.HEADER_LEN + 4, c.getId());\n\t\t\t\tsendData = buf.array();\n\t\t\t\tout.write(sendData);\n\t\t\t\tout.flush();\n\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\": sent client peer data (with server port \" +client_server_port+\").\");\n\t\t\t\tpeer_threads.add(peer_thread);\n\t\t\t} catch (IOException e){\n\t\t\t\t// couldn't connect to peer, skip it\n\t\t\t\tSystem.err.println(client.getAddress()+ \n\t\t\t\t\t\t\": Failed to set up P2p connection \" + e.getMessage());\n\t\t\t} catch (RuntimeException e){\n\t\t\t\t// couldn't connect to peer, skip it\n\t\t\t\tSystem.err.println(client.getAddress()+ \n\t\t\t\t\t\t\": Failed to set uo P2p connection \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\t\n\t\t// send last to client\n\t\tbuf = Utility.addHeader(Constants.DOWNLOAD_REQ, 8, client.getId());\n\t\tbuf.putInt(Constants.HEADER_LEN, 0);\n\t\tbuf.putInt(Constants.HEADER_LEN + 4, 0);\n\t\tout.write(buf.array());\n\t\tout.flush();\n\t\t\n\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\": Correctly processed download req for \" + buf_id);\n\t}", "protected String createBatchAndUpload() throws IOException {\n String batchId;\n try (CloseableClientResponse response = getResponse(RequestType.POST, \"upload\")) {\n assertEquals(Status.CREATED.getStatusCode(), response.getStatus());\n JsonNode node = mapper.readTree(response.getEntityInputStream());\n batchId = node.get(\"batchId\").asText();\n assertNotNull(batchId);\n }\n\n // fist file\n \n String data = \"SomeDataExtractedFromNuxeoDBToFeedTensorFlow\";\n String fileSize = String.valueOf(data.getBytes(UTF_8).length);\n Map<String, String> headers = new HashMap<>();\n headers.put(\"Content-Type\", \"text/plain\");\n headers.put(\"X-Upload-Type\", \"normal\");\n headers.put(\"X-File-Name\", \"aidata.bin\");\n headers.put(\"X-File-Size\", fileSize);\n headers.put(\"X-File-Type\", \"application/octet-stream\");\n\n try (CloseableClientResponse response = getResponse(RequestType.POST, \"upload/\" + batchId + \"/0\", data,\n headers)) {\n assertEquals(Status.CREATED.getStatusCode(), response.getStatus());\n JsonNode node = mapper.readTree(response.getEntityInputStream());\n assertEquals(\"true\", node.get(\"uploaded\").asText());\n assertEquals(batchId, node.get(\"batchId\").asText());\n assertEquals(\"0\", node.get(\"fileIdx\").asText());\n assertEquals(\"normal\", node.get(\"uploadType\").asText());\n } \n\n // second file\n data = \"SomeDataExtractedFromNuxeoDBToValidateTensorFlow\";\n fileSize = String.valueOf(data.getBytes(UTF_8).length);\n headers.clear();\n headers.put(\"Content-Type\", \"text/plain\");\n headers.put(\"X-Upload-Type\", \"normal\");\n headers.put(\"X-File-Name\", \"aidatacheck.bin\");\n headers.put(\"X-File-Size\", fileSize);\n headers.put(\"X-File-Type\", \"application/octet-stream\");\n\n try (CloseableClientResponse response = getResponse(RequestType.POST, \"upload/\" + batchId + \"/1\", data,\n headers)) {\n assertEquals(Status.CREATED.getStatusCode(), response.getStatus());\n JsonNode node = mapper.readTree(response.getEntityInputStream());\n assertEquals(\"true\", node.get(\"uploaded\").asText());\n assertEquals(batchId, node.get(\"batchId\").asText());\n assertEquals(\"1\", node.get(\"fileIdx\").asText());\n assertEquals(\"normal\", node.get(\"uploadType\").asText());\n } \n \n return batchId;\n }", "private static List<Path> listChunkableFiles(FileSystem fs) throws IOException {\r\n\r\n List<Path> resultMediaPathList = new ArrayList<Path>();\r\n\r\n Path mediaFolderInsideZipPath = getMediaDirectoryPath(fs);\r\n // list the contents of the result /media/ folder\r\n try (DirectoryStream<Path> mediaDirectoryStream = Files.newDirectoryStream(mediaFolderInsideZipPath)) {\r\n // for every file in the result /media/ folder\r\n // note: NOT expecting any subfolders\r\n for (Path mediaFilePath : mediaDirectoryStream) {\r\n if (BMPUtils.CHUNKABLE_IMAGE_FILE_EXTENSIONS.contains(FileUtils.getFileExtension(mediaFilePath.toString()))) {\r\n resultMediaPathList.add(mediaFilePath);\r\n }\r\n }\r\n }\r\n\r\n return resultMediaPathList;\r\n }", "public static void sync() {\n\t\tUiApplication.getUiApplication().addFileSystemJournalListener(fileListener);\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t// Find files sdcard\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.SDCARD)) {\n\t\t\t\t\tlogger.debug(\"Finding files on sdcard\");\n\t\t\t\t\tfindFiles(sdcardDir);\n\t\t\t\t}\n\t\t\t\t// Find files on eMMC\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.STORE)) {\n\t\t\t\t\tlogger.debug(\"Finding files on eMMC\");\n\t\t\t\t\tfindFiles(storeDir);\n\t\t\t\t}\n\n\t\t\t\t// Upload files to server\n\t\t\t\tFileLog.upload();\n\n\t\t\t}\n\t\t}.start();\n\t}", "public void run()\n\t{\n\t\tSystem.out.println(\"Looking for spots to fill\");\n\t\tfor(int i = 0; i <= theFileArray.length; i++)\n\t\t{\n\t\t\tif(theFileArray[i] == -1)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Spot found: commence requesting byte at spot: \" + i);\n\t\t\t\t//****get the byte*****\n\t\t\t\tserverOutput.println(i);//ask server to send byte\n\t\t\t\ttheFileArray[i] = Integer.parseInt(serverInput.nextLine()); //receive byte and enter in array\n\t\t\t}\n\t\t}\n\t\t//once we get to the end of the array, write to disk\n\t\tbyte[] array = new byte[theFileArray.length];//convert int[] to byte[] so fos.write works\n\t\tfor(int i = 0; i < theFileArray.length; i++)\n\t\t{\n\t\t\tarray[i] = (byte) theFileArray[i];\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tFileOutputStream fos = new FileOutputStream(\"\\\\bin\\\\myFiles\\\\newFile.png\");\n\t\t\tfos.write(array);\n\t\t\tfos.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n IConnectionManager conManager = m_ftpConfig.getConnectionManager();\n while (m_runner != null) {\n try {\n \n // closed - return\n if(m_serverSocket == null) {\n return;\n }\n \n // accept new connection .. if suspended \n // close immediately.\n Socket soc = m_serverSocket.accept();\n if(m_suspended) {\n try {\n soc.close();\n }\n catch(Exception ex) {\n }\n continue;\n }\n \n IConnection connection = new RequestHandler(m_ftpConfig, soc);\n conManager.newConnection(connection);\n }\n catch (Exception ex) {\n return;\n }\n }\n }", "protected void emitBatch(){\n synchronized(this){\n\n revokeSendBatch();\n\n int viewn = getCurrentViewNumber();\n long seqn = getStateLog().getNextPrePrepareSEQ();\n\n PBFTRequestInfo rinfo = getRequestInfo();\n if(!rinfo.hasSomeWaiting()){\n return;\n }\n /* creates a new pre-prepare message */\n PBFTPrePrepare pp = null;\n\n int size = 0;\n\n /* while has not achieved the batch size and there is digests in queue */\n String digest = null;\n while(size < getBatchSize() && (digest = rinfo.getFirtRequestDigestWaiting())!= null){\n if(pp == null){\n pp = new PBFTPrePrepare(viewn, seqn, getLocalServerID());\n }\n pp.getDigests().add(digest);\n rinfo.assign(digest, RequestState.PREPREPARED);\n size += 1;//rinfo.getRequestSize(digest);\n }\n\n if(pp == null){\n return;\n }\n \n /* emits pre-prepare */\n emitPrePrepare(pp);\n //emit(pp, getLocalGroup().minus(getLocalProcess()));\n\n /* update log current pre-prepare */\n handle(pp);\n\n /* if there is digest then it will schedule a send batch */\n if(rinfo.hasSomeWaiting()){\n batch();\n }//end if digest queue is no empty\n\n }//end synchronized(this)\n }", "public void envio_paquetes (Socket sock, ServerSocket sersock) throws IOException {\r\n\t\t\r\n\t\tFileInputStream fis = null;\r\n\t\tBufferedInputStream bis = null;\r\n\t\tOutputStream os = null;\r\n\t\tServerSocket servsock = null;\r\n\t\tint particiones;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tFile myFile = new File (Archivo_de_registro);\r\n\t\t\tbyte [] mybytearray = new byte [(int)myFile.length()];\r\n\t\t\tbyte [] buffertemp = new byte [Max_buffer];\r\n\t\t\tfis = new FileInputStream(myFile);\r\n\t\t\tbis = new BufferedInputStream(fis);\r\n\t\t\tparticiones = (int)Math.ceil((float)mybytearray.length / (float)Max_buffer ) ;\r\n\t\t\t// mandamos metadata\r\n\t\t\tSystem.out.println(\"Enviando metadata...\");\r\n\t\t\tSystem.out.println(\"Particiones = \"+particiones);\r\n\t\t\tSystem.out.println(\"Largo archivo = \"+mybytearray.length);\r\n\t\t\tPrintStream ios = new PrintStream(sock.getOutputStream());\r\n\t\t\t//primero servidor manda cantidad de paquetes\r\n\t\t\tios.println(particiones);\r\n \t\t//luego servidor manda tamanio paquete\r\n\t\t\tios.println(Max_buffer);\r\n\r\n\t\t\tsock.close();\r\n\t\t\tsock = sersock.accept();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// luego mandamos paquetes\r\n\t\t\tfor (int i= 0; i < particiones ;i++){\r\n\t\t\t\tif((i+1)*Max_buffer <mybytearray.length){\r\n\t\t\t\t\tbis.read(mybytearray,i*Max_buffer ,Max_buffer);\r\n\r\n\t\t\t\t\tos = sock.getOutputStream();\r\n\t\t\t\t\tSystem.out.println(\"Sending \" + Archivo_de_registro + \"(\" + mybytearray.length + \" bytes)\");\r\n\t\t\t\t\tos.write(mybytearray,i*Max_buffer ,Max_buffer);\r\n\t\t\t\t\tos.flush();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbis.read(mybytearray,i*Max_buffer ,mybytearray.length-i*Max_buffer);\r\n\r\n\t\t\t\t\tos = sock.getOutputStream();\r\n\t\t\t\t\tSystem.out.println(\"Sending \" + Archivo_de_registro + \"(\" + mybytearray.length + \" bytes)\");\r\n\t\t\t\t\tos.write(mybytearray,i*Max_buffer ,mybytearray.length-i*Max_buffer);\r\n\t\t\t\t\tos.flush();\r\n\t\t\t\t}\tSystem.out.println(\"Enviada parte \"+(i+1) + \" de \" + particiones+\"\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enviado todo\");\r\n\r\n\r\n\t\t} catch (IllegalBlockingModeException e){\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\t\r\n\t\t\tif (bis != null) bis.close();\r\n\t\t\tif (os != null) os.close();\r\n\t\t}\r\n\t}", "private void postImg(File index) {\n FileInputStream imgIn = null;\n byte[] imgData = new byte[(int)index.length()];\n try {\n imgIn = new FileInputStream(index);\n imgIn.read(imgData);\n\n BufferedOutputStream imgOut = new BufferedOutputStream(connectionSocket.getOutputStream());\n\n\n out.println(OK);\n out.println(htmlType);\n out.println(closed);\n out.println(\"Content-Length: \" + index.length());\n out.write(ENDLINE);\n out.flush();\n imgOut.write(imgData, 0, (int)index.length());\n imgOut.flush();\n\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "public void upload(final List<Option> options,\n final IProgressCallback<UploadType> callback,\n final int... configs)\n throws IOException {\n int chunkSize = DEFAULT_CHUNK_SIZE;\n\n if (configs.length > 0) {\n chunkSize = configs[0];\n }\n\n int maxRetry = MAXIMUM_RETRY_TIMES;\n\n if (configs.length > 1) {\n maxRetry = configs[1];\n }\n\n if (chunkSize % REQUIRED_CHUNK_SIZE_INCREMENT != 0) {\n throw new IllegalArgumentException(\"Chunk size must be a multiple of 320 KiB\");\n }\n\n if (chunkSize > MAXIMUM_CHUNK_SIZE) {\n throw new IllegalArgumentException(\"Please set chunk size smaller than 60 MiB\");\n }\n\n byte[] buffer = new byte[chunkSize];\n\n while (this.mReadSoFar < this.mStreamSize) {\n int read = this.mInputStream.read(buffer);\n\n if (read == -1) {\n break;\n }\n\n ChunkedUploadRequest request =\n new ChunkedUploadRequest(this.mUploadUrl, this.mClient, options, buffer, read,\n maxRetry, this.mReadSoFar, this.mStreamSize);\n ChunkedUploadResult result = request.upload(this.mResponseHandler);\n\n if (result.uploadCompleted()) {\n callback.progress(this.mStreamSize, this.mStreamSize);\n callback.success((UploadType) result.getItem());\n break;\n } else if (result.chunkCompleted()) {\n callback.progress(this.mReadSoFar, this.mStreamSize);\n } else if (result.hasError()) {\n callback.failure(result.getError());\n break;\n }\n\n this.mReadSoFar += read;\n }\n }", "@Override\n protected Void call() {\n if(download_queue.isEmpty()) return null;\n \n //Proceed to create a file with a list of addresses\n Writer writer = null;\n String file_dir = Configuration.root_dir + \"Download_list.txt\";\n try{\n writer = new BufferedWriter(\n new OutputStreamWriter(\n new FileOutputStream(\n file_dir), \"utf-8\"));\n String server_root = Configuration.getInstance().getSina_server_root();\n //Traverse through the download list and write each download address to file\n String content = \"\";\n for(int i = 0; i < download_queue.size(); i++){\n SoundTrack track = download_queue.get(i);\n String address = server_root + track.getLocalFileName();\n content += address;\n if(i < (download_queue.size() - 1)){\n content += \"\\n\";\n }\n }\n //Write to file\n writer.write(content);\n \n } catch (UnsupportedEncodingException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } finally{\n try {\n if(writer != null)\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n //Run wget command to download the listed files\n String command = \"wget\";\n command += \" -P \" + Configuration.root_dir + \"SoundTracks/\";\n command += \" -i list\";\n try {\n Process p = Runtime.getRuntime().exec(command);\n p.waitFor();\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InterruptedException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return null;\n }", "@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}", "@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 }", "public static void main(String[] args) throws Exception{\t\tSmbFile smbFile = new SmbFile(\"smb://10.10.10.163/gf\");\n\t\ttry{\n\t\t\tSmbFile[] hostFiles = smbFile.listFiles();\n\n\t\t\tfor(SmbFile itemHostFile : hostFiles){\n\t\t\t\t//String server = itemHostFile.getServer();\n\t\t\t\t//System.out.println(server);\n\t\t\t\tSystem.out.println(itemHostFile.toString());\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch (Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\n\t\t\n\t}", "public void requestServerData() throws IOException {\n Iterator it = gameServers.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry<InetSocketAddress, GameServer> pair = (Map.Entry) it.next();\n pair.getValue().requestAll();\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n PrintWriter out = null;\n JSONObject outputObject = new JSONObject();\n try {\n \n HashMap<String,String> bigItemIds = new HashMap<>();\n Iterator mIterator = bigItemIds.keySet().iterator();\n out = response.getWriter();\n // Create a factory for disk-based file items\n DiskFileItemFactory factory = new DiskFileItemFactory();\n\n // Configure a repository (to ensure a secure temp location is used)\n ServletContext servletContext = this.getServletConfig().getServletContext();\n File repository = (File) servletContext.getAttribute(\"javax.servlet.context.tempdir\");\n factory.setRepository(repository);\n\n // Create a new file upload handler\n ServletFileUpload upload = new ServletFileUpload(factory);\n // Parse the request\n List<FileItem> items = upload.parseRequest(request);\n \n final String moveId = UUID.randomUUID().toString();\n final MovesDb movesDb = new MovesDb();\n // Process the uploaded items\n Iterator<FileItem> iter = items.iterator();\n while (iter.hasNext()) {\n FileItem item = iter.next();\n\n if (item.isFormField()) {\n \n System.out.println(\"Form field\" +item.getString());\n \n bigItemIds = processFormField(new JSONObject( item.getString()), out,moveId,movesDb);\n mIterator = bigItemIds.keySet().iterator();\n System.out.println(\"ITEM ID SIZE \"+bigItemIds.size());\n \n } else {\n //processUploadedFile(item);\n System.out.print(\"Photo Field\");\n String key = (String) mIterator.next();\n File mFile = new File(bigItemIds.get(key));\n item.write(mFile);\n \n \n \n \n }\n }\n new Thread(){\n \n public void run(){\n pushMovetoMailQueue moveToMailQueue= new pushMovetoMailQueue();\n moveToMailQueue.pushMoveToMailQueue(movesDb);\n }\n }.start();\n outputObject = new JSONObject();\n try {\n outputObject.put(Constants.JSON_STATUS, Constants.JSON_SUCCESS);\n outputObject.put(Constants.JSON_MSG,Constants.JSON_GET_QUOTE);\n } catch (JSONException ex1) {\n Logger.getLogger(doSignUp.class.getName()).log(Level.SEVERE, null, ex1);\n }\n \n out.println(outputObject.toString());\n \n \n \n \n }catch(Exception ex){\n \n outputObject = new JSONObject();\n try {\n outputObject.put(Constants.JSON_STATUS, Constants.JSON_FAILURE);\n outputObject.put(Constants.JSON_MSG,Constants.JSON_EXCEPTION);\n } catch (JSONException ex1) {\n Logger.getLogger(doSignUp.class.getName()).log(Level.SEVERE, null, ex1);\n }\n \n out.println(outputObject.toString());\n Logger.getLogger(doSignUp.class.getName()).log(Level.SEVERE, null, ex);\n }finally{\n out.close();\n }\n }", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n Timestamp startTime;\n Timestamp endTime;\n int responseCode;\n int successfulPosts = 0;\n int failedPosts = 0;\n List<String> fileData = new ArrayList<>();\n SkiersApi apiInstance = new SkiersApi();\n ApiClient client = apiInstance.getApiClient();\n client.setBasePath(BASE_PATH);\n for (int i = 0; i < this.numPostRequests; i++) {\n LiftRide liftRide = new LiftRide();\n liftRide.time(ThreadLocalRandom.current().nextInt(this.endTime - this.startTime) + this.startTime);\n liftRide.liftID(ThreadLocalRandom.current().nextInt(this.liftID) + 1);\n Integer skierID = ThreadLocalRandom.current().nextInt(this.endSkierID - this.startSkierID) + this.startSkierID;\n startTime = new Timestamp(System.currentTimeMillis());\n try {\n apiInstance.writeNewLiftRide(liftRide, this.resortID, this.seasonID, this.dayID, skierID);\n endTime = new Timestamp(System.currentTimeMillis());\n successfulPosts++;\n responseCode = 200;\n } catch (ApiException e) {\n System.err.println(\"Exception when calling SkierApi#writeNewLiftRide\");\n endTime = new Timestamp(System.currentTimeMillis());\n responseCode = e.getCode();\n failedPosts++;\n e.printStackTrace();\n }\n long latency = endTime.getTime() - startTime.getTime();\n String fileLine = startTime.toString() + \",POST,\" + latency + \",\" + responseCode + \"\\n\";\n fileData.add(fileLine);\n }\n this.sharedResults.incrementSuccessfulPost(successfulPosts);\n this.sharedResults.incrementFailedPost(failedPosts);\n this.sharedResults.addNewResults(fileData);\n try {\n this.latch.countDown();\n this.overallLatch.countDown();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@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}", "public void getPeerFiles(){\n\t\t\n\t\tFile[] files = new File(path).listFiles();\n\t\tfor (File file : files) {\n\t\t\tfileNames.add(file.getName());\n\t\t}\n\t\tSystem.out.println(\"Number of Files Registerd to the server - \"+fileNames.size());\n\t\tSystem.out.println(\"To search for file give command: get <Filename>\");\n\t\tSystem.out.println(\"To refresh type command: refresh\");\n\t\tSystem.out.println(\"To disconnect type command: disconnect\");\n\t}", "public void run()\n {\n Connection conn;\n Socket clientSock;\n int timeout;\n\n conn = new Connection();\n timeout = _config.getClientTimeout() * 1000;\n\n for ( ; ; ) {\n /*\n * Wait for connection request.\n */\n try {\n clientSock = _serverSock.accept();\n }\n catch(IOException e) {\n logError(\"accept() failure: \" + e.getMessage());\n continue;\n }\n\n try {\n clientSock.setSoTimeout(timeout);\n }\n catch(SocketException e) {\n logError(\"Cannot set timeout of client socket: \" + e.getMessage()\n + \" -- closing socket\");\n\n try {\n clientSock.close();\n }\n catch(IOException e2) {\n logError(\"Cannot close socket: \" + e2.getMessage());\n }\n continue;\n }\n\n /*\n * `Create' a new connection.\n */\n try {\n conn.init(clientSock);\n }\n catch(IOException e) {\n logError(\"Cannot open client streams\" + getExceptionMessage(e));\n try {\n clientSock.close();\n }\n catch(IOException e2) {\n logError(\"Cannot close client socket\" + getExceptionMessage(e2));\n }\n continue;\n }\n\n if (DEBUG && _debugLevel > 0) {\n debugPrintLn(\"Reading HTTP Request...\");\n }\n\n /*\n * `Create' a new container for the request.\n */\n setCurrentDate(_date);\n _req.init(conn, _clfDateFormatter.format(_date));\n\n // Get the current GAP list.\n _gapList = GlobeRedirector.getGAPList();\n\n processRequest(conn);\n\n /*\n * If access logging is enabled, write an entry to the access log.\n */\n if (_config.getAccessLogEnabledFlag()) {\n GlobeRedirector.accessLog.write(_req.getCommonLogFileStatistics());\n } \n\n if (DEBUG && _debugLevel > 1) {\n debugPrintLn(\"Closing client connection\");\n }\n\n try {\n conn.close();\n }\n catch(IOException e) {\n logError(\"Cannot close client connection\" + getExceptionMessage(e));\n }\n\n /*\n * Release references that are no longer needed. To reduce the\n * memory footprint, these references are released now because it\n * may take a long time before this thread handles a new request\n * (in which case the references are released too).\n */\n _gapList = null;\n _req.clear();\n _httpRespHdr.clear();\n _cookieCoords = null;\n }\n }", "public void run() {\n \t\t\t\t\tif (pendingChunks.isEmpty()) {\r\n \t\t\t\t\t\tstop();\r\n \t\t\t\t\t\tchunkLoadTask = null;\r\n \t\t\t\t\t\treturn;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// Ignore this run if fixing is still being performed\r\n \t\t\t\t\tsynchronized (toFix) {\r\n \t\t\t\t\t\tif (toFix.size() > 500) {\r\n \t\t\t\t\t\t\treturn;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// Load a maximum of 20 chunks\r\n \t\t\t\t\tfinal int loadRate = 20;\r\n \t\t\t\t\tfor (int i = 0; i < loadRate && !pendingChunks.isEmpty(); i++) {\r\n \t\t\t\t\t\tPendingChunk pending = pendingChunks.poll();\r\n \t\t\t\t\t\taddForFixing(pending.world.getChunkAt(pending.x, pending.z));\r\n \t\t\t\t\t}\r\n \t\t\t\t}", "@Override\n public List<Integer> invoke(final File baseDir, final VirtualChannel channel) throws IOException,\n InterruptedException {\n\n List<Integer> results = new ArrayList<Integer>();\n\n FileSet src = Util.createFileSet(baseDir, resultSet.getSpec());\n DirectoryScanner ds = src.getDirectoryScanner();\n ds.scan();\n if (ds.getIncludedFilesCount() == 0) {\n listener.getLogger().println(\"No exportable files found\");\n return results;\n }\n\n // Get target URL\n String targetUrl = klarosUrl;\n\n if (targetUrl != null) {\n String strURL = buildServletURL(targetUrl);\n\n // Get HTTP client\n HttpClient httpclient = new HttpClient();\n\n // Prepare HTTP PUT\n for (String f : ds.getIncludedFiles()) {\n final PutMethod put = new PutMethod(strURL);\n final StringBuilder query =\n new StringBuilder(\"config=\").append(expandVariables(config, environment,\n buildVariables));\n if (StringUtils.isNotBlank(iteration)) {\n query.append(\"&iteration=\").append(\n expandVariables(iteration, environment, buildVariables));\n }\n query.append(\"&env=\").append(expandVariables(env, environment, buildVariables)).append(\n \"&sut=\").append(expandVariables(sut, environment, buildVariables)).append(\"&type=\")\n .append(expandVariables(resultSet.getFormat(), environment, buildVariables));\n if (createTestSuite) {\n query.append(\"&createTestSuiteResults=true\");\n }\n\n query.append(\"&buildServerUrl=\").append(buildServerUrl);\n query.append(\"&buildJobId=\").append(buildJobId);\n query.append(\"&buildId=\").append(buildId);\n\n if (StringUtils.isNotBlank(username)) {\n query.append(\"&username=\").append(\n expandVariables(username, environment, buildVariables)).append(\"&password=\")\n .append(expandVariables(password.getPlainText(), environment, buildVariables));\n }\n put.setQueryString(query.toString());\n\n File file = new File(baseDir, f);\n int result;\n\n RequestEntity entity = new FileRequestEntity(file, \"text/xml; charset=ISO-8859-1\");\n put.setRequestEntity(entity);\n\n // Execute request\n try {\n result = httpclient.executeMethod(put);\n\n if (result != HttpServletResponse.SC_OK) {\n StringBuilder msg =\n new StringBuilder().append(\"Export of \").append(file.getName()).append(\n \" failed - Response status code: \").append(result).append(\n \" for request URL: \").append(strURL).append(\"?\").append(query);\n String response = put.getResponseBodyAsString();\n if (response != null && response.length() > 0) {\n msg.append(\"\\nReason: \").append(response);\n }\n listener.getLogger().println(msg.toString());\n } else {\n results.add(result);\n listener.getLogger().println(\n \"Test result file \" + file.getName() + \" has been successfully exported.\");\n }\n } catch (Exception e) {\n e.printStackTrace(listener.getLogger());\n } finally {\n // Release current connection to the connection pool once you are done\n put.releaseConnection();\n }\n }\n } else {\n listener.getLogger().println(klarosUrl + \": unable to locate this Klaros URL\");\n }\n return results;\n }", "public void run() {\n\t\ttry {\n\t\t\tServerSocket listenSocket = new ServerSocket(port);\n\t\t\twhile (true) {\n\t\t\t\tSocket socket = listenSocket.accept();\n\t\t\t\t\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t\toutput.flush();\n\t\t\t\tObjectInputStream input = new ObjectInputStream(socket.getInputStream());\n\t\t\t\t\n\t\t\t\tFSMessage message = FSMessage.readMessage(input);\n\t\t\t\t\n\t\t\t\tif (message.getType() == FSMessage.MESSAGE_SPREAD_REQ) {\n\t\t\t\t\t// Namenode wants to send a block to datanode.\n\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_SPREAD_REQ_ACK);\n\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\t\n\t\t\t\t\t// Open a new thread to receive the block.\n\t\t\t\t\tnew Thread(new BlockReceiver(socket.getInputStream(), message.getBlockID(), message.getLength(), message.getOffset())).start();\n\t\t\t\t} else if (message.getType() == FSMessage.MESSAGE_GETBLOCK_REQ) {\n\t\t\t\t\t// Clients wants to get a block with certain block ID.\n\t\t\t\t\tif (!blockMap.containsKey(message.getBlockID())) {\n\t\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_GETBLOCK_FAIL);\n\t\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t// Open a new thread to send the block.\n\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_GETBLOCK_REQ_ACK);\n\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\tnew Thread(new BlockSender(socket.getOutputStream(), message.getBlockID())).start();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private void run() throws InterruptedException, IOException {\n endpoint.getWcEvents().take();\n\n //process received data\n processRecv();\n\n for (int i=0; i < 1000000; i++) {\n //change data in remote memory\n writeData(i);\n\n //wait for writing remote memory to complete\n endpoint.getWcEvents().take();\n }\n System.out.println(\"ClientWrite::finished!\");\n }", "public void sendRequest(byte[] request) {\n // send request\n try {\n //get file id and chunk number\n String[] req = new String(request).split(\" \",5);\n String fileID = req[3] , chunkNo = req[4];\n\n //create socket\n MulticastSocket socket = new MulticastSocket(this.mcastPort);\n\n socket.setTimeToLive(1);\n socket.joinGroup(InetAddress.getByName(mscastAdress));\n\n int time = new Random().nextInt(400);\n socket.setSoTimeout(time); //max time it will listen to\n\n //listen for x time\n long oldTime = System.currentTimeMillis();\n byte[] b = new byte[65000];\n\n DatagramPacket receive = new DatagramPacket(b,b.length);\n while(System.currentTimeMillis()-oldTime < time){\n\n try {\n socket.receive(receive);\n }catch (IOException e)\n {\n System.out.println(\"\\nReached time out - no one has sent PUTCHUNK!\");\n break;\n }\n\n String[] ms = new String(receive.getData()).split(\" \",6);\n\n if(ms[1]==\"PUTCHUNK\" && ms[3]==fileID && ms[4]==chunkNo){\n System.out.println(\"Someone already sent it!\");\n socket.close();\n return;//exit\n }\n }\n\n //sending request\n DatagramPacket replyPacket = new DatagramPacket(request, request.length, InetAddress.getByName(mscastAdress), mcastPort);\n socket.send(replyPacket);\n\n System.out.println(\"In PUTCHUNK - Sent packet, no one has sent it\");\n socket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public int append(String filePath, byte[] bytes) throws IOException {\n\t\tint ret;\n\t\t\n\t\t// check in file cache whether such file exists\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn NOT_FOUND;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// file info is ready now, get the first chunkserver\n\t\tif (file.getChunkServers().length == 0) {\n\t\t\tif (trace)\n\t\t\t\tSystem.out.println(\"There is no chunk servers found.\");\n\t\t\t\n\t\t\treturn NOT_FOUND;\n\t\t}\n\t\t\n\t\tString strs[] = file.getChunkServers()[0].split(\" \");\n\t\t\n\t\tif (strs.length != 2) {\n\t\t\tif (trace)\n\t\t\t\tSystem.out.println(\"Bad chunk server address.\");\n\t\t\t\n\t\t\treturn CLIENT_ERROR;\n\t\t}\n\t\t\n\t\t\n\t\tString ip = strs[0];\n\t\tint port = 0;\n\t\ttry {\n\t\t\tport = Integer.parseInt(strs[1]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tif (trace)\n\t\t\t\tSystem.out.println(\"Bad chunk server address (wrong port).\");\n\t\t\t\n\t\t\treturn CLIENT_ERROR;\n\t\t}\n\t\t\n\t\tret = writeRequest(ip, port, file.getAbsolutePath());\n\t\t\n\t\tif (ret != OK) {\n\t\t\treturn ret;\n\t\t}\n\t\t\n\t\t// at this time, the client knows what is the primary replica it should contact with\n\t\t// then it can start the write process\n\t\t\n\t\t// tell the primary replica to append\n\t\tSocket sock = new Socket(priReplicaIpAddress, priReplicaPort);\n\t\tSocketIO sockIO = new SocketIO(sock);\n\t\t\n\t\tsockIO.write((TFSClient.APPEND + \" \" + filePath + \" \" + bytes.length + \"\\r\\n\").getBytes());\n\t\tsockIO.write(bytes);\n\t\tsockIO.flush();\n\t\t\n\t\tString line = sockIO.readLine();\n\t\t\n\t\tsockIO.close();\n\t\t\n\t\tswitch (line) {\n\t\tcase STR_OK:\n\t\t\tret = OK;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tret = SERVER_ERROR;\n\t\t}\t\t\n\t\t\n\t\treturn ret;\n\t}", "public File[] writeChunks(String save, int chunkSize) throws IOException {\n\t\tCollection<File> rtrn=new TreeSet<File>();\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(this.fastqFile)));\n\t\tString nextLine;\n\t\tFileWriter writer=new FileWriter(save+\".0.fq\");\n \tint i=0;\n while ((nextLine = reader.readLine()) != null && (nextLine.trim().length() > 0)) {\n \tif(nextLine.startsWith(\"@\")){\n \t\tif(i%chunkSize ==0){\n \t\t\twriter.close();\n \t\t\trtrn.add(new File(save+\".\"+(i/chunkSize)+\".fq\")); \n \t\t\twriter=new FileWriter(save+\".\"+(i/chunkSize)+\".fq\"); \n \t\t\tSystem.err.println(i);\n \t\t}\n \t\tString firstLine=nextLine;\n \t\tString secondLine=reader.readLine();\n \t\tString thirdLine=reader.readLine();\n \t\tString fourthLine=reader.readLine();\n \t\t\n \t\tFastqSequence seq=new FastqSequence(firstLine, secondLine, thirdLine, fourthLine);\n \t\t//String sequence=seq.getSequence();\n \t\twriter.write(seq.toFastq()+\"\\n\");\n \t\ti++;\n \t\tif(i % 100000 == 0){System.err.println(\"Iterating.. \"+ i);}\n \t}\n \t\n \t\n }\n this.numberOfSeq=i;\n File[] files=new File[rtrn.size()];\n int counter=0;\n for(File file: rtrn){files[counter++]=file;}\n\t\treturn files;\n\t}", "private synchronized void handleActionStartAllUpload() {\n Log.d(TAG, \"handle action start all action\");\n // For sync, we stop upload thread first\n // 1. Pause mTask\n pauseUploadThread();\n // 2. Refresh mWaitDataList from local table upload_table\n refreshWaitData();\n // 3. Start mTask again\n startUploadThread();\n }", "private void readHttpDataChunkByChunk(HttpPostRequestDecoder decoder) {\n try {\n while (decoder.hasNext()) {\n InterfaceHttpData data = decoder.next();\n if (data != null) {\n // check if current HttpData is a FileUpload and previously set as partial\n if (partialContent == data) {\n partialContent = null;\n }\n try {\n // new value\n writeHttpData(data);\n } finally {\n data.release();\n }\n }\n }\n // Check partial decoding for a FileUpload\n InterfaceHttpData data = decoder.currentPartialHttpData();\n if (data != null) {\n if (partialContent == null) {\n partialContent = (HttpData) data;\n }\n }\n } catch (HttpPostRequestDecoder.EndOfDataDecoderException e1) {\n // end\n }\n }", "private void sendToAll(final byte[] data) {\n for (ServerClient client : clients) {\n send(data, client.getAddress(), client.getPort());\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString utf8Path = StringUtil.pathEncodeURL(path);\n\n\t\t\t\tMultiStatusResponse[] multiStatusResponses = webDavManager\n\t\t\t\t\t\t.getFileList(utf8Path);\n\t\t\t\twebDavItemEntities.clear();\n\n\t\t\t\tif (multiStatusResponses == null\n\t\t\t\t\t\t|| (StringUtil.isEmpty(currentPath) && multiStatusResponses.length <= 1)) {\n\t\t\t\t\t\n\t\t\t\t\tgetActivity().runOnUiThread(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\tprogressBar.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\tfileListView.setVisibility(View.GONE);\n\t\t\t\t\t\t\tshowErrorAlertDialog(\"Please Check your storages.\");\n\t\t\t\t\t\t\tshowMenu(false);\n\t\t\t\t\t\t\tcurrentPath = \"\";\n\t\t\t\t\t\t\tbonjourManage.startBonjour();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tdismissErrorAlertDialog();\n\t\t\t\t\n\t\t\t\tArrayList<WebDavItemEntity> folders = new ArrayList<WebDavItemEntity>();\n\t\t\t\tArrayList<WebDavItemEntity> files = new ArrayList<WebDavItemEntity>();\n\n\t\t\t\tfor (int i = 0; i < multiStatusResponses.length; i++) {\n\n\t\t\t\t\tif (i > 0) { // ignore the first item.\n\n\t\t\t\t\t\tWebDavItemEntity webDavItemEntity = ganerateDavItemEntity(multiStatusResponses[i]);\n\n\t\t\t\t\t\tswitch (webDavItemEntity.getItemType()) {\n\t\t\t\t\t\tcase Folder:\n\t\t\t\t\t\t\tfolders.add(webDavItemEntity);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase File:\n\t\t\t\t\t\t\tfiles.add(webDavItemEntity);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tCollections.sort(folders, new SortByName()); // Sort by Folder Name\n\t\t\t\tCollections.sort(files, new SortByName()); // Sort by File Name\n\n\t\t\t\t// Merge the folder list and file list.\n\t\t\t\twebDavItemEntities.addAll(folders);\n\t\t\t\twebDavItemEntities.addAll(files);\n\n\t\t\t\tgetActivity().runOnUiThread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tcloudFileListAdapter.notifyDataSetChanged();\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\tfileListView.setVisibility(View.VISIBLE);\n\n\t\t\t\t\t\tif (StringUtil.isEmpty(currentPath)) {\n\t\t\t\t\t\t\tshowMenu(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshowMenu(true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\tIndexServer is = new IndexServer(3002,\"/src/P2Pfile/Peer2/filefolder\" );\n\t\t\tSystem.out.println(\"Peer2Server Start\");\n\t\t\tis.ConnectionAccept();\n\t\t\t\n\t\t\n\t\t\t\n\t\t}", "public void uploadFilesToUrl(ArrayList<File> listFiles) {\n\t\tPostMethod filePost = new PostMethod(getHostURL());\n\t\t// Disable USE_EXPECT_CONTINUE for problems with servers not HTTP/1.1\n\t\tfilePost.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, false);\n\n\t\ttry {\n\n\t\t\tint totalFiles = listFiles.size();\n\t\t\tif (totalFiles <= 0) {\n\t\t\t\tlogger.warning(\"Warning not upload files to \" + hostURL + \", list files empty.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tPart[] parts = new FilePart[totalFiles];\n\t\t\tfor (int idx = 0; idx < totalFiles; idx++) {\n\t\t\t\tFile tgtFile = listFiles.get(idx);\n\t\t\t\tlogger.log(Level.INFO, \"Add File \" + tgtFile.getName() + \" for upload.\");\n\t\t\t\tparts[idx] = new FilePart(\"uploadFile-\" + idx, tgtFile);\n\t\t\t}\n\n\t\t\t// Set multipart content\n\t\t\tfilePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams()));\n\n\t\t\t// Create Http client\n\t\t\tHttpClient client = new HttpClient();\n\t\t\tclient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);\n\n\t\t\t// Upload files and get result\n\t\t\tint status = client.executeMethod(filePost);\n\t\t\tif (status == HttpStatus.SC_OK) {\n\t\t\t\tlogger.info(\"Upload complete, response=\" + filePost.getResponseBodyAsString());\n\t\t\t} else {\n\t\t\t\tlogger.info(\"Upload failed, response=\" + HttpStatus.getStatusText(status));\n\t\t\t\tresultFromPost = HTTP_REQUESTER_ERROR;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tlogger.log(Level.SEVERE, \"Error uploading files to \" + getHostURL(), ex);\n\t\t\tresultFromPost = HTTP_REQUESTER_ERROR;\n\t\t} finally {\n\t\t\tfilePost.releaseConnection();\n\t\t}\n\t}", "public List<String> getFiles() throws IOException {\n toServer.println(\"getFiles\");\n toServer.flush();\n\n List<String> files = new ArrayList<>();\n\n while (true) {\n String filename = fromServer.readLine();\n if (filename.isEmpty()) { break; }\n\n files.add(filename);\n }\n\n return files;\n }", "public byte[] readall(String filePath) throws IOException {\n\t\tint ret;\n\t\t\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn null;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now the file info is ready\n\t\t// pick-up a chunkserver to read from\n\t\tList<String> servers = new LinkedList<String>();\n\t\tfor (String server : file.getChunkServers())\n\t\t\tservers.add(server);\n\t\t\n\t\tRandom rand = new Random();\n\t\tint index = 0;\n\t\twhile (!servers.isEmpty()) {\n\t\t\tindex = rand.nextInt(servers.size());\n\t\t\t\n\t\t\tString[] strs = servers.get(index).split(\" \");\n\t\t\tservers.remove(index);\n\t\t\t\n\t\t\tSocketIO sockIO = new SocketIO(strs[0], Integer.parseInt(strs[1]));\n\t\t\tsockIO.write((READALL + \" \" + filePath + \"\\r\\n\").getBytes());\n\t\t\tsockIO.flush();\n\t\t\t\n\t\t\tString line = sockIO.readLine();\n\t\t\tif (line.startsWith(STR_OK)) {\n\t\t\t\tstrs = line.split(\" \");\n\t\t\t\tint length = Integer.parseInt(strs[1]);\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[length];\n\t\t\t\tsockIO.read(data);\n\t\t\t\tsockIO.close();\n\t\t\t\treturn data;\n\t\t\t} else {\n\t\t\t\tsockIO.close();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}" ]
[ "0.6898086", "0.6591681", "0.6340665", "0.6225596", "0.6207414", "0.6201325", "0.61206824", "0.5989807", "0.5972283", "0.5919013", "0.59131473", "0.5906974", "0.587747", "0.5811016", "0.57571894", "0.5596435", "0.5565466", "0.55623925", "0.54995054", "0.54880565", "0.5462487", "0.5413211", "0.54040504", "0.5396048", "0.53878665", "0.5368298", "0.5368163", "0.53517663", "0.5351582", "0.53400326", "0.5332999", "0.53305167", "0.53215384", "0.53148067", "0.53110677", "0.53040713", "0.5277267", "0.52738136", "0.52734524", "0.52683735", "0.5236914", "0.5219232", "0.51940966", "0.51939905", "0.519194", "0.5186125", "0.5172895", "0.51642627", "0.51602334", "0.51584893", "0.51548004", "0.51470923", "0.5143863", "0.5143849", "0.51263773", "0.5124561", "0.5103131", "0.5100391", "0.5096398", "0.50941575", "0.5092745", "0.5087296", "0.5081848", "0.5079677", "0.50779945", "0.50597066", "0.50495255", "0.5043852", "0.50388163", "0.50269294", "0.50100094", "0.5004855", "0.5004317", "0.50016314", "0.4998798", "0.49917823", "0.49910092", "0.4990801", "0.49854636", "0.49853465", "0.49811035", "0.49810174", "0.49794123", "0.49716455", "0.49679998", "0.49647075", "0.4956532", "0.4952852", "0.49495944", "0.4948573", "0.49345964", "0.49309787", "0.49302366", "0.49216816", "0.4921269", "0.49188736", "0.4918109", "0.491673", "0.4916479", "0.4914714" ]
0.6423516
2
Process an individual file by traversing the chunks of bytes within. This is accomplished via the following steps: read the next chunk of the file send request to controller for details of where to write the chunk. wait for a reply from the controller the client will notify this thread connect to the first item chunk server returned by the controller, and send the data request
private void processIndividualFile(File file, InputStream is, ConnectionUtilities connections) throws IOException, InterruptedException, ClientWriteException, NumberFormatException { SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS" ); LOG.debug( "The file: " + file.getAbsolutePath() + " was last modified at " + sdf.format( file.lastModified() ) ); int filelength = ( int ) file.length(); int numberOfChunks = ( int ) Math.ceil( ( double ) filelength / Constants.CHUNK_SIZE ); routes = new String[ numberOfChunks ][]; WriteFileRequest request = new WriteFileRequest( file.getAbsolutePath(), 0, filelength, numberOfChunks ); for ( int sequence = 0; sequence < numberOfChunks; ++sequence ) { request.setSequence( sequence ); this.node.getControllerConnection().getTCPSender() .sendData( request.getBytes() ); } // wait for response from controller containing routing information. synchronized ( lock ) { lock.wait(); } if ( !ableToWrite ) { throw new ClientWriteException( "The controller has not" + " received file chunk locations for the original file yet." ); } sendWriteChunkRequest( file, is, connections, numberOfChunks ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\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\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tprotected void process(List<String> chunks) {\r\n\t\tfor (String data: chunks) {\r\n\t\t\thandleData(data);\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public synchronized void run() {\n try {\n String data = in.readUTF();\n String response = FileRequestService.handleRequest(data, sharedWriteQueueService);\n out.writeUTF(response);\n System.out.println(\"server wrote:\" + response);\n } catch(EOFException e) {\n System.out.println(\"EOF:\" + e.getLocalizedMessage() + \" \" + e);\n } catch(IOException e) {\n System.out.println(\"IO:\" + e.getLocalizedMessage() + \" \" + e);\n } finally { \n try {\n clientSocket.close();\n } catch (IOException e){\n System.out.println(\"close:\" + e.getMessage());\n }\n }\n }", "void sendChunkRequest(int chunkX, int chunkY);", "public void OnFileDataReceived(byte[] data,int read, int length, int downloaded);", "private void sendWriteChunkRequest(File file, InputStream is,\n ConnectionUtilities connections, int numberOfChunks)\n throws NumberFormatException, IOException {\n byte[] message = new byte[ Constants.CHUNK_SIZE ];\n\n ProgressBar progress = new ProgressBar( file.getName() );\n\n WriteChunkRequest request = new WriteChunkRequest( file.getAbsolutePath(),\n 0, null, file.lastModified(), 1, null );\n\n int sequence = 0, length = 0;\n while ( ( length = is.read( message ) ) != -1 )\n {\n // Only send to the first connection, whom will forward the rest\n String[] initialConnection = routes[ sequence ][ 0 ].split( \":\" );\n TCPConnection connection =\n connections.cacheConnection( node, initialConnection, false );\n // Pad elements b[k] through b[b.length-1] with zeros\n Arrays.fill( message, length, Constants.CHUNK_SIZE, ( byte ) 0 );\n byte[][] messageToSend = new byte[][] { message };\n if ( Properties.SYSTEM_DESIGN_SCHEMA\n .equals( Constants.SYSTEM_TYPE_ERASURE ) )\n {\n messageToSend = ReedSolomonUtilities.encode( message );\n }\n request.setMessage( messageToSend );\n request.setRoutes( routes[ sequence ] );\n request.setSequence( sequence );\n connection.getTCPSender().sendData( request.getBytes() );\n\n progress.update( sequence, numberOfChunks );\n ++sequence;\n }\n }", "private boolean sendChunk() throws IOException {\n // allocate Buffer\n final Buffer buffer = mm.allocate(chunkSize);\n // mark it available for disposal after content is written\n buffer.allowBufferDispose(true);\n\n // read file to the Buffer\n final int justReadBytes = (int) Buffers.readFromFileChannel(\n fileChannel, buffer);\n \n if (justReadBytes <= 0) {\n complete();\n return false;\n }\n\n // prepare buffer to be written\n buffer.trim();\n\n // write the Buffer\n outputStream.write(buffer);\n size -= justReadBytes;\n\n // check the remaining size here to avoid extra onWritePossible() invocation\n if (size <= 0) {\n complete();\n return false;\n }\n\n return true;\n }", "public void sendChunk(String fileName,ObjectOutputStream out)\n {\n FileInputStream fInput;\n BufferedInputStream bufInput;\n byte[] byteToSend = new byte[chunkSize];\n try\n {\n fInput = new FileInputStream(fileName);\n bufInput = new BufferedInputStream(fInput);\n int b;\n int i=0;\n b = bufInput.read(byteToSend,0,chunkSize);\n out.write(byteToSend,0,chunkSize);\n out.flush();\n bufInput.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File Chunk Not found Exception: Some chunk missing.\");\n }\n catch(IOException ex)\n {\n System.out.println(\"IOException while reading from the chunk file.\");\n }\n }", "public void run() {\n try {\n //first send the file name to the receiver\n out.flush();\n out.writeUTF(fileName);\n out.flush();\n //sends the destination folder name\n out.writeUTF(destFolder);\n out.flush(); //flushes the buffer\n //array of bytes that holds the file bytes\n byte[] file = readFile(srcFilePath +\"/\"+fileName);\n System.out.println(\"Sending file: \"+fileName+\" to folder: \"+destFolder);\n //sends the file\n out.write(file,0,file.length);\n out.flush();\n if(notifDownloader) {\n NodeInterface nodeStub = (NodeInterface) Naming.lookup(\"/\"+clientSocket.getInetAddress().toString()+\"/Node\");\n nodeStub.fileDownloaded(fileName);\n }\n } catch (IOException e) {\n System.out.println(\"readline: \" + e.getMessage());\n } catch (NotBoundException e) {\n //e.printStackTrace();\n System.err.println(\"There was an error notifying the downloader \"+e.getMessage());\n } finally{\n try{\n //closes the socket\n clientSocket.close();\n }catch(IOException e){\n System.out.println(\"problem closing the socket: \"+e.getMessage());\n }\n }\n }", "@Override\n\tpublic void transferFile() throws Exception {\n\t\tnew Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"开始上传\");\n\t\t\t\t\tsocket=new Socket(ip,port);\n\t\t\t\t\tInputStream in=socket.getInputStream();\n\t\t\t\t\tOutputStream out=socket.getOutputStream();\n\t\t\t\t\tBufferedInputStream input=new BufferedInputStream(in);\n\t\t\t\t\twhile(true)\n\t\t\t\t\t{\n\t\t\t\t\t\tFileInputStream fis=new FileInputStream(file);\n\t\t\t\t\t\tDataInputStream dis=new DataInputStream(new BufferedInputStream(fis));\n\t\t\t\t\t\tbyte[] buf=new byte[8192];\n\t\t\t\t\t\tDataOutputStream ps=new DataOutputStream(out);\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\tint read=0;\n\t\t\t\t\t\t\tif(dis!=null){\n\t\t\t\t\t\t\t\tread=fis.read(buf);\n\t\t\t\t\t\t\t\tdownLoadFileSize+=read;\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(read==-1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttimer.cancel();\n\t\t\t\t\t\t\t\tMessage msg=new Message();\n\t\t\t\t\t\t\t\tBundle bundle=new Bundle();\n\t\t\t\t\t\t\t\tbundle.putInt(\"percent\",100 );\n\t\t\t\t\t\t\t\tmsg.setData(bundle);\n\t\t\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tps.write(buf,0,read);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tps.flush();\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tps.close();\n\t\t\t\t\t\tdis.close();\n\t\t\t\t\t\tsocket.close();\n\t\t\t\t\t\tSystem.out.println(\"上传完成\");\n\t\t\t\t\t\t \n\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} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}).start();\n\t}", "@Override\n\tpublic void run() \n\t{\n\t\ttry\n\t\t{\t\t\t\n\t\t\tint [] blockSizes = {1,1024,65505};\n\t\t\tfor(int blk = 0; blk < blockSizes.length; blk++)\n\t\t\t{\n\t\t\t\tDataInputStream inpStream = new DataInputStream(clientSock.getInputStream());\n\t\t\t\tDataOutputStream opStream = new DataOutputStream(clientSock.getOutputStream());\n\n\t\t\t\tFile file = new File(\"ClientA.txt\");\n\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\n\t\t\t\tbufLen = blockSizes[blk];\n\t\t\t\t\n\t\t\t\tbyte[] buffContent = new byte[bufLen];\n\t\t\t\tint numRead = 0, totalBytes=0;\n\n\t\t\t\twhile ((numRead = inpStream.read(buffContent))!=-1) \n\t\t\t\t{\n\t\t\t\t\tfos.write(buffContent, 0, numRead);\n\t\t\t\t\ttotalBytes+=numRead;\n\t\t\t\t\tif (totalBytes == bufLen)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tnumRead = 0;\n\t\t\t\ttotalBytes = 0;\n\t\t\t\n\t\t\t\twhile((numRead = fis.read(buffContent))!=-1)\n\t\t\t\t{\t\t\n\t\t\t\t\topStream.write(buffContent,0,numRead);\n\t\t\t\t\ttotalBytes+=numRead;\n\t\t\t\t\tif (totalBytes == bufLen)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void customTest() throws IOException, NotBoundException, MessageNotFoundException {\n Client c = new Client();\n String fileName = \"file1\";\n\n char[] ss = \"[INITIAL DATA!]\".toCharArray(); // len = 15\n byte[] data = new byte[ss.length];\n for (int i = 0; i < ss.length; i++) {\n data[i] = (byte) ss[i];\n }\n\n c.write(fileName, data);\n\n c = new Client();\n ss = \"File 1 test test END\".toCharArray(); // len = 20\n data = new byte[ss.length];\n for (int i = 0; i < ss.length; i++) {\n data[i] = (byte) ss[i];\n }\n\n byte[] chunk = new byte[Configurations.CHUNK_SIZE];\n\n int seqN = data.length / Configurations.CHUNK_SIZE;\n int lastChunkLen = Configurations.CHUNK_SIZE;\n\n if (data.length % Configurations.CHUNK_SIZE > 0) {\n lastChunkLen = data.length % Configurations.CHUNK_SIZE;\n seqN++;\n }\n\n WriteAck ackMsg = c.masterStub.write(fileName);\n ReplicaServerClientInterface stub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + ackMsg.getLoc().getId());\n\n FileContent fileContent;\n @SuppressWarnings(\"unused\")\n ChunkAck chunkAck;\n //\t\tfor (int i = 0; i < seqN; i++) {\n System.arraycopy(data, 0 * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), 0, fileContent);\n\n System.arraycopy(data, 1 * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), 1, fileContent);\n\n // read here \n List<ReplicaLoc> locations = c.masterStub.read(fileName);\n System.err.println(\"[@CustomTest] Read1 started \");\n\n // TODO fetch from all and verify \n ReplicaLoc replicaLoc = locations.get(0);\n ReplicaServerClientInterface replicaStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + replicaLoc.getId());\n fileContent = replicaStub.read(fileName);\n System.err.println(\"[@CustomTest] data:\");\n System.err.println(new String(fileContent.getData()));\n\n // continue write \n for (int i = 2; i < seqN - 1; i++) {\n System.arraycopy(data, i * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), i, fileContent);\n }\n // copy the last chuck that might be < CHUNK_SIZE\n System.arraycopy(data, (seqN - 1) * Configurations.CHUNK_SIZE, chunk, 0, lastChunkLen);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), seqN - 1, fileContent);\n\n //commit\n ReplicaLoc primaryLoc = c.masterStub.locatePrimaryReplica(fileName);\n ReplicaServerClientInterface primaryStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + primaryLoc.getId());\n primaryStub.commit(ackMsg.getTransactionId(), seqN);\n\n // read\n locations = c.masterStub.read(fileName);\n System.err.println(\"[@CustomTest] Read3 started \");\n\n replicaLoc = locations.get(0);\n replicaStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + replicaLoc.getId());\n fileContent = replicaStub.read(fileName);\n System.err.println(\"[@CustomTest] data:\");\n System.err.println(new String(fileContent.getData()));\n\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 void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket sock = ss.accept(); // 接受连接请求\n\t\t\t\tDataInputStream din = new DataInputStream(sock.getInputStream());\n\t\t\t\tbyte buffer[] = new byte[1024]; // 缓冲区\n\t\t\t\tint len = din.read(buffer);\n\t\t\t\tString filename = new String(buffer, 0, len); // 提取出想要获取的文件名\n\t\t\t\tSystem.out.println(\"Client01: received a file request from\" + sock.getInetAddress()+\":\"+sock.getPort()+\",filename:\"+ filename);\n\t\t\t\tDataOutputStream dout = new DataOutputStream(sock.getOutputStream());\n\t\t\t\tFileInputStream fis = new FileInputStream(new File(\"D:/networkExperiment/experiment04/host01/\" + filename));\n\t\t\t\tbyte b[] = new byte[1024];\n\t\t\t\tfis.read(b); // 从文件中将数据写入缓冲区\n\t\t\t\tdout.write(b); // 将缓冲区中的数据返回\n\t\t\t\tSystem.out.println(\"Client01: return file successfully!\");\n\t\t\t\tdout.close();\n\t\t\t\tsock.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}", "public void read(InetAddress addr, String filePath, String mode) {\r\n\t\ttry {\r\n\r\n\t\t\t// Form request and send to server\r\n\t\t\tRequest r = new Request(Request.Type.READ,filePath,mode);\r\n\t\t\tif (verbose) System.out.println(\"Sending a READ request to server for file \\\"\" + r.getFileName() + \"\\\".\\n\");\r\n\t\t\tDatagramPacket requestPacket = TFTP.formRQPacket(addr, sendPort, r);\r\n\t\t\tDatagramPacket dataPacket;\r\n\t\t\t// Send the request\r\n\t\t\tsendReceiveSocket.send(requestPacket);\r\n\r\n\t\t\tboolean transferComplete = false;\r\n\r\n\t\t\tboolean firstIteration = true;\r\n\r\n\t\t\tboolean packetInOrder;\r\n\r\n\t\t\t//To hold most recently sent packet for possible re-sending if needed.\r\n\t\t\t//DatagramPacket previousPacket = requestPacket;\r\n\r\n\t\t\tint currentBlockNumber = 1;\r\n\t\t\tbyte[] fileBytes = new byte[0];\r\n\t\t\tdo {\r\n\t\t\t\t// Make packet to receive DATA\r\n\t\t\t\tdataPacket = TFTP.formPacket();\r\n\r\n\t\t\t\t// Wait for DATA from server. If no response within set timeout limit, re-send packet (up to maximum re-send limit)\r\n\t\t\t\tif (verbose) System.out.println(\"Waiting for DATA from server...\");\r\n\r\n\t\t\t\tfor(int i = 0; i<RESEND_LIMIT; i = i+1) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t//System.out.println(\"Waiting... \" + i);\r\n\t\t\t\t\t\tsendReceiveSocket.receive(dataPacket);\r\n\t\t\t\t\t\ti = RESEND_LIMIT+1;\t\t//If packet successfully received, leave loop\r\n\t\t\t\t\t} catch(SocketTimeoutException e) {\r\n\t\t\t\t\t\t//if re-send attempt limit reached, 'give up' and cancel transfer\r\n\t\t\t\t\t\tif(i == RESEND_LIMIT-1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(\"No response from server after \" + RESEND_LIMIT + \" attempts. Try again later.\");\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//don't re-send ACK packets, but do re-send request\r\n\t\t\t\t\t\tif(firstIteration)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(verbose) System.out.println(\"\\nServer timed out. RRQ resent.\\n\");\r\n\t\t\t\t\t\t\tsendReceiveSocket.send(requestPacket);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tTFTP.shrinkData(dataPacket);\r\n\r\n\t\t\t\t// If this is the first DATA packet received, record the address and port\r\n\t\t\t\tif (firstIteration) {\r\n\t\t\t\t\tthis.replyAddr = dataPacket.getAddress();\r\n\t\t\t\t\tthis.TID = dataPacket.getPort();\r\n\t\t\t\t\tfirstIteration = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tInetAddress packetAddress = dataPacket.getAddress();\r\n\t\t\t\t\tint packetPort = dataPacket.getPort();\r\n\t\t\t\t\tif (!(packetAddress.equals(replyAddr) && (packetPort == TID))) {\r\n\t\t\t\t\t\t// Creates an \"unknown TID\" error packet\r\n\t\t\t\t\t\tDatagramPacket errorPacket = TFTP.formERRORPacket(\r\n\t\t\t\t\t\t\t\tpacketAddress,\r\n\t\t\t\t\t\t\t\tpacketPort,\r\n\t\t\t\t\t\t\t\tTFTP.ERROR_CODE_UNKNOWN_TID,\r\n\t\t\t\t\t\t\t\t\"The address and port of the packet does not match the TID of the ongoing transfer.\");\r\n\r\n\t\t\t\t\t\t// Sends error packet\r\n\t\t\t\t\t\tsendReceiveSocket.send(errorPacket);\r\n\r\n\t\t\t\t\t\t// Echo error message\r\n\t\t\t\t\t\tif (verbose) System.out.println(\"Sent ERROR packet with ERROR code \" + TFTP.getErrorCode(errorPacket) + \": Received packet from an unknown host. Discarding packet and continuing transfer...\\n\");\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// This block is entered if the packet received is not a valid DATA packet\r\n\t\t\t\tString[] errorMessage = new String[1];\r\n\t\t\t\tif (!TFTP.verifyDataPacket(dataPacket, currentBlockNumber, errorMessage)) {\r\n\t\t\t\t\tString[] errorMessage2 = new String[1];\r\n\t\t\t\t\t// If an ERROR packet is received instead of the expected DATA packet, delete the file\r\n\t\t\t\t\t// and abort the transfer\r\n\t\t\t\t\tif (TFTP.verifyErrorPacket(dataPacket, errorMessage2)) {\r\n\t\t\t\t\t\tif (verbose) System.out.println(\"Received ERROR packet with ERROR code \" + TFTP.getErrorCode(dataPacket) + \": \" + TFTP.getErrorMessage(dataPacket) + \". Aborting transfer...\\n\");\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If the received packet is not a DATA or an ERROR packet, then send an illegal TFTP\r\n\t\t\t\t\t// operation ERROR packet and abort the transfer\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// Creates an \"illegal TFTP operation\" error packet\r\n\t\t\t\t\t\tDatagramPacket errorPacket = TFTP.formERRORPacket(\r\n\t\t\t\t\t\t\t\treplyAddr,\r\n\t\t\t\t\t\t\t\tTID,\r\n\t\t\t\t\t\t\t\tTFTP.ERROR_CODE_ILLEGAL_TFTP_OPERATION,\r\n\t\t\t\t\t\t\t\tr.getFileName() + \" could not be transferred because of the following error: \" + errorMessage[0] + \" (client expected a DATA packet with block#: \" + currentBlockNumber + \")\");\r\n\r\n\t\t\t\t\t\t// Sends error packet\r\n\t\t\t\t\t\t//TFTP.printPacket(errorPacket);\r\n\t\t\t\t\t\tsendReceiveSocket.send(errorPacket);\r\n\r\n\t\t\t\t\t\t// Echo error message\r\n\t\t\t\t\t\tif (verbose) System.out.println(\"Send ERROR packet with ERROR code \" + TFTP.getErrorCode(errorPacket) + \": Illegal TFTP Operation. Aborting transfer...\\n\");\r\n\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (verbose) System.out.println(\"DATA \" + TFTP.getBlockNumber(dataPacket) + \" received.\");\r\n\t\t\t\t//if (verbose) System.out.println(\"The size of the data was \" + TFTP.getData(dataPacket).length + \".\");\r\n\r\n\t\t\t\t// Transfer is complete if data block is less than MAX_PACKET_SIZE\r\n\t\t\t\tif (dataPacket.getLength() < TFTP.MAX_PACKET_SIZE) {\r\n\t\t\t\t\ttransferComplete = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpacketInOrder = TFTP.checkPacketInOrder(dataPacket, currentBlockNumber);\r\n\r\n\t\t\t\t//If the packet was the expected sequential block number in the transfer (not duplicated or delayed), write the data to the file\r\n\t\t\t\tif(packetInOrder){\r\n\t\t\t\t\t// Write data to file\r\n\t\t\t\t\t//if (verbose) System.out.println(\"Appending current block to filebytes.\");\r\n\t\t\t\t\tfileBytes = TFTP.appendData(dataPacket, fileBytes);\r\n\t\t\t\t\tif ((fileBytes.length*TFTP.MAX_DATA_SIZE) > TFTP.getFreeSpaceOnFileSystem(directory)) {\r\n\t\t\t\t\t\t// Creates a \"disk full\" error packet\r\n\t\t\t\t\t\tDatagramPacket errorPacket = TFTP.formERRORPacket(\r\n\t\t\t\t\t\t\t\treplyAddr,\r\n\t\t\t\t\t\t\t\tTID,\r\n\t\t\t\t\t\t\t\tTFTP.ERROR_CODE_DISK_FULL,\r\n\t\t\t\t\t\t\t\t\"\\\"\" + r.getFileName() + \"\\\" could not be transferred because disk is full.\");\r\n\r\n\t\t\t\t\t\t// Sends error packet\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsendReceiveSocket.send(errorPacket);\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t// Do nothing\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Echo error message\r\n\t\t\t\t\t\tif (verbose) System.out.println(\"Sent ERROR packet with ERROR code \" + TFTP.ERROR_CODE_DISK_FULL + \": Disk full. Aborting transfer...\\n\");\r\n\r\n\t\t\t\t\t\t// Closes socket and aborts thread\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Form an ACK packet to respond with and send\r\n\t\t\t\tDatagramPacket ackPacket = TFTP.formACKPacket(replyAddr, TID, TFTP.getBlockNumber(dataPacket));\r\n\t\t\t\tif (verbose) System.out.println(\"ACK \" + TFTP.getBlockNumber(ackPacket) + \" sent.\");\r\n\t\t\t\tsendReceiveSocket.send(ackPacket);\r\n\r\n\r\n\t\t\t\t//Update the current block number only if the packet was not a duplicate/delayed\r\n\t\t\t\tif(packetInOrder){\r\n\t\t\t\t\tcurrentBlockNumber = (currentBlockNumber + 1) % 65536;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Newline\r\n\t\t\t\tif (verbose) System.out.println();\r\n\t\t\t} while (!transferComplete);\r\n\t\t\t//} while (TFTP.getData(dataPacket).length == TFTP.MAX_DATA_SIZE);\r\n\t\t\tif (verbose) System.out.println(\"Writing bytes to file...\");\r\n\t\t\tTFTP.writeBytesToFile(filePath, fileBytes);\r\n\t\t\tSystem.out.println(\"Read complete.\\n\");\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "@Override\n public void doDataReceived(ResourceDataMessage dataMessage) {\n if(outputStream == null) return;\n if(startTime == 0) startTime = System.nanoTime();\n if (this.getTunnel() == null)\n this.setTunnel(dataMessage.getNetworkMessage().getTunnel());\n\n EventManager.callEvent(new ResourceTransferDataReceivedEvent(this, dataMessage));\n\n try {\n if (dataMessage.getResourceData().length != 0) {\n //Saving received chunks\n byte[] chunk = dataMessage.getResourceData();\n written += chunk.length;\n double speedInMBps = NANOS_PER_SECOND / BYTES_PER_MIB * written / (System.nanoTime() - startTime + 1);\n System.out.println();\n logger.info(\"Receiving file: {} | {}% ({}MB/s)\", this.getResource().attributes.get(1), ((float) written / (float) fileLength) * 100f, speedInMBps);\n\n //add to 4mb buffer\n System.arraycopy(chunk, 0, buffer, saved, chunk.length);\n saved += chunk.length;\n if (buffer.length - saved < BUFFER_SIZE || written >= fileLength) {\n //save and clear buffer\n outputStream.write(buffer, 0, saved);\n saved = 0;\n }\n\n\n if (written >= fileLength) {\n this.close();\n }\n } else {\n //Empty chunk, ending the transfer and closing the file.\n logger.info(\"Empty chunk received for: {}, ending the transfer...\", this.getResource().attributes.get(1));\n\n //File fully received.\n this.close();\n }\n } catch (Exception e) {\n callError(e);\n }\n }", "private void ViewFiles(ByteBuffer packet) throws IOException{\n\t\t// (view files req c->s) [header | page (4)]\n\t\t// (initial response) [header | num files to expect | total num (4)]\n\t\t// (list of available clients s->c) [header | size(8) | num_peers(4) | id(4) | name(?)]xNum files\n\t\tMap<ServerFile, Integer> files = totalFiles();\n\t\t\n\t\t//read payload / construct response\n\t\tif (packet.capacity() < 4)\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"page not correctly specified\");\n\t\t\n\t\tint page = packet.getInt(0);\n\t\t\n\t\tint num_to_send = files.size();\n\t\tif (files.size() > (Constants.PAGE_SIZE * page))\n\t\t\tnum_to_send = Constants.PAGE_SIZE;\n\t\telse if (files.size() > (Constants.PAGE_SIZE * (page - 1)))\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\telse {\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\t\tpage = (files.size() / Constants.PAGE_SIZE) + 1;\n\t\t}\n\t\t\t\n\t\tbuf = Utility.addHeader(1, 8, client.getId());\n\t\tbuf.putInt(Constants.HEADER_LEN, num_to_send);\n\t\tbuf.putInt(Constants.HEADER_LEN + 4, files.size());\n\t\tbyte[] sendData = buf.array();\n\t\t\n\t\t// send response\n\t\tout.write(sendData);\n\t\tout.flush();\n\t\t\n\t\t//construct/send file infos\n\t\tIterator<ServerFile> it = files.keySet().iterator();\n\t\tfor (int count = 0; count < ((page - 1) * Constants.PAGE_SIZE); count++)\n\t\t\tit.next();\n\t\tfor (int count = 0; count < num_to_send; count++) {\n\t\t\tServerFile f = it.next();\n\t\t\tString sent_name = f.name() + '\\0';\n\t\t\tbuf = Utility.addHeader(1, sent_name.length() + 16, client.getId());\n\t\t\tbuf.putLong(Constants.HEADER_LEN, f.size());\n\t\t\tbuf.putInt(Constants.HEADER_LEN + 8, files.get(f)); \n\t\t\tbuf.putInt(Constants.HEADER_LEN + 12, f.id());\n\t\t\tbyte[] sent_name_bytes = sent_name.getBytes();\n\t\t\tfor (int i = 0; i < sent_name.length(); i++)\n\t\t\t\tbuf.put(Constants.HEADER_LEN + 16 + i, sent_name_bytes[i]);\n\t\t\tsendData = buf.array();\n\t\t\tout.write(sendData);\n\t\t\tout.flush();\n\t\t}\t\t\n\t\tSystem.out.println(client.getAddress() + \": Correctly processed file req\");\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}", "@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run(){\r\n DataInputStream dis = null;\r\n try{\r\n dis = new DataInputStream(socket.getInputStream());\r\n while(true){\r\n String command = dis.readUTF();\r\n if(command.startsWith(\"/\")){\r\n if(command.length() > 1) listener.receivedCommand(this, command.substring(1));\r\n }\r\n else{\r\n int size = dis.readInt();\r\n if(size > limit){\r\n cleanup(false);\r\n break;\r\n }\r\n byte[] buffer = new byte[size];\r\n dis.readFully(buffer, 0, size);\r\n listener.receivedFile(this, command, buffer);\r\n }\r\n }\r\n }\r\n catch(SocketException e){ e.printStackTrace(); }\r\n catch(EOFException e){ e.printStackTrace(); }\r\n catch(IOException ioe){ ioe.printStackTrace(); }\r\n finally{ cleanup(); }\r\n \r\n if(dis != null){\r\n try{ dis.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dis = null;\r\n }\r\n }", "public void sendFile(ByteString bs, String filename, int numOfChunks, int chunkId) {\n\t\tHeader.Builder hb = Header.newBuilder();\n\t\thb.setNodeId(999);\n\t\thb.setTime(System.currentTimeMillis());\n\t\thb.setDestination(-1);\n\t\t\n\t\tTask.Builder tb = Task.newBuilder();\n\t\ttb.setNoOfChunks(numOfChunks); //Num of chunks\n\t\ttb.setChunkNo(chunkId); //chunk id\n\t\ttb.setTaskType(Task.TaskType.WRITE);\n\t\ttry {\n\t\t\ttb.setSender(InetAddress.getLocalHost().getHostAddress());\n\t\t} catch (UnknownHostException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttb.setFilename(filename);\n\t\ttb.setChunk(bs);\n\t\t\n\t\tCommandMessage.Builder rb = CommandMessage.newBuilder();\n\t\trb.setHeader(hb);\n\t\trb.setTask(tb);\n\t\trb.setMessage(filename);\n\t\t\n\t\ttry {\n\t\t\t// direct no queue\n\t\t\t// CommConnection.getInstance().write(rb.build());\n\n\t\t\t// using queue\n\t\t\tCommConnection.getInstance().enqueue(rb.build());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void OnFileIncoming(int length);", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile(true) {\n\t\t\t\t\tv.read(file);\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"开始上传\");\n\t\t\t\t\tsocket=new Socket(ip,port);\n\t\t\t\t\tInputStream in=socket.getInputStream();\n\t\t\t\t\tOutputStream out=socket.getOutputStream();\n\t\t\t\t\tBufferedInputStream input=new BufferedInputStream(in);\n\t\t\t\t\twhile(true)\n\t\t\t\t\t{\n\t\t\t\t\t\tFileInputStream fis=new FileInputStream(file);\n\t\t\t\t\t\tDataInputStream dis=new DataInputStream(new BufferedInputStream(fis));\n\t\t\t\t\t\tbyte[] buf=new byte[8192];\n\t\t\t\t\t\tDataOutputStream ps=new DataOutputStream(out);\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\tint read=0;\n\t\t\t\t\t\t\tif(dis!=null){\n\t\t\t\t\t\t\t\tread=fis.read(buf);\n\t\t\t\t\t\t\t\tdownLoadFileSize+=read;\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(read==-1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttimer.cancel();\n\t\t\t\t\t\t\t\tMessage msg=new Message();\n\t\t\t\t\t\t\t\tBundle bundle=new Bundle();\n\t\t\t\t\t\t\t\tbundle.putInt(\"percent\",100 );\n\t\t\t\t\t\t\t\tmsg.setData(bundle);\n\t\t\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tps.write(buf,0,read);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tps.flush();\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tps.close();\n\t\t\t\t\t\tdis.close();\n\t\t\t\t\t\tsocket.close();\n\t\t\t\t\t\tSystem.out.println(\"上传完成\");\n\t\t\t\t\t\t \n\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} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "private void handleRetr(String file) {\n File f = new File(currDirectory + fileSeparator + file);\n\n if (!f.exists()) {\n sendMsgToClient(\"550 File does not exist\");\n }\n\n else {\n\n // Binary mode\n if (transferMode == transferType.BINARY) {\n BufferedOutputStream fout = null;\n BufferedInputStream fin = null;\n\n sendMsgToClient(\"150 Opening binary mode data connection for requested file \" + f.getName());\n\n try {\n // create streams\n fout = new BufferedOutputStream(dataConnection.getOutputStream());\n fin = new BufferedInputStream(new FileInputStream(f));\n } catch (Exception e) {\n debugOutput(\"Could not create file streams\");\n }\n\n debugOutput(\"Starting file transmission of \" + f.getName());\n\n // write file with buffer\n byte[] buf = new byte[1024];\n int l = 0;\n try {\n while ((l = fin.read(buf, 0, 1024)) != -1) {\n fout.write(buf, 0, l);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n // close streams\n try {\n fin.close();\n fout.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n\n debugOutput(\"Completed file transmission of \" + f.getName());\n\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n\n }\n\n // ASCII mode\n else {\n sendMsgToClient(\"150 Opening ASCII mode data connection for requested file \" + f.getName());\n\n BufferedReader rin = null;\n PrintWriter rout = null;\n\n try {\n rin = new BufferedReader(new FileReader(f));\n rout = new PrintWriter(dataConnection.getOutputStream(), true);\n\n } catch (IOException e) {\n debugOutput(\"Could not create file streams\");\n }\n\n String s;\n\n try {\n while ((s = rin.readLine()) != null) {\n rout.println(s);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n try {\n rout.close();\n rin.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n }\n\n }\n closeDataConnection();\n\n }", "public void run() {\n xmitsInProgress++;\n try {\n Socket s = new Socket();\n s.connect(curTarget, READ_TIMEOUT);\n s.setSoTimeout(READ_TIMEOUT);\n DataOutputStream out = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));\n try {\n long filelen = data.getLength(b);\n DataInputStream in = new DataInputStream(new BufferedInputStream(data.getBlockData(b)));\n try {\n //\n // Header info\n //\n out.write(OP_WRITE_BLOCK);\n out.writeBoolean(true);\n b.write(out);\n out.writeInt(targets.length);\n for (int i = 0; i < targets.length; i++) {\n targets[i].write(out);\n }\n out.write(RUNLENGTH_ENCODING);\n out.writeLong(filelen);\n\n //\n // Write the data\n //\n while (filelen > 0) {\n int bytesRead = in.read(buf, 0, (int) Math.min(filelen, buf.length));\n out.write(buf, 0, bytesRead);\n filelen -= bytesRead;\n }\n } finally {\n in.close();\n }\n } finally {\n out.close();\n }\n LOG.info(\"Transmitted block \" + b + \" to \" + curTarget);\n } catch (IOException ie) {\n LOG.warn(\"Failed to transfer \"+b+\" to \"+curTarget, ie);\n } finally {\n xmitsInProgress--;\n }\n }", "private void readHttpDataChunkByChunk(HttpPostRequestDecoder decoder) {\n try {\n while (decoder.hasNext()) {\n InterfaceHttpData data = decoder.next();\n if (data != null) {\n // check if current HttpData is a FileUpload and previously set as partial\n if (partialContent == data) {\n partialContent = null;\n }\n try {\n // new value\n writeHttpData(data);\n } finally {\n data.release();\n }\n }\n }\n // Check partial decoding for a FileUpload\n InterfaceHttpData data = decoder.currentPartialHttpData();\n if (data != null) {\n if (partialContent == null) {\n partialContent = (HttpData) data;\n }\n }\n } catch (HttpPostRequestDecoder.EndOfDataDecoderException e1) {\n // end\n }\n }", "public void sendFile(SocketChannel socketChannel) throws IOException {\n int index = -1;\n RandomAccessFile aFile = null;\n try {\n File file = new File(\"C:\\\\Users\\\\ASUS\\\\Downloads\\\\Music\\\\Marshmello-One-Thing-Right-(Ft-Kane-Brown).mp3\");\n aFile = new RandomAccessFile(file, \"r\");\n FileChannel inChannel = aFile.getChannel();\n ByteBuffer buffer = ByteBuffer.allocate(1024);\n while (inChannel.read(buffer) > 0) {\n buffer.flip();\n socketChannel.write(buffer);\n buffer.clear();\n }\n Thread.sleep(1000);\n System.out.println(\"End of file reached..\");\n socketChannel.close();\n aFile.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n }", "public synchronized void receiveFile(byte[] passedByteArray){\n\n try {\n \n if( passedByteArray.length + fileByteCounter > fileSize ){\n int diff = (int) (fileSize - fileByteCounter);\n passedByteArray = Arrays.copyOf(passedByteArray, diff);\n }\n \n //Copy over the bytes\n aFileStream.write(passedByteArray);\n fileByteCounter += passedByteArray.length;\n// fileDigest.update(passedByteArray);\n// DebugPrinter.printMessage(this, \"Receiving file, bytes: \" + fileByteCounter);\n \n //If the byte count has passed the file size than send a finished message\n //so the socket can be closed\n if( fileSize >= 0 && fileByteCounter >= fileSize )\n finishFileTransfer(); \n\n } catch (IOException ex) {\n\n Log.log(Level.SEVERE, NAME_Class, \"receiveFile()\", ex.getMessage(), ex);\n\n //Clear all the file transfer variables\n cleanupFileTransfer();\n\n }\n\n }", "@RequestMapping(method=RequestMethod.GET, value =\"/file\")\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic BatchStatus processFile() {\n\t\tSystem.out.println(\"Request received to process input transactions file\");\n\t\treturn FileProcessorService.processInputTransactionsFile();\n\t}", "public void run() {\n String fileName;\n DataInputStream in;\n byte[] arr = new byte[5000];\n try {\n //getting the file name from client\n in = new DataInputStream(clientSocket.getInputStream());\n fileName = in.readUTF();\n // calling the function to send the file back to the client\n sendDataToClient(s3, fileName);\n //read file from disk\n FileInputStream fis = new FileInputStream(\"/home/ubuntu/\" + fileName);\n BufferedInputStream bis = new BufferedInputStream(fis);\n //output stream for socket\n BufferedOutputStream out = new BufferedOutputStream(clientSocket.getOutputStream());\n // if the file is for getting RTT\n if ( !fileName.equals(\"RTTFile.txt\") )\n System.out.println(\"\\n Serving file: \" + fileName + \"\\n\");\n // writing to streams\n int count;\n while ((count = bis.read(arr)) > 0) {\n out.write(arr, 0, count);\n }\n // flushing and closing all the open streams\n out.flush();\n out.close();\n fis.close();\n bis.close();\n clientSocket.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void chunkedUploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {\n long size = localFile.length();\n\n // assert our file is at least the chunk upload size. We make this assumption in the code\n // below to simplify the logic.\n if (size < CHUNKED_UPLOAD_CHUNK_SIZE) {\n System.err.println(\"File too small, use upload() instead.\");\n System.exit(1);\n return;\n }\n\n long uploaded = 0L;\n DbxException thrown = null;\n\n ProgressListener progressListener = new ProgressListener() {\n long uploadedBytes = 0;\n @Override\n public void onProgress(long l) {\n printProgress(l + uploadedBytes, size);\n if (l == CHUNKED_UPLOAD_CHUNK_SIZE) uploadedBytes += CHUNKED_UPLOAD_CHUNK_SIZE;\n }\n };\n\n // Chunked uploads have 3 phases, each of which can accept uploaded bytes:\n //\n // (1) Start: initiate the upload and get an upload session ID\n // (2) Append: upload chunks of the file to append to our session\n // (3) Finish: commit the upload and close the session\n //\n // We track how many bytes we uploaded to determine which phase we should be in.\n String sessionId = null;\n for (int i = 0; i < CHUNKED_UPLOAD_MAX_ATTEMPTS; ++i) {\n if (i > 0) {\n System.out.printf(\"Retrying chunked upload (%d / %d attempts)\\n\", i + 1, CHUNKED_UPLOAD_MAX_ATTEMPTS);\n }\n\n try (InputStream in = new FileInputStream(localFile)) {\n // if this is a retry, make sure seek to the correct offset\n in.skip(uploaded);\n\n // (1) Start\n if (sessionId == null) {\n sessionId = dbxClient.files().uploadSessionStart()\n .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE, progressListener)\n .getSessionId();\n uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;\n printProgress(uploaded, size);\n }\n\n UploadSessionCursor cursor = new UploadSessionCursor(sessionId, uploaded);\n\n // (2) Append\n while ((size - uploaded) > CHUNKED_UPLOAD_CHUNK_SIZE) {\n dbxClient.files().uploadSessionAppendV2(cursor)\n .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE, progressListener);\n uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;\n printProgress(uploaded, size);\n cursor = new UploadSessionCursor(sessionId, uploaded);\n }\n\n // (3) Finish\n long remaining = size - uploaded;\n CommitInfo commitInfo = CommitInfo.newBuilder(dropboxPath)\n .withMode(WriteMode.ADD)\n .withClientModified(new Date(localFile.lastModified()))\n .build();\n FileMetadata metadata = dbxClient.files().uploadSessionFinish(cursor, commitInfo)\n .uploadAndFinish(in, remaining, progressListener);\n\n System.out.println(metadata.toStringMultiline());\n return;\n } catch (RetryException ex) {\n thrown = ex;\n // RetryExceptions are never automatically retried by the client for uploads. Must\n // catch this exception even if DbxRequestConfig.getMaxRetries() > 0.\n sleepQuietly(ex.getBackoffMillis());\n continue;\n } catch (NetworkIOException ex) {\n thrown = ex;\n // network issue with Dropbox (maybe a timeout?) try again\n continue;\n } catch (UploadSessionLookupErrorException ex) {\n if (ex.errorValue.isIncorrectOffset()) {\n thrown = ex;\n // server offset into the stream doesn't match our offset (uploaded). Seek to\n // the expected offset according to the server and try again.\n uploaded = ex.errorValue\n .getIncorrectOffsetValue()\n .getCorrectOffset();\n continue;\n } else {\n // Some other error occurred, give up.\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n }\n } catch (UploadSessionFinishErrorException ex) {\n if (ex.errorValue.isLookupFailed() && ex.errorValue.getLookupFailedValue().isIncorrectOffset()) {\n thrown = ex;\n // server offset into the stream doesn't match our offset (uploaded). Seek to\n // the expected offset according to the server and try again.\n uploaded = ex.errorValue\n .getLookupFailedValue()\n .getIncorrectOffsetValue()\n .getCorrectOffset();\n continue;\n } else {\n // some other error occurred, give up.\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n }\n } catch (DbxException ex) {\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n } catch (IOException ex) {\n System.err.println(\"Error reading from file \\\"\" + localFile + \"\\\": \" + ex.getMessage());\n return;\n }\n }\n\n // if we made it here, then we must have run out of attempts\n System.err.println(\"Maxed out upload attempts to Dropbox. Most recent error: \" + thrown.getMessage());\n }", "private synchronized void startProcessing() throws IOException {\n\n if (privateInput == null) {\n privateInput = new PrivateInputStream(this);\n }\n boolean more = true;\n\n if (isGet) {\n if (!isDone) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x03);\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x83, null, replyHeaders, privateInput);\n }\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n }\n } else {\n\n if (!isDone) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x02);\n\n }\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x82, null, replyHeaders, privateInput);\n }\n\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n }\n }", "DataChunk nextChunk() throws RemoteException;", "private void fileHandler(String line) {\n var splited = line.split(\" \");\n if (splited.length < 3) {\n System.err.println(\"usage: /file login filename\");\n return;\n }\n String receiver = splited[1];\n String filename = splited[2];\n Path filePath = Path.of(directoryPath.toAbsolutePath().toString(), filename);\n\n if (!Files.exists(filePath)) {\n System.err.println(splited[2] + \" file does not exist.\");\n return;\n }\n\n readFile(filePath).ifPresent(fileContent ->\n {\n if (fileContent.limit() > Helper.LIMIT_FILE_CONTENT_SIZE) {\n System.err.println(\"file is too big. It must be under \" + Helper.LIMIT_SIZE_MSG);\n return;\n }\n\n var fileMsg = new FileMessage(filename, login, fileContent);\n if (!existPrivateConnection(receiver)) {\n sendPrivateConnectionRequest(receiver);\n privateConnectionMap.get(receiver).pendingDirectMessages.add(fileMsg.toBuffer());\n return;\n }\n handlerPrivateFrameSending(fileMsg, receiver);\n });\n }", "public void replyToClientBody(File file) {\r\n FileInputStream fis = null;\r\n try {\r\n /**\r\n * @see <a href=\"https://stackoverflow.com/questions/14169661/read-c\r\n * omplete-file-without-using-loop-in-java\">https://stackoverflow.co\r\n * m/questions/14169661/read-complete-file-without-using-loop-in-j\r\n * ava</a>\r\n */\r\n fis = new FileInputStream(file);\r\n byte[] data = new byte[(int) file.length()];\r\n fis.read(data);\r\n fis.close();\r\n outputBody.write(data);\r\n outputBody.flush();\r\n } catch (Exception ex) {\r\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n public void run()\n {\n try\n {\n InputStream fis = new FileInputStream(transferFile);\n OutputStream sos = socket.getOutputStream();\n\n logWriter.println(\"Sending the file...\");\n\n byte [] buffer = new byte[1024];\n int readBytes;\n while((readBytes = fis.read(buffer)) > -1) {\n sos.write(buffer, 0, readBytes);\n sos.flush();\n }\n\n fis.close();\n sos.close();\n socket.close();\n\n logWriter.println(\"File: \" + transferFile.getName());\n logWriter.println(transferFile.length() + \" bytes sent.\");\n logWriter.println(\"Data Connection Closed.\");\n\n } catch (IOException e)\n {\n e.printStackTrace(logWriter);\n }\n }", "public void run() {\n\n do {\n\n ByteBuffer byteBuffer = (ByteBuffer) slist[0];\n slist = (Object[]) slist[1];\n if (0 == bufsize) {\n if (null == slist) {\n buffer = byteBuffer;\n break;//optimization\n }\n linkedList = new LinkedList<ByteBuffer>();\n }\n bufsize += byteBuffer.limit();\n linkedList.addFirst(byteBuffer);\n\n } while (null != slist);\n\n if (null == buffer) {\n buffer = ByteBuffer.allocateDirect(bufsize);\n\n for (ByteBuffer netBuffer : linkedList) {\n buffer.put(netBuffer);\n }\n }\n\n buffer.rewind();\n System.err.println(\"MsgSize: \" + buffer.limit());\n int i = ENDL.length - 1;\n byte b1 = ENDL[i];\n do {\n ByteBuffer b = buffer.slice();\n while (b.hasRemaining() && b.get() != b1);\n b.flip();\n Integer integer = Integer.valueOf(UTF8.decode(b).toString().trim(), 0x10);\n System.err.println(\"RecordSize: \" + integer);\n buffer = ((ByteBuffer) buffer.position(b.limit())).slice();\n ByteBuffer handoff = (ByteBuffer) buffer.slice().limit(integer);\n final String trim = UTF8.decode(handoff).toString().trim();\n // System.err.println(\"RecordId: \" + trim);\n final LinkedHashMap couchChange = CouchDriver.GSON.fromJson(trim, LinkedHashMap.class);\n\n EXECUTOR_SERVICE.submit(getDocUpdateHandler(couchChange));\n buffer.position(handoff.limit() + ENDL.length);\n buffer = buffer.slice();\n } while (buffer.hasRemaining());\n }", "private void processSession()\n\t\tthrows ProtocolException, AtmException\n\t{\n\t\tboolean fDone = false;\n\t\ttry\n\t\t{\n\t\t\twhile(!fDone)\n\t\t\t{\n\t\t\t\t// listen for client to send data\n\t\t\t\tString dataIn = m_reader.readLine();\n\t\t\t\ttrace(\"handling client command \" + dataIn);\n\t\t\t\tif(dataIn.trim().equals(START_XFR))\n\t\t\t\t{\n\t\t\t\t\ttrace(\"starting a file transfer request\");\n\t\t\t\t\tsendOK();\n\t\t\t\t\t//m_writer.println(OK); // send the ack\n\t\t\t\t\t\n\t\t\t\t\t// get the file name\n\t\t\t\t\tdataIn = m_reader.readLine();\n\t\t\t\t\t\n\t\t\t\t\t// create the AtmObject\n//\t\t\t\t\tDocument inDom = XmlUtility.xmlDocumentFromXmlString(dataIn.trim());\n//\t\t\t\t\tAtmObject obj = XmlUtility.xmlToObject(inDom);\n//\t\t\t\t\t\n//\t\t\t\t\tAtmObject response = AtmApplication.getInstance().processAtmObject(obj);\n//\t\t\t\t\t\n//\t\t\t\t\tDocument xmlResponse = XmlUtility.objectToXml(response);\n//\t\t\t\t\tString xmlResponseString = XmlUtility.xmlDocumentToString(xmlResponse);\n//\t\t\t\t\tsendData(xmlResponseString);\n\t\t\t\t\t// process the object\n//\t\t\t\t\tif(dataIn.trim().startsWith(FILE_NAME))\n//\t\t\t\t\t{\n//\t\t\t\t\t\t// get the file name\n//\t\t\t\t\t\tString data = dataIn.trim();\n//\t\t\t\t\t\t//String fileName = data.trim();\t\n////\t\t\t\t\t\tString path = m_destDirectory.getAbsolutePath()\n////\t\t\t\t\t\t\t\t+ \"\\\\\" + fileName;\n////\t\t\t\t\t\ttrace(\"Preparing to copy file: \" + fileName + \n////\t\t\t\t\t\t\t\t\" to \" + path);\n//\t\t\t\t\t\t\n////\t\t\t\t\t\tdestFile = new File(path);\n////\t\t\t\t\t\tFileWriter writer = new FileWriter(destFile);\n////\t\t\t\t\t\tdestWriter = new BufferedWriter(writer);\n////\t\t\t\t\t\t\n//\t\t\t\t\t\ttrace(\"created destination file\");\n//\t\t\t\t\t\tm_writer.println(OK); // send the ack\n//\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\telse if(messageIn.trim().startsWith(DATA))\n//\t\t\t\t{\n//\t\t\t\t\ttrace(\"writing data to destination file\");\n//\t\t\t\t\t// don't trim now. We want whitespace if it's there.\n//\t\t\t\t\tString data = messageIn.substring(DATA.length());\n//\t\t\t\t\tdestWriter.write(data);\n//\t\t\t\t\tdestWriter.newLine();\n//\t\t\t\t}\n//\t\t\t\telse if(messageIn.trim().equals(END_FILE))\n//\t\t\t\t{\n//\t\t\t\t\tdestWriter.flush();\n//\t\t\t\t\tdestWriter.close();\n//\t\t\t\t\tm_writer.println(OK); // send the ack\n//\t\t\t\t}\n//\t\t\t\telse if(messageIn.trim().equals(END_SESSION))\n//\t\t\t\t{\n//\t\t\t\t\ttrace(\" - Ending session\");\n//\t\t\t\t\tm_reader.close();\n//\t\t\t\t\tm_writer.println(OK); // send the ack\n//\t\t\t\t\tbreak;\n//\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(IOException ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\ttrace(\"Error copying file\" + ex.getMessage());\n\t\t\tthrow new ProtocolException(\"Error copying file\", ex);\t\t\t\n\t\t}\n\t}", "private void sendFile(String fileName) throws IOException {\n // Read file from disk\n //\n fileReader = new MyFileReader();\n byte[] data = fileReader.readFile(fileName);\n //\n // Send binary data over the TCP/IP socket connection\n //\n for (byte i : data) {\n this.socket.getOutputStream().write(i);\n }\n\n System.out.println(\"\\r\\nSent \" + data.length + \" bytes to server.\");\n }", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "void fileReceived(IMSession session, String requestId, String fileId, String filePath);", "public void run() {\r\n\r\n\r\n\t\tint count = 1;\r\n\t\twhile (!endOfFile) {\r\n\t\t\treceive();\r\n\r\n\t\t\tSystem.out.println(\"-------------------------------------------------\");\r\n\t\t\tif(!corrupt()&&hasSeq(currentState.ordinal())) {\r\n\t\t\t\tSystem.out.println(\">> Pkt.: \" + count);\r\n\t\t\t\tif(currentState == State.WAIT0) processMsg(Msg.RCV_NOTCORRUPT_SEQ0);\r\n\t\t\t\telse processMsg(Msg.RCV_NOTCORRUPT_SEQ1);\r\n\t\t\t\tif(count++ >= numberOfpkts) endOfFile = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(currentState == State.WAIT0) processMsg(Msg.RESEND_ACK1);\r\n\t\t\t\telse processMsg(Msg.RESEND_ACK0);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tlong transTime = System.currentTimeMillis() - StartTime;\r\n\t\tSystem.out.println(\"________________________________________\");\r\n\t\tSystem.out.println(\"Goodput: \" + byteCount/transTime +\" MBit/s\");\r\n\r\n\t}", "@Override\n\t\t\t\tpublic void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,\n\t\t\t\t\t\tLinphoneContent content, byte[] buffer, int size) {\n\t\t\t\t\t\n\t\t\t\t}", "Future<File> processDataFile(File dataFile);", "private void sendFileContents() {\n\t\t// mostramos un log\n\t\tthis.getLogger().debug(\"Sending file (\" + this.getFile().getName() + \": \" + this.getFile().length() + \" bytes)..\");\n\t\t// iniciamos una bandera\n\t\tint bytesRead = 0;\n\t\ttry {\n\t\t\t// abrimos el fichero\n\t\t\tfinal FileInputStream inFile = new FileInputStream(this.getFile());\n\t\t\t// creamos un buffer para el envio\n\t\t\tfinal byte[] buff = new byte[this.getConnection().getSendBufferSize()];\n\t\t\t// leemos el fichero\n\t\t\twhile ((bytesRead = inFile.read(buff)) > 0) {\n\t\t\t\t// enviamos el buffer por el socket\n\t\t\t\tthis.getConnection().getOutputStream().write(buff, 0, bytesRead);\n\t\t\t\t// vaciamos el buffer\n\t\t\t\tthis.getConnection().getOutputStream().flush();\n\t\t\t}\n\t\t\t// cerramos el fichero\n\t\t\tinFile.close();\n\t\t\t// vaciamos el fichero enviado\n\t\t\tthis.file = null;\n\t\t\t// mostramos un log\n\t\t\tthis.getLogger().info(\"File sent\");\n\t\t} catch (final SocketException e) {\n\t\t\t// mostramos el trace de la excepcion\n\t\t\tthis.getLogger().error(e);\n\t\t} catch (final FileNotFoundException e) {\n\t\t\ttry {\n\t\t\t\t// enviamos -1 para finalizar\n\t\t\t\tthis.getConnection().getOutputStream().write(-1);\n\t\t\t} catch (final IOException ignored) {}\n\t\t} catch (final IOException e) {\n\t\t\t// mostramos el trace de la excepcion\n\t\t\tthis.getLogger().error(e);\n\t\t}\n\t}", "private void run() throws InterruptedException, IOException {\n endpoint.getWcEvents().take();\n\n //process received data\n processRecv();\n\n for (int i=0; i < 1000000; i++) {\n //change data in remote memory\n writeData(i);\n\n //wait for writing remote memory to complete\n endpoint.getWcEvents().take();\n }\n System.out.println(\"ClientWrite::finished!\");\n }", "public UploadHandle upload(List<File> files) throws Exception {\n \tMetadata md = new Metadata();\n \tfinal FileCollection fcol = new FileCollection(md);\n \tfor(File f: files) {\n \t\tFileMetaData mf = new FileMetaData(f.getName(), f.getLocalName(), \"\", null);\n \t\tmf.setGroups(f.getGroups());\n \t\tmd.md.file.add(mf);\n \t}\n NullOutputStream ostream = new NullOutputStream();\n fcol.tarit(ostream);\n long length = ostream.getLength();\n\n HttpResponse response = client.get(new URI(config.preallocurl()));\n String prealloc_file = this.read_http_entity(response.getEntity());\n String ingestServer = prealloc_file.split(\"\\n\")[0];\n String location = prealloc_file.split(\"\\n\")[1];\n ingestServer = ingestServer.split(\": \")[1];\n location = location.split(\": \")[1];\n \n PipedInputStream in = new PipedInputStream();\n final PipedOutputStream out = new PipedOutputStream(in);\n new Thread(\n new Runnable(){\n @Override\n public void run(){\n try {\n fcol.tarit(out);\n } catch (Exception ex) {\n Logger.getLogger(Connect.class.getName()).log(Level.SEVERE, null, ex);\n \n }\n }\n }\n ).start();\n \n InputStreamEntity entity = new InputStreamEntity(in, length);\n response = client.put(entity, new URI(\"https://\"+ingestServer+location));\n this.read_http_entity(response.getEntity());\n\n response = client.get(new URI(\"https://\"+ingestServer+config.finishurl()+location));\n String status_url = this.read_http_entity(response.getEntity());\n for(String line:status_url.split(\"\\n\")) {\n System.out.println(line);\n if(line.startsWith(\"Status: \"))\n status_url = line.split(\": \")[1];\n }\n System.out.println(status_url+\"/xml\");\n StatusHandler sturl = new StatusHandler();\n sturl.status_url = status_url+\"/xml\";\n sturl.timeout = 30;\n sturl.step = 5;\n UploadHandle ret = sturl;\n return ret;\n }", "@Override\n\tpublic void process(ChannelHandlerContext ctx, BaseMessage baseMessage) throws IOException {\n\t\tCompleteMsg completeMsg = new CompleteMsg(baseMessage);\n\t\tFtsTask ftsTask = TaskMgr.getTask(completeMsg.getUuid());\n\t\tString filename = ftsTask.getFtsFile().getFileNameto();\n\t\tString filepath = ftsTask.getFtsFile().getFilePathto();\n\t\tString fileorgname = filename + ftsTask.getFtsFile().getFilesuffix();\n\t\tCompleteMsg completeMsg2;\n\t\tif (ftsTask != null) {\n\t\t\tlogger.info(\"File Recv Complete!\");\n\t\t\tif (ftsTask.getFtsFile().isOverWrite() && new File(filepath + \"\\\\\" + filename).exists()) {\n\t\t\t\tnew File(filepath + \"\\\\\" + filename).delete();\n\t\t\t\tlogger.info(\"Same Name File Deleted!\");\n\t\t\t}\n\t\t\tif (new File(filepath + \"\\\\\" + filename).exists()) {\n\t\t\t\tcompleteMsg2 = new CompleteMsg(completeMsg.getUuid(), false, \"file exits\");\n\t\t\t\tlogger.error(\"File Exits not OverWrite!\");\n\t\t\t} else {\n\t\t\t\tFile file = new File(filepath + \"\\\\\" + fileorgname);\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\tif (FileUtils.getFileHash(ftsTask.getHashType(), filepath + \"\\\\\" + fileorgname, 0L).equalsIgnoreCase(ftsTask.getHashCode())) {\n\t\t\t\t\t\tfile.renameTo(new File(filepath + \"\\\\\" + filename));\n\t\t\t\t\t\tlogger.info(\"File CheckSum OK! HashCode->\" + ftsTask.getHashCode());\n\t\t\t\t\t\tcompleteMsg2 = new CompleteMsg(completeMsg.getUuid(), true, \"ok\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcompleteMsg2 = new CompleteMsg(completeMsg.getUuid(), false, \"file check sum error\");\n\t\t\t\t\t\tfile.delete();\n\t\t\t\t\t\tlogger.info(\"Temp File Check Sum Error ,Deleted!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcompleteMsg2 = new CompleteMsg(completeMsg.getUuid(), false, \"file not found!\");\n\t\t\t\t\tlogger.error(\"File Not Found! FileInfo->\" + ftsTask.getFtsFile());\n\t\t\t\t}\n\t\t\t}\n\t\t\tctx.writeAndFlush(completeMsg2);\n\t\t\tTaskMgr.removeTask(ftsTask.getUuid());\n\t\t}\n\n\t}", "@Override\n\t\t\t\tpublic void run() \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"reading..\" +next.getFileName());\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t//ts1.finalWrite(next.getFileName(),(int)file.length());\n\t\t\t\t\t\t\tInputStream in = new FileInputStream(readFile);\n\t\t\t\t\t\t\tint i;\n\t\t\t\t\t\t\tint fileNameLength =readFile.length();\n\t\t\t\t\t\t\tlong fileLength = file.length();\n\t\t\t\t\t\t\tlong total = (2+fileNameLength+fileLength);\n\t\t\t\t\t\t\t//System.out.println(\"toal length\" +total);\n\t\t\t\t\t\t\tqu.put((byte)total);\n\t\t\t\t\t\t\tqu.put((byte)readFile.length()); // file name length\n\t\t\t\t\t\t\tqu.put((byte)file.length()); //file content length\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(int j=0;j<readFile.length();j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tqu.put((byte)readFile.charAt(j)); //writing file Name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile((i=in.read())!=-1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tqu.put((byte)i);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tin.close();\n\t\t\t\t\t} \n\t\t\t\t\tcatch (IOException e) \n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t\t\tcatch (InterruptedException e) \n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "void fileTransferProgress(IMSession session, String requestId, String fileId, long bytesTransferred, long bytesTotal);", "@Override\r\n\tpublic void runSystem() throws IOException {\n\t\tclientWithHalf.setHalfFile(fileHalf);\r\n\t\tserverWithTotal.setTotalFile(fileTotal);\r\n\t\tclientWithHalf.connect(serverWithTotal);\r\n\t\tserverWithTotal.connect(clientWithHalf);\r\n\t\tclientWithHalf.sendCheckSumFile();\r\n\t\tserverWithTotal.receieveCheckSumFile();\r\n\t\tserverWithTotal.startMatch();\r\n\t\tserverWithTotal.sendBackData();\r\n\t\tclientWithHalf.rebuidFile();\r\n\t\tclientWithHalf.checkFileEqual();\r\n\t\tclientWithHalf.clearTempData();\r\n\t\tserverWithTotal.getConfirm();\r\n\t\tserverWithTotal.clearTempData();\r\n\t}", "public void postRequestUploadProgress(Request<?> request, long transferredBytesSize, long totalSize, int currentFileIndex, File currentFile);", "public void downloadFile(FileDetails fileDetails) {\n DataOutputStream fileOut = null;\n try {\n DataOutputStream dataOutputStream =new DataOutputStream(this.clientSocket.getOutputStream());\n// sc = new Socket(hostIp, hostPort);\n System.out.println(\"Successfully connected(client) for file retrieval\");\n\n //Sending message to determining Upload/Download(0/1) request\n dataOutputStream.writeInt(1);\n// dataOutputStream.flush();\n //Sending Index of the file\n dataOutputStream.writeInt(fileDetails.getId());\n// dataOutputStream.flush();\n// this.clientSocket.shutdownOutput();\n\n\n DataInputStream dataInputStream = new DataInputStream(this.clientSocket.getInputStream());\n int hasFile = 1;\n // hasFile = dataInputStream.readInt();\n System.out.println(\"Does have file? : \" + hasFile);\n if (hasFile == 0) {\n System.out.println(\"Couldn't find the file\");\n } else {\n System.out.println(\"File started downloading in client-side...\");\n// int bufferSize = 8192;\n// byte[] buf = new byte[bufferSize];\n long passedlen = 0;\n long len = 0;\n\n\n// len = dataInputStream.readInt();\n len = fileDetails.getFileSize();\n System.out.println(\"The Length : \" + len);\n System.out.println(\"Staring receiving...\");\n\n int lengthInt = (int)len;\n byte[] fileByte = new byte[lengthInt];\n\n\n// ObjectInputStream objectInputStream = new ObjectInputStream(inputStreamObj);\n// String fileName =(String) objectInputStream.readObject();\n String fileName =(String) fileDetails.getFileName();\n\n// String fileName = (String) obj;\n String fileDir = downFileDir + fileName;\n System.out.println(\"Filepath : \" + fileDir);\n System.out.println(\"Filename receiving : \" + fileName);\n\n// File fileToDownload = new File(fileDir);\n// FileOutputStream fileOutputStream = new FileOutputStream(fileToDownload);\n DataOutputStream fileOutNew = new DataOutputStream(new FileOutputStream(fileDir));\n dataInputStream.readFully(fileByte,0,fileByte.length);\n fileOutNew.write(fileByte);\n// fileOutNew.close();\n\n// fileOutputStream.close();\n// fileOut = new DataOutputStream(new FileOutputStream(fileDir));\n// fileOut.write(fileByte);\n// fileOut.flush();\n// fileOut.close();\n// dataInputStream.close();\n// while (true) {\n// int read = 0;\n// if (dataInputStream != null) {\n// read = dataInputStream.read(buf);\n// }\n// passedlen += read;\n// if (read == -1) {\n// break;\n// }\n// fileOut.write(buf, 0, read);\n// }\n System.out.println(\"Receiving completed\");\n fetchFileListFromServer();\n// fileOut.close();\n }\n\n// dataOutputStream.close();\n// dataInputStream.close();\n// clientSocket.close();\n// new Client(\"127.0.0.1\",9908);\n// clientSocket.close();\n } catch (Exception e) {\n System.out.println(\"An Error has occurred in file retrieval(client)!\");\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}", "abstract Function<Multipart.FileInfo, play.libs.streams.Accumulator<ByteString, Http.MultipartFormData.FilePart<A>>> createFilePartHandler();", "@Override\n public void run() {\n try {\n Request command = (Request) cmdInStream.readObject();\n while (!\"EXIT\".equalsIgnoreCase(command.getContent())) {\n log.info(String.format(\"Received command: %s\", command.getContent()));\n\n // Searching for appropriate handler for received request\n RequestHandler request = handlers.get(command.getContent());\n if (request != null) {\n // Processing request and writing response\n Response response = request.handle(command);\n cmdOutStream.writeObject(response);\n }\n else {\n cmdOutStream.writeObject(new Response(\"Incorrect request. Please try again.\"));\n }\n\n // Read next command\n command = (Request) cmdInStream.readObject();\n }\n\n cmdInStream.close();\n cmdOutStream.close();\n\n fileInStream.close();\n fileOutStream.close();\n\n cmdSocket.close();\n fileSocket.close();\n }\n catch (ClassNotFoundException ex) {\n log.error(\"Class can't be found! \" + ex.getMessage());\n }\n catch (IOException ex) {\n log.error(ex.getMessage());\n }\n }", "@Override\r\n public void run()\r\n {\r\n File server_Dir_Files = new File(client_Info.getDir());\r\n File[] server_Files = server_Dir_Files.listFiles();\r\n boolean check;\r\n ArrayList<String> user_Files = new ArrayList<>();\r\n try\r\n {\r\n DataInputStream data_Receive = new DataInputStream(client_Info.getUserSocket().getInputStream());\r\n\r\n int files_Number = data_Receive.readInt();\r\n for(int i = 0; i < files_Number; i++)\r\n {\r\n user_Files.add(data_Receive.readUTF());\r\n }\r\n\r\n for(int i = 0; i<server_Files.length; i++)\r\n {\r\n check = false;\r\n for(int j = 0; j<user_Files.size(); j++)\r\n {\r\n if(server_Files[i].getName().equals(user_Files.get(j)))\r\n {\r\n check = true;\r\n break;\r\n }\r\n }\r\n if(check == false)\r\n {\r\n Thread send_File = new ServerSendFile(client_Info, server_Files[i].getName());\r\n send_File.start();\r\n }\r\n }\r\n Thread.sleep(3000);\r\n }\r\n catch(IOException | InterruptedException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n last_Operation.clear();\r\n File old_Dir = new File(client_Info.getDir());\r\n File[] old_Dir_Files = old_Dir.listFiles();\r\n\r\n while(true)\r\n {\r\n try\r\n {\r\n Thread.sleep(3000);\r\n File new_Dir = new File(client_Info.getDir());\r\n File[] new_Dir_Files = new_Dir.listFiles();\r\n\r\n if(new_Dir_Files.length > old_Dir_Files.length)\r\n {\r\n for(int i = 0; i < new_Dir_Files.length; i++)\r\n {\r\n check = false;\r\n for(int j = 0; j < old_Dir_Files.length; j++)\r\n {\r\n if(new_Dir_Files[i].getName().equals(old_Dir_Files[j].getName()))\r\n {\r\n check = true;\r\n break;\r\n }\r\n }\r\n if(check == false)\r\n {\r\n if(last_Operation.size() > 1)\r\n {\r\n if(last_Operation.get(0).equals(\"send\") && last_Operation.get(1).equals(new_Dir_Files[i].getName()))\r\n {\r\n last_Operation.remove(0);\r\n last_Operation.remove(0);\r\n continue;\r\n }\r\n }\r\n else\r\n {\r\n Thread send_File = new ServerSendFile(client_Info, new_Dir_Files[i].getName());\r\n send_File.start();\r\n }\r\n }\r\n }\r\n }\r\n old_Dir = new_Dir;\r\n old_Dir_Files = old_Dir.listFiles();\r\n }\r\n catch(Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public byte[] read(String filePath, int offset, int dataLength) throws IOException {\n\t\tint ret;\n\t\t\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn null;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now the file info is ready\n\t\t// pick-up a chunkserver to read from\n\t\tList<String> servers = new LinkedList<String>();\n\t\tfor (String server : file.getChunkServers())\n\t\t\tservers.add(server);\n\t\t\n\t\tRandom rand = new Random();\n\t\tint index = 0;\n\t\twhile (!servers.isEmpty()) {\n\t\t\tindex = rand.nextInt(servers.size());\n\t\t\t\n\t\t\tString[] strs = servers.get(index).split(\" \");\n\t\t\tservers.remove(index);\n\t\t\t\n\t\t\tSocketIO sockIO = new SocketIO(strs[0], Integer.parseInt(strs[1]));\n\t\t\t\n\t\t\tif (dataLength > 0)\n\t\t\t\tsockIO.write((READ + \" \" + filePath + \" \" + offset + \" \" + dataLength + \"\\r\\n\").getBytes());\n\t\t\telse\n\t\t\t\tsockIO.write((READ + \" \" + filePath + \" \" + offset + \"\\r\\n\").getBytes());\n\t\t\t\n\t\t\tsockIO.flush();\n\t\t\t\n\t\t\tString line = sockIO.readLine();\n\t\t\tif (line.startsWith(STR_OK)) {\n\t\t\t\tstrs = line.split(\" \");\n\t\t\t\tint length = Integer.parseInt(strs[1]);\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[length];\n\t\t\t\tsockIO.read(data);\n\t\t\t\tsockIO.close();\n\t\t\t\treturn data;\n\t\t\t} else {\n\t\t\t\tsockIO.close();\n\t\t\t\treturn null;\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public void sendRequest(SimpleChannelHandler handler){\n fileServer.sendMessage(this.packet,new FileNode(ip,port),handler);\n }", "@Override\n\tprotected void process(List<Integer> chunks){\n\t\tString[] s= fileName.split(\"/\");\n\t\tthis.statuslbl.setText(\"Creating \"+s[s.length-1]+\", please wait...\");\n\t\tprogressBar.setValue(n);\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n PrintWriter out = null;\n JSONObject outputObject = new JSONObject();\n try {\n \n HashMap<String,String> bigItemIds = new HashMap<>();\n Iterator mIterator = bigItemIds.keySet().iterator();\n out = response.getWriter();\n // Create a factory for disk-based file items\n DiskFileItemFactory factory = new DiskFileItemFactory();\n\n // Configure a repository (to ensure a secure temp location is used)\n ServletContext servletContext = this.getServletConfig().getServletContext();\n File repository = (File) servletContext.getAttribute(\"javax.servlet.context.tempdir\");\n factory.setRepository(repository);\n\n // Create a new file upload handler\n ServletFileUpload upload = new ServletFileUpload(factory);\n // Parse the request\n List<FileItem> items = upload.parseRequest(request);\n \n final String moveId = UUID.randomUUID().toString();\n final MovesDb movesDb = new MovesDb();\n // Process the uploaded items\n Iterator<FileItem> iter = items.iterator();\n while (iter.hasNext()) {\n FileItem item = iter.next();\n\n if (item.isFormField()) {\n \n System.out.println(\"Form field\" +item.getString());\n \n bigItemIds = processFormField(new JSONObject( item.getString()), out,moveId,movesDb);\n mIterator = bigItemIds.keySet().iterator();\n System.out.println(\"ITEM ID SIZE \"+bigItemIds.size());\n \n } else {\n //processUploadedFile(item);\n System.out.print(\"Photo Field\");\n String key = (String) mIterator.next();\n File mFile = new File(bigItemIds.get(key));\n item.write(mFile);\n \n \n \n \n }\n }\n new Thread(){\n \n public void run(){\n pushMovetoMailQueue moveToMailQueue= new pushMovetoMailQueue();\n moveToMailQueue.pushMoveToMailQueue(movesDb);\n }\n }.start();\n outputObject = new JSONObject();\n try {\n outputObject.put(Constants.JSON_STATUS, Constants.JSON_SUCCESS);\n outputObject.put(Constants.JSON_MSG,Constants.JSON_GET_QUOTE);\n } catch (JSONException ex1) {\n Logger.getLogger(doSignUp.class.getName()).log(Level.SEVERE, null, ex1);\n }\n \n out.println(outputObject.toString());\n \n \n \n \n }catch(Exception ex){\n \n outputObject = new JSONObject();\n try {\n outputObject.put(Constants.JSON_STATUS, Constants.JSON_FAILURE);\n outputObject.put(Constants.JSON_MSG,Constants.JSON_EXCEPTION);\n } catch (JSONException ex1) {\n Logger.getLogger(doSignUp.class.getName()).log(Level.SEVERE, null, ex1);\n }\n \n out.println(outputObject.toString());\n Logger.getLogger(doSignUp.class.getName()).log(Level.SEVERE, null, ex);\n }finally{\n out.close();\n }\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\t\n\t\tOpenFileRequest.Builder openFileReqObj = OpenFileRequest.newBuilder();\n\t\topenFileReqObj.setFileName(fileName);\t\t\n\t\topenFileReqObj.setForRead(true);\n\t\t\n\t\t\n\t\tFileWriterClass fileWriteObj = new FileWriterClass(localOutFile);\n\t\tfileWriteObj.createFile();\n\t\t\n\t\tbyte[] responseArray;\n\t\t\n\t\ttry {\n\t\t\tRegistry registry=LocateRegistry.getRegistry(Constants.NAME_NODE_IP,Registry.REGISTRY_PORT);\n\t\t\tINameNode nameStub;\n\t\t\tnameStub=(INameNode) registry.lookup(Constants.NAME_NODE);\n\t\t\tresponseArray = nameStub.openFile(openFileReqObj.build().toByteArray());\n\t\t\t\n\t\t\ttry {\n\t\t\t\tOpenFileResponse responseObj = OpenFileResponse.parseFrom(responseArray);\n\t\t\t\tif(responseObj.getStatus()==Constants.STATUS_NOT_FOUND)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"File not found fatal error\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<Integer> blockNums = responseObj.getBlockNumsList();\n\t\t\t\tBlockLocationRequest.Builder blockLocReqObj = BlockLocationRequest.newBuilder();\n\t\t\t\t\n//\t\t\t\tSystem.out.println(blockNums);\n\t\t\t\t/**Now perform Read Block Request from all the blockNums**/\n\t\t\t\tblockLocReqObj.addAllBlockNums(blockNums);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tresponseArray = nameStub.getBlockLocations(blockLocReqObj.build().toByteArray());\n\t\t\t\t} catch (RemoteException 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\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tBlockLocationResponse blockLocResObj = BlockLocationResponse.parseFrom(responseArray);\n//\t\t\t\tSystem.out.println(blockLocResObj.toString());\n\t\t\t\t\n\t\t\t\tif(blockLocResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Fatal error!\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<BlockLocations> blockLocations = blockLocResObj.getBlockLocationsList();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<blockLocations.size();i++)\n\t\t\t\t{\n\t\t\t\t\tBlockLocations thisBlock = blockLocations.get(i);\n\t\t\t\t\t\n\t\t\t\t\tint blockNumber = thisBlock.getBlockNumber();\t\t\t\t\t\n\t\t\t\t\tList<DataNodeLocation> dataNodes = thisBlock.getLocationsList();\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodes==null || dataNodes.size()==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint dataNodeCounter=0;\n\t\t\t\t\t\n\t\t\t\t\tDataNodeLocation thisDataNode = null;//dataNodes.get(dataNodeCounter);\t\t\t\t\t\n\t\t\t\t\tString ip;// = thisDataNode.getIp();\n\t\t\t\t\tint port ; //= thisDataNode.getPort();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tIDataNode dataStub=null;\n\t\t\t\t\t\n\t\t\t\t\tboolean gotDataNodeFlag=false;\n\t\t\t\t\t\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthisDataNode = dataNodes.get(dataNodeCounter);\n\t\t\t\t\t\t\tip = thisDataNode.getIp();\n\t\t\t\t\t\t\tport = thisDataNode.getPort();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRegistry registry2=LocateRegistry.getRegistry(ip,port);\t\t\t\t\t\n\t\t\t\t\t\t\tdataStub = (IDataNode) registry2.lookup(Constants.DATA_NODE_ID);\n\t\t\t\t\t\t\tgotDataNodeFlag=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (RemoteException e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgotDataNodeFlag=false;\n//\t\t\t\t\t\t\tSystem.out.println(\"Remote Exception\");\n\t\t\t\t\t\t\tdataNodeCounter++;\n\t\t\t\t\t\t} \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\twhile(gotDataNodeFlag==false && dataNodeCounter<dataNodes.size());\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodeCounter == dataNodes.size())\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All data nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\t/**Construct Read block request **/\n\t\t\t\t\tReadBlockRequest.Builder readBlockReqObj = ReadBlockRequest.newBuilder();\n\t\t\t\t\treadBlockReqObj.setBlockNumber(blockNumber);\n\t\t\t\t\t\n\t\t\t\t\t/**Read block request call **/\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = dataStub.readBlock(readBlockReqObj.build().toByteArray());\n\t\t\t\t\t\tReadBlockResponse readBlockResObj = ReadBlockResponse.parseFrom(responseArray);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(readBlockResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"In method openFileGet(), readError\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = readBlockResObj.getData(0).toByteArray();\t\t\t\t\t\t\n\t\t\t\t\t\tString str = new String(responseArray, StandardCharsets.UTF_8);\t\t\t\t\t\t\n\t\t\t\t\t\tfileWriteObj.writeonly(str);\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (NotBoundException e) {\n\t\t\tSystem.out.println(\"Exception caught: NotBoundException \");\t\t\t\n\t\t} catch (RemoteException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\t\tfileWriteObj.closeFile();\n\t\t\n\t\t\n\t}", "@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 void sendFile() throws Exception {\n\t\tthis.logger.info(\"Sender: sending file\");\n\t\tlong senderStartTime = System.nanoTime();\n\t\tboolean done = false;\n\t\tDatagramPacket dp;\n\t\twhile (!done) {\n\t\t\twhile (!this.pw.windowFull() && (dp = this.readyPacket()) != null) {\n\t\t\t\tthis.pw.appendPacket(this.packetNumber, dp); // add the packet to the window\n\t\t\t\tthis.logger.debug(\"Adding packet: \" + this.packetNumber);\n\t\t\t\tthis.packetNumber = (this.packetNumber + 1) % 128;\n\t\t\t}\n\t\t\tthis.pw.transmitWindow(this.socket);\n\t\t\tthis.lastSent = System.nanoTime();\n\t\t\tthis.receivePacket();\n\t\t\tdone = this.pw.doneYet(); // all packages have been acknowledged\n\t\t\tthis.logger.debug(\"Done yet: \" + done + \" \" + this.doneReading);\n\t\t\tif (done && !this.doneReading) {\n\t\t\t\tdone = this.doneReading; // still need to read some packets\n\t\t\t}\n\t\t}\n\t\tthis.signalFinished(); // signal done sending file\n\t\tlong senderEndTime = System.nanoTime();\n\t\tdouble seconds = (senderEndTime - senderStartTime) / NS_TO_S;\n\t\tthis.logger.info(\"Sender: file sending complete\");\n\t\tthis.logger.info(String.format(\"Total time to send file: %.3f seconds\", seconds));\n\t\tthis.logger.info(\"Total file size: \"+ this.totalBytesRead +\" bytes\");\n\t}", "public void receiveData(){\n try {\n // setting up input stream and output stream for the data being sent\n fromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n fileCount++;\n outputFile = new FileOutputStream(\"java_20/server/receivedFiles/receivedFile\"+fileCount+\".txt\");\n char[] receivedData = new char[2048];\n String section = null;\n\n //read first chuck of data and start timer\n int dataRead = fromClient.read(receivedData,0,2048);\n startTimer();\n\n //Read the rest of the files worth of data\n while ( dataRead != -1){\n section = new String(receivedData, 0, dataRead);\n outputFile.write(section.getBytes());\n\n dataRead = fromClient.read(receivedData, 0, 2048);\n }\n\n //stop timers\n endTimer();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@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 }", "public static void main(String args[]) throws Exception\n {\n\n ServerSocket server = new ServerSocket(2000,10);\n\n System.out.println(\"Web Server Started. Listening on port number 2000\");\n String filespec;\n int ch;\n \n while (true)\n {\n // get connection from client \n Socket client = server.accept();\n\n BufferedReader br = new BufferedReader( new InputStreamReader(client.getInputStream()));\n\n OutputStream clientout = client.getOutputStream();\n\n // read filespec from client\n while ( (filespec = br.readLine()) == null);\n\n System.out.println(\"Processing request for file : \" + filespec);\n \n // open the file and send content back to client\n\n FileReader fr = new FileReader( filespec);\n\n while ( ( ch = fr.read()) != -1 )\n clientout.write(ch);\n\n clientout.write(-1); // write EOF\n clientout.close();\n \n fr.close();\n\n System.out.println(\"Process Completed Successfully\");\n\n } // end of while\n\n }", "public void transferFile() {\n\t\t// create file event and set client and server path\n\t\tfileEvent = new FileEvent();\n\t\tfileEvent.setClientPath(clientPath);\n\t\tfileEvent.setServerPath(serverPath);\n\t\t\n\t\t// get client name and set filename\n\t\tFile file = new File(clientPath);\n\t\tString name = clientPath.substring(clientPath.lastIndexOf(\"/\") + 1, \n\t\t\t\t\t\tclientPath.length());\n\t\tfileEvent.setFilename(name);\n\t\t\n\t\t// checks if the file exists in the path mentioned or sets valid to No\n\t\tif (file.isFile()) {\n\t\t\t//creates input stream setup the data in byte arrays\n\t\t\tDataInputStream inStream = null;\n\t\t\ttry {\n\t\t\t\tinStream = new DataInputStream(new FileInputStream(file));\n\t\t\t\tlong length = (int) file.length();\n\t\t\t\tbyte[] byteArray = new byte[(int) length];\n\t\t\t\tint start = 0;\n\t\t\t\tint last = 0;\n\t\t\t\tint rest = inStream.read(byteArray, start, \n\t\t\t\t\t\t\t\t\t\t\tbyteArray.length - start);\n\t\t\t\twhile (start < byteArray.length && (last = rest) >= 0) {\n\t\t\t\t\tstart = start + last;\n\t\t\t\t}\n\t\t\t\tfileEvent.setFileSize(length);\n\t\t\t\tfileEvent.setFileData(byteArray);\n\t\t\t\tfileEvent.setValid(\"Yes\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tfileEvent.setValid(\"No\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Path does not exist.\");\n\t\t\tfileEvent.setValid(\"No\");\n\t\t}\n\t\t// Start sending the data byte array\n\t\ttry {\n\t\t\toutStream.writeObject(fileEvent);\n\t\t\tSystem.out.println(\"Done...\");\n\t\t\tThread.sleep(5000);\n\t\t\tSystem.exit(0);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public interface FilePartAction {\n DownloadInfo[] partTask(DownloadFile dFile, int length);\n}", "@Override\n protected void process(List<String> chunks) {\n\n logger.debug(LOG_TAG + \".process()\");\n\n logger.info(chunks.get(chunks.size() - 1));\n\n if (newConnection) {\n // save email address for distributing communication message\n emailAddress = chunks.get(chunks.size() - 1);\n // send email address and remote address to server\n server.newConnection(chunks.get(chunks.size() - 1),\n socket.getRemoteSocketAddress().toString());\n\n // send 'welcome' message to client\n sendMessage(\"@welcome\");\n\n newConnection = false;\n\n return;\n }\n\n if (chunks.get(chunks.size() - 1).equals(\"@disconnect\")) {\n // send message to server\n server.removeConnection(clientId);\n\n // send 'goodbye' message to client\n sendMessage(\"@goodbye\");\n\n newConnection = true;\n\n return;\n }\n\n // communication message from client, distribute message\n // to all clients\n server.distributeMessage(emailAddress + \">\" + chunks.get(chunks.size() - 1));\n\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n\t\t\tInputStream in = mySocket.getInputStream();\n DataInputStream clientData = new DataInputStream(in);\n\n String nameFile = clientData.readUTF();\n long size = clientData.readLong();\n \n OutputStream output = new FileOutputStream(nameFile);\n \n int bytesRead;\n byte[] buffer = new byte[1024];\n while (size > 0 && (bytesRead = clientData.read(buffer, 0, (int) Math.min(buffer.length, size))) != -1) {\n output.write(buffer, 0, bytesRead);\n size -= bytesRead;\n }\t\n\t\t\t}catch(IOException e){\n\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t}", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "public void run() {\n\n ServerSocket ss = null;\n try {\n\n ss = new ServerSocket(port); // accept connection from other peers and send out blocks of images to others\n\n } catch (Exception e) {\n\n // e.printStackTrace();\n\n }\n\n while (true) {\n\n Socket s;\n\n try {\n\n s = ss.accept();\n\n new Thread(new uploader(s)).start(); // create an uploader thread for each incoming client\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }\n\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void run() {\n\n try{\n\n // random block number\n int blockNo = new Random().nextInt(100);\n\n while (true){\n\n Thread.sleep(500);\n writer.reset();\n\n // upload image blocks in a round robin fashion\n if (blockNo < 99)\n blockNo++;\n else\n blockNo = 0;\n\n writer.writeObject(new Message(\"\", \"\", \"SEND_IMG_BLOCK\", blockNo, labels[blockNo].getIcon(), null));\n System.out.println(\"Send to IP: \" + s.getLocalAddress().getHostAddress() + \" Port: \" + s.getPort() + \" Block: \" + (blockNo));\n writer.flush();\n\n }\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }", "private void handleStor(String file) {\n if (file == null) {\n sendMsgToClient(\"501 No filename given\");\n } else {\n File f = new File(currDirectory + fileSeparator + file);\n\n if (f.exists()) {\n sendMsgToClient(\"550 File already exists\");\n }\n\n else {\n\n // Binary mode\n if (transferMode == transferType.BINARY) {\n BufferedOutputStream fout = null;\n BufferedInputStream fin = null;\n\n sendMsgToClient(\"150 Opening binary mode data connection for requested file \" + f.getName());\n\n try {\n // create streams\n fout = new BufferedOutputStream(new FileOutputStream(f));\n fin = new BufferedInputStream(dataConnection.getInputStream());\n } catch (Exception e) {\n debugOutput(\"Could not create file streams\");\n }\n\n debugOutput(\"Start receiving file \" + f.getName());\n\n // write file with buffer\n byte[] buf = new byte[1024];\n int l = 0;\n try {\n while ((l = fin.read(buf, 0, 1024)) != -1) {\n fout.write(buf, 0, l);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n // close streams\n try {\n fin.close();\n fout.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n\n debugOutput(\"Completed receiving file \" + f.getName());\n\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n\n }\n\n // ASCII mode\n else {\n sendMsgToClient(\"150 Opening ASCII mode data connection for requested file \" + f.getName());\n\n BufferedReader rin = null;\n PrintWriter rout = null;\n\n try {\n rin = new BufferedReader(new InputStreamReader(dataConnection.getInputStream()));\n rout = new PrintWriter(new FileOutputStream(f), true);\n\n } catch (IOException e) {\n debugOutput(\"Could not create file streams\");\n }\n\n String s;\n\n try {\n while ((s = rin.readLine()) != null) {\n rout.println(s);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n try {\n rout.close();\n rin.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n }\n\n }\n closeDataConnection();\n }\n\n }", "public static void receiveFile(DataInputStream in) throws NumberFormatException, IOException{\n\t\t// Obtains the file's name and size from the other client\n\t\tString fileName = in.readUTF();\n\t\tSystem.out.print(\"file name: \");\n\t\tSystem.out.println(fileName);\n\t\tlong size = Long.parseLong(in.readUTF());\n\t\tSystem.out.println(size + \" size1\\n\");\n\t\t\n\t\t// Byte array to store file's content as bytes\n\t\tbyte[] bytes = new byte[1024];\n\t\t\n\t\t// File output stream to write the bytes to the specified file\n\t\tFileOutputStream fos = new FileOutputStream(fileName);\n\t\tint n;\n\t\t\n\t\t// While there is still content to write to the file, write data to the file\n\t\twhile (size > 0 && (n = in.read(bytes, 0, (int)Math.min(bytes.length, size))) != -1)\n\t\t{\n\t\t\tfos.write(bytes, 0, n);\n\t\t\tsize -= n;\n\t\t}\n\t\tfos.close();\n\t}", "public void processFile() throws IOException {\n\t\tsetContent(file.getBytes());\n\t\tsetMultipartFileContentType(file.getContentType());\n\t}", "public void readAllChunks(EndPoint endpoint) throws IOException, Pausable {\n IntList chunkRanges = new IntList(); // alternate numbers in this list refer to the start and end offsets of chunks.\n do {\n int n = readLine(endpoint); // read chunk size text into buffer\n int beg = iread;\n int size = parseChunkSize(buffer, iread - n, iread); // Parse size in hex, ignore extension\n if (size == 0)\n break;\n // If the chunk has not already been read in, do so\n fill(endpoint, iread, size+2 /*chunksize + CRLF*/);\n // record chunk start and end\n chunkRanges.add(beg); \n chunkRanges.add(beg + size); // without the CRLF\n iread += size + 2; // for the next round.\n } while (true);\n\n // / consolidate all chunkRanges\n if (chunkRanges.numElements == 0) {\n contentLength = 0;\n return;\n }\n contentOffset = chunkRanges.get(0); // first chunk's beginning\n int endOfLastChunk = chunkRanges.get(1); // first chunk's end\n\n byte[] bufa = buffer.array();\n for (int i = 2; i < chunkRanges.numElements; i += 2) {\n int beg = chunkRanges.get(i);\n int chunkSize = chunkRanges.get(i + 1) - beg;\n System.arraycopy(bufa, beg, bufa, endOfLastChunk, chunkSize);\n endOfLastChunk += chunkSize;\n }\n // TODO move all trailer stuff up\n contentLength = endOfLastChunk - contentOffset;\n \n // At this point, the contentOffset and contentLen give the entire content \n }", "public void run() {\n \t\ttry {\n \t\t\tout.setHeader(init(in.getHeader()));\n \t\t\tsetSampleProcessed(0); // set the number of samples being processed\n \t\t\t\t\t\t\t\t\t// as zero\n \t\t\twhile (true) {\n \t\t\t\tStreamFrame sf = process(in.recvFrame());\n \t\t\t\tif (sf != null)\n \t\t\t\t\tout.sendFrame(sf);\n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "private void processFileRequest(String requestURL, Socket client, List<String> headers) throws IOException {\n\t\tif (requestURL == null) {\n\t\t\treturn;\n\t\t}\n\t\tLog.d(TAG, \"processing file request:\" + requestURL + \"headers:\" + headers);\n\t\tint startRange = -1;\n\t\tint endRange = -1;\n\n\t\tif (headers != null && headers.size() > 1) {\n\t\t\t// String header = headers.get(i);\n\t\t\t// if(header.contains(\"C\"))\n\t\t\tfor (int i = 1; i < headers.size(); i++) {\n\t\t\t\tString[] parts = headers.get(i).split(\":\");\n\t\t\t\tif (parts != null && parts.length == 2) {\n\t\t\t\t\tif (\"Range\".equals(parts[0].trim())) {\n\t\t\t\t\t\t// bytes=0-1024\n\t\t\t\t\t\tint index = parts[1].indexOf('=');\n\t\t\t\t\t\tif (index > 0 && index < parts[1].length() - 1) {\n\t\t\t\t\t\t\tString range = parts[1].substring(index + 1).trim();\n\t\t\t\t\t\t\tparts = range.split(\"-\");\n\t\t\t\t\t\t\tif (parts != null && parts.length >= 1) {\n\t\t\t\t\t\t\t\tif (parts.length == 1) {\n\t\t\t\t\t\t\t\t\tif (range.startsWith(\"-\")) {\n\t\t\t\t\t\t\t\t\t\tendRange = Integer.parseInt(parts[0]);\n\t\t\t\t\t\t\t\t\t\tstartRange = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstartRange = Integer.parseInt(parts[0]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (parts.length == 2) {\n\t\t\t\t\t\t\t\t\tstartRange = Integer.parseInt(parts[0]);\n\n\t\t\t\t\t\t\t\t\tendRange = Integer.parseInt(parts[1]);\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tInputStream data = new SvnFileInputStream(requestURL);\n\t\tint fileLength = SvnFileTool.getFileLength(requestURL);\n\n\t\tint requestLength = fileLength;\n\n\t\tLog.d(TAG, \"reading headers\");\n\t\tStringBuilder httpString = new StringBuilder();\n\n\t\tif (startRange >= 0) {\n\t\t\tif (endRange >= fileLength || endRange < startRange) {\n\t\t\t\tendRange = fileLength - 1;\n\t\t\t}\n\t\t\tdata.skip(startRange);\n\n\t\t\trequestLength = endRange - startRange + 1;\n\t\t\thttpString.append(\"HTTP/1.1 206 Partial Content\\n\");\n\n\t\t\thttpString.append(\"Content-Range\").append(\": bytes \").append(\"\" + startRange).append(\"-\").append(\"\" + endRange)\n\t\t\t\t\t.append(\"/\" + fileLength).append(\"\\n\");\n\t\t} else {\n\t\t\thttpString.append(\"HTTP/1.1 200 OK\\n\");\n\t\t}\n\n\t\t// for (Header h : response.getAllHeaders()) {\n\t\t// if(!\"Transfer-Encoding\".equalsIgnoreCase(h.getName()))\n\t\t// {\n\t\t// httpString.append(h.getName()).append(\": \").append(h.getValue())\n\t\t// .append(\"\\n\");\n\t\t// }\n\t\t//\n\t\t// }\n\n\t\thttpString.append(\"Content-Length\").append(\": \").append(\"\" + requestLength).append(\"\\n\");\n\n\t\thttpString.append(\"\\n\");\n\t\tLog.e(TAG, \"headers done:\" + httpString.length() + \"\\n\" + httpString.toString());\n\t\tint totalReadBytes = 0;\n\t\t\n\t\t\n\t\ttry {\n\t\t\tbyte[] buffer = httpString.toString().getBytes();\n\t\t\tint readBytes;\n\t\t\tLog.d(TAG, \"writing to client\");\n\t\t\tclient.getOutputStream().write(buffer, 0, buffer.length);\n\n\t\t\t// Start streaming content.\n\t\t\tbyte[] buff = new byte[BUFFER_SIZE];\n\n\t\t\twhile (isRunning && totalReadBytes < requestLength) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tint toRead = Math.min(requestLength - totalReadBytes, BUFFER_SIZE);\n\t\t\t\tLog.e(TAG, \"toRead:\" + toRead);\n\t\t\t\t\n\n\t\t\t\treadBytes = data.read(buff, 0, toRead);\n\t\t\t\t\n\t\t\t\tif(readBytes < 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t// System.out.println(\"totalReadBytes:\" + totalReadBytes);\n\t\t\t\tif(readBytes > 0)\n\t\t\t\t{\n\t\t\t\t\ttotalReadBytes += readBytes;\n\t\t\t\t\tclient.getOutputStream().write(buff, 0, readBytes);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tLog.e(\"\", e.getMessage(), e);\n\t\t} finally {\n\n\t\t\tLog.e(TAG, \"totalReadBytes:\" + totalReadBytes);\n\t\t\tif (data != null) {\n\t\t\t\tdata.close();\n\t\t\t}\n\t\t\tclient.close();\n\n\t\t}\n\t}", "private void postImg(File index) {\n FileInputStream imgIn = null;\n byte[] imgData = new byte[(int)index.length()];\n try {\n imgIn = new FileInputStream(index);\n imgIn.read(imgData);\n\n BufferedOutputStream imgOut = new BufferedOutputStream(connectionSocket.getOutputStream());\n\n\n out.println(OK);\n out.println(htmlType);\n out.println(closed);\n out.println(\"Content-Length: \" + index.length());\n out.write(ENDLINE);\n out.flush();\n imgOut.write(imgData, 0, (int)index.length());\n imgOut.flush();\n\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "public void run() {\n\t\tboolean completed = false;\n\t\t\n\t\ttry {\n\t\t\twhile (buffer.hasNext()) {\n\t\t\t\tsink.process(buffer.getNext());\n\t\t\t}\n\t\t\t\n\t\t\tsink.complete();\n\t\t\tcompleted = true;\n\t\t\t\n\t\t} finally {\n\t\t\tif (!completed) {\n\t\t\t\tbuffer.setOutputError();\n\t\t\t}\n\t\t\t\n\t\t\tsink.release();\n\t\t}\n\t}", "private void sendToNodes(Sm.RetrieveChunkResponse chunkResponse, ArrayList<Sm.StorageNode> toSend) {\n\n System.out.println(\"Nodes to send to: \" + toSend);\n\n if (toSend.size() != 0) {\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n PatrolMessagePipeline pipeline = new PatrolMessagePipeline();\n Bootstrap bootstrap = new Bootstrap()\n .group(workerGroup)\n .channel(NioSocketChannel.class)\n .option(ChannelOption.SO_KEEPALIVE, true)\n .handler(pipeline);\n\n// for (Sm.StorageNode node: toSend) {\n\n //create StoreChunkRequest\n Sm.StoreChunk chunk = Sm.StoreChunk.newBuilder()\n .setFileName(chunkResponse.getFilename())\n .setChunkId(chunkResponse.getChunkId())\n .setChunkSize(chunkResponse.getChunkSize())\n .setData(chunkResponse.getData())\n .setChunkName(chunkResponse.getChunkName())\n .build();\n\n Sm.StorageNodes nodes = Sm.StorageNodes.newBuilder()\n .addAllNodeList(toSend)\n .build();\n\n Sm.StorageNode primary = toSend.get(0);\n System.out.println(\"Primary: \" + primary.getIp());\n System.out.println(\"Primary: \" + primary.getPort());\n\n //Connect to the first replica\n ChannelFuture cf = bootstrap.connect(primary.getIp(), primary.getPort());\n cf.syncUninterruptibly();\n\n //Prepare Request & Wrap\n Sm.StoreChunkRequest request = Sm.StoreChunkRequest.newBuilder()\n .setChunk(chunk)\n .setNodes(nodes)\n .build();\n\n Sm.StorageMessageWrapper msgWrapper = Sm.StorageMessageWrapper.newBuilder()\n .setScRequest(request)\n .build();\n\n //Send\n Channel chan = cf.channel();\n PatrolInboundHandler handler = chan.pipeline().get(PatrolInboundHandler.class);\n Sm.StorageMessageWrapper response = handler.request(msgWrapper);\n\n if (response.getScResponse().getSuccess()) {\n System.out.println(\"StoreChunk successful?: \" + response.getScResponse().getSuccess());\n Controller.getInstance().updateReplicasAndChunkNames(toSend, chunk.getChunkName());\n }\n\n workerGroup.shutdownGracefully();\n }\n }", "public int append(String filePath, byte[] bytes) throws IOException {\n\t\tint ret;\n\t\t\n\t\t// check in file cache whether such file exists\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn NOT_FOUND;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// file info is ready now, get the first chunkserver\n\t\tif (file.getChunkServers().length == 0) {\n\t\t\tif (trace)\n\t\t\t\tSystem.out.println(\"There is no chunk servers found.\");\n\t\t\t\n\t\t\treturn NOT_FOUND;\n\t\t}\n\t\t\n\t\tString strs[] = file.getChunkServers()[0].split(\" \");\n\t\t\n\t\tif (strs.length != 2) {\n\t\t\tif (trace)\n\t\t\t\tSystem.out.println(\"Bad chunk server address.\");\n\t\t\t\n\t\t\treturn CLIENT_ERROR;\n\t\t}\n\t\t\n\t\t\n\t\tString ip = strs[0];\n\t\tint port = 0;\n\t\ttry {\n\t\t\tport = Integer.parseInt(strs[1]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tif (trace)\n\t\t\t\tSystem.out.println(\"Bad chunk server address (wrong port).\");\n\t\t\t\n\t\t\treturn CLIENT_ERROR;\n\t\t}\n\t\t\n\t\tret = writeRequest(ip, port, file.getAbsolutePath());\n\t\t\n\t\tif (ret != OK) {\n\t\t\treturn ret;\n\t\t}\n\t\t\n\t\t// at this time, the client knows what is the primary replica it should contact with\n\t\t// then it can start the write process\n\t\t\n\t\t// tell the primary replica to append\n\t\tSocket sock = new Socket(priReplicaIpAddress, priReplicaPort);\n\t\tSocketIO sockIO = new SocketIO(sock);\n\t\t\n\t\tsockIO.write((TFSClient.APPEND + \" \" + filePath + \" \" + bytes.length + \"\\r\\n\").getBytes());\n\t\tsockIO.write(bytes);\n\t\tsockIO.flush();\n\t\t\n\t\tString line = sockIO.readLine();\n\t\t\n\t\tsockIO.close();\n\t\t\n\t\tswitch (line) {\n\t\tcase STR_OK:\n\t\t\tret = OK;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tret = SERVER_ERROR;\n\t\t}\t\t\n\t\t\n\t\treturn ret;\n\t}", "public void send(List<File> files) {\n SimpleDateFormat sdf = new SimpleDateFormat( \"yyyy-MM-dd HH:mm:ss.SSS\" );\n int numberOfFiles = files.size();\n LOG.info( \"Started uploading \" + numberOfFiles + \" file(s) at \"\n + sdf.format( System.currentTimeMillis() ) );\n ConnectionUtilities connections = new ConnectionUtilities();\n\n for ( File file : files )\n {\n ableToWrite = true;\n totalReceived.set( 0 );\n try ( InputStream is = new FileInputStream( file ) )\n {\n processIndividualFile( file, is, connections );\n } catch ( IOException | ClientWriteException | NumberFormatException e )\n {\n LOG.error( \"Unable to process the file \" + file.getName() + \". \"\n + e.getMessage() );\n try\n { // sleep to allow stale messages to be send before reading next file\n TimeUnit.SECONDS.sleep( 1 );\n } catch ( InterruptedException e0 )\n {\n LOG.error( e0.getMessage() );\n }\n --numberOfFiles;\n } catch ( InterruptedException e )\n {\n LOG.error( e.getMessage() );\n Thread.currentThread().interrupt();\n }\n }\n LOG.info( \"Finished uploading \" + numberOfFiles + \" file(s) at \"\n + sdf.format( System.currentTimeMillis() ) + \"\\n\" );\n connections.setAbleToClear( true );\n connections.closeCachedConnections();\n }", "public void run()\n\t{\n\t\tSystem.out.println(\"Looking for spots to fill\");\n\t\tfor(int i = 0; i <= theFileArray.length; i++)\n\t\t{\n\t\t\tif(theFileArray[i] == -1)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Spot found: commence requesting byte at spot: \" + i);\n\t\t\t\t//****get the byte*****\n\t\t\t\tserverOutput.println(i);//ask server to send byte\n\t\t\t\ttheFileArray[i] = Integer.parseInt(serverInput.nextLine()); //receive byte and enter in array\n\t\t\t}\n\t\t}\n\t\t//once we get to the end of the array, write to disk\n\t\tbyte[] array = new byte[theFileArray.length];//convert int[] to byte[] so fos.write works\n\t\tfor(int i = 0; i < theFileArray.length; i++)\n\t\t{\n\t\t\tarray[i] = (byte) theFileArray[i];\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tFileOutputStream fos = new FileOutputStream(\"\\\\bin\\\\myFiles\\\\newFile.png\");\n\t\t\tfos.write(array);\n\t\t\tfos.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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 }", "void onRequest(int index, int begin, int length)\n {\n if (DEBUG) System.out.println(\"[stdpc] onRequest:\" + index + \",\" + begin + \",\" + length);\n\n// sendQueue.forEach(pm -> System.out.println(\"[stdpc] onRequest -b>\" + System.identityHashCode(pm) +\n// \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length) );\n\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n // just ignore such requests\n statistics.blocksRequestedIncorrect++;\n return;\n }\n\n // this could be moved to send(), but doesn't really matter\n statistics.blocksSent++;\n\n // track active requests\n StdPeerMessage pm = pmCache.request(index, begin, length);\n peerBlockRequests.add(pm);\n\n // notify torrent to read and enqueue block\n torrent.onRequest(this, index, begin, length);\n\n// sendQueue.forEach(x -> System.out.println(\"[stdpc] onRequest -a<\" + System.identityHashCode(x) +\n// \" \" +x.type + \" ,\" + x.index +\",\" + x.begin + \",\" + x.length) );\n\n }", "@Override\n\t\tpublic void run() {\n\t\t\tmFiles = DataSourceManager.getSongFileList(currentAlbumPath);\n\t\t\tif (mFiles == null || mFiles.length == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (mPlayPos < 0 || mPlayPos > mFiles.length -1) {\n\t\t\t\tmPlayPos = 0;\n\t\t\t}\n\t\t\t/*Message msg = mMediaplayerHandler.obtainMessage(PREPARE_PLAY);\n\t\t\tif (msg == null) {\n\t\t\t\tmsg = new Message();\n\t\t\t\tmsg.what = PREPARE_PLAY;\n\t\t\t\t\n\t\t\t}\n\t\t\tBundle data = new Bundle();\n\t\t\tdata.putString(MSG_PLAY_PATH, mFiles[mPlayPos]);\n\t\t\tdata.putInt(MSG_PLAY_POSITION, mSeek);\n\t\t\tmsg.setData(data);\n\t\t\tmMediaplayerHandler.sendMessage(msg);*/\n\t\t\t\n\t\t\tsendHandlerInitialized(mFiles[mPlayPos], false);\n\t\t}", "public void run()\n {\n try\n {\n // Load the manifest file\n File manifest = new File(UploaderMain.getManifestName());\n if (!manifest.exists())\n {\n ErrorPrinter.printError(ErrorCode.fileNotFound, \"manifest does not exist\");\n System.exit(0);\n }\n\n // Read names of files from manifest\n Map<String, File> files = new HashMap<String, File>();\n BufferedReader manifestReader = new BufferedReader(new FileReader(manifest));\n String line;\n long totalLength = 0;\n while ((line = manifestReader.readLine()) != null)\n {\n if (line.startsWith(\"//\") || line.trim().isEmpty()) continue; // ignore comments\n StringTokenizer token = new StringTokenizer(line, \"@\");\n String destinationName = token.nextToken();\n String localName = token.nextToken();\n File f = new File(localName);\n if (!f.exists())\n {\n \tErrorPrinter.printError(ErrorCode.fileNotFound, \"file \" + localName + \" not found\");\n \tcontinue;\n }\n totalLength += f.length();\n files.put(destinationName, f);\n }\n manifestReader.close();\n\n dOut.writeInt(files.size());\n dOut.writeLong(totalLength);\n\n for (String s : files.keySet())\n {\n File f = files.get(s);\n \n try\n {\n // Send the name and length of the file\n dOut.writeUTF(s);\n dOut.writeLong(f.length());\n\n // Send the file over the network\n FileInputStream reader = new FileInputStream(f);\n byte[] buffer = new byte[BUFFER_SIZE];\n int numRead;\n long numSent = 0;\n while (numSent < f.length())\n {\n numRead = reader.read(buffer);\n dOut.write(buffer, 0, numRead);\n numSent += numRead;\n }\n\n reader.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Error sending file \" + f.getName());\n }\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public void sendRequest(){\n fileServer.sendMessage(this.packet,new FileNode(ip,port));\n }", "public void fileTransferReq(Packet packet) {\r\n\t\tjava.util.Date date = new java.util.Date();\r\n\t\tSystem.out.println(date + \" \" + packet.packetSenderID + \" is requesting file \" + packet.fileName);\r\n\t\tSystem.out.println(peerNode.fileDir);\r\n\t\tFile reqFile = new File(\"./\"+peerNode.fileDir, packet.fileName);\r\n\t\tbyte[] buf = new byte [(int)reqFile.length()]; \r\n\t\t\r\n\t\ttry {\r\n\t\t\tjava.util.Date fileSendDate = new java.util.Date();\r\n\t\t\tSystem.out.println(fileSendDate + \": Sending the file \" + packet.fileName + \" to Peer Node \" + packet.packetSenderID);\r\n\t\t\tfileInStream = new FileInputStream(reqFile);\r\n\t\t\tbufInStream = new BufferedInputStream(fileInStream);\r\n\t\t\tbufInStream.read(buf, 0, buf.length);\r\n\r\n\t\t\tPacket fileTransPckt = new Packet();\r\n\t\t\tfor(int i = 0; i < buf.length; i++ ) {\r\n\t\t\t\tfileTransPckt.buf[i] = buf[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfileTransPckt.eventCode = 6;\r\n\t\t\tfileTransPckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\tfileTransPckt.packetRecipientID = packet.packetSenderID;\r\n\t\t\tfileTransPckt.totalFileSize = buf.length;\r\n\t\t\tfileTransPckt.fileName = packet.fileName;\r\n\t\t\tpeerNode.peer2Peer = new Socket(packet.peerClientIP, packet.peerClientListenPort);\r\n\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\r\n\t\t\tpeerNode.peer2PeerOutStream.writeObject(fileTransPckt);\r\n\t\t\tpeerNode.peer2PeerOutStream.flush();\r\n\t\t\t\r\n\t\t\t// Close socket/connection\r\n\t\t\tfileInStream.close();\r\n\t\t\tbufInStream.close();\r\n\t\t\tcloseConnection();\r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch blo\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void processIn() throws IOException {\n for (; ; ) {\n var status = fr.process(bbin);\n switch (status) {\n case ERROR:\n silentlyClose();\n return;\n case REFILL:\n return;\n case DONE:\n Frame frame = fr.get();\n fr.reset();\n treatFrame(frame);\n break;\n }\n }\n }", "protected void work() {\n try {\n if(theFile!=null) { \n //construct filePath, fileSize\n int fileSize = theFile.getFileSize();\n if(fileSize==0) fileSize=1;\n String filePath = path+\"/\"+theFile.getFileName();\n if(log.isDebugEnabled()) log.debug(\"Uploading file: \"+filePath+\", filesize: \"+fileSize/1000+\"KB\");\n\t\t\t\n //write out file\n InputStream stream = theFile.getInputStream();\n OutputStream bos = new FileOutputStream(filePath);\n int bytesRead = 0;\n byte[] buffer = new byte[Constants.FILEUPLOAD_BUFFER];\n while(isRunning() && ((bytesRead = stream.read(buffer, 0, Constants.FILEUPLOAD_BUFFER)) != -1)) {\n bos.write(buffer, 0, bytesRead);\n sum+=bytesRead;\n setPercent(sum/fileSize);\n }\n bos.close();\n stream.close();\n }\n } catch(Exception ex) {\n setRunning(false);\n log.error(\"Error while uploading: \"+ex.getMessage());\n ex.printStackTrace();\n }\n }", "public void run(){\n try{\n String line = null;\n String [] line_seg; \n\t\t int num ;\n while((line = br.readLine())!=null) {\n\t\t\t line_seg = line.split(\",\");\n\t\t num = line_seg.length;\n\t\t\tif (num == 4) {\n\t\t\t\tif (line_seg[0].equals(\"FPUT\")) {\n\t\t\t\t\tfile_name = line_seg[1];\n\t\t\t\t\tport_num_ = Integer.parseInt(line_seg[3]);\n\t\t\t\t\tnew Thread(){\n\t\t\t\t\t\tpublic void run(){\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tReceiverThread.fileServer();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}.start();\n\t\t\t\t} else if (line_seg[0].equals(\"FGET\")) {\n\t\t\t\t\t\tSocket sk = null;\n\t\t\t\t\t\ttry { \n\t\t\t\t\t\t\tsk = new Socket(line_seg[2], Integer.parseInt(line_seg[3]));\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tFile output = new File(line_seg[1]);\n\t\t\t\t\t\tFileOutputStream fos = new FileOutputStream(output);\n\t\t\t\t\t\tBufferedInputStream bis =new BufferedInputStream(sk.getInputStream());\n\t\t\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(fos);\n\t\t\t\t\t\tbyte buffer[] = new byte[1024];\n\t\t\t\t\t\tint read;\n\t\t\t\t\t\twhile((read = bis.read(buffer))!=-1) {\n\t\t\t\t\t\t\tbos.write(buffer, 0, read);\n\t\t\t\t\t\t\tbos.flush();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfos.close();\n\t\t\t\t\t\t sk.close();\n\t\t\t\t\t\tSystem.out.println(\"File downloaded\");\n\t\t\t\t }\n\t\t } // end of if (num == 4) \n\t\t else { \n\t\t\t System.out.println(line);\n\t\t }\n } // end of while\t\n } catch(Exception e) {\n \t//e.printStackTrace();\n\t } finally {\n\t\t try{\n\t\t\t if(br!=null) {\n\t\t\t\t br.close();\n\t\t\t }\n\t\t }catch(Exception ex) {}\n\t\t try {\n\t\t\t if(sock!=null){\n\t\t\t\t sock.close();\n\t\t\t }\n\t\t }catch(Exception ex){}\n }\n }", "public byte[] readall(String filePath) throws IOException {\n\t\tint ret;\n\t\t\n\t\tTFSClientFile file = getFileFromCache(filePath);\n\t\tif (file == null) {\t\t// cannot find the file, try to get file info from the master\n\t\t\tret = getFileInfo(filePath);\n\t\t\t\n\t\t\tif (ret != OK)\n\t\t\t\treturn null;\n\t\t\telse {\n\t\t\t\tfile = getFileFromCache(filePath);\t\t\t\t\n\t\t\t\tassert(file != null);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now the file info is ready\n\t\t// pick-up a chunkserver to read from\n\t\tList<String> servers = new LinkedList<String>();\n\t\tfor (String server : file.getChunkServers())\n\t\t\tservers.add(server);\n\t\t\n\t\tRandom rand = new Random();\n\t\tint index = 0;\n\t\twhile (!servers.isEmpty()) {\n\t\t\tindex = rand.nextInt(servers.size());\n\t\t\t\n\t\t\tString[] strs = servers.get(index).split(\" \");\n\t\t\tservers.remove(index);\n\t\t\t\n\t\t\tSocketIO sockIO = new SocketIO(strs[0], Integer.parseInt(strs[1]));\n\t\t\tsockIO.write((READALL + \" \" + filePath + \"\\r\\n\").getBytes());\n\t\t\tsockIO.flush();\n\t\t\t\n\t\t\tString line = sockIO.readLine();\n\t\t\tif (line.startsWith(STR_OK)) {\n\t\t\t\tstrs = line.split(\" \");\n\t\t\t\tint length = Integer.parseInt(strs[1]);\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[length];\n\t\t\t\tsockIO.read(data);\n\t\t\t\tsockIO.close();\n\t\t\t\treturn data;\n\t\t\t} else {\n\t\t\t\tsockIO.close();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "@Override\n\tpublic void run() {\n\t\twhile(run)\n\t\t{\n\t\t\tSystem.out.println(\"status : \" + this.filesize + \" Byte\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\tThread.sleep(this.wait);\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6385211", "0.62118596", "0.6117816", "0.60939723", "0.60930246", "0.5946223", "0.5921548", "0.5887961", "0.58732975", "0.58058554", "0.5756273", "0.57541424", "0.5733393", "0.5731499", "0.5729741", "0.57159555", "0.5701703", "0.5685239", "0.56637895", "0.56365746", "0.5633101", "0.5631831", "0.5627871", "0.5622705", "0.5621433", "0.56124055", "0.5612211", "0.558302", "0.55191195", "0.54979676", "0.5496756", "0.5466527", "0.5466169", "0.5461561", "0.5447984", "0.5433169", "0.5426865", "0.5420463", "0.5418311", "0.5405584", "0.5402126", "0.53496146", "0.5347802", "0.5340907", "0.5336337", "0.5326583", "0.5294814", "0.52860343", "0.5283989", "0.52810115", "0.52777284", "0.5257065", "0.5253382", "0.525131", "0.52508414", "0.52460694", "0.5232962", "0.5232049", "0.5228313", "0.5222702", "0.5222069", "0.5219662", "0.5218542", "0.521482", "0.5214616", "0.5208622", "0.52078366", "0.5204424", "0.5199506", "0.51909095", "0.5186927", "0.5185904", "0.5184307", "0.5178117", "0.51724505", "0.5161728", "0.51579154", "0.51555544", "0.5146283", "0.5146059", "0.5143992", "0.5141596", "0.5136882", "0.51011646", "0.5094916", "0.50893384", "0.5087814", "0.5085288", "0.5077983", "0.5072485", "0.5071565", "0.5054084", "0.5053857", "0.50538427", "0.50527394", "0.5052022", "0.5049185", "0.5047108", "0.50430554", "0.5041164" ]
0.6051661
5
Send the individual chunks to only the initial destination for each chunk / fragment. The metadata is set with temporary version number ( the server will detect the difference and update if necessary )
private void sendWriteChunkRequest(File file, InputStream is, ConnectionUtilities connections, int numberOfChunks) throws NumberFormatException, IOException { byte[] message = new byte[ Constants.CHUNK_SIZE ]; ProgressBar progress = new ProgressBar( file.getName() ); WriteChunkRequest request = new WriteChunkRequest( file.getAbsolutePath(), 0, null, file.lastModified(), 1, null ); int sequence = 0, length = 0; while ( ( length = is.read( message ) ) != -1 ) { // Only send to the first connection, whom will forward the rest String[] initialConnection = routes[ sequence ][ 0 ].split( ":" ); TCPConnection connection = connections.cacheConnection( node, initialConnection, false ); // Pad elements b[k] through b[b.length-1] with zeros Arrays.fill( message, length, Constants.CHUNK_SIZE, ( byte ) 0 ); byte[][] messageToSend = new byte[][] { message }; if ( Properties.SYSTEM_DESIGN_SCHEMA .equals( Constants.SYSTEM_TYPE_ERASURE ) ) { messageToSend = ReedSolomonUtilities.encode( message ); } request.setMessage( messageToSend ); request.setRoutes( routes[ sequence ] ); request.setSequence( sequence ); connection.getTCPSender().sendData( request.getBytes() ); progress.update( sequence, numberOfChunks ); ++sequence; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void sendChunkRequest(int chunkX, int chunkY);", "@Override public void onStreamUpdate(final Set<Long> updatedChunks) {\n }", "@Override\n public void finishMessageSending() {\n for (int i = 0; i < fragNum; ++i) {\n long bytesWriten = cacheOut[i].bytesWriten();\n cacheOut[i].finishSetting();\n cacheOut[i].writeLong(0, bytesWriten - SIZE_OF_LONG);\n\n if (bytesWriten == SIZE_OF_LONG) {\n logger.debug(\n \"[Finish msg] sending skip msg from {} -> {}, since msg size: {}\",\n fragId,\n i,\n bytesWriten);\n continue;\n }\n if (i == fragId) {\n nextIncomingMessageStore.digest(cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] digest msg to self of size: {}\",\n fragId,\n bytesWriten);\n } else {\n grapeMessager.sendToFragment(i, cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] send msg to [{}] of size: {}\",\n fragId,\n i,\n bytesWriten);\n }\n }\n // if (maxSuperStep > 0) {\n // grapeMessager.ForceContinue();\n // maxSuperStep -= 1;\n // }\n\n // logger.debug(\"[Unused res] {}\", unused);\n // logger.debug(\"adaptor hasNext {}, grape hasNext{}\", adaptorHasNext, grapeHasNext);\n // logger.debug(\"adaptor next {}, grape next {}\", adaptorNext, grapeNext);\n // logger.debug(\"adaptor neighbor {}, grape neighbor {}\", adaptorNeighbor,\n // grapeNeighbor);\n }", "protected Version putChunks(long startByte,\n byte chunkPrefix[],\n Version metadataVersion)\n throws IOException {\n\n if (((chunkPrefix == null) != ((startByte % chunkSize) == 0))) {\n throw new IllegalStateException(\"start byte:\" + startByte +\n \" chunk size:\" + chunkSize +\n \" inconsistent with prefix chunk:\" +\n chunkPrefix);\n }\n\n if ((lobSize < 0) || (numChunks < 0)) {\n throw new IllegalStateException(\"lobSize:\" + lobSize +\n \" numChunks:\" + numChunks);\n }\n\n byte chunk[] = new byte[chunkSize];\n boolean initialReplacePut = false;\n\n int currentSize = 0;\n if (chunkPrefix != null) {\n currentSize = chunkPrefix.length;\n lobSize -= currentSize;\n /* Back up over the chunk, so we can overwrite it. */\n numChunks--;\n System.arraycopy(chunkPrefix, 0, chunk, 0, currentSize);\n initialReplacePut = true;\n }\n\n final ChunkKeysIterator chunkKeys =\n getChunkKeysByteRangeIterator(startByte, Long.MAX_VALUE);\n\n readLoop:\n while (true) {\n int readBytes = -1;\n\n /* Fill up a chunk. */\n while (currentSize < chunkSize) {\n readBytes = lobStream.read(chunk, currentSize,\n (chunkSize - currentSize));\n if (readBytes == -1) {\n if (currentSize > 0) {\n break;\n }\n break readLoop;\n }\n currentSize += readBytes;\n }\n\n final Key chunkKey = chunkKeys.next();\n\n /* Write it, vary the durability based upon the chunk. */\n final Durability chunkDurability = (readBytes == -1) ||\n (chunkKeys.getChunkId() == chunksPerPartition) ?\n lobDurability : CHUNK_DURABILITY;\n\n putChunk(chunkKey, chunk, currentSize,\n initialReplacePut, chunkDurability);\n numChunks++;\n if (chunkKeys.getChunkId() == 1) {\n metadataVersion =\n checkpointSuperChunkId(chunkKeys.getSuperChunkId(),\n metadataVersion);\n }\n lobSize += currentSize;\n currentSize = 0;\n initialReplacePut = false;\n }\n\n return metadataVersion;\n }", "public void sendChunk(String fileName,ObjectOutputStream out)\n {\n FileInputStream fInput;\n BufferedInputStream bufInput;\n byte[] byteToSend = new byte[chunkSize];\n try\n {\n fInput = new FileInputStream(fileName);\n bufInput = new BufferedInputStream(fInput);\n int b;\n int i=0;\n b = bufInput.read(byteToSend,0,chunkSize);\n out.write(byteToSend,0,chunkSize);\n out.flush();\n bufInput.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File Chunk Not found Exception: Some chunk missing.\");\n }\n catch(IOException ex)\n {\n System.out.println(\"IOException while reading from the chunk file.\");\n }\n }", "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\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\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void sendToNodes(Sm.RetrieveChunkResponse chunkResponse, ArrayList<Sm.StorageNode> toSend) {\n\n System.out.println(\"Nodes to send to: \" + toSend);\n\n if (toSend.size() != 0) {\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n PatrolMessagePipeline pipeline = new PatrolMessagePipeline();\n Bootstrap bootstrap = new Bootstrap()\n .group(workerGroup)\n .channel(NioSocketChannel.class)\n .option(ChannelOption.SO_KEEPALIVE, true)\n .handler(pipeline);\n\n// for (Sm.StorageNode node: toSend) {\n\n //create StoreChunkRequest\n Sm.StoreChunk chunk = Sm.StoreChunk.newBuilder()\n .setFileName(chunkResponse.getFilename())\n .setChunkId(chunkResponse.getChunkId())\n .setChunkSize(chunkResponse.getChunkSize())\n .setData(chunkResponse.getData())\n .setChunkName(chunkResponse.getChunkName())\n .build();\n\n Sm.StorageNodes nodes = Sm.StorageNodes.newBuilder()\n .addAllNodeList(toSend)\n .build();\n\n Sm.StorageNode primary = toSend.get(0);\n System.out.println(\"Primary: \" + primary.getIp());\n System.out.println(\"Primary: \" + primary.getPort());\n\n //Connect to the first replica\n ChannelFuture cf = bootstrap.connect(primary.getIp(), primary.getPort());\n cf.syncUninterruptibly();\n\n //Prepare Request & Wrap\n Sm.StoreChunkRequest request = Sm.StoreChunkRequest.newBuilder()\n .setChunk(chunk)\n .setNodes(nodes)\n .build();\n\n Sm.StorageMessageWrapper msgWrapper = Sm.StorageMessageWrapper.newBuilder()\n .setScRequest(request)\n .build();\n\n //Send\n Channel chan = cf.channel();\n PatrolInboundHandler handler = chan.pipeline().get(PatrolInboundHandler.class);\n Sm.StorageMessageWrapper response = handler.request(msgWrapper);\n\n if (response.getScResponse().getSuccess()) {\n System.out.println(\"StoreChunk successful?: \" + response.getScResponse().getSuccess());\n Controller.getInstance().updateReplicasAndChunkNames(toSend, chunk.getChunkName());\n }\n\n workerGroup.shutdownGracefully();\n }\n }", "protected abstract void processChunk(List<StructureEntityVersion> versions, CommitInfo lastFix, boolean isFixed);", "private boolean sendChunk() throws IOException {\n // allocate Buffer\n final Buffer buffer = mm.allocate(chunkSize);\n // mark it available for disposal after content is written\n buffer.allowBufferDispose(true);\n\n // read file to the Buffer\n final int justReadBytes = (int) Buffers.readFromFileChannel(\n fileChannel, buffer);\n \n if (justReadBytes <= 0) {\n complete();\n return false;\n }\n\n // prepare buffer to be written\n buffer.trim();\n\n // write the Buffer\n outputStream.write(buffer);\n size -= justReadBytes;\n\n // check the remaining size here to avoid extra onWritePossible() invocation\n if (size <= 0) {\n complete();\n return false;\n }\n\n return true;\n }", "public void setChunked(boolean b) {\n/* 178 */ this.chunked = b;\n/* */ }", "private void distributeFragments() {\r\n\t\tif (!isOptComplete || !isEncryptComplete)\r\n\t\t\treturn;\r\n\r\n\t\t// Scan through all files in the folder and upload them\r\n\t\tFile fileFragDir = AndroidIOUtils.getExternalFile(Constants.DIR_ROOT + \"/\"\r\n\t\t\t\t+ MDFSFileInfo.getDirName(file.getName(), file.lastModified()));\r\n\t\tFile[] files = fileFragDir.listFiles();\r\n\t\tString name;\r\n\r\n\t\t// Distribute the key fragments\r\n\t\t/*\r\n\t\t * keyStorages = new ArrayList<Integer>(); keyStorages.add(2);\r\n\t\t * keyStorages.add(4); keyStorages.add(6); keyStorages.add(7);\r\n\t\t */\r\n\t\tfinal Node node = serviceHelper.getMyNode();\r\n\t\tint destNode;\r\n\t\t\r\n\t\t// Hack: Try to deliver the key multiple times...\r\n\t\tfor(int keyRun=0; keyRun < 1 ; keyRun++) {\r\n\t\tIterator<Integer> nodesIter = keyStorages.iterator();\r\n\t\tfor (KeyShareInfo key : keyShares) {\r\n\t\t\tif (nodesIter != null && nodesIter.hasNext()) {\r\n\t\t\t\tdestNode = nodesIter.next();\r\n\t\t\t\tif (destNode != node.getNodeId()) {\r\n\t\t\t\t\tfinal KeyFragPacket packet = new KeyFragPacket(node.getNodeId(),\r\n\t\t\t\t\t\t\tdestNode, key, file.lastModified());\r\n\t\t\t\t\t// This thread may not be necessary\r\n\t\t\t\t\t/*pool.execute(new Runnable(){\t\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t// Problem: There is no way to confirm that the key fragment is successfully sent ...\r\n\t\t\t\t\t\t\t// node.sendAODVDataContainer(packet);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});*/\r\n\t\t\t\t\tnode.sendAODVDataContainer(packet);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Just store the key fragment locally.\r\n\t\t\t\t\tFile tmp = IOUtilities.createNewFile(fileFragDir,\r\n\t\t\t\t\t\t\tkey.getFileName() + \"__key__\" + key.getIndex());\r\n\t\t\t\t\tif (IOUtilities.writeObjectToFile(key, tmp)) {\r\n\t\t\t\t\t\tMDFSDirectory directory = serviceHelper.getDirectory();\r\n\t\t\t\t\t\tdirectory.addKeyFragment(file.lastModified(),\r\n\t\t\t\t\t\t\t\tkey.getIndex());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Distribute the file fragments\r\n\t\t/*\r\n\t\t * fileStorages = new ArrayList<Integer>(); fileStorages.add(2);\r\n\t\t * fileStorages.add(4); fileStorages.add(6); fileStorages.add(7);\r\n\t\t */\r\n\t\tlogger.distStart = System.currentTimeMillis();\r\n\t\tfragCounter.set(0);\r\n\t\tIterator<Integer> nodesIter = fileStorages.iterator();\r\n\t\tfor (File f : files) {\r\n\t\t\tname = f.getName();\r\n\t\t\tif (name.contains(\"__frag__\")) {\r\n\t\t\t\t// Find the fragment Number\r\n\t\t\t\tif (nodesIter != null && nodesIter.hasNext()) {\r\n\t\t\t\t\tdestNode = nodesIter.next();\r\n\t\t\t\t\tif (destNode == node.getNodeId()){\r\n\t\t\t\t\t\tfragCounter.incrementAndGet();\r\n\t\t\t\t\t\tcontinue; // Don't need to send to myself again\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpool.execute(new FileFragmentUploader(f, file\r\n\t\t\t\t\t\t\t.lastModified(), destNode, !nodesIter.hasNext()));\r\n\t\t\t\t}\r\n\t\t\t} else if (name.contains(\"__key__\")) {\r\n\t\t\t\t/*\r\n\t\t\t\t * This may only happens if the file creator is also chosen as\r\n\t\t\t\t * the key storage node and the key fragment is copied to this\r\n\t\t\t\t * folder faster than the files in the folder is read. Just\r\n\t\t\t\t * ignore it for now\r\n\t\t\t\t */\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tjTimer.start(); //jTimer.start();\r\n\t\tlistener.statusUpdate(\"Distributing file fragments\");\r\n\t}", "public boolean sendChunkChange ( Location loc , int sx , int sy , int sz , byte[] data ) {\n\t\treturn invokeSafe ( \"sendChunkChange\" , loc , sx , sy , sz , data );\n\t}", "entities.Torrent.ChunkInfo getChunks(int index);", "private void generateNextChunk() {\n \n chunkNumber++;\n \n // generate a chunk filled with content\n List<Object> list = chunkFactory.generateChunk(chunkNumber);\n Vector3f newChunkPosition =\n new Vector3f(nextChunkX, 0f, 0f);\n nextChunkX += P.chunkLength;\n\n for (Object object : list) {\n if (object instanceof Spatial) {\n Spatial spatial = (Spatial) object;\n addToLevel(spatial, spatial.getLocalTranslation().add(newChunkPosition));\n } else if (object instanceof SpotLight) {\n SpotLight light = (SpotLight) object;\n addToLevel(light, light.getPosition().add(newChunkPosition));\n } else if (object instanceof PointLight) {\n PointLight light = (PointLight) object;\n addToLevel(light, light.getPosition().add(newChunkPosition)); \n }\n }\n\n }", "public static void customTest() throws IOException, NotBoundException, MessageNotFoundException {\n Client c = new Client();\n String fileName = \"file1\";\n\n char[] ss = \"[INITIAL DATA!]\".toCharArray(); // len = 15\n byte[] data = new byte[ss.length];\n for (int i = 0; i < ss.length; i++) {\n data[i] = (byte) ss[i];\n }\n\n c.write(fileName, data);\n\n c = new Client();\n ss = \"File 1 test test END\".toCharArray(); // len = 20\n data = new byte[ss.length];\n for (int i = 0; i < ss.length; i++) {\n data[i] = (byte) ss[i];\n }\n\n byte[] chunk = new byte[Configurations.CHUNK_SIZE];\n\n int seqN = data.length / Configurations.CHUNK_SIZE;\n int lastChunkLen = Configurations.CHUNK_SIZE;\n\n if (data.length % Configurations.CHUNK_SIZE > 0) {\n lastChunkLen = data.length % Configurations.CHUNK_SIZE;\n seqN++;\n }\n\n WriteAck ackMsg = c.masterStub.write(fileName);\n ReplicaServerClientInterface stub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + ackMsg.getLoc().getId());\n\n FileContent fileContent;\n @SuppressWarnings(\"unused\")\n ChunkAck chunkAck;\n //\t\tfor (int i = 0; i < seqN; i++) {\n System.arraycopy(data, 0 * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), 0, fileContent);\n\n System.arraycopy(data, 1 * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), 1, fileContent);\n\n // read here \n List<ReplicaLoc> locations = c.masterStub.read(fileName);\n System.err.println(\"[@CustomTest] Read1 started \");\n\n // TODO fetch from all and verify \n ReplicaLoc replicaLoc = locations.get(0);\n ReplicaServerClientInterface replicaStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + replicaLoc.getId());\n fileContent = replicaStub.read(fileName);\n System.err.println(\"[@CustomTest] data:\");\n System.err.println(new String(fileContent.getData()));\n\n // continue write \n for (int i = 2; i < seqN - 1; i++) {\n System.arraycopy(data, i * Configurations.CHUNK_SIZE, chunk, 0, Configurations.CHUNK_SIZE);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), i, fileContent);\n }\n // copy the last chuck that might be < CHUNK_SIZE\n System.arraycopy(data, (seqN - 1) * Configurations.CHUNK_SIZE, chunk, 0, lastChunkLen);\n fileContent = new FileContent(fileName, chunk);\n chunkAck = stub.write(ackMsg.getTransactionId(), seqN - 1, fileContent);\n\n //commit\n ReplicaLoc primaryLoc = c.masterStub.locatePrimaryReplica(fileName);\n ReplicaServerClientInterface primaryStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + primaryLoc.getId());\n primaryStub.commit(ackMsg.getTransactionId(), seqN);\n\n // read\n locations = c.masterStub.read(fileName);\n System.err.println(\"[@CustomTest] Read3 started \");\n\n replicaLoc = locations.get(0);\n replicaStub = (ReplicaServerClientInterface) registry.lookup(\"ReplicaClient\" + replicaLoc.getId());\n fileContent = replicaStub.read(fileName);\n System.err.println(\"[@CustomTest] data:\");\n System.err.println(new String(fileContent.getData()));\n\n }", "protected void emitBatch(){\n synchronized(this){\n\n revokeSendBatch();\n\n int viewn = getCurrentViewNumber();\n long seqn = getStateLog().getNextPrePrepareSEQ();\n\n PBFTRequestInfo rinfo = getRequestInfo();\n if(!rinfo.hasSomeWaiting()){\n return;\n }\n /* creates a new pre-prepare message */\n PBFTPrePrepare pp = null;\n\n int size = 0;\n\n /* while has not achieved the batch size and there is digests in queue */\n String digest = null;\n while(size < getBatchSize() && (digest = rinfo.getFirtRequestDigestWaiting())!= null){\n if(pp == null){\n pp = new PBFTPrePrepare(viewn, seqn, getLocalServerID());\n }\n pp.getDigests().add(digest);\n rinfo.assign(digest, RequestState.PREPREPARED);\n size += 1;//rinfo.getRequestSize(digest);\n }\n\n if(pp == null){\n return;\n }\n \n /* emits pre-prepare */\n emitPrePrepare(pp);\n //emit(pp, getLocalGroup().minus(getLocalProcess()));\n\n /* update log current pre-prepare */\n handle(pp);\n\n /* if there is digest then it will schedule a send batch */\n if(rinfo.hasSomeWaiting()){\n batch();\n }//end if digest queue is no empty\n\n }//end synchronized(this)\n }", "entities.Torrent.ChunkInfoOrBuilder getChunksOrBuilder(\n int index);", "long getChunkSize();", "long getChunkSize();", "long getChunkSize();", "long getChunkSize();", "public void readAllChunks(EndPoint endpoint) throws IOException, Pausable {\n IntList chunkRanges = new IntList(); // alternate numbers in this list refer to the start and end offsets of chunks.\n do {\n int n = readLine(endpoint); // read chunk size text into buffer\n int beg = iread;\n int size = parseChunkSize(buffer, iread - n, iread); // Parse size in hex, ignore extension\n if (size == 0)\n break;\n // If the chunk has not already been read in, do so\n fill(endpoint, iread, size+2 /*chunksize + CRLF*/);\n // record chunk start and end\n chunkRanges.add(beg); \n chunkRanges.add(beg + size); // without the CRLF\n iread += size + 2; // for the next round.\n } while (true);\n\n // / consolidate all chunkRanges\n if (chunkRanges.numElements == 0) {\n contentLength = 0;\n return;\n }\n contentOffset = chunkRanges.get(0); // first chunk's beginning\n int endOfLastChunk = chunkRanges.get(1); // first chunk's end\n\n byte[] bufa = buffer.array();\n for (int i = 2; i < chunkRanges.numElements; i += 2) {\n int beg = chunkRanges.get(i);\n int chunkSize = chunkRanges.get(i + 1) - beg;\n System.arraycopy(bufa, beg, bufa, endOfLastChunk, chunkSize);\n endOfLastChunk += chunkSize;\n }\n // TODO move all trailer stuff up\n contentLength = endOfLastChunk - contentOffset;\n \n // At this point, the contentOffset and contentLen give the entire content \n }", "private void processStoreRequest(boolean initiatorPeer, Message request, ConcurrentHashMap<Integer, ChunkInfo> hashMap) {\n if (hashMap.get(request.getHeader().getChunkNo()) == null)\n return;\n\n ConcurrentHashMap<Integer, CopyOnWriteArrayList<Integer>> storesReceivedHash = peer.getFileSystem().getStoresReceived().get(request.getHeader().getFileId());\n\n if (storesReceivedHash == null) {\n storesReceivedHash = new ConcurrentHashMap<>();\n storesReceivedHash.put(request.getHeader().getSenderId(), new CopyOnWriteArrayList<>());\n }\n\n CopyOnWriteArrayList<Integer> listOfReceivedChunkOfThatSender = storesReceivedHash.get(request.getHeader().getSenderId());\n\n if (listOfReceivedChunkOfThatSender == null) {\n CopyOnWriteArrayList<Integer> newList = new CopyOnWriteArrayList<>();\n storesReceivedHash.put(request.getHeader().getSenderId(), newList);\n listOfReceivedChunkOfThatSender = newList;\n }\n\n\n if (listOfReceivedChunkOfThatSender.contains(request.getHeader().getChunkNo()))\n return;\n\n //Add the chunk No to the record\n listOfReceivedChunkOfThatSender.add(request.getHeader().getChunkNo());\n\n ChunkInfo chunkInfo = hashMap.get(request.getHeader().getChunkNo());\n\n chunkInfo.incrementReplicationLevel();\n\n hashMap.put(request.getHeader().getChunkNo(), chunkInfo);\n\n try {\n if (initiatorPeer) {\n peer.getFileSystem().writeInternalFileMetadataToDisk();\n } else {\n peer.getFileSystem().writeExternalFileChunksMetadataToDisk();\n }\n } catch (IOException e){\n log.error(\"Error while registering an increment of the perceivedReplication\");\n }\n }", "int getChunkId();", "int getChunkId();", "int getChunkId();", "int getChunkId();", "int getChunkId();", "int getChunkId();", "public boolean putChunk(String ChunkHandle, byte[] payload, int offset) {\n\t\t\n\t\tif (offset + payload.length > ChunkServer.ChunkSize) {\n\t\t\tSystem.out.println(\"The chunk should write should be within range of the file, invalid\");\n\t\t\treturn false; \n\t\t} \n\t\ttry {\n\t\t\t// request \n\t\t\tbyte[] handle = ChunkHandle.getBytes();\n\t\t\t// write payload size \n\t\t\toos.writeInt(4 + 4 + 4 + 4 + 4 + handle.length + payload.length);\n\t\t\t// write command identifier \n\t\t\toos.writeInt(ChunkServer.PutChunk);\n\t\t\t// write chunkHandle size \n\t\t\toos.writeInt(handle.length);\n\t\t\t// write chunk handle\n\t\t\toos.write(handle);\n\t\t\t// write payload size s\n\t\t\toos.writeInt(payload.length);\n\t\t\t// write payload \n\t\t\toos.write(payload);\n\t\t\t// write offset\n\t\t\toos.writeInt(offset);\n\t\t\toos.flush();\n\t\t\t// parse response \n\t\t\tint resultSize = getPayloadInt(ois);\n\t\t\tint result = getPayloadInt(ois);\n\t\t\t\n\t\t\tif (result == 0) {\n\t\t\t\treturn false; \n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"success put chunk\");\n\t\t\t\treturn true; \n\t\t\t}\n\t\t\t\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(ioe.getMessage());\n\t\t}\n\t\t\n\t\treturn false; \n\t}", "edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation getChunksLocation(int index);", "public void upload() {\r\n\t\t\tARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vboVertexId);\r\n\t\t\tFloatBuffer coordinates = shapePeer.shape.getVertexData().coordinates;\r\n\t\t\tint tempIdx=0;\r\n\t\t\tfor (int i=0; i<count; i++) {\r\n\t\t\t\ttempP3f.x = coordinates.get((minIndex+i)*3+0);\r\n\t\t\t\ttempP3f.y = coordinates.get((minIndex+i)*3+1);\r\n\t\t\t\ttempP3f.z = coordinates.get((minIndex+i)*3+2);\r\n\t\t\t\tshapePeer.shape.getModelMatrix().transform(tempP3f);\r\n\t\t\t\tuploadBuffer.put(tempIdx*3+0, tempP3f.x);\r\n\t\t\t\tuploadBuffer.put(tempIdx*3+1, tempP3f.y);\r\n\t\t\t\tuploadBuffer.put(tempIdx*3+2, tempP3f.z);\r\n\t\t\t\tif (tempIdx*3 >= uploadBuffer.capacity() || i==count-1) {\r\n\t\t\t\t\tint offset = (startIdx+i-tempIdx)*3;\r\n\t\t\t\t\tuploadBuffer.position(0).limit((tempIdx+1)*3);\r\n//\t\t\t\t\tSystem.out.println(\"upload \"+offset+\" \"+uploadBuffer.limit()+\" \"+startIdx);\r\n\t\t\t\t\tARBVertexBufferObject.glBufferSubDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, offset*4, uploadBuffer);\r\n\t\t\t\t\tuploadBuffer.position(0).limit(uploadBuffer.capacity());\r\n\t\t\t\t\ttempIdx=0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempIdx++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// upload colors\r\n\t\t\tFloatBuffer colors = shapePeer.shape.getVertexData().colors;\r\n\t\t\tif (colors != null) {\r\n\t\t\t\tcolors.position(minIndex).limit(minIndex+count*3);\r\n\t\t\t\tint offset = (numElements*3)+(startIdx*3);\r\n\t\t\t\tARBVertexBufferObject.glBufferSubDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, offset*4, colors);\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// upload texture coordinates\r\n\t\t\tObjectArray<VertexData.TexCoordData> texCoords = shapePeer.shape.getVertexData().texCoords;\r\n\t\t\tif (texCoords != null) {\r\n\t\t\t\tfor (int unit=0; unit<texCoords.length(); unit++) {\r\n\t\t\t\t\tVertexData.TexCoordData texCoord = texCoords.get(unit);\r\n\t\t\t\t\tif (texCoord != null) {\r\n\t\t\t\t\t\tGL13.glClientActiveTexture(GL13.GL_TEXTURE0 + unit);\r\n\t\t\t\t\t\ttexCoord.data.position(minIndex*2).limit(minIndex*2+count*2);\r\n//\t\t\t\t\t\tint offset = (numElements*(6+unit*2))+(startIdx*2);\r\n\t\t\t\t\t\tint offset = (numElements*(6+unit*2))+startIdx+startIdx;\r\n\t\t\t\t\t\tARBVertexBufferObject.glBufferSubDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, offset*4, texCoord.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tGL13.glClientActiveTexture(GL13.GL_TEXTURE0);\r\n\t\t\t\r\n\t\t\tARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);\r\n\r\n\t\t\tVertexData vertexData = shapePeer.shape.getVertexData();\r\n\t\t\tIntBuffer indices = vertexData.indices;\r\n\t\t\tindices.position(0).limit(indices.capacity());\r\n\t\t\tthis.indices = new int[indices.capacity()];\r\n\t\t\tindices.get(this.indices);\r\n\t\t\tfor (int i=0; i<this.indices.length; i++) {\r\n\t\t\t\tthis.indices[i] += startIdx-minIndex;\r\n\t\t\t}\r\n\t\t\tUtil.checkGLError();\r\n\t\t}", "int getChunkSize();", "public GlBuffer commit(final Chunk<E>[] chunks, boolean push){\n\t\t//android.util.//Log.d(TAG,\"update(\"+chunks+\", \"+commit+\")\");\n\t\tint startPosition = 0;\n\t\tint offset = this.stride;\n\t\tswitch(this.datatype){\n\t\t\tcase TYPE_FLOAT :\n\t\t\t\tif(this.buffer == null){\n\t\t\t\t\tthis.buffer = ByteBufferPool.getInstance().getDirectFloatBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((FloatBuffer)this.buffer).put(((float[])chunk.data),compIndex,chunk.components);\n }\n }\n\t\t\t\tbreak;\n case TYPE_INT :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectIntBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((IntBuffer)this.buffer).put(((int[])chunk.data),compIndex,chunk.components);\n }\n }\n break;\n\t\t\tcase TYPE_SHORT :\n\t\t\t\tif(this.buffer == null){\n\t\t\t\t\tthis.buffer = ByteBufferPool.getInstance().getDirectShortBuffer(this.size >> 1);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 1;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ShortBuffer)this.buffer).put(((short[])chunk.data),compIndex,chunk.components);\n }\n }\n\t\t\t\tbreak;\n default :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectByteBuffer(this.size);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ByteBuffer)this.buffer).put(((byte[])chunk.data),compIndex,chunk.components);\n }\n }\n break;\n\t\t}\n\n //Update server if needed\n if(push){\n push();\n }\n\n\t\treturn this;\n\t}", "DataChunk nextChunk() throws RemoteException;", "@Override\n protected void process(List<String> chunks) {\n\n logger.debug(LOG_TAG + \".process()\");\n\n logger.info(chunks.get(chunks.size() - 1));\n\n if (newConnection) {\n // save email address for distributing communication message\n emailAddress = chunks.get(chunks.size() - 1);\n // send email address and remote address to server\n server.newConnection(chunks.get(chunks.size() - 1),\n socket.getRemoteSocketAddress().toString());\n\n // send 'welcome' message to client\n sendMessage(\"@welcome\");\n\n newConnection = false;\n\n return;\n }\n\n if (chunks.get(chunks.size() - 1).equals(\"@disconnect\")) {\n // send message to server\n server.removeConnection(clientId);\n\n // send 'goodbye' message to client\n sendMessage(\"@goodbye\");\n\n newConnection = true;\n\n return;\n }\n\n // communication message from client, distribute message\n // to all clients\n server.distributeMessage(emailAddress + \">\" + chunks.get(chunks.size() - 1));\n\n }", "void mo54426b(int i, List<DownloadChunk> list);", "void mo54417a(DownloadChunk downloadChunk);", "void mo54414a(int i, List<DownloadChunk> list);", "public void sendRequest(byte[] request) {\n // send request\n try {\n //get file id and chunk number\n String[] req = new String(request).split(\" \",5);\n String fileID = req[3] , chunkNo = req[4];\n\n //create socket\n MulticastSocket socket = new MulticastSocket(this.mcastPort);\n\n socket.setTimeToLive(1);\n socket.joinGroup(InetAddress.getByName(mscastAdress));\n\n int time = new Random().nextInt(400);\n socket.setSoTimeout(time); //max time it will listen to\n\n //listen for x time\n long oldTime = System.currentTimeMillis();\n byte[] b = new byte[65000];\n\n DatagramPacket receive = new DatagramPacket(b,b.length);\n while(System.currentTimeMillis()-oldTime < time){\n\n try {\n socket.receive(receive);\n }catch (IOException e)\n {\n System.out.println(\"\\nReached time out - no one has sent PUTCHUNK!\");\n break;\n }\n\n String[] ms = new String(receive.getData()).split(\" \",6);\n\n if(ms[1]==\"PUTCHUNK\" && ms[3]==fileID && ms[4]==chunkNo){\n System.out.println(\"Someone already sent it!\");\n socket.close();\n return;//exit\n }\n }\n\n //sending request\n DatagramPacket replyPacket = new DatagramPacket(request, request.length, InetAddress.getByName(mscastAdress), mcastPort);\n socket.send(replyPacket);\n\n System.out.println(\"In PUTCHUNK - Sent packet, no one has sent it\");\n socket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private Version checkpointSuperChunkId(long superChunkId,\n Version metadataVersion) {\n if ((lobProps.getNumChunks() != null) ||\n (lobProps.getLOBSize() != null)) {\n throw new IllegalStateException(\"Inconsistent lob props for \"\n + \"metadata checkpoint:\" + lobProps.toString());\n }\n lobProps.setLastSuperChunkId(superChunkId);\n return updateMetadata(metadataVersion);\n }", "public Builder setChunks(\n int index, entities.Torrent.ChunkInfo value) {\n if (chunksBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureChunksIsMutable();\n chunks_.set(index, value);\n onChanged();\n } else {\n chunksBuilder_.setMessage(index, value);\n }\n return this;\n }", "entities.Torrent.ChunkRequest getChunkRequest();", "public boolean isNewChunk() {\n/* 26 */ return this.newChunk;\n/* */ }", "public entities.Torrent.ChunkInfo.Builder addChunksBuilder() {\n return getChunksFieldBuilder().addBuilder(\n entities.Torrent.ChunkInfo.getDefaultInstance());\n }", "@java.lang.Override\n public int getChunkIndex() {\n return chunkIndex_;\n }", "@java.lang.Override\n public int getChunkIndex() {\n return chunkIndex_;\n }", "@Test\n public void testMultipleBlocks()\n {\n long blockSize = 1000;\n int noOfBlocks = (int)((testMeta.dataFile.length() / blockSize)\n + (((testMeta.dataFile.length() % blockSize) == 0) ? 0 : 1));\n\n testMeta.blockReader.beginWindow(1);\n\n for (int i = 0; i < noOfBlocks; i++) {\n BlockMetadata.FileBlockMetadata blockMetadata = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1, i,\n i * blockSize, i == noOfBlocks - 1 ? testMeta.dataFile.length() : (i + 1) * blockSize, i == noOfBlocks - 1,\n i - 1, testMeta.dataFile.length());\n testMeta.blockReader.blocksMetadataInput.process(blockMetadata);\n }\n\n testMeta.blockReader.endWindow();\n\n List<Object> messages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), messages.size());\n for (int i = 0; i < messages.size(); i++) {\n\n byte[] msg = (byte[])messages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }", "@Override\n public void stepPartial(VLongWritable vertexIndex,\n VLongArrayListWritable msg) throws HyracksDataException {\n \n }", "public Builder addAllChunks(\n java.lang.Iterable<? extends entities.Torrent.ChunkInfo> values) {\n if (chunksBuilder_ == null) {\n ensureChunksIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, chunks_);\n onChanged();\n } else {\n chunksBuilder_.addAllMessages(values);\n }\n return this;\n }", "public void setChunkServers(HostID[] chunkServers)\n {\n this.chunkServers = chunkServers;\n }", "private void readHttpDataChunkByChunk(HttpPostRequestDecoder decoder) {\n try {\n while (decoder.hasNext()) {\n InterfaceHttpData data = decoder.next();\n if (data != null) {\n // check if current HttpData is a FileUpload and previously set as partial\n if (partialContent == data) {\n partialContent = null;\n }\n try {\n // new value\n writeHttpData(data);\n } finally {\n data.release();\n }\n }\n }\n // Check partial decoding for a FileUpload\n InterfaceHttpData data = decoder.currentPartialHttpData();\n if (data != null) {\n if (partialContent == null) {\n partialContent = (HttpData) data;\n }\n }\n } catch (HttpPostRequestDecoder.EndOfDataDecoderException e1) {\n // end\n }\n }", "public void setChunking (boolean b) {\n\tchunk = b;\n }", "public void saveChunk(String chunkName,ObjectInputStream in)\n {\n BufferedOutputStream bufOutput;\n try\n {\n bufOutput = new BufferedOutputStream(new FileOutputStream(chunkName));\n int b;\n int bytesRead=0;\n while(bytesRead < chunkSize && (b=in.read())!=-1)\n {\n bufOutput.write(b);\n bytesRead++;\n }\n bufOutput.close();\n }\n catch(IOException ex)\n {\n System.out.println(\"Exception While Saving Chunk:\" + ex.getMessage());\n }\n }", "entities.Torrent.ChunkResponse getChunkResponse();", "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 }", "@Override\r\n\tprotected void process(List<String> chunks) {\r\n\t\tfor (String data: chunks) {\r\n\t\t\thandleData(data);\r\n\t\t}\r\n\t}", "List<DownloadChunk> mo54445j(int i);", "@java.lang.Override\n public int getChunkIndex() {\n return chunkIndex_;\n }", "@java.lang.Override\n public int getChunkIndex() {\n return chunkIndex_;\n }", "public boolean isChunked() {\n/* 101 */ return this.chunked;\n/* */ }", "public entities.Torrent.ChunkInfo.Builder addChunksBuilder(\n int index) {\n return getChunksFieldBuilder().addBuilder(\n index, entities.Torrent.ChunkInfo.getDefaultInstance());\n }", "@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 }", "private void fireChunkSent(final int chunkSize) {\n utils.logMonitorChunkSent(monitor, chunkSize);\n try {\n monitor.chunkSent(chunkSize);\n } catch (final Throwable cause) {\n utils.logMonitorError(monitor, cause);\n }\n }", "@Test\n public void testStreamParsePubDev3401() throws IOException {\n final int chunkSize = 64 * 1024;\n ParseSetupV3 ps = new ParseSetupV3();\n ps.parse_type = \"CSV\";\n ps.chunk_size = chunkSize;\n // mock Parser\n final List<Integer> pcCalls = new LinkedList<>();\n Parser p = new Parser(new ParseSetup(ps), null) {\n @Override protected ParseWriter parseChunk(int cidx, ParseReader din, ParseWriter dout) {\n pcCalls.add(cidx);\n byte[] data = din.getChunkData(cidx);\n assert cidx <= 3;\n assert ((data != null) && (data.length == chunkSize)) || (cidx == 3);\n return null;\n }\n };\n // mock source InputStream, only used for \"back-channel\" chunk index signalling\n final Queue<Integer> cidxs = new LinkedList<>(Arrays.asList(1, 2, 3, 4));\n InputStream bvs = new InputStream() {\n @Override public int read() throws IOException { throw new UnsupportedOperationException(); }\n @Override public int read(byte[] b, int off, int len) throws IOException {\n assert b == null;\n return cidxs.remove();\n }\n };\n // mock StreamParseWriter\n MockStreamParseWriter w = new MockStreamParseWriter(chunkSize);\n // Vec made of 3 chunks\n Key k = FVecFactory.makeByteVec(\n RandomStringUtils.randomAscii(chunkSize),\n RandomStringUtils.randomAscii(chunkSize),\n RandomStringUtils.randomAscii(chunkSize)\n );\n try {\n ByteVec v = DKV.getGet(k);\n p.streamParseZip(v.openStream(null), w, bvs);\n assertEquals(\"Expected calls to parseChunk()\", Arrays.asList(0, 1, 2, 3), pcCalls);\n assertEquals(\"Expected calls to nextChunk()\", Arrays.asList(0, 1, 2), w._nchks);\n } finally {\n k.remove();\n }\n }", "public GlBuffer commit(final Chunk<E> chunk, boolean push){\n //Log.d(TAG,\"update(\"+chunk+\", \"+commit+\")\");\n\t\tint startPosition = 0;\n\t\tint offset = this.stride;\n switch(this.datatype){\n case TYPE_FLOAT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectFloatBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n }\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((FloatBuffer) this.buffer).put(((float[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n case TYPE_INT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectIntBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((IntBuffer) this.buffer).put(((int[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n case TYPE_SHORT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectShortBuffer(this.size >> 1);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 1;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ShortBuffer) this.buffer).put(((short[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n default :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectByteBuffer(this.size);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ByteBuffer) this.buffer).put(((byte[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n\n //Update server if needed\n if(push){\n push();\n }\n\n return this;\n }", "public static void updateDatabase(){\n\t\ttry {\n\t\t\tPrintWriter pwFLU = new PrintWriter(filePath);\n\t\t\tfor(Entry<String, Pair<FileID, Integer>> entry : Peer.fileList.entrySet()){\n\t\t\t\tString path = entry.getKey();\n\t\t\t\tPair<FileID, Integer> pair = entry.getValue();\n\t\t\t\tpwFLU.println(path + \"|\" + pair.getFirst().toString() + \"|\" + pair.getSecond());\n\t\t\t}\n\t\t\tpwFLU.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*\n\t\t * UPDATE THE CHUNKS\n\t\t */\n\t\ttry {\n\t\t\tPrintWriter pwCLU = new PrintWriter(chunkPath);\n\t\t\tfor(ChunkInfo ci : Peer.chunks){\n\t\t\t\tpwCLU.println(ci.getFileId() + \"|\" + ci.getChunkNo() + \"|\" + ci.getDesiredRD() + \"|\" + ci.getActualRD());\n\t\t\t}\n\t\t\tpwCLU.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void mergeChunks(String fileName,int numChunks)\n {\n FileInputStream fInput;\n BufferedInputStream bufInput;\n BufferedOutputStream bufOutput;\n FileOutputStream fOutput;\n try\n { \n fOutput = new FileOutputStream(fileName);\n bufOutput = new BufferedOutputStream(fOutput); \n for(int i=0;i<numChunks;i++)\n {\n fInput = new FileInputStream(fileName+ \".chunk.\" + i);\n bufInput = new BufferedInputStream(fInput);\n int b;\n while((b=bufInput.read())!= -1)\n {\n bufOutput.write(b);\n }\n\n }\n bufOutput.close();\n }\n\t\tcatch(FileNotFoundException ex)\n {\n System.out.println(\"File Not Found\");\n }\n catch(IOException ex)\n {\n System.out.println(\"Some IOException occurred\");\n }\n }", "public int getChunkId() {\n return chunkId_;\n }", "public int getChunkId() {\n return chunkId_;\n }", "public int getChunkId() {\n return chunkId_;\n }", "public int getChunkId() {\n return chunkId_;\n }", "public int getChunkId() {\n return chunkId_;\n }", "public int getChunkId() {\n return chunkId_;\n }", "void handleChunk(char[] buff, int length) {\n\t\tint newlinePos = -1;\n\t\tfor (int pos = 0; pos < length; pos++) {\n\t\t\tif (buff[pos] == '\\n') {\n\t\t\t\tnewlinePos = pos;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (newlinePos > -1) {\n\t\t\tloaded.append(buff, 0, newlinePos);\n\t\t\tendLine();\n\t\t\tloaded.append(buff, newlinePos + 1, length - newlinePos - 1);\n\t\t} else {\n\t\t\tloaded.append(buff, 0, length);\n\t\t}\n\t}", "private void putChunk(Key chunkKey,\n byte[] chunk,\n int actualSize,\n boolean replace,\n Durability chunkDurability) {\n\n if (actualSize != chunkSize) {\n final byte[] smallerChunk = new byte[actualSize];\n System.arraycopy(chunk, 0, smallerChunk, 0, actualSize);\n chunk = smallerChunk;\n }\n\n final Value chunkValue = Value.createValue(chunk);\n final Version version;\n\n /* Write out the chunk. */\n if (replace) {\n version = kvsImpl.putIfPresent(chunkKey, chunkValue, null,\n chunkDurability,\n chunkTimeoutMs, TimeUnit.MILLISECONDS);\n if (version == null) {\n throw new ConcurrentModificationException\n (\"Expected to find chunk \" + chunkKey +\n \" but it was missing. \");\n }\n } else {\n version = kvsImpl.putIfAbsent(chunkKey, chunkValue, null,\n chunkDurability,\n chunkTimeoutMs, TimeUnit.MILLISECONDS);\n if (version == null) {\n throw new ConcurrentModificationException\n (\"Chunk \" + chunkKey +\n \" was already associated with the key: \" +\n chunkKey.toString());\n\n }\n }\n }", "public void writeChunk(String id, byte[] data) throws IOException {\n byte[] identifier = id.getBytes(\"US-ASCII\");\n if (identifier.length != 4) {\n throw new IllegalArgumentException(\"ID length must match 4!\");\n }\n writeInt(data.length);\n write(identifier);\n write(data);\n CRC32 crc = new CRC32();\n crc.update(identifier);\n crc.update(data);\n writeInt((int) (crc.getValue() & 0xFFFFFFFFL));\n crc.reset();\n }", "public UploadHandle upload(List<File> files) throws Exception {\n \tMetadata md = new Metadata();\n \tfinal FileCollection fcol = new FileCollection(md);\n \tfor(File f: files) {\n \t\tFileMetaData mf = new FileMetaData(f.getName(), f.getLocalName(), \"\", null);\n \t\tmf.setGroups(f.getGroups());\n \t\tmd.md.file.add(mf);\n \t}\n NullOutputStream ostream = new NullOutputStream();\n fcol.tarit(ostream);\n long length = ostream.getLength();\n\n HttpResponse response = client.get(new URI(config.preallocurl()));\n String prealloc_file = this.read_http_entity(response.getEntity());\n String ingestServer = prealloc_file.split(\"\\n\")[0];\n String location = prealloc_file.split(\"\\n\")[1];\n ingestServer = ingestServer.split(\": \")[1];\n location = location.split(\": \")[1];\n \n PipedInputStream in = new PipedInputStream();\n final PipedOutputStream out = new PipedOutputStream(in);\n new Thread(\n new Runnable(){\n @Override\n public void run(){\n try {\n fcol.tarit(out);\n } catch (Exception ex) {\n Logger.getLogger(Connect.class.getName()).log(Level.SEVERE, null, ex);\n \n }\n }\n }\n ).start();\n \n InputStreamEntity entity = new InputStreamEntity(in, length);\n response = client.put(entity, new URI(\"https://\"+ingestServer+location));\n this.read_http_entity(response.getEntity());\n\n response = client.get(new URI(\"https://\"+ingestServer+config.finishurl()+location));\n String status_url = this.read_http_entity(response.getEntity());\n for(String line:status_url.split(\"\\n\")) {\n System.out.println(line);\n if(line.startsWith(\"Status: \"))\n status_url = line.split(\": \")[1];\n }\n System.out.println(status_url+\"/xml\");\n StatusHandler sturl = new StatusHandler();\n sturl.status_url = status_url+\"/xml\";\n sturl.timeout = 30;\n sturl.step = 5;\n UploadHandle ret = sturl;\n return ret;\n }", "private byte[] pushDataChunk(final byte[] commandApdu) {\r\n // Only start transmission if tx buffer is ready\r\n if (!dataOutReady.get()) {\r\n return APDU.StatusMessage.ERR_NO_DATA;\r\n }\r\n\r\n int requestedSize = APDU.getHeaderValue(commandApdu, APDU.Header.LC);\r\n requestedSize = Math.min(requestedSize, MAX_CHUNK_SIZE);\r\n int msgLength = Math.min(requestedSize, dataOut.available());\r\n // Construct payload + status code\r\n byte[] rawOutMsg = new byte[msgLength + 2];\r\n\r\n int writtenBytes = dataOut.read(rawOutMsg, 0, msgLength);\r\n int nextBytes = Math.min(dataOut.available(), MAX_CHUNK_SIZE);\r\n Log.d(TAG, \"Sending chunk of \" + writtenBytes + \" bytes, next will be \" + nextBytes + \" bytes.\");\r\n\r\n if (nextBytes > 0) {\r\n // Announce available bytes for the next transmission\r\n byte[] status = new byte[]{(byte) 0x61, (byte)(nextBytes & 0xff)};\r\n APDU.insertStatusMessage(rawOutMsg, status);\r\n } else {\r\n // Stop communication\r\n APDU.insertStatusMessage(rawOutMsg, APDU.StatusMessage.SUCCESS);\r\n dataOutReady.set(false);\r\n }\r\n\r\n return rawOutMsg;\r\n }", "public Builder setChunkIndex(int value) {\n\n chunkIndex_ = value;\n onChanged();\n return this;\n }", "public void addChunk(ParquetStreamReader.ChunkDescriptor descriptor) {\n chunks.add(descriptor);\n length += descriptor.size;\n }", "public Builder setChunkIndex(int value) {\n\n chunkIndex_ = value;\n onChanged();\n return this;\n }", "public String getSongChunk(Long key, Long fragment) throws IOException {\n byte buf[] = new byte[FRAGMENT_SIZE];\n File file = new File(MUSIC_FILE_PATH + File.separator + key + \".mp3\");\n System.out.println(\"SongDispatcher has found file: \" + key + \"\\tStatus: \" + file.exists());\n FileInputStream inputStream = new FileInputStream(file);\n inputStream.skip(fragment * FRAGMENT_SIZE);\n inputStream.read(buf);\n inputStream.close();\n\n return Base64.getEncoder().encodeToString(buf);\n }", "private LeafNodeObject getChunk(long chunkStart, long chunkEnd) throws IOException {\n if (chunkEnd <= chunkStart || (chunkEnd - chunkStart > this.maxChunkSize) ||\n chunkStart > Integer.MAX_VALUE) {\n throw new IOException(\"ChunkStart out of range\");\n }\n\n byte[] temp = Arrays.copyOfRange(this.fileContent, (int) chunkStart,\n (int) (chunkEnd - chunkStart));\n\n\n SignatureObject signature = new SignatureObject();\n signature.signatureData = new BinaryItem(ByteUtil.toListOfByte(temp));\n\n// RDCSignatureGenerator generator = new RDCSignatureGenerator();\n// signatureBytes = generator.ComputeHash(temp);\n//\n// SignatureObject signature = new SignatureObject();\n// signature.SignatureData = new BinaryItem(signatureBytes);\n\n return new LeafNodeObject.IntermediateNodeObjectBuilder().Build(temp, signature);\n }", "private static boolean parseChunk(final FileChannel fc,final long[] offset,final int depth) throws IOException {\n\t Log.d(TAG, \"entering parseChunk \"+ offset[0] +\"/\"+ depth);\n\n\t long data_offset = offset[0];\n\n long chunk_size = Util.readUInt(fc, data_offset); \n int chunk_type = Util.readInt(fc, data_offset+4);\n\n Log.v(TAG, chunk_type + \" \" + chunk_size);\n char sChunk[] = new char[4];\n Util.MakeFourCCString(chunk_type, sChunk);\n Log.v(TAG, String.format(\"chunk %s\", String.valueOf(sChunk)));\n\n data_offset += 8;\n // long chunk_data_size = offset[0] + chunk_size - data_offset;\n\n if (chunk_size == 1) {\n\n chunk_size = Util.readLong(fc, data_offset);\n\n data_offset += 8;\n\n if (chunk_size < 16) {\n Log.e(TAG,\" The smallest valid chunk is 16 bytes long in this case.\");\n return false;\n }\n\n } else if (chunk_size < 8) {\n Log.e(TAG,\"The smallest valid chunk is 8 bytes long.\");\n return false;\n }\n\n Log.v(TAG, String.format(\"parsing chunk %s at depth %d\",\n String.valueOf(sChunk), depth));\n\n if(chunk_type == Util.FOURCC('m', 'o', 'o', 'v') || chunk_type == Util.FOURCC('u', 'd', 't', 'a')) {\n Log.d(TAG, String.valueOf(sChunk));\n\n long stop_offset = offset[0] + chunk_size;\n offset[0] = data_offset;\n while (offset[0] < stop_offset) {\n boolean err = parseChunk(fc,offset, depth + 1);\n if (!err) {\n return err;\n }\n }\n\n if (offset[0] != stop_offset) {\n return false;\n }\n\n if (chunk_type == Util.FOURCC('m', 'o', 'o', 'v') ) {\n return true;\n }\n }\n else if(chunk_type == Util.FOURCC('h', 't', 'c', 'b')) {\n Log.d(TAG,\"Found Htc MetaData\");\n sHtcTableOffset = data_offset;\n Log.d(TAG,\"sHtcTableOffset = \" + sHtcTableOffset );\n parseHtcMetaData(fc,data_offset,chunk_size);\n Log.d(TAG,\"Parse Htc MetaData done\");\n offset[0] += chunk_size;\n } else if (chunk_type == Util.FOURCC('_', 'h', 't', 'c')\n || chunk_type == Util.FOURCC('d', 't', 'a', 'h')) {\n Log.d(TAG, \"Found HTC box\");\n offset[0] += 8;\n parseChunk(fc, offset, depth + 1);\n } else {\n offset[0] += chunk_size;\n }\n return true;\n }", "public entities.Torrent.ChunkInfoOrBuilder getChunksOrBuilder(\n int index) {\n if (chunksBuilder_ == null) {\n return chunks_.get(index); } else {\n return chunksBuilder_.getMessageOrBuilder(index);\n }\n }", "@Override\n\t\tvoid putTo(ByteBuffer dst, TcpTxContext tx) {\n\t\t\tfor(ByteChunk bc: byteChunks)\n\t\t\t\tbc.putTo(dst);\n\t\t}", "private void dbFirstGetNextChunk(SortBy sort) throws ServiceException {\n DbSearchConstraints.Leaf sc = getTopLeafConstraint();\n sc.hasIndexId = Boolean.TRUE;\n\n do {\n // (1) Get the next chunk of results from the DB\n List<DbSearch.Result> dbResults = new ArrayList<DbSearch.Result>();\n dbSearch(dbResults, sort, dbOffset, MAX_HITS_PER_CHUNK);\n\n if (dbResults.size() < MAX_HITS_PER_CHUNK) {\n endOfHits = true;\n }\n\n if (dbResults.size() > 0) {\n dbOffset += dbResults.size();\n\n // (2) for each of the results returned in (1), do a lucene search\n // for \"ORIGINAL-LUCENE-PART AND id:(RESULTS-FROM-1-ABOVE)\"\n try {\n // For each search result, do two things:\n // -- remember the indexId in a hash, so we can find the SearchResult later\n // -- add that indexId to our new booleanquery\n Map<Integer, List<DbSearch.Result>> mailItemToResultsMap = new HashMap<Integer, List<DbSearch.Result>>();\n\n for (DbSearch.Result sr : dbResults) {\n List<DbSearch.Result> results = mailItemToResultsMap.get(sr.getIndexId());\n if (results == null) {\n results = new LinkedList<DbSearch.Result>();\n mailItemToResultsMap.put(sr.getIndexId(), results);\n }\n results.add(sr);\n // add the new query to the mLuceneOp's query\n luceneOp.addFilterClause(new Term(LuceneFields.L_MAILBOX_BLOB_ID,\n String.valueOf(sr.getIndexId())));\n }\n\n boolean hasMore = true;\n\n // we have to get ALL of the lucene hits for these ids. There can very likely be more\n // hits from Lucene then there are DB id's, so we just ask for a large number.\n while (hasMore) {\n luceneChunk = luceneOp.getNextResultsChunk(MAX_HITS_PER_CHUNK);\n Set<Integer> indexIds = luceneChunk.getIndexIds();\n if (indexIds.size() < MAX_HITS_PER_CHUNK) {\n hasMore = false;\n }\n for (int indexId : indexIds) {\n List<DbSearch.Result> results = mailItemToResultsMap.get(indexId);\n if (results != null) {\n for (DbSearch.Result sr : results) {\n dbHits.add(sr);\n }\n } else {\n ZmailLog.search.warn(\"Lucene returned item ID %d but wasn't in resultMap\", indexId);\n throw ServiceException.FAILURE(\n \"Inconsistent DB/Index query results: Text Index returned item ID \" +\n indexId + \" but wasn't in resultMap\", null);\n }\n }\n }\n } finally {\n luceneOp.clearFilterClause();\n }\n }\n\n } while (dbHits.size() ==0 && !endOfHits);\n }", "ChunkCachingProtocol.Factory getChunkCachingProtocolFactory();", "void setChunkType(String aChunkType);", "public void setChunkNumber(int chunkNumber) {\r\n\t\tthis.chunkNumber = chunkNumber;\r\n\t}", "public int getChunkNo() {\n return chunkNo;\n }", "public int getChunkNo() {\n return chunkNo;\n }", "void setLastChunk(Boolean aIsLastChunk);", "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}", "public entities.Torrent.ChunkInfo getChunks(int index) {\n if (chunksBuilder_ == null) {\n return chunks_.get(index);\n } else {\n return chunksBuilder_.getMessage(index);\n }\n }", "private StoreChunkResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public void sendUpdates() {\n\t\tif (this.dirtyBlocks.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tWorld world = this.cube.getWorld();\n\t\t\n\t\t// how many?\n\t\tif (this.dirtyBlocks.size() == 1) {\n\t\t\t// get the block coords\n\t\t\tint address = this.dirtyBlocks.first();\n\t\t\t\n\t\t\tBlockPos pos = addressToBlockPos(address);\n\t\t\t\n\t\t\t// send single block updates\n\t\t\tsendPacketToAllPlayers(new PacketBlockChange(world, pos));\n\t\t\tif (world.getBlockEntityAt(pos) != null) {\n\t\t\t\tsendBlockEntityToAllPlayers(world.getBlockEntityAt(pos));\n\t\t\t}\n\t\t} else if (this.dirtyBlocks.size() == MaxBlocksPerUpdate) {\n\t\t\t// send whole cube (wrapped in a column view)\n\t\t\tColumnView view = new ColumnView(this.cube.getColumn());\n\t\t\tview.addCubeToView(this.cube);\n\t\t\tsendPacketToAllPlayers(new PacketChunkData(view, false, 0));\n\t\t\tfor (BlockEntity blockEntity : this.cube.getBlockEntities()) {\n\t\t\t\tsendBlockEntityToAllPlayers(blockEntity);\n\t\t\t}\n\t\t} else {\n\t\t\t// encode the update coords\n\t\t\tshort[] coords = new short[this.dirtyBlocks.size()];\n\t\t\tint i = 0;\n\t\t\tfor (int address : this.dirtyBlocks) {\n\t\t\t\tint localX = unpackLocalX(address);\n\t\t\t\tint localY = unpackLocalY(address);\n\t\t\t\tint localZ = unpackLocalZ(address);\n\t\t\t\tint blockY = Coords.localToBlock(this.cube.getY(), localY);\n\t\t\t\tcoords[i++] = (short) ( (localX & 0xf) << 12 | (localZ & 0xf) << 8 | (blockY & 0xff));\n\t\t\t}\n\t\t\t\n\t\t\t// send multi-block updates\n\t\t\tsendPacketToAllPlayers(new PacketMultiBlockChange(coords.length, coords, this.cube.getColumn()));\n\t\t\tfor (int address : this.dirtyBlocks) {\n\t\t\t\tint localX = unpackLocalX(address);\n\t\t\t\tint localY = unpackLocalY(address);\n\t\t\t\tint localZ = unpackLocalZ(address);\n\t\t\t\tint blockX = Coords.localToBlock(this.cube.getX(), localX);\n\t\t\t\tint blockY = Coords.localToBlock(this.cube.getY(), localY);\n\t\t\t\tint blockZ = Coords.localToBlock(this.cube.getZ(), localZ);\n\t\t\t\t\n\t\t\t\tBlockPos pos = new BlockPos(blockX, blockY, blockZ);\n\t\t\t\tsendBlockEntityToAllPlayers(this.cube.getBlockEntity(pos, ChunkEntityCreationType.QUEUED));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.dirtyBlocks.clear();\n\t}", "public Builder addChunks(\n int index, entities.Torrent.ChunkInfo value) {\n if (chunksBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureChunksIsMutable();\n chunks_.add(index, value);\n onChanged();\n } else {\n chunksBuilder_.addMessage(index, value);\n }\n return this;\n }", "private static void chunkedUploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {\n long size = localFile.length();\n\n // assert our file is at least the chunk upload size. We make this assumption in the code\n // below to simplify the logic.\n if (size < CHUNKED_UPLOAD_CHUNK_SIZE) {\n System.err.println(\"File too small, use upload() instead.\");\n System.exit(1);\n return;\n }\n\n long uploaded = 0L;\n DbxException thrown = null;\n\n ProgressListener progressListener = new ProgressListener() {\n long uploadedBytes = 0;\n @Override\n public void onProgress(long l) {\n printProgress(l + uploadedBytes, size);\n if (l == CHUNKED_UPLOAD_CHUNK_SIZE) uploadedBytes += CHUNKED_UPLOAD_CHUNK_SIZE;\n }\n };\n\n // Chunked uploads have 3 phases, each of which can accept uploaded bytes:\n //\n // (1) Start: initiate the upload and get an upload session ID\n // (2) Append: upload chunks of the file to append to our session\n // (3) Finish: commit the upload and close the session\n //\n // We track how many bytes we uploaded to determine which phase we should be in.\n String sessionId = null;\n for (int i = 0; i < CHUNKED_UPLOAD_MAX_ATTEMPTS; ++i) {\n if (i > 0) {\n System.out.printf(\"Retrying chunked upload (%d / %d attempts)\\n\", i + 1, CHUNKED_UPLOAD_MAX_ATTEMPTS);\n }\n\n try (InputStream in = new FileInputStream(localFile)) {\n // if this is a retry, make sure seek to the correct offset\n in.skip(uploaded);\n\n // (1) Start\n if (sessionId == null) {\n sessionId = dbxClient.files().uploadSessionStart()\n .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE, progressListener)\n .getSessionId();\n uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;\n printProgress(uploaded, size);\n }\n\n UploadSessionCursor cursor = new UploadSessionCursor(sessionId, uploaded);\n\n // (2) Append\n while ((size - uploaded) > CHUNKED_UPLOAD_CHUNK_SIZE) {\n dbxClient.files().uploadSessionAppendV2(cursor)\n .uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE, progressListener);\n uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;\n printProgress(uploaded, size);\n cursor = new UploadSessionCursor(sessionId, uploaded);\n }\n\n // (3) Finish\n long remaining = size - uploaded;\n CommitInfo commitInfo = CommitInfo.newBuilder(dropboxPath)\n .withMode(WriteMode.ADD)\n .withClientModified(new Date(localFile.lastModified()))\n .build();\n FileMetadata metadata = dbxClient.files().uploadSessionFinish(cursor, commitInfo)\n .uploadAndFinish(in, remaining, progressListener);\n\n System.out.println(metadata.toStringMultiline());\n return;\n } catch (RetryException ex) {\n thrown = ex;\n // RetryExceptions are never automatically retried by the client for uploads. Must\n // catch this exception even if DbxRequestConfig.getMaxRetries() > 0.\n sleepQuietly(ex.getBackoffMillis());\n continue;\n } catch (NetworkIOException ex) {\n thrown = ex;\n // network issue with Dropbox (maybe a timeout?) try again\n continue;\n } catch (UploadSessionLookupErrorException ex) {\n if (ex.errorValue.isIncorrectOffset()) {\n thrown = ex;\n // server offset into the stream doesn't match our offset (uploaded). Seek to\n // the expected offset according to the server and try again.\n uploaded = ex.errorValue\n .getIncorrectOffsetValue()\n .getCorrectOffset();\n continue;\n } else {\n // Some other error occurred, give up.\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n }\n } catch (UploadSessionFinishErrorException ex) {\n if (ex.errorValue.isLookupFailed() && ex.errorValue.getLookupFailedValue().isIncorrectOffset()) {\n thrown = ex;\n // server offset into the stream doesn't match our offset (uploaded). Seek to\n // the expected offset according to the server and try again.\n uploaded = ex.errorValue\n .getLookupFailedValue()\n .getIncorrectOffsetValue()\n .getCorrectOffset();\n continue;\n } else {\n // some other error occurred, give up.\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n }\n } catch (DbxException ex) {\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n return;\n } catch (IOException ex) {\n System.err.println(\"Error reading from file \\\"\" + localFile + \"\\\": \" + ex.getMessage());\n return;\n }\n }\n\n // if we made it here, then we must have run out of attempts\n System.err.println(\"Maxed out upload attempts to Dropbox. Most recent error: \" + thrown.getMessage());\n }" ]
[ "0.62546", "0.5919376", "0.58786166", "0.5836947", "0.57594585", "0.5708803", "0.56590956", "0.5625272", "0.5623952", "0.5586952", "0.5582656", "0.5490847", "0.54405445", "0.53450817", "0.53257304", "0.5280769", "0.5272249", "0.5258895", "0.5258895", "0.5258895", "0.5258895", "0.5240702", "0.5209811", "0.520844", "0.520844", "0.520844", "0.520844", "0.520844", "0.520844", "0.5198789", "0.5191384", "0.5176782", "0.5173252", "0.5171524", "0.5144487", "0.51330155", "0.51174897", "0.5108917", "0.51011604", "0.50865686", "0.50838864", "0.50770485", "0.5065008", "0.50573874", "0.504216", "0.50386775", "0.50386775", "0.5028554", "0.5026074", "0.5004363", "0.5003067", "0.4996555", "0.4986653", "0.4974906", "0.49671483", "0.4959606", "0.49512324", "0.49293667", "0.49266577", "0.49266577", "0.4901861", "0.48912355", "0.48840132", "0.48772323", "0.4876771", "0.48566625", "0.48528877", "0.48521966", "0.48467305", "0.48467305", "0.48467305", "0.48467305", "0.48467305", "0.48467305", "0.48434505", "0.48247197", "0.482282", "0.48198074", "0.48139024", "0.48120514", "0.4811975", "0.48106605", "0.48086542", "0.4807473", "0.4803599", "0.480022", "0.47958493", "0.47954836", "0.47916344", "0.4790978", "0.47886014", "0.47873148", "0.47873148", "0.47764105", "0.4763209", "0.4753821", "0.47528183", "0.47471532", "0.47439295", "0.4741933" ]
0.5965999
1
This boolean holds the verdict of a whitelist condition, on checking 1 complete rule. The verdict starts at false, but can change during the loop through all rule components.
public Boolean isWhiteListed(Map<String,Object> alertFieldsAndValues) { Boolean isWhiteListedSoFar = false; Iterator<Map.Entry<String,String>> it = ruleAsJSON.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, String> ruleComponent = it.next(); //A complete WL rule also contains fields that are meant to be appended to the stream //but are not rule components that can be checked if (ruleComponent.getKey().toString().startsWith("wl_")) { continue; } String[] rulePartKeyComponents = ruleComponent.getKey().split("\\."); String ruleField = rulePartKeyComponents[0]; String ruleFilter = rulePartKeyComponents[1]; // ruleComponent (key) cannot be checked: field is missing in alert // OR // ruleValue itself is NULL if (!alertFieldsAndValues.containsKey(ruleField) || alertFieldsAndValues.get(ruleField) == null) { if (LOG.isDebugEnabled()) { LOG.debug("WhiteListEval Detail : [" + new JSONObject(alertFieldsAndValues).toJSONString() + "] not whitelisted [exit 1] : ruleField [" + ruleField + "] not found in field values"); } return false; } String ruleValue = ruleComponent.getValue(); Object alertValue = alertFieldsAndValues.get(ruleField); //Rule DSL notation allows for single value or multiple comma separated values, we don't care String[] ruleComponentValues = ruleValue.split(","); if (ruleField.equals("timestamp")) { //early exit, cause whatever the rule might grant based on alert field values, the specified timerange does not fit if (!timeRange.isAlertInWhiteListRange(Long.parseLong(alertValue.toString()))) { return false; } isWhiteListedSoFar = true; } else if (ruleField.equals("ip_src_addr") || ruleField.equals("ip_dst_addr")) { //Specific check for alert values of ip type for (String s : ruleComponentValues) { SubnetUtils utils; try { utils = new SubnetUtils(s); } catch (IllegalArgumentException e) { LOG.warn(String.format("Invalid cidr address: [%s]. %s", s, e)); break; } utils.setInclusiveHostCount(true); // if one value matched, early exit if (utils.getInfo().isInRange((String)alertValue)) { isWhiteListedSoFar = true; break; } } } else { boolean matchingValue = false; for (int i = 0; i < ruleComponentValues.length && !matchingValue; i++) { matchingValue = alertValue.toString().equalsIgnoreCase(ruleComponentValues[i]); } isWhiteListedSoFar = matchingValue; } // on exclude flip isWhiteListed isWhiteListedSoFar = ruleFilter.equals("exclude") ? !isWhiteListedSoFar : isWhiteListedSoFar; // early exit, if after checking 1 complete rule component the verdict isWhiteListedSoFar is still false, we can exit the rule as //it can never apply if (!isWhiteListedSoFar) { return false; } } return isWhiteListedSoFar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n @Generated\n @Selector(\"needRulesVerdict\")\n public static native NEFilterNewFlowVerdict needRulesVerdict();", "public boolean C_trueCond(ListOfParameterLists parameterLists) {\n if(debug)\n System.out.println(\"Condition: TRUE\");\n return true;\n }", "@NotNull\n @Generated\n @Selector(\"allowVerdict\")\n public static native NEFilterNewFlowVerdict allowVerdict();", "private boolean isVcheck (JPLine plinesucc)\n\t{\n\t\tJPLine pline = plines.lower(plinesucc);\n\t\tif (pline == null) return false;\n\t\tif (pline.len != 2) return false;\n\t\tJPLine pred = plines.lower(pline);\n\t\tif (pred == null) return false;\n\t\treturn (pred.flag0 & 0x64) == 0x24; // branch instruction that is itself covered and not start of source code statement\n\t}", "public boolean nextConditionMet() {\n return true;\n }", "private boolean scanPreconditions()\n\t\t{\n\t\t\tboolean statusChanged = false;\n\t\t\t\n\t\t\t//Conditional activity\n\t\t\tif(TravelToCustomer.precondition(this) == true)\n\t\t\t{\n\t\t\t\tTravelToCustomer act = new TravelToCustomer(this);\n\t\t\t\tact.startingEvent();\n\t\t\t\tscheduleActivity(act);\n\t\t\t\tstatusChanged = true;\n\t\t\t\t//System.out.println(\"Started Travel to Customer. \");\n\t\t\t}\n\t\t\t\n\t\t\tif(TakingLunch.precondition(this) == true)\n\t\t\t{\n\t\t\t\tTakingLunch act = new TakingLunch(this);\n\t\t\t\tact.startingEvent();\n\t\t\t\tscheduleActivity(act);\n\t\t\t\tstatusChanged = true;\n\t\t\t\t//System.out.println(\"Started Take Lunch. \");\n\t\t\t}\n\t\t\t\n\t\t\t// Do not change the status if already true\n\t\t\tif(statusChanged) scanInterruptPreconditions();\n\t\t\telse statusChanged = scanInterruptPreconditions();\n\t\t\treturn(statusChanged);\n\t\t}", "public boolean whiteCheck() {\n\t\treturn false;\n\t}", "public boolean isARuleBreaker()\n {\n return mBrokenRules.size() > 0;\n }", "public boolean conditionFulfilled();", "private boolean checkTrainingCondition(){\n //if one sample validation was negative, so trainingCondition will be false.\n for(Sample s: samples){\n if(!s.getValidation())\n return false;\n }\n return true;\n }", "@Override\n public boolean preconditionsSatisfied() {\n return true;\n }", "public boolean check()\n\t{\n\t\tif (kinect.isTracking())\n\t\t{\n\t\t\tboolean result = true;\n\t\t\tfor (int i = 0; i < rules.size(); ++i)\n\t\t\t{\n\t\t\t\tBodyPoseRule rule = rules.get(i);\n\t\t\t\tresult = result && rule.check();\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\treturn false;\n\t}", "public boolean adjust_satisfy(int satisfy) {\n boolean flag = false;\n switch (satisfy) {\n case 0: {//none satisfied\n this.relax_cpu += 0.1;\n this.relax_memory += 0.1;\n this.relax_qpi += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 1: {//only CPU satisfied\n this.relax_memory += 0.1;\n this.relax_qpi += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 2: {//only memory satisfied\n this.relax_cpu += 0.1;\n this.relax_qpi += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 4: {//only qpi satisfied\n this.relax_memory += 0.1;\n this.relax_cpu += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 8: {//only cores satisfied\n this.relax_cpu += 0.1;\n this.relax_memory += 0.1;\n this.relax_qpi += 0.1;\n }\n case 3: {//cpu and memory satisfied\n this.relax_qpi += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 5: {//cpu and qpi satisfied\n this.relax_memory += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 6: {//memory and qpi satisfied\n this.relax_cpu += 0.1;\n this.relax_cores += 1;\n break;\n }\n case 7: {//all except cores\n this.relax_cores += 1;\n break;\n }\n case 9: {//cpu and cores satisfied\n this.relax_qpi += 0.1;\n this.relax_memory += 0.1;\n break;\n }\n case 10: {//memory and cores satisfied\n this.relax_cpu += 0.1;\n this.relax_qpi += 0.1;\n break;\n }\n case 11: {//all except qpi\n this.relax_qpi += 0.1;\n break;\n }\n case 12: {//qpi and cores satisfied\n this.relax_cpu += 0.1;\n this.relax_memory += 0.1;\n break;\n }\n case 13: {//all except memory\n this.relax_memory += 0.1;\n break;\n }\n case 14: {//all except cpu\n this.relax_cpu += 0.1;\n break;\n }\n }\n\n// if (this.relax_cpu > 1 || this.relax_memory > 1.5 || this.relax_qpi > 1.5) {\n// SOURCE_RATE = SOURCE_RATE * 0.9;\n// flag = true;\n// }\n\n// if (this.relax_cpu > 2) {\n// this.relax_cpu = 2;\n// }\n// if (this.relax_memory > 2) {\n// this.relax_memory = 2;\n// }\n// if (this.relax_qpi > 2) {\n// this.relax_qpi = 2;\n// }\n\n setRelax_cpu(this.relax_cpu);\n setRelax_memory(this.relax_memory);\n setRelax_qpi(this.relax_qpi);\n setRelax_cores(this.relax_cores);\n return flag;\n }", "private boolean processPrecond(String paramName) throws Exception\n\t{\n\t\tString precond = piseMarshaller.getPrecond(paramName);\n\t\tString vdef = piseMarshaller.getVdef(paramName);\n\t\tif (precond != null) \n\t\t{\n\t\t\tlog.debug(\"EVALUATE Precondition for \" + paramName);\n\t\t\tprecond = preparePerlExpression(precond, paramName, vdef);\n\t\t\tString perlPrecond = evaluatePerlStatement(precond);\n\t\t\tif (!Boolean.valueOf(perlPrecond))\n\t\t\t{\n\t\t\t\tlog.debug(\"\\tPrecond = false\");\n\t\t\t\treturn false;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tlog.debug(\"\\tPrecond = true\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private void isFiltersSatisfied() {\n Filter[] filters = rule.getFilters();\n for (int i = 0; i < filters.length; i++) {\n linkedList.add(filters[i]);\n }\n recursiveFiltering(linkedList.peek().filter.split(\":\"),null);\n }", "boolean hasDdzConfirmRule();", "public boolean requiresChecking(ReferencedURL rurl)\n\t{\n\t\t// DO NOT CHANGE THIS METHOD without also changing the other methods in\n\t\t// this policy class, and also the documented policy in the class\n\t\t// comments.\n\n\t\tfinal long lastCheck = rurl.getLastChecked().getTime();\n\n\t\tif( lastCheck < oneMonthAgo() )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif( !rurl.isSuccess() && rurl.getTries() < triesUntilDisabled )\n\t\t{\n\t\t\tif( lastCheck < oneDayAgo() )\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "@Override\r\n public final boolean isUseless() {\r\n int i;\r\n Rule[] r;\r\n\r\n r = this.m_rules;\r\n for (i = (r.length - 1); i >= 0; i--) {\r\n if (!(r[i].isUseless()))\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public boolean hasRulePlacers() { return !rulePlacers.isEmpty(); }", "public void setWhitelistEnabled(Boolean whitelistEnabled) {\n this.whitelistEnabled = whitelistEnabled;\n }", "public boolean isSatisfied() {\r\n\t\tif (isParked() == true || wasParked() == true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean shouldApply() {\n return nextRandomInt() >= unappliedJobCutoff;\n }", "boolean hasExplicitLac();", "@Override\r\n\tpublic boolean CheckConditions() {\n\t\treturn true;\r\n\t}", "public boolean isLever() {\n return this.type == Type.LEVER;\n }", "private boolean constraintChecker(Norm norm1, Norm norm2) {\n\t\tif (norm1.getActivationConstraint() == null || norm1.getDeactivationConstraint() == null ||\n\t\t\tnorm2.getActivationConstraint() == null || norm2.getDeactivationConstraint() == null) {\n\t\t\t\n\t\t\tnorm1.setActivationConstraint(null);\n\t\t\tnorm2.setActivationConstraint(null);\n\t\t\tnorm1.setDeactivationConstraint(null);\n\t\t\tnorm2.setDeactivationConstraint(null);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tConstraintType na1 = norm1.getActivationConstraint().getConstraintType();\n\t\tConstraintType nd1 = norm1.getDeactivationConstraint().getConstraintType();\n\t\t\n\t\tConstraintType na2 = norm2.getActivationConstraint().getConstraintType();\n\t\tConstraintType nd2 = norm2.getDeactivationConstraint().getConstraintType();\n\t\t\n\t\t//it is necessary only 3 tests\n\t\tif (!na1.equals(nd1) || !na2.equals(nd2) || !na1.equals(na2)) {\n\t\t\tnorm1.setActivationConstraint(null);\n\t\t\tnorm2.setActivationConstraint(null);\n\t\t\tnorm1.setDeactivationConstraint(null);\n\t\t\tnorm2.setDeactivationConstraint(null);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// If the activation conditions are actions\n\t\tif (norm1.getActivationConstraint().getConstraintType().equals(ConstraintType.ACTIONTYPE)\n\t\t\t\t&& norm1.getActivationConstraint().getConstraintType().equals(ConstraintType.ACTIONTYPE)) {\n\n\t\t\t//todo...o tratamento vai ser realizado no futuro, caso necessário\n\t\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t//\n\t\t//at this moment the constrainttype are both DATETYPE, so it is not necessary more comparisons\n\t\t//\n\t\t\n\t\tDateTime d1Begin = ((ConstraintDate) norm1.getActivationConstraint()).getDate();\n\t\tDateTime d1End = ((ConstraintDate) norm1.getDeactivationConstraint()).getDate();\n\t\tDateTime d2Begin = ((ConstraintDate) norm2.getActivationConstraint()).getDate();\n\t\tDateTime d2End = ((ConstraintDate) norm2.getDeactivationConstraint()).getDate();\n\t\t\n\t\tboolean r = this.compareDateIntervals(d1Begin, d1End, d2Begin, d2End);\n\t\treturn r;\n\t}", "private Boolean precond() {\r\n\t\tcalculoCantidadSacar(grupoPuestosController.getIdConcursoPuestoAgr());\r\n\t\t/**\r\n\t\t * fin incidencia 0001649\r\n\t\t */\r\n\t\tBoolean respuesta = validacionesIteracion();\r\n\t\treturn respuesta;\r\n\t}", "private void checkEnabled() {\n }", "public boolean validate() {\n\n\t\tNoLista p = lista.validate();\n\t\tif(p==null){\n\t\t\treturn true; \n\t\t}else {\n\t\t\twhile(p!=null) {\n\t\t\t\tfor (int i = 0; i < ignore.length; i++) {\n\t\t\t\t\tif(ignore[i].equals(p.getInfo())) {\n\t\t\t\t\t\tretirar(p.getInfo());\n\t\t\t\t\t\taddList(p.getInfo());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tp=p.getProximo();\n\t\t\t}\n\t\t\t\n\t\t\tif(this.lista.getPrimeiro()==null) {\n\t\t\t\treturn true;\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic boolean isCovered() {\n\t\treturn (falseCount > 0) && (trueCount > 0);\n\t}", "protected boolean checkYazy(ReturnValue returnValue) {\n\t\tboolean localBool = false;\n\t\tint localInt = intList.get(0);\n\t\tfor (int i = 1; i < 5; i++) {\n\t\t\tif (localInt != intList.get(i)) {\n\t\t\t\treturnValue.setValue(localBool, 0, Box.YATZY);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tlocalBool = true;\n\t\treturnValue.setValue(localBool, 50, Box.YATZY);\n\t\treturn true;\n\t}", "public boolean isPreFreeze() {\r\n return preFreezeCheck;\r\n }", "public boolean has_unprocessed_rules();", "public final boolean synpred1_PrePro() {\n\t\tstate.backtracking++;\n\t\tint start = input.mark();\n\t\ttry {\n\t\t\tsynpred1_PrePro_fragment(); // can never throw exception\n\t\t} catch (RecognitionException re) {\n\t\t\tSystem.err.println(\"impossible: \"+re);\n\t\t}\n\t\tboolean success = !state.failed;\n\t\tinput.rewind(start);\n\t\tstate.backtracking--;\n\t\tstate.failed=false;\n\t\treturn success;\n\t}", "private boolean checkVisualCondition(final String[] condArray) throws Exception {\r\n\t\t//boolean isDisplay = true ; // remarked by Leo YEUNG for testing\r\n\t\tboolean isDisplay = false ;\r\n\t\tint CondPassCount = 0; //Use to count the number of Boolean expressions passed\t\t\t\t\t\t \r\n\t\tint CondAmount = condArray.length;//Total number of Boolean expressions in this Node\r\n\t\t//Loop for all Boolean expressions in one conditon\t\t\t \r\n\t\tfor (int k=0; k<CondAmount; k++) {\t\t \t\t\t\t\t\r\n\t\t\tif (CondPassCount<k) break;\t //Exit the following condition check while one of the Boolean expresssion is failure which save the loop time\r\n\t\t\t//Loop for sort out different Attribute\r\n\t\t\tfor (int m=0; m<conAttName.length; m++) {\r\n\t\t\t\tint previousCondPassCount = CondPassCount;//a value use to check the Boolean expresssion is failure\r\n\t\t\t\tif (condArray[k].toUpperCase().startsWith(conAttName[m].toUpperCase())){ \r\n\t\t\t\t\tfinal String tempConAttType = conAttType[m]; // ldap attribute type\r\n\t\t\t\t\tfinal String tempValue = condArray[k].substring(conAttName[m].length());\r\n\t\t\t\t\tfinal int tempColonIndex = condArray[k].indexOf(\"\\\"\");\r\n\t\t\t\t\tfinal String attName = condArray[k].substring(0,conAttName[m].length()); \t \t\t\t \t\t \t\t\t\t //Attribute Name\r\n\t\t\t\t\tfinal String attCond = condArray[k].substring(conAttName[m].length(),tempColonIndex); //Attribute condition syntax\r\n\t\t\t\t\tfinal String attVal = condArray[k].substring(tempColonIndex+1,condArray[k].lastIndexOf(\"\\\"\"));//Attribute Value\r\n\t\t\t\t\tint k2 = k+1;\r\n\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" checking for \" + condArray[k]+\" Start\");\r\n\t\t\t\t\t//Condition Greater Than\r\n\t\t\t\t\tif (attCond.equalsIgnoreCase(Constant.gt)){ \r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null){\r\n\t\t\t\t\t\t\tint intCrtUserInfo;\r\n\t\t\t\t\t\t\tint intAttVal;\r\n\t\t\t\t\t\t\tString strCrtUserInfo;\r\n\t\t\t\t\t\t\tString strAttVal;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (tempConAttType.equalsIgnoreCase(\"cis\")){\r\n\t\t\t\t\t\t\t\tstrCrtUserInfo = (String)ht.get(attName.toUpperCase());\r\n\t\t\t\t\t\t\t\tstrAttVal = attVal;\r\n\t\t\t\t\t\t\t\tif (strCrtUserInfo.compareTo(strAttVal) > 0 ){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t\t} else if(tempConAttType.equalsIgnoreCase(\"int\")){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tintCrtUserInfo = Integer.parseInt((String)ht.get(attName.toUpperCase()));\r\n\t\t\t\t\t\t\t\t\tintAttVal = Integer.parseInt(attVal);\r\n\t\t\t\t\t\t\t\t}catch (NumberFormatException e){\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"checkVisualCondition:\" + e.getMessage(), e);\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Invalid attribute value: The attribute value is not numeric, the <Greater Than> condition cannot apply.\");\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (intCrtUserInfo > intAttVal){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Less Than\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.lt)){\r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tint intCrtUserInfo;\r\n\t\t\t\t\t\t\tint intAttVal;\r\n\t\t\t\t\t\t\tString strCrtUserInfo;\r\n\t\t\t\t\t\t\tString strAttVal;\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n\t\t\t\t\t\t\tif (tempConAttType.equalsIgnoreCase(\"cis\")){\r\n\t\t\t\t\t\t\t\tstrCrtUserInfo = (String)ht.get(attName.toUpperCase());\r\n\t\t\t\t\t\t\t\tstrAttVal = attVal;\r\n\t\t\t\t\t\t\t\tif (strCrtUserInfo.compareTo(strAttVal) < 0 ){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\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\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else if(tempConAttType.equalsIgnoreCase(\"int\")){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tintCrtUserInfo = Integer.parseInt((String)ht.get(attName.toUpperCase()));\r\n\t\t\t\t\t\t\t\t\tintAttVal = Integer.parseInt(attVal);\r\n\t\t\t\t\t\t\t\t}catch (NumberFormatException e){\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"checkVisualCondition:\" + e.getMessage(), e);\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Invalid attribute value: The attribute value is not numeric, the <Less than> condition cannot apply.\");\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (intCrtUserInfo < intAttVal){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Greater and Equal\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.ge)){ \r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tint intCrtUserInfo;\r\n\t\t\t\t\t\t\tint intAttVal;\r\n\t\t\t\t\t\t\tString strCrtUserInfo;\r\n\t\t\t\t\t\t\tString strAttVal;\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n\t\t\t\t\t\t\tif (tempConAttType.equalsIgnoreCase(\"cis\")){\r\n\t\t\t\t\t\t\t\tstrCrtUserInfo = (String)ht.get(attName.toUpperCase());\r\n\t\t\t\t\t\t\t\tstrAttVal = attVal;\r\n\t\t\t\t\t\t\t\tif (strCrtUserInfo.compareTo(strAttVal) >= 0 ){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t\t}else if(tempConAttType.equalsIgnoreCase(\"int\")){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tintCrtUserInfo = Integer.parseInt((String)ht.get(attName.toUpperCase()));\r\n\t\t\t\t\t\t\t\t\tintAttVal = Integer.parseInt(attVal);\r\n\t\t\t\t\t\t\t\t} catch (NumberFormatException e){\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"checkVisualCondition:\" + e.getMessage(), e);\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Invalid attribute value: The attribute value is not numeric, the <Greater and Equal to> condition cannot apply.\");\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (intCrtUserInfo >= intAttVal){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Less and Equal\t\t\t\t\t\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.le)){ \r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tint intCrtUserInfo;\r\n\t\t\t\t\t\t\tint intAttVal;\r\n\t\t\t\t\t\t\tString strCrtUserInfo;\r\n\t\t\t\t\t\t\tString strAttVal;\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n\t\t\t\t\t\t\tif (tempConAttType.equalsIgnoreCase(\"cis\")){\r\n\t\t\t\t\t\t\t\tstrCrtUserInfo = (String)ht.get(attName.toUpperCase());\r\n\t\t\t\t\t\t\t\tstrAttVal = attVal;\r\n\t\t\t\t\t\t\t\tif (strCrtUserInfo.compareTo(strAttVal) <= 0 ){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t\t}else if(tempConAttType.equalsIgnoreCase(\"int\")){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tintCrtUserInfo = Integer.parseInt((String)ht.get(attName.toUpperCase()));\r\n\t\t\t\t\t\t\t\t\tintAttVal = Integer.parseInt(attVal);\r\n\t\t\t\t\t\t\t\t}catch (NumberFormatException e){\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"checkVisualCondition::\" + e.getMessage(), e);\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Invalid attribute value: The attribute value is not numeric, the <Less and Equal to> condition cannot apply.\");\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (intCrtUserInfo <= intAttVal){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Equal\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.equal)){ //Equal\r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tint intCrtUserInfo;\r\n\t\t\t\t\t\t\tint intAttVal;\r\n\t\t\t\t\t\t\tString strCrtUserInfo;\r\n\t\t\t\t\t\t\tString strAttVal;\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n\t\t\t\t\t\t\tif (tempConAttType.equalsIgnoreCase(\"cis\")){\r\n\t\t\t\t\t\t\t\tstrCrtUserInfo = (String)ht.get(attName.toUpperCase());\r\n\t\t\t\t\t\t\t\tstrAttVal = attVal;\r\n\t\t\t\t\t\t\t\t\tif (strCrtUserInfo.equalsIgnoreCase(strAttVal)){\r\n\t\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t\t} else if(tempConAttType.equalsIgnoreCase(\"int\")){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tintCrtUserInfo = Integer.parseInt((String)ht.get(attName.toUpperCase()));\r\n\t\t\t\t\t\t\t\t\tintAttVal = Integer.parseInt(attVal);\r\n\t\t\t\t\t\t\t\t}catch (NumberFormatException e){\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"checkVisualCondition:\" + e.getMessage(), e);\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Invalid attribute value: The attribute value is not numeric, the <equal to> condition cannot apply.\");\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (intCrtUserInfo == intAttVal){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\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}\r\n\t\t\t\t\t//Condition Not Equal to\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.not_equal)){\r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tint intCrtUserInfo;\r\n\t\t\t\t\t\t\tint intAttVal;\r\n\t\t\t\t\t\t\tString strCrtUserInfo;\r\n\t\t\t\t\t\t\tString strAttVal;\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n\t\t\t\t\t\t\tif (tempConAttType.equalsIgnoreCase(\"cis\")){\r\n\t\t\t\t\t\t\t\tstrCrtUserInfo = (String)ht.get(attName.toUpperCase());\r\n\t\t\t\t\t\t\t\tstrAttVal = attVal;\r\n\t\t\t\t\t\t\t\tif (!strCrtUserInfo.equalsIgnoreCase(strAttVal)){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t\t} else if(tempConAttType.equalsIgnoreCase(\"int\")){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tintCrtUserInfo = Integer.parseInt((String)ht.get(attName.toUpperCase()));\r\n\t\t\t\t\t\t\t\t\tintAttVal = Integer.parseInt(attVal);\r\n\t\t\t\t\t\t\t\t}catch (NumberFormatException e){\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"checkVisualCondition:\" + e.getMessage(), e);\r\n\t\t\t\t\t\t\t\t\tlogger.error(\"Invalid attribute value: The attribute value is not numeric, the <Not equal to> condition cannot apply.\");\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (intCrtUserInfo != intAttVal){\r\n\t\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Contain\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.contain)){ \r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tif (((String)ht.get(attName.toUpperCase())).indexOf(attVal)!=-1){\r\n\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Start with\t \t \r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.start_with)){\r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tif (((String)ht.get(attName.toUpperCase())).startsWith(attVal)){\r\n\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition\tNot contain\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.not_contain)){ \r\n\t\t\t\t\t\tif (ht.get(attName.toUpperCase()) != null) {\r\n\t\t\t\t\t\t\tif (((String)ht.get(attName.toUpperCase())).indexOf(attVal)==-1){\r\n\t\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Condition Not start with\t\r\n\t\t\t\t\t} else if (attCond.equalsIgnoreCase(Constant.not_start_with)){\r\n\t\t\t\t\t\tif (!((String)ht.get(attName.toUpperCase())).startsWith(attVal)){\r\n\t\t\t\t\t\t\tCondPassCount += 1;\r\n\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" OK: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlogger.debug(\"Boolean expression \" + k2 + \" failed: \" + attName + \"- \" + (String)ht.get(attName) + attCond + attVal + \" failed!!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//Finally, Syntax Error\t \r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlogger.error(\"checkVisualCondition:Invalid condition syntax found: \" + attCond);\r\n\t\t\t\t\t} \r\n\t\t\t\t}\t\r\n\t\t\t\tif (previousCondPassCount<CondPassCount) break; // condition passed. Exit the for loop\r\n\t\t\t}\r\n\t\t\tif (CondPassCount == CondAmount) isDisplay = true;\r\n\t\t}\r\n\t\t//logger.debug(\"checkVistualCondition: isDisplay = \" + isDisplay);\r\n\t\t//logger.debug(\"checkVistualCondition: CondPassCount = \" + CondPassCount);\r\n\t\t//logger.debug(\"checkVistualCondition: CondAmount = \" + CondAmount);\r\n\t\treturn isDisplay;\r\n\t}", "public boolean checkAndIncrement() {\n\t\tsynchronized(lock) {\n\t\t\tif (passes == 0) {\n\t\t\t\tpasses++;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tpasses = 0;\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasConditionList();", "public boolean isPreTrusted(){\n\t\treturn (this.pre_trusted);\n\t}", "public EtatDuJeu verifierCondition() {\r\n for (Objet obj : this.objets) {\r\n if (!this.vivant.possede(obj)) {\r\n return EtatDuJeu.ENCOURS;\r\n }\r\n }\r\n return this.getEtatConditionVerifiee();\r\n }", "public boolean isPreparer() {\n\t\treturn getStatut().equals(StatusBonPreparation.PREPARER);\n\t}", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "protected boolean isValid()\r\n {\r\n \treturn true;\r\n }", "public boolean isNonLivrer() {\n\t\treturn getStatut().equals(StatusBonPreparation.NON_LIVRER);\n\t}", "public boolean isValid(){\n\t\treturn this.arm.isValid();\n\t}", "Boolean getPartiallyCorrect();", "public boolean whiteCheckmate() {\n\t\treturn false;\n\t}", "public boolean isCanBypassIntermediate() {\n return getFlow().isCanBypassIntermediate();\n }", "private boolean noImpedingPredecessors(\r\n\t\t\tfinal List<Rule> sequence) {\r\n\t\t\r\n\t\tboolean result = true;\r\n\t\tfor (int i=1; i<sequence.size(); i++) {\r\n\t\t\tRule ri = sequence.get(i);\r\n\t\t\tboolean localResult = true;\r\n\t\t\tfinal Pair<Boolean, List<String>> \r\n\t\t\truleRes = this.ruleSequence.getRuleResult(i, ri.getName(), ApplicabilityConstants.NO_IMPEDING_PREDECESSORS);\r\n\t\t\tif (ruleRes != null) {\r\n\t\t\t\tlocalResult = ruleRes.first.booleanValue();\r\n\t\t\t} \r\n\t\t\telse {\r\n\t\t\t\tfor (int j=0; j<i; j++) {\r\n\t\t\t\t\tRule rj = sequence.get(j);\r\n\t\t\t\t\tfinal SimpleExcludePair excludePair = makeExcludePair();\r\n\t\t\t\t\tif(!asymParallelIndependentByCPA(excludePair, rj, j, ri, i)) {\t\t\t\t\t\r\n\t\t\t\t\t\tlocalResult = false;\r\n\t\t\t\t\t\tsetRuleResult(i, ri.getName(), false, ApplicabilityConstants.NO_IMPEDING_PREDECESSORS, rj.getName());\t\r\n\t\t\t\t\t\tbreak; // evntl. weiter machen!\r\n\t\t\t\t\t} \r\n\t\t\t\t\texcludePair.dispose();\r\n\t\t\t\t}\r\n\t\t\t\tif (localResult) {\r\n\t\t\t\t\tsetRuleResult(i, ri.getName(), true, ApplicabilityConstants.NO_IMPEDING_PREDECESSORS, \"\");\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\t// rewrite result only if localResult is FALSE\r\n\t\t\tif (!localResult) {\r\n\t\t\t\tresult = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!result) {\r\n\t\t\tsetApplicabilityResult(false, ApplicabilityConstants.NO_IMPEDING_PREDECESSORS);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void check_always_true_condition(boolean on){\r\n this.e_always_true_condition = on;\r\n }", "public void changeIsParalysed()\r\n\t{\r\n\t\tisParalysed = !isParalysed;\r\n\t}", "@Override\n protected Boolean isValidBuild() {\n return frontendFieldToBackendField.entrySet().stream().allMatch(entry -> {\n return (entry.getValue().getWorker() == null && !entry.getValue().getHasDome()) &&\n ((entry.getValue().getBlocks() == entry.getKey().getBlocks() - 1) && entry.getKey().getBlocks() <= 3 && !entry.getKey().getHasDome() ||\n (entry.getValue().getBlocks() <= 3 && entry.getKey().getHasDome() == true));\n });\n }", "private boolean purelySequentialDependent(\r\n\t\t\tfinal Rule r1, \r\n\t\t\tint indx_r1,\r\n\t\t\tfinal Rule r2,\r\n\t\t\tint indx_r2,\r\n\t\t\tGraph g) {\n\t\t\r\n\t\tfinal Match embedding = BaseFactory.theFactory().createMatch(r2, r1.getRight());\t\t\r\n\t\tembedding.setCompletionStrategy(this.strategy, true);\r\n\t\tboolean result = false;\r\n\t\twhile (embedding.nextCompletionWithConstantsChecking() && !result) {\r\n\t\t\tEnumeration<GraphObject> codom = embedding.getCodomain();\t\t\t\t\t\t\r\n\t\t\t// exist l21 : L2 -> R1\r\n\t\t\twhile (codom.hasMoreElements()) {\r\n\t\t\t\tGraphObject obj = codom.nextElement();\r\n\t\t\t\t// rule r1 produce at least one object which is used in LHS of r2\r\n\t\t\t\tif (!r1.getInverseImage(obj).hasMoreElements()) {\r\n\t\t\t\t\tresult = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (this.ruleSequence.isObjFlowActive()) {\r\n\t\t\t\t\t\tfinal ObjectFlow objFlow = this.ruleSequence.getObjFlowForRules(r1, indx_r1, r2, indx_r2);\r\n\t\t\t\t\t\tif (objFlow != null && !objFlow.isEmpty()) \r\n\t\t\t\t\t\t\tresult = pureEnablingAlongObjectFlow(embedding, objFlow);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// add match to matchSequence\r\n\t\t\t\t\tif (result)\r\n\t\t\t\t\t\tthis.ruleSequence.getMatchSequence().addTotalPureEnablingSourceMatch(r2, r1, embedding, indx_r2, indx_r1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (result) {\r\n\t\t\t\tboolean attrCondUsesIP = attrConditionUsesInputParameterRight(r2, r1, embedding);\r\n\t\t\t\t\t\r\n\t\t\t\tif (attrCondUsesIP) {\r\n\t\t\t\t\tsetRuleResult(indx_r2, r2.getName(), false, ApplicabilityConstants.PURE_ENABLING_PREDECESSOR, r1.getName());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetRuleResult(indx_r2, r2.getName(), true, ApplicabilityConstants.PURE_ENABLING_PREDECESSOR, r1.getName());\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// TODO: apply r1, then r2 along the comatch of r2 to check NACs of r2\r\n//\t\t\tresult = isPurelyEnabledRuleApplicable(r1, r2, embedding, g);\r\n//\t\t\tif (result) {\r\n//\t\t\t\t// to test : add match to matchSequence\r\n//\t\t\t\tthis.ruleSequence.getMatchSequence().addTotalPureEnablingSourceOfMatch(r2, r1, embedding, indx_r2, indx_r1);\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tembedding.dispose();\r\n\t\tBaseFactory.theFactory().unsetAllTransientAttrValuesOfRule(r1);\r\n//\t\tr1.getRight().setNotificationRequired(true);\r\n\t\t\r\n\t\treturn result;\r\n\t}", "Boolean getCompletelyCorrect();", "public boolean mustBeInlined() {\n // TODO(118734615): Include SINGLE_CALLER and DUAL_CALLER here as well?\n return this == FORCE || this == ALWAYS;\n }", "public boolean isValid(){\n\t\treturn true;\n\t}", "public boolean isWhitelisted ( ) {\n\t\treturn extract ( handle -> handle.isWhitelisted ( ) );\n\t}", "public Boolean satisfies(KB kb) {\n\t\t//I flipped the return statements in this, they looked wrong before?\n\t\tCollection<Sentence> sentences = kb.sentences();\n\t\t\n\t\tfor(Sentence s: sentences) {\n\t\t\tif(!(s.isSatisfiedBy(this))) {\n\t\t\t\treturn Boolean.FALSE;\n\t\t\t}\n\n\t\t}\n\t\treturn Boolean.TRUE;\n\t}", "boolean hasOutputPartialsBeforeLanguageDecision();", "final public boolean requiresProtection()\r\n {\r\n return requires_PRO;\r\n }", "boolean isAccepting();", "boolean checkVerification();", "private boolean partialEnablingPredecessor(\r\n\t\t\tfinal Rule ri,\r\n\t\t\tfinal int i,\r\n\t\t\tfinal List<Rule> sequence, \r\n\t\t\tfinal Graph g) {\r\n//\t\tSystem.out.println(\"\\n=== >>> ApplicabilityChecker.partialEnablingPredecessor ... of \"+ri.getName());\r\n\t\t\r\n\t\tboolean result = false;\r\n\t\t\r\n\t\tfor (int j=i-1; j>=0; j--) {\r\n\t\t\tRule rj = sequence.get(j);\r\n\t\t\tthis.info = rj.getName();\t\r\n\t\t\t\t\r\n\t\t\tPair<Boolean, List<String>> pair = this.ruleSequence.getRuleResult(j, rj.getName(), ApplicabilityConstants.PREDECESSOR_NOT_NEEDED);\r\n\t\t\tif (pair == null)\r\n\t\t\t\tpair = this.ruleSequence.getRuleResult(j, rj.getName(), ApplicabilityConstants.INITIALIZATION);\r\n\t\t\t\r\n\t\t\tif (pair != null && pair.first.booleanValue()) {\r\n//\t\t\t\tSystem.out.println(\"=== >>> ApplicabilityChecker.partialEnablingPredecessor :: applicable: \"+rj.getName());\r\n\t\t\t\t// rule rj is applicable to graph g\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t// get new list of concurrent rules of the current rule ri\r\n\t\t\t\tList<List<ConcurrentRule>> concurRuleLists = this.ruleSequence.getListsOfConcurrentRules(ri, i);\r\n\t\t\t\tif (concurRuleLists == null) {\r\n\t\t\t\t\tconcurRuleLists = new Vector<List<ConcurrentRule>> ();\r\n\t\t\t\t\tthis.ruleSequence.putListsOfConcurrentRules(ri, i, concurRuleLists);\r\n\t\t\t\t}\r\n\t\t\t\t// make concurrent rule(s) due to dependency pair overlapping\r\n\t\t\t\tList<ConcurrentRule> list = this.makeJointlyConcurrentRule(rj, j, ri, i);\r\n\t\t\t\t\r\n\t\t \t\tif (list != null && !list.isEmpty()) {\r\n\t\t \t\t\tconcurRuleLists.add(list);\r\n\t\t \t\t\tint d = 1;\r\n\t\t \t\t\t\r\n\t\t \t\t\t// set match of concurrent rule, (check due to ObjectFlow?)\r\n\t\t\t\t\tfinal Hashtable<GraphObject, GraphObject> \r\n\t\t\t\t\trjMatch = this.ruleSequence.getMatchSequence().getDirectMatch(j, rj);\r\n\t\t\t\t\tif (rjMatch != null) {\t\t\t\t\t\t\r\n\t\t \t\t\t\tfor (int c=0; c<list.size(); c++) {\r\n\t\t \t\t\t\t\tfinal ConcurrentRule cr = list.get(c);\r\n\t\t \t\t\t\t\tif (!rjMatch.isEmpty() &&\r\n\t\t \t\t\t\t\t\t\t!cr.forwardMatchMappingOfFirstSourceRule(rjMatch, this.ruleSequence.getGraph())) {\r\n\t\t \t\t\t\t\t\tlist.remove(c);\r\n\t\t \t\t\t\t\t\tc--;\r\n\t\t \t\t\t\t\t} \r\n\t\t \t\t\t\t}\r\n\t\t \t\t\t\tfor (int k = 0; k<list.size(); k++) {\r\n\t\t \t\t\t\t\tConcurrentRule cr = list.get(k);\t\t\t\t\r\n\t\t \t\t\t\t\tif (isConcurrentRuleApplicable(i, ri, \r\n\t\t \t\t\t\t\t\t\tthis.ruleSequence.getRules(), g, \r\n\t\t \t\t\t\t\t\t\tcr, d, ApplicabilityConstants.PARTIAL_ENABLING_PREDECESSOR)) {\r\n\t\t \t\t\t\t\t\tresult = true;\r\n\t\t \t\t\t\t\t\tSystem.out.println(\"=== >>> ApplicabilityChecker.partialEnablingPredecessor: of rule: \"+ri.getName()+\" is rule: \"+rj.getName());\r\n\t\t \t\t\t\t\t\tbreak;\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t}\t\t\t\r\n\t\t \t\t\t\tif (result)\r\n\t\t \t\t\t\t\tbreak;\t\t \t\t\t\t\r\n\t\t \t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (result) {\r\n\t\t\tsetRuleResult(i, ri.getName(), true, ApplicabilityConstants.PARTIAL_ENABLING_PREDECESSOR, this.info);\r\n//\t\t\tsetRuleResult(i, ri.getName(), true, ApplicabilityConstants.DIRECT_ENABLING_PREDECESSOR, \"\");\r\n\t\t\tsetRuleResult(i, ri.getName(), false, ApplicabilityConstants.NO_ENABLING_PREDECESSOR, \"(partial)\");\t\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public boolean affordRoad() {\n \t\treturn (FREE_BUILD || roads.size() < MAX_ROADS\n \t\t\t\t&& getResources(Type.BRICK) >= 1\n \t\t\t\t&& getResources(Type.LUMBER) >= 1);\n \t}", "public boolean whitelist(Range<Integer> range) {\n meta.add(range);\n return isWhitelisted(range);\n }", "private boolean consistencyCheckC1Constraints(double[][] xResults) {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tdouble outxValue = GRBSolverUtils.getOutValue(i, xResults, mExplicitMDP);\n\t\t\tdouble inxValue = GRBSolverUtils.getInValue(i, xResults, mExplicitMDP);\n\t\t\tboolean satisfied = GRBSolverUtils.approximatelyEqual(outxValue, inxValue,\n\t\t\t\t\tmSettings.getFeasibilityTolerance());\n\n\t\t\tif (!satisfied) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean carryingPassengers() {\n\t\treturn carryingPassengers;\n\t}", "public boolean isValid(){\r\n\t\t\r\n\t\t// TODO\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public boolean preaction() {\n\t\tboolean p = true;\r\n\t\tif(!model.setSCVBuilding(2*preactionTime+duration)) { // adding time before and after\r\n\t\t\tp = false;\r\n\t\t}\r\n\t\tif(p) {\r\n\t\t\t//System.out.println(model.printTime() + \" <SCActionBuilding> Preaction\");\r\n\t\t\tpreactionComplete=true;\r\n\t\t}\r\n\t\treturn p;\r\n\t\t\r\n\t}", "public boolean isSetLegalList() {\n return this.legalList != null;\n }", "public abstract boolean isSatisfied();", "public boolean setDangerous() {\r\n\t\tif(!isDangerous && isCovered) {\r\n\t\t\tisDangerous=true;\r\n\t\t\t\r\n\t\t\tthis.setChanged();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tthis.clearChanged();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean isSatisfiable(ConditionContext context);", "private boolean normsAppliedToAgentContext(EnvironmentAgentContext agContext) {\n\t\tNormsApplicableToAgentContext normsApplicable = \n\t\t\t\tthis.normReasoner.getNormsApplicable(agContext.getDescription());\n\n\t\tfor(Norm n : normsApplicable.getApplicableNorms()) {\n\t\t\tNetworkNodeState nState = this.normativeNetwork.getState(n);\n\t\t\tboolean isRepresented = this.normativeNetwork.isRepresented(n);\n\t\t\tboolean isHibernated = nState == NetworkNodeState.Candidate;\n\t\t\tboolean isSubstituted = nState == NetworkNodeState.Substituted;\n\t\t\t\n\t\t\tif(isRepresented || isHibernated || isSubstituted) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean livre() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean canApply() {\n\t\tif ((this.alignment.getFlowA().getName().toLowerCase().contains(\"basic flow\") \n\t\t\t&& this.alignment.getFlowB().getName().toLowerCase().contains(\"basic flow\"))\n\t\t\t&& (this.alignment.getSimilarBlocksFromA().size()>1\n\t\t\t&& this.alignment.getSimilarBlocksFromB().size()>1)){\n\t\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean canEnlist() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n || uiStateManager.getState().equals(GameUIState.STANDBY);\n }", "private boolean alphas() {\r\n return OPT(GO() && alpha() && alphas());\r\n }", "public boolean strictMatches() { return strict_matches_cbmi.isSelected(); }", "@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}", "public boolean isValid() {\n // TODO: Question 2.2.\n \n return false;\n }", "public boolean C_enterTheZone(ListOfParameterLists parameterLists){\n //if(isEnter == true){\n if(debug)\n System.out.println(\"Condition from Rule7 :: is true\");\n\n\n return true;\n\n // }\n // else\n //return false;\n\n // Future work\n // Put the condition code here, eg. if the track is friendly, we\n // don't need to alert the analyst.\n\n }", "public boolean reducible() {\n\treturn \n\t operator . equals( \"\\\\\") &&\n\t (argument.reducible() || argument instanceof BoolConstant);\n }", "public boolean checkstability()\r\n\t\t{\r\n\t\t\tArrayList<String> previouselement = null;\r\n\t\t\t\r\n\t\t\tSystem.out.println(womenmatchinlist);\r\n\t\t\t\r\n\t\t\tfor(int l=0;l<womenmatchinlist.size();l++)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tString matchedman = menmatchinglist.get(l);\r\n\t\t\t\t\r\n\t\t\t\tString matchedwoman = womenmatchinlist.get(l);\r\n\t\t\t\t\r\n\t\t\t\tint matchedwomanindex = women.indexOf(matchedwoman);\r\n\t\t\t\t\r\n\t\t\t\tfor(int z=0;z<women.size();z++)\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\tif(womenpreflist[matchedwomanindex][z].equals(matchedman))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(z>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor(int s=0;s<=z;s++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tpreviouselement = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tpreviouselement.add(womenpreflist[matchedwomanindex][s]);\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{\r\n\t\t\t\t\t\t\treturn true;\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\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(previouselement.isEmpty()==false)\r\n\t\t\t\t{\r\n\r\n\t\t\t\tfor(int t=0;t<previouselement.size();t++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tString higherpreferman = previouselement.get(t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// find current partner of higherpreferman\r\n\t\t\t\t\t\r\n\t\t\t\t\tint higherprefmenindex = menmatchinglist.indexOf(higherpreferman);\r\n\t\t\t\t\t\r\n\t\t\t\t\tString currentpartnerofhigher = womenmatchinlist.get(higherprefmenindex);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tint tempindex = men.indexOf(higherpreferman);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<numberofwomen;i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// if new partner comes before current partner then return true\r\n\t\t\t\t\t\tif(menpreflist[tempindex][i].equals(currentpartnerofhigher))\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// otherwise return false\r\n\t\t\t\t\t\tif(womenpreflist[tempindex][i].equals(matchedwoman))\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\t}", "boolean isForwardPredicted()\n {\n return ((mbType & FORWARD) != 0);\n }", "private void canRepair(boolean b) {\n\t\t\n\t}", "public boolean hasPassed()\n {\n return status == Status.PASSED || status == Status.SKIPPED;\n }", "boolean isSetProbables();", "public boolean affordCard() {\n \t\treturn (FREE_BUILD || getResources(Type.WOOL) >= 1\n \t\t\t\t&& getResources(Type.GRAIN) >= 1 && getResources(Type.ORE) >= 1);\n \t}", "public boolean isValid()\r\n {\r\n //Override this method in MediaItem object\r\n return getSemanticObject().getBooleanProperty(swb_valid,false);\r\n }", "public boolean isApplicable(DevelopmentCard card) {\n\t\treturn (this.familyMember.getActionValue()\n\t\t\t\t+ this.getPlayer().getBonuses().getActivationVariation(card.getCardType())\n\t\t\t\t+ paidServants >= card.getActivationCost());\n\t}", "protected boolean isValid() {\n \t\treturn valid;\n \t}", "boolean exactMatch(FlowRule rule);", "boolean isSetComplianceCheckResult();", "public boolean isBusted() {\n\t\tif (hand.checkHandValue() > 21) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected boolean applyRuleTransaction(StateRuleTransaction tr) {\t\n\t\tString ruleCode = ((StateRuleTransaction)tr).code;\n\t\tSimpleRule rule = new SimpleRule(ruleCode);\n\t\t\n\t\tboolean isConditionValid = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(rule.account_condition)){\n\t\t\t\tisConditionValid = rule.validateOperand(account.getData()); \n\t\t\t}\n\t\t}\n\n\t\tif (isConditionValid) {\n\t\t\tfor(AccountInterface account: accounts) {\n\t\t\t\tif (account.getAddress().equals(rule.account_effect)){\n\t\t\t\t\taccount.setAssetType(rule.value_effect);\n\t\t\t\t\taccount.increaseNonce();\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\t\n\t}", "public boolean isGranted(){\n\n// if (BallotBoxState.Granted.equals(getBallotBoxState()) || this.quorum.get() <= 0) {\n// setBallotBoxState(BallotBoxState.Granted);\n// return true;\n// }\n// return false;\n\n return this.quorum.get() <= 0;\n }", "public boolean isPrivacyModelFulfilled() {\n return privacyModelFulfilled;\n }", "public final boolean bw() {\n return this.ad != null;\n }", "public abstract boolean isPassable();", "@NotNull\n boolean isTrustedWholeLand();", "protected boolean getStravaCheckToken()\n {\n return true;\n }" ]
[ "0.5440778", "0.53602564", "0.5301816", "0.52661127", "0.5232236", "0.52316236", "0.52057934", "0.52000445", "0.5166974", "0.5155233", "0.51438504", "0.50978947", "0.5095857", "0.50958395", "0.508209", "0.5080303", "0.50627536", "0.50520384", "0.50435716", "0.502867", "0.5021745", "0.5006956", "0.5003942", "0.5002867", "0.49920815", "0.49892133", "0.498723", "0.4985258", "0.49832729", "0.4978963", "0.49717867", "0.4969087", "0.49658927", "0.496101", "0.4960444", "0.49458903", "0.49415773", "0.49285066", "0.49253958", "0.49205968", "0.49050745", "0.4894085", "0.48894727", "0.48826703", "0.48683915", "0.48632652", "0.4849606", "0.48463687", "0.4846088", "0.4840506", "0.48322394", "0.48277074", "0.48270056", "0.48260692", "0.4824008", "0.48210412", "0.4814424", "0.48133552", "0.48126262", "0.4812132", "0.48092026", "0.48079672", "0.480599", "0.47993714", "0.4798829", "0.479078", "0.47847277", "0.478202", "0.47804746", "0.47788388", "0.47764203", "0.47721693", "0.4769511", "0.47679573", "0.4762685", "0.47592235", "0.47497743", "0.4746343", "0.47461894", "0.47439024", "0.47434044", "0.47404", "0.47397834", "0.47384122", "0.47351092", "0.4733982", "0.47299218", "0.4725456", "0.47242045", "0.4719753", "0.47183964", "0.4712623", "0.47038674", "0.47009084", "0.4696069", "0.46904725", "0.46882063", "0.46874604", "0.46851167", "0.46837166", "0.4681377" ]
0.0
-1
/ All if conditions are true and all statements are executed
@Test public void method1SC() { System.out.println(FaultyClass.method1(3)); assertEquals(1, FaultyClass.method1(3)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void evaluateConditions()\n {\n ensureConditionContinuity() ;\n checkComponentList() ;\n\n for ( int liCondCtr = 1 ; liCondCtr <= 5 ; liCondCtr++ )\n {\n checkCondition( liCondCtr ) ;\n } /* end for */\n\n }", "@Override\r\n\tpublic boolean CheckConditions() {\n\t\treturn true;\r\n\t}", "public void check(){\n check1();\n check2();\n check3();\n check4();\n check5();\n check6();\n\t}", "private void Conditional(){\n\t\tLogicOR();\n\t\t\n\t\tfor(;;){\n\t\t\tif(eat(\"for\")){\n\t\t\t\tInlineFor();\n\t\t\t}else if(eat(\"if\")){\n\t\t\t\tExpression();\n\t\t\t\tif(eat(\"else\"))\n\t\t\t\t\tConditional();\n\t\t\t}else if(eat(\"defined\") || eat(\"!defined\"));\n\t\t\telse for(;;){\n\t\t\t\tif(eat(\"?\")){\n\t\t\t\t\tExpression();\n\t\t\t\t\tassert_eat(\":\");\n\t\t\t\t\tConditional();\n\t\t\t\t}else return;\n\t\t\t}\n\t\t}\n\t}", "static boolean test(List<Condition> conditions) {\n return true; // REPLACE WITH SOLUTION \n }", "public void logic(){\r\n\r\n\t}", "public void doChecking() {\n \tdoCheckingDump();\n \tdoCheckingMatl();\n }", "AlgNode handleConditionalExecute( AlgNode node, Statement statement, LogicalQueryInformation queryInformation );", "private void ensureConditionContinuity( )\n {\n /* If the operators are not valid, then do not move the conditions */\n if ( checkOperators() )\n {\n /*\n * When Left Hand Side, Operator and Right Hand Side for a Condition\n * are empty then infer the default value, i.e., set Operator to\n * CVL_WF_OPRSImpl.EQUAL. Left Hand Side and Right Hand Side will continue\n * to remain empty.\n */\n defaultForEmptyConditions();\n\n int liCount = 0;\n int liNumber = 0 ;\n int liCurrentRow = 0;\n Data loNewData = null ;\n Data loOldData = null ;\n\n /* Cycle through the conditions. Make sure the conditions in front */\n /* of current condition are not blank, if so, move current condition up */\n\n for (liCount = 2; liCount < 6; liCount++ )\n {\n liNumber = liCount ;\n while (liNumber > 1)\n {\n liCurrentRow = liCount - ( liNumber - 1 );\n if (getAND_COND_LHS(liCurrentRow) == null)\n {\n /*\n * copy old condition to new condition, or condition 2 to 1 ...\n * first get data from new left hand side, and get data from\n * old left hand side, and copy new to old. Repeat for right\n * hand side , operator and Condition Type.\n */\n\n loNewData = getData(\"AND_COND_LHS_\" + liCount ) ;\n loOldData = getData(\"AND_COND_LHS_\" + liCurrentRow ) ;\n loOldData.setString(loNewData.getString() );\n loNewData = getData(\"AND_COND_RHS_\" + liCount ) ;\n loOldData = getData(\"AND_COND_RHS_\" + liCurrentRow ) ;\n loOldData.setString(loNewData.getString() );\n loNewData = getData(\"AND_COND_RHS_FLD_\" + liCount ) ;\n loOldData = getData(\"AND_COND_RHS_FLD_\" + liCurrentRow ) ;\n loOldData.setString(loNewData.getString() );\n loNewData = getData(\"AND_COND_OPR_\" + liCount ) ;\n loOldData = getData(\"AND_COND_OPR_\" + liCurrentRow ) ;\n loOldData.setbyte(loNewData.getbyte() );\n loNewData = getData(\"AND_COND_TYP_\" + liCount ) ;\n loOldData = getData(\"AND_COND_TYP_\" + liCurrentRow ) ;\n loOldData.setint(loNewData.getint() );\n /*\n * reset the old condition back to null ,operator to default 3\n * and Condition type to 1 (i.e. Actual Value)\n */\n loNewData = getData(\"AND_COND_LHS_\" + liCount ) ;\n loNewData.setString(null);\n loNewData = getData(\"AND_COND_RHS_\" + liCount ) ;\n loNewData.setString(null);\n loNewData = getData(\"AND_COND_RHS_FLD_\" + liCount ) ;\n loNewData.setString(null);\n loNewData = getData(\"AND_COND_OPR_\" + liCount ) ;\n loNewData.setbyte((byte)3);\n loNewData = getData(\"AND_COND_TYP_\" + liCount ) ;\n loNewData.setint(CVL_WF_COND_TYPImpl.ACTUAL_VAL);\n\n } /* end if (getAND_COND_LHS(liCurrentRow) == null) */\n\n liNumber-- ;\n\n } /* end while (liNumber > 1) */\n } /* end for (liCount = 2; liCount < 6; liCount++ ) */\n } /* end if ( checkOperators() ) */\n }", "private boolean for_cond(){\n int save = position;\r\n boolean for_cond = false;\r\n\r\n if (getNextLexeme() == Lexeme.LP) {\r\n if(init()){\r\n if(log_exp() && getNextLexeme() == Lexeme.END){\r\n if(getNextLexeme() == Lexeme.VAR && assign_op()) {\r\n if (getNextLexeme() == Lexeme.RP) {\r\n for_cond = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n position = for_cond ? position : save;\r\n return for_cond;\r\n }", "final public void conditional() throws ParseException {\n jj_consume_token(IF);\n if (jj_2_40(4)) {\n jj_consume_token(39);\n } else {\n ;\n }\n jj_consume_token(BLOCKEDP);\n label_6:\n while (true) {\n if (jj_2_41(4)) {\n ;\n } else {\n break label_6;\n }\n jj_consume_token(34);\n }\n jj_consume_token(37);\n label_7:\n while (true) {\n if (jj_2_42(4)) {\n ;\n } else {\n break label_7;\n }\n jj_consume_token(34);\n }\n if (jj_2_43(4)) {\n command(salidaS);\n } else {\n ;\n }\n basicCommand();\n jj_consume_token(38);\n }", "@Override\n\tprotected void logic() {\n\n\t}", "private boolean scanPreconditions()\n\t\t{\n\t\t\tboolean statusChanged = false;\n\t\t\t\n\t\t\t//Conditional activity\n\t\t\tif(TravelToCustomer.precondition(this) == true)\n\t\t\t{\n\t\t\t\tTravelToCustomer act = new TravelToCustomer(this);\n\t\t\t\tact.startingEvent();\n\t\t\t\tscheduleActivity(act);\n\t\t\t\tstatusChanged = true;\n\t\t\t\t//System.out.println(\"Started Travel to Customer. \");\n\t\t\t}\n\t\t\t\n\t\t\tif(TakingLunch.precondition(this) == true)\n\t\t\t{\n\t\t\t\tTakingLunch act = new TakingLunch(this);\n\t\t\t\tact.startingEvent();\n\t\t\t\tscheduleActivity(act);\n\t\t\t\tstatusChanged = true;\n\t\t\t\t//System.out.println(\"Started Take Lunch. \");\n\t\t\t}\n\t\t\t\n\t\t\t// Do not change the status if already true\n\t\t\tif(statusChanged) scanInterruptPreconditions();\n\t\t\telse statusChanged = scanInterruptPreconditions();\n\t\t\treturn(statusChanged);\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\tint a,b,c,d;\n\t a = 50; b =20; c= 30; d=40;\n\t \n\t if (a>d) //true\n\t\t \n\t {\n\t if (d>b) //true\n\t {\n\t if (a>c) //true\n\t {\n\t\t if (c>b) //true\n\t\t {\n\t\t\t System.out.println(\"nested if condition true\");\n\t {\n\t System.out.println(\"nested if condition false\");\n\t} \n\t\t }\n\t }\n\t }\n }\n\n//eg 2\n\nint nu , nu1, nu2;\nnu = 100; nu1 = 200; nu2=300;\n if (nu<nu1 )\n System.out.println(\"nu is lesser\");\n { \n if(nu2>nu1)\n System.out.println(\"nu2 is grater\");\n {\n if (nu1>nu)\n System.out.println(\"nu1 is grater\");\n {\n System.out.println(\"netsred if got executed\");\t\n }\n }\n }\n {\n \tSystem.out.println(\"netsted if not got executed\");\t\n }\n \n \t}", "public static void main(String[] agrs) {\n\t\tconditionalOperEx();\r\n\t}", "public static void run(Runnable run, List<Boolean> bools) {\n if (bools.stream().allMatch(b -> b == true)) // Check if all booleans are true\n run.run(); // Ran if the above condition is met\n }", "private static boolean condenseConditional2_type1(Op03SimpleStatement ifStatement, List<Op03SimpleStatement> allStatements) {\n if (!(ifStatement.getStatement() instanceof IfStatement)) return false;\n\n final Op03SimpleStatement taken1 = ifStatement.getTargets().get(1);\n final Op03SimpleStatement nottaken1 = ifStatement.getTargets().get(0);\n if (!(nottaken1.getStatement() instanceof IfStatement)) return false;\n Op03SimpleStatement ifStatement2 = nottaken1;\n Op03SimpleStatement taken2 = ifStatement2.getTargets().get(1);\n Op03SimpleStatement nottaken2 = ifStatement2.getTargets().get(0);\n final Op03SimpleStatement nottaken2Immed = nottaken2;\n if (nottaken2Immed.getSources().size() != 1) return false;\n nottaken2 = Misc.followNopGotoChain(nottaken2, true, false);\n do {\n Op03SimpleStatement nontaken2rewrite = Misc.followNopGoto(nottaken2, true, false);\n if (nontaken2rewrite == nottaken2) break;\n nottaken2 = nontaken2rewrite;\n } while (true);\n if (!(taken1.getStatement() instanceof IfStatement)) return false;\n if (taken1.getSources().size() != 1) return false;\n Op03SimpleStatement ifStatement3 = taken1;\n Op03SimpleStatement taken3 = ifStatement3.getTargets().get(1);\n Op03SimpleStatement nottaken3 = ifStatement3.getTargets().get(0);\n Op03SimpleStatement notTaken3Source = ifStatement3;\n do {\n Op03SimpleStatement nontaken3rewrite = Misc.followNopGoto(nottaken3, true, false);\n if (nontaken3rewrite == nottaken3) break;\n notTaken3Source = nottaken3;\n nottaken3 = nontaken3rewrite;\n } while (true);\n\n // nottaken2 = nottaken3 = c\n if (nottaken2 != nottaken3) {\n // There's one final thing we can get away with - if these are both returns, and they are IDENTICAL\n // (i.e. same, AND for any variables accessed, ssa-same), then we can assume nottaken2 is a rewritten branch\n // to nottaken3.\n if (nottaken2.getStatement() instanceof ReturnStatement) {\n if (!nottaken2.getStatement().equivalentUnder(nottaken3.getStatement(), new StatementEquivalenceConstraint(nottaken2, nottaken3))) {\n return false;\n }\n } else {\n return false;\n }\n }\n if (taken2 != taken3) return false; // taken2 = taken3 = b;\n /*\n * rewrite as if ((w && z) || x)\n *\n *\n */\n IfStatement if1 = (IfStatement) ifStatement.getStatement();\n IfStatement if2 = (IfStatement) ifStatement2.getStatement();\n IfStatement if3 = (IfStatement) ifStatement3.getStatement();\n\n ConditionalExpression newCond = new BooleanExpression(\n new TernaryExpression(BytecodeLoc.combineShallow(if1, if2, if3),\n if1.getCondition().getNegated().simplify(),\n if2.getCondition().getNegated().simplify(),\n if3.getCondition().getNegated().simplify())).getNegated();\n// TernaryExpression\n// ConditionalExpression newCond =\n// new BooleanOperation(\n// new BooleanOperation(if1.getCondition(), if2.getCondition(), BoolOp.OR),\n// if3.getCondition(), BoolOp.AND);\n\n ifStatement.replaceTarget(taken1, taken3);\n taken3.addSource(ifStatement);\n taken3.removeSource(ifStatement2);\n taken3.removeSource(ifStatement3);\n\n nottaken1.getSources().remove(ifStatement);\n nottaken2Immed.replaceSource(ifStatement2, ifStatement);\n ifStatement.replaceTarget(nottaken1, nottaken2Immed);\n\n// nottaken3.removeSource(notTaken3Source);\n nottaken3.removeSource(notTaken3Source);\n\n ifStatement2.replaceStatement(new Nop());\n ifStatement3.replaceStatement(new Nop());\n ifStatement2.removeTarget(taken3);\n ifStatement3.removeTarget(taken3);\n\n ifStatement.replaceStatement(new IfStatement(BytecodeLoc.NONE, newCond));\n\n /*\n * Now we're cleared up, see if nottaken2immed actually jumps straight to its target.\n */\n if (nottaken2Immed.getSources().size() == 1) {\n if (nottaken2Immed.getSources().get(0).getIndex().isBackJumpFrom(nottaken2Immed)) {\n if (nottaken2Immed.getStatement().getClass() == GotoStatement.class) {\n Op03SimpleStatement nottaken2ImmedTgt = nottaken2Immed.getTargets().get(0);\n int idx = allStatements.indexOf(nottaken2Immed);\n int idx2 = idx + 1;\n do {\n Op03SimpleStatement next = allStatements.get(idx2);\n if (next.getStatement() instanceof Nop) {\n idx2++;\n continue;\n }\n if (next == nottaken2ImmedTgt) {\n // Replace nottaken2 with nottaken2ImmedTgt.\n nottaken2ImmedTgt.replaceSource(nottaken2Immed, ifStatement);\n ifStatement.replaceTarget(nottaken2Immed, nottaken2ImmedTgt);\n }\n break;\n } while (true);\n }\n }\n }\n\n return true;\n\n }", "@Override\n public Object Execute()\n {\n Object result = null;\n\n if (IfClause.Execute().toString().toLowerCase() == \"true\")\n {\n result = ThenClause.Execute();\n }\n else\n {\n if (ElseClause != null)\n {\n result = ElseClause.Execute();\n }\n }\n \n return result;\n }", "public boolean nextConditionMet() {\n return true;\n }", "private static void forAllCheck(String condition, HashMap<String, Object> preParams, HashMap<String, Object> postParams, HashMap<String, Object> preFields, HashMap<String, Object> postFields, Object result) throws ContractException {\n //This is the generalised looped post check, which changes depends on who called it.\n loopedCheck(condition, preParams, postParams, preFields, postFields, result, false, \"ForAll(Post)\");\n }", "public static boolean condenseConditionals(List<Op03SimpleStatement> statements) {\n boolean effect = false;\n for (int x = 0; x < statements.size(); ++x) {\n boolean retry;\n do {\n retry = false;\n Op03SimpleStatement op03SimpleStatement = statements.get(x);\n // If successful, this statement will be nopped out, and the next one will be\n // the combination of the two.\n Statement inner = op03SimpleStatement.getStatement();\n if (!(inner instanceof IfStatement)) continue;\n Op03SimpleStatement fallThrough = op03SimpleStatement.getTargets().get(0);\n Op03SimpleStatement taken = op03SimpleStatement.getTargets().get(1);\n Statement fallthroughInner = fallThrough.getStatement();\n Statement takenInner = taken.getStatement();\n // Is the taken path just jumping straight over the non taken?\n boolean takenJumpBy1 = (x < statements.size() - 2) && statements.get(x+2) == taken;\n\n if (fallthroughInner instanceof IfStatement) {\n Op03SimpleStatement sndIf = fallThrough;\n Op03SimpleStatement sndTaken = sndIf.getTargets().get(1);\n Op03SimpleStatement sndFallThrough = sndIf.getTargets().get(0);\n\n retry = condenseIfs(op03SimpleStatement, sndIf, taken, sndTaken, sndFallThrough, false);\n\n// if (if2.condenseWithPriorIfStatement(if1, false)) {\n// retry = true;\n// }\n } else if (fallthroughInner.getClass() == GotoStatement.class && takenJumpBy1 && takenInner instanceof IfStatement) {\n // If it's not an if statement, we might have to negate a jump - i.e.\n // if (c1) a1\n // goto a2\n // a1 : if (c2) goto a2\n // a3\n //\n // is (of course) equivalent to\n // if (!c1 || c2) goto a2\n\n Op03SimpleStatement negatedTaken = fallThrough.getTargets().get(0);\n Op03SimpleStatement sndIf = statements.get(x+2);\n Op03SimpleStatement sndTaken = sndIf.getTargets().get(1);\n Op03SimpleStatement sndFallThrough = sndIf.getTargets().get(0);\n\n retry = condenseIfs(op03SimpleStatement, sndIf, negatedTaken, sndTaken, sndFallThrough, true);\n\n// IfStatement if1 = (IfStatement)inner;\n// IfStatement if2 = (IfStatement)takenInner;\n// if (if2.condenseWithPriorIfStatement(if1, true)) {\n// retry = true;\n// }\n }\n\n if (retry) {\n effect = true;\n do {\n x--;\n } while (statements.get(x).isAgreedNop() && x > 0);\n }\n } while (retry);\n }\n return effect;\n }", "static boolean test(List<Condition> conditions) {\n for (Condition cond : conditions) {\n if (!cond.test()) {\n return false;\n }\n }\n return true;\n }", "public boolean C_enterTheZone(ListOfParameterLists parameterLists){\n //if(isEnter == true){\n if(debug)\n System.out.println(\"Condition from Rule7 :: is true\");\n\n\n return true;\n\n // }\n // else\n //return false;\n\n // Future work\n // Put the condition code here, eg. if the track is friendly, we\n // don't need to alert the analyst.\n\n }", "@Override\n\tpublic String visitIfstatement(IfstatementContext ctx) {\n\t\t\n\t\tfor(int i =0; i< ctx.getChildCount(); i++)\n\t\t{\n\t\t\n\t\tif(ctx.getChild(i).getText().equals(\"if\"))\t\n\t\t sb.append(\"CHECK \\n\");\n\t\telse if (ctx.getChild(i).getText().equals(\"else\"))\n\t\t sb.append(\"OR \\n\");\n\t\telse if (ctx.getChild(i).getText().equals(\"stop\"))\n\t\t\t sb.append(\"STOP\");\n\t\telse if(!ctx.getChild(i).getText().equals(\":\"))\n\t\t{\n\t\t\tString str =visit(ctx.getChild(i));\n\t\t\tif(str.length()>0)\n\t\t\t\tsb.append(str+\"\\n\");\n\t\t}\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}", "void pass() {\r\n if (m1 >=35 && m2>=35 && m3>=35) {\r\n System.out.println(\"pass\");\r\n } else {\r\n System.out.println(\"fail\");\r\n }\r\n }", "private static boolean condenseConditional2_type3(Op03SimpleStatement ifStatement, List<Op03SimpleStatement> allStatements) {\n Op03SimpleStatement s1c = ifStatement;\n Statement s1 = s1c.getStatement();\n if (s1.getClass() != IfStatement.class) return false;\n Op03SimpleStatement s4c = ifStatement.getTargets().get(1);\n Op03SimpleStatement s2c = ifStatement.getTargets().get(0);\n Statement s2 = s2c.getStatement();\n if (s2.getClass() != IfStatement.class) return false;\n Statement s4 = s4c.getStatement();\n if (s4.getClass() != IfStatement.class) return false;\n Op03SimpleStatement s3c = s2c.getTargets().get(0);\n Statement s3 = s3c.getStatement();\n if (s3.getClass() != GotoStatement.class) return false;\n\n Op03SimpleStatement s5c = s2c.getTargets().get(1);\n Op03SimpleStatement y = s3c.getTargets().get(0);\n if (s4c.getTargets().get(1) != y) return false;\n if (s4c.getTargets().get(0) != s5c) return false;\n if (s2c.getSources().size() != 1) return false;\n if (s3c.getSources().size() != 1) return false;\n if (s4c.getSources().size() != 1) return false;\n IfStatement is1 = (IfStatement)s1;\n IfStatement is2 = (IfStatement)s2;\n IfStatement is4 = (IfStatement)s4;\n ConditionalExpression cond = new BooleanExpression(new TernaryExpression(s1.getLoc(), is1.getCondition(), is4.getCondition(), is2.getCondition().getNegated()));\n\n s1c.replaceStatement(new IfStatement(BytecodeLoc.combineShallow(s1, s2, s3, s4), cond));\n s1c.replaceTarget(s4c,y);\n y.replaceSource(s4c, s1c);\n\n // Fix sources / targets.\n s2c.replaceStatement(new GotoStatement(BytecodeLoc.NONE));\n s2c.removeGotoTarget(s3c);\n s3c.removeSource(s2c);\n s3c.clear();\n s4c.clear();\n\n // If we know for a fact that the original nodes were laid out linearly, then we can assume fallthrough from\n // S1 to S5.\n // This violates the \"next is fallthrough\" invariant temporarily, and is only ok because we KNOW\n // we will tidy up immediately.\n int idx = allStatements.indexOf(s1c);\n if (allStatements.size() > idx+5\n && allStatements.get(idx+1) == s2c\n && allStatements.get(idx+2) == s3c\n && allStatements.get(idx+3) == s4c\n && allStatements.get(idx+4) == s5c) {\n s5c.replaceSource(s2c, s1c);\n s1c.replaceTarget(s2c, s5c);\n s2c.clear();\n }\n\n return true;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint x=300;\n\t\tint y=500;\n\t\tint z=500;\n\t\t\n\t\t//((x<y) && (x<z)) // logical expression in Java\n\t\t\n\t\t// (true && true) // the output is going to be true\n\t\t\n\t\t//((x==y) && (x>z))\n\t\t \n\t\t//( false && False) // the final output is going to be False\n\t\t//((x>y) && (x<z))\n\t\t \n\t\t//( false && true) // the final output is going to be False\t \n\t\t\n\t\t\n\t\tif((x==y)&&(x>z)) // compound condition\n{\n\tSystem.out.println(\"execute the block of code\");\n}\n\t\t\n\t\t\n\t\t\n\t\tboolean results= ((x<y)&&(x<z)); // true\n\t\tSystem.out.println(results);\n\t\t\n\t\t\n\t\t//OR operator ||\n\t\t\n\t\t// In case of OR operator, \n\t\t//if anyone of the relational expression is true, the final output is going to be true\n\t\t\n\t\t\n\t\t// x=400;\n\t\t// y=500;\n\t\t// z=400;\n\t\t \n\t\t\t//((x<y) || (x==z))\n\t\t\n\t\t// ( true || true) ----> true\n\t\t\n\t\t// false || true ----> TRUE\n\t\t\n\t\t// false || false----> false\n\t\t\n\t\t// True || False --->true\n\t\t\n\t\tint age= 30;\n\t\t\n\t\t if((age==30)||(age>18))\n\t\t {\n\t\t\t System.out.println(\"give the licence to customer\");\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t \n\t\t\n\t\t// Not operator ! - if the original value of the expression is true, and if we use ! operator on it, \n\t\t//the output will be changed to False\n\t\t\n\tint x1=100;\n\tint y1=50;\n\t\n\tif(!(x1==y1)) // x1 not equal to y1 ---true\n\t\t\n\t\t\n\t\t// !(x==y)\n\t\t\n\t{\n\t\tSystem.out.println(\"the output is true\");\n\t}\n\t\t// x>y --> 100>50 --->true\n\t\t \n\t\t//!(x>y) ---!(100>50) ---> False\n\t\t// 100 is not greater than 50 ---> false\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void dispatch(){\n if (size() == 0){\n return;\n }\n int nb = 0, ns = 0;\n for (Exp exp : this){\n if (exp.isStatement()){\n ns++;\n }\n else {\n nb++;\n }\n }\n if (ns == 0 || (ns == 1 && nb == 0)){\n return;\n }\n doDispatch();\n }", "public void executeBR(){\n\t\tBitString conditions = mIR.substring(4, 3);\n\t\tBitString setInstruction = mIR.substring(7, 9);\n\t\tboolean ccMatch = false;\n\t\tfor (int i = 0; i < conditions.getLength() ; i++) {\n\t\t\tif(conditions.substring(i, 1).getValue() + mCC.substring(i, 1).getValue() == 2){\n\t\t\t\tccMatch = true;\n\t\t\t}\n\t\t}\n\n\t\tif(ccMatch){\n\t\t\tmPC.setValue(mPC.getValue() + setInstruction.getValue2sComp());\n\t\t}\n\t}", "public static void main(String[] args) {\n boolean freeShipping = true;\n boolean onSale = true;\n boolean hasItem = false;\n String item = \"Wooden Spoon\";\n\n if (freeShipping && onSale) {\n System.out.println(\"Purchase the - \" + item);\n } else {\n System.out.println(\"Next time when item \" + item + \" on sale\");\n }\n System.out.println(\"==================================\");\n\n // 2nd job offer selector\n\n String location = \"Toronto\";\n double salary = 85_000.0;\n boolean remote = true;\n boolean hasBenefit = true;\n\n if (location.equals(\"Toronto\") && salary == 85_000 && remote && hasBenefit) {\n\n System.out.println(\"Accept job offer\");\n } else {\n System.out.println(\"Reject the offer\");\n }\n System.out.println(\"==================================\");\n // 3rd practice OR(||)\n System.out.println(\"false || true = \" + (false || true)); // true\n System.out.println(\"true || false = \" + (false || true)); // true\n System.out.println(\"==================================\");\n\n // 4th practice OR||\n\n int apples = 10;\n int oranges = 8;\n\n if (apples > 11 || oranges > 10) {\n System.out.println(\"I have enough fruits\");\n } else {\n System.out.println(\"Go to Giant buy fruits\");\n\n }\n System.out.println(\"==================================\");\n\n // 4th practice CitySelector\n\n String city = \"VA\";\n if (city.equals(\"LA\") || city.equals(\"Toronto\")) {\n System.out.println(\"Willing to relocate LA\");\n\n } else {\n System.out.println(\"Not considering Seattle\");\n }\n System.out.println(\"==================================\");\n\n char grade = 'A';\n if (grade == 'A' || grade == 'B' || grade == 'C') {\n System.out.println(\"passed with grade\");\n\n } else if (grade == 'D') {\n System.out.println(\"quality for retake\");\n } else if(grade == 'E') {\n\n } else {\n System.out.println(\"invalid grade\");\n }\n\n // 4 th dealership\n\n double budget = 5000.0;\n String model = (\"Toyota\");\n double carPrice = 4500;\n\n if (carPrice == 4500 && (model.equals(\"Toyota\") || model.equals(\"Honda\"))) {\n\n System.out.println(\"Ready to purchase + \" + model + \", price = \" + carPrice);\n\n }else {\n System.out.println(\"Not interested in model = \" + model + \", price = \" + carPrice);\n }\n\n // ! not Operator\n\n\n System.out.println(\"!true = \" + (!true));\n int age = 5;\n if (!(age < 4)) {\n System.out.println(\"Need to seat in child seat = \" + age);\n }else {\n System.out.println(\"Can seat in adult seat = \" + age);\n }\n\n boolean isSmokingAllowed = false;\n\n if (!isSmokingAllowed) {\n System.out.println(\"Need to exit and smoke outside\");\n }else {\n System.out.println(\"You can smoke\");\n }\n\n String inputPassword = \"abd123\";\n String correctPassword = \"123abc\";\n\n if (!inputPassword.equals(\"abc123\")) {\n\n System.out.println(\"Access granted\");\n }else {\n System.out.println(\"Access denied\" );\n }\n\n\n\n\n }", "private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }", "private void compileIfHelper() throws IOException {\n for (int i = 0; i < 2; i++) {\n printToken();\n getNextToken();\n }\n compileExpression();\n for (int i = 0; i < 2; i++) {\n printToken();\n getNextToken();\n }\n compileStatements();\n printToken();\n getNextToken();\n if (currentToken.equals(ELSE_TAG)) {\n for (int i = 0; i < 2; i++) {\n printToken();\n getNextToken();\n }\n compileStatements();\n printToken();\n getNextToken();\n }\n }", "private void checkExecuteConditions(HttpState state, HttpConnection conn)\n throws HttpException {\n\n if (null == state) {\n throw new NullPointerException(\"HttpState parameter\");\n }\n if (null == conn) {\n throw new NullPointerException(\"HttpConnection parameter\");\n }\n if (hasBeenUsed()) {\n throw new HttpException(\"Already used, but not recycled.\");\n }\n if (!validate()) {\n throw new HttpException(\"Not valid\");\n }\n if (inExecute) {\n throw new IllegalStateException(\"Execute invoked recursively, or exited abnormally.\");\n }\n }", "private static void loopedCheck(String condition, HashMap<String, Object> preParams, HashMap<String, Object> postParams, HashMap<String, Object> preFields, HashMap<String, Object> postFields, Object result, boolean assertValue, String errorMessage) throws ContractException {\n Bindings bind = engine.createBindings();\n //This creates and binds all the variables.\n bind.putAll(preParams);\n bind.putAll(postParams);\n bind.putAll(preFields);\n bind.putAll(postFields);\n bind.put(\"result\", result);\n\n String collectionName;\n String[] tokenized = condition.split(\",\\\\s+\"); //This tokenizes acording to \", \" similar to a parameter\n\n collectionName = tokenized[0]; //The first value is the collection name.\n\n Object collectionObj = postParams.get(collectionName);\n Collection<?> collection = null;\n if (collectionObj instanceof Collection<?>) {\n collection = (Collection<?>) collectionObj;\n }\n\n if (collection == null) { //If there's no collection found it will be null.\n collectionObj = postFields.get(collectionName); //This checks post fields\n if (collectionObj instanceof Collection<?>) {\n collection = (Collection<?>) collectionObj;\n }\n }\n if (collection == null) {\n collection = (Collection<?>) result; //Check incase result is the collection.\n }\n\n engine.setBindings(bind, ScriptContext.ENGINE_SCOPE); //Sets bindings to the engine.ss\n\n String start = \"0\"; //This sets the default values\n String end = \"-1\";\n \n if (collection != null) {\n end = String.valueOf(collection.size()); //This remains as 0 until the collection is known or a value is entered.\n } else if (collectionObj != null && collectionObj.getClass().isArray()) {\n end = String.valueOf(Array.getLength(collectionObj));\n }\n String newCondition = \"\";\n\n int length = tokenized.length;\n\n newCondition = tokenized[length - 1]; //The condition is always the last thing.\n\n if (length == 4) { //If there's 2 extra parameters then use these as limits.\n start = tokenized[length - 3];\n end = tokenized[length - 2];\n }\n\n String script = \"var assert =\" + String.valueOf(assertValue) + \"; \";\n script += \"var i = 0;\" //This is the basic loop with values inserted.\n + \"for(i = \" + start + \"; i < \" + end + \"; i++){ \"\n + \"if(\" + ((!assertValue) ? \"!(\" : \"(\") + newCondition + \"))\"\n + \"{ assert = !assert; break;}\"\n + \"}\";\n\n getAssert(script, errorMessage, newCondition); //This then runs the script.\n }", "private void defaultForEmptyConditions()\n {\n /*\n * When any of the Conditions has all Left Hand Side, Operator and\n * Right Hand Side as empty then set Operator to default value of\n * CVL_WF_OPRSImpl.EQUAL(mimic default situation).\n * Note if this is not done then the condition will store null value\n * for Left Hand Side, Operator and Right Hand Side, and the whole condition\n * record will not be displayed on \"Manage Approval Conditions\" page\n * because the page selection query uses an equal join with R_WF_APRV_COND\n * and CVL_WF_OPRS tables.\n */\n for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ )\n {\n if( isNull(\"AND_COND_LHS_\" + liCtr) && isNull(\"AND_COND_OPR_\" + liCtr)\n && isNull(\"AND_COND_RHS_\" + liCtr) )\n {\n getData(\"AND_COND_OPR_\" + liCtr).setbyte((byte)3);\n }\n }//end for\n }", "public boolean continueExecuting() {\n/* 91 */ if (this.field_190859_a.func_190718_dR() && this.field_190859_a.func_190716_dS().isEntityAlive() && func_190858_a(this.field_190859_a, 0)) {\n/* */ \n/* 93 */ double d0 = this.field_190859_a.getDistanceSqToEntity((Entity)this.field_190859_a.func_190716_dS());\n/* */ \n/* 95 */ if (d0 > 676.0D) {\n/* */ \n/* 97 */ if (this.field_190860_b <= 3.0D) {\n/* */ \n/* 99 */ this.field_190860_b *= 1.2D;\n/* 100 */ this.field_190861_c = 40;\n/* 101 */ return true;\n/* */ } \n/* */ \n/* 104 */ if (this.field_190861_c == 0)\n/* */ {\n/* 106 */ return false;\n/* */ }\n/* */ } \n/* */ \n/* 110 */ if (this.field_190861_c > 0)\n/* */ {\n/* 112 */ this.field_190861_c--;\n/* */ }\n/* */ \n/* 115 */ return true;\n/* */ } \n/* */ \n/* */ \n/* 119 */ return false;\n/* */ }", "private static void preCheck(String condition, HashMap<String, Object> params, HashMap<String, Object> fields) throws ContractException {\n Bindings bind = engine.createBindings(); //A binding is used to link java and javascript.\n\n bind.putAll(params); //This adds the hashmaps of parameters to the engine.\n bind.putAll(fields); //This adds the fields.\n\n engine.setBindings(bind, ScriptContext.ENGINE_SCOPE); //This binds all the parameters to the engine.\n\n testSimpleAssertion(condition, \"Pre condition\"); //This then tests the condition.\n }", "void doCondition() throws IOException\n\t{\n\t\ttry\n\t\t{\n\t\t\t// must have a breakpoint number\n\t\t\tint id = nextIntToken();\n\n\t\t\t// get the breakpoint\n\t\t\tint at = breakpointIndexOf(id);\n\t\t\tBreakAction a = breakpointAt(at);\n\n\t\t\t// no more parms means to clear it\n\t\t\tif (hasMoreTokens())\n\t\t\t{\n\t\t\t\t// now just pull the commands as they come while not end\n\t\t\t\tString line = restOfLine();\n\n\t\t\t\t// build an expression and attach it to the breakpoint\n\t\t\t\tValueExp exp = parseExpression(line);\n\n\t\t\t\t// warn about the assignment!\n\t\t\t\tif ( exp.containsAssignment() && !yesNoQuery(getLocalizationManager().getLocalizedTextString(\"askExpressionContainsAssignment\")) ) //$NON-NLS-1$\n\t\t\t\t\tthrow new IllegalAccessException(\"=\"); //$NON-NLS-1$\n\n\t\t\t\ta.setCondition(exp, line);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ta.clearCondition(); // clear it\n\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\targs.put(\"breakpointNumber\", Integer.toString(id)); //$NON-NLS-1$\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"breakpointNowUnconditional\", args)); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\t\tcatch(IllegalAccessException iae)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"breakpointNotChanged\")); //$NON-NLS-1$\n\t\t}\n\t\tcatch(IndexOutOfBoundsException iob)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"breakpointNumber\", m_currentToken); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noBreakpointNumber\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NumberFormatException nfe)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"token\", m_currentToken); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"badBreakpointNumber\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"commandFailed\")); //$NON-NLS-1$\n\t\t}\n\t}", "@Override\n public void execute() {\n ballCount = conveyor.getBallCount();\n SmartDashboard.putNumber(\"Ball Count\", conveyor.getBallCount());\n if(ballCount == 4){\n complete = true;\n conveyor.setDone(complete);\n } else {\n complete = false;\n conveyor.setDone(complete);\n }\n SmartDashboard.putBoolean(\"Intake Complete?\", complete);\n \n //conveyor.rightWithSensor();\n if(ballCount == 0){ // right one\n conveyor.engageConveyor(false, 0.5);\n } else if(ballCount == 1) { // left one\n conveyor.engageConveyor(true, 0.5);\n stage2 = false;\n } else if(ballCount == 2 && !stage2){\n //System.out.println(\"Moving balls up\");\n conveyor.conveyorFeedTime();\n if(conveyor.doneBoolean()){\n //System.out.println(\"Ready for 3rd and 4th balls\");\n stage2 = true;\n }\n } else if(stage2 && ballCount == 2) {\n //System.out.println(\"3rd\");\n conveyor.engageConveyor(false, 0.375);\n } else if(ballCount == 3){\n conveyor.engageConveyor(true, 0.375);\n } else {\n conveyor.setConveyorMotors(0, 0, 0, 0);\n }\n \n }", "private void executeExecutables() {\n \r\n if (stunTime > 0) { // still stunned, so lower stunTime and skip all actions\r\n if (stunTime < Game.deltaTime) {\r\n stunTime = 0;\r\n } else {\r\n stunTime -= Game.deltaTime;\r\n }\r\n //System.out.println(this + \" stunned\");\r\n tryStopping();\r\n return;\r\n }\r\n final Action action = state.action;\r\n if (action instanceof Attack) {\r\n if (moveTime < action.totalTime()) {\r\n moveTime += Game.deltaTime;\r\n return;\r\n } else {\r\n state.resetTime();\r\n stop();\r\n state.resetTime(); // FIXME why two calls to this\r\n }\r\n }\r\n \r\n // just finished hitstun\r\n stunTime = 0;\r\n moveTime = 0;\r\n actionTimer = 0;\r\n acceleration.x = 0;\r\n log(this + \" checking for called executables\");\r\n boolean noMovesCalled = true;\r\n for (int i = 0; i < executables.length; i++) {\r\n final Executable executable = executables[i];\r\n executable.update();\r\n if (executable.keyBinding.isPressed(controller)) {\r\n if (executable instanceof Move) {\r\n noMovesCalled = false;\r\n }\r\n //System.out.println(this + \" pressed \" + KeyBinding.get(i) + \", calling \" + executable);\r\n state = executable.execute(this);\r\n } else {\r\n executable.reset();\r\n }\r\n }\r\n if (noMovesCalled) {\r\n tryStopping();\r\n }\r\n if (wasOnPlatform) {\r\n numMidairJumps = 1;\r\n }\r\n }", "public void execute() {\n\t\t// XOR GATE OP\n\t\txor.a.set(a.get());\n\t\txor.b.set(b.get());\n\t\txor.execute();\n\t\tsum.set(xor.out.get());\n\n\t\t// AND GATE OP\n\t\tand.a.set(a.get());\n\t\tand.b.set(b.get());\n\t\tand.execute();\n\t\tcarry.set(and.out.get());\n\n\t}", "private void doStuff() {\n if (shouldContinue == false) {\n stopSelf();\n return;\n }\n\n // continue doing something\n\n // check the condition\n if (shouldContinue == false) {\n stopSelf();\n return;\n }\n\n // put those checks wherever you need\n }", "public void caseAIfStmt(AIfStmt node)\n {\n int initCount = 0;\n //inAIfStmt(node);\n if(node.getStmt() != null)\n {\n newScope();\n initCount++;\n }\n if(node.getIf() != null)\n {\n node.getIf().apply(this);\n }\n if(node.getStmt() != null)\n {\n node.getStmt().apply(this);\n }\n if(node.getExp() != null)\n {\n node.getExp().apply(this);\n }\n {\n List<PStmt> copy = new ArrayList<PStmt>(node.getTrue());\n for(PStmt e : copy)\n {\n e.apply(this);\n }\n }\n {\n List<PElseIf> copy = new ArrayList<PElseIf>(node.getElseIf());\n Iterator<PElseIf> itr = copy.iterator();\n while (itr.hasNext()) {\n PElseIf e = itr.next();\n AElseIf elseIf = (AElseIf) e;\n if(elseIf.getStmt() != null)\n {\n newScope();\n initCount++;\n }\n e.apply(this);\n if(elseIf.getExp() != null)\n {\n Type t = typemap.get(elseIf.getExp());\n t = removeAlias(t);\n if(!(t instanceof BooleanType)) throw new TypeException(\"[line \" + golite.weeder.LineNumber.getLineNumber(elseIf) + \"] If-else statement with non-boolean condition.\");\n }\n }\n }\n {\n List<PStmt> copy = new ArrayList<PStmt>(node.getFalse());\n for(PStmt e : copy)\n {\n e.apply(this);\n }\n }\n //outAIfStmt(node);\n if(node.getExp() != null)\n {\n Node e = node.getExp();\n Type t = typemap.get(e);\n t = removeAlias(t);\n if(!(t instanceof BooleanType)) throw new TypeException(\"[line \" + golite.weeder.LineNumber.getLineNumber(node) + \"] If statement with non-boolean condition.\");\n }\n if (initCount>0) {\n if (dump) {\n List<PStmt> copy = new ArrayList<PStmt>(node.getTrue());\n if (copy.size()>0 && golite.weeder.LineNumber.getLineNumber(copy.get(copy.size()-1))>0)\n {\n Node n = copy.get(copy.size()-1);\n System.out.println(\"[line \" + golite.weeder.LineNumber.getLineNumber(n) + \"]\");\n }\n }\n while (initCount>0) {\n unScope();\n initCount--;\n }\n }\n }", "public static void main(String[] args) {\n\n\t\tint subject1 = 40;\n\t\tint subject2 = 60;\n\t\t\n\t\tif ((subject2 <= 60) && (subject1<=60)){\n\t\t\tSystem.out.println(\"condition is true\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"condition is false\");\n\t\t}\n\t\t\t\n\t\t// && - ANd , || OR operator\n\t\t\n\t}", "@Override\n\tpublic void visit(IfNode node) {\n\t\tif (Evaluator.checkScope(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Verificare pentru assert failed\n\t\t */\n\t\tif (Evaluator.checkAssert(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * evaluam conditia si preluam rezultatul evaluarii fiului corespunzator\n\t\t * branch-ului de then sau de else\n\t\t */\n\t\tEvaluator.evaluate(node.getChild(0));\n\n\t\t/***\n\t\t * Daca conditia este adevarata, continuam cu evaluarea celui de-al\n\t\t * doiela fiu, iar daca este false evaluam al treilea fiu\n\t\t */\n\t\tif (node.getChild(0).getName().contentEquals(\"true\")) {\n\t\t\tEvaluator.evaluate(node.getChild(1));\n\t\t\tnode.getChild(2).setVisited(true);\n\n\t\t\tif (node.getChild(1) instanceof Variable) {\n\t\t\t\tnode.setName(Evaluator.variables.get(node.getChild(1).getName()));\n\t\t\t} else {\n\t\t\t\tnode.setName(node.getChild(1).getName());\n\t\t\t}\n\t\t} else {\n\t\t\tEvaluator.evaluate(node.getChild(2));\n\t\t\tnode.getChild(1).setVisited(true);\n\n\t\t\tif (node.getChild(2) instanceof Variable) {\n\t\t\t\tnode.setName(Evaluator.variables.get(node.getChild(2).getName()));\n\t\t\t} else {\n\t\t\t\tnode.setName(node.getChild(2).getName());\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String args[]) {\n boolean hasSATscore = true;\n boolean hasHighSchoolTranscript = true;\n boolean isInternational=false;\n boolean hasTOFELscore=false;\n\n /*\n * logical_step2: Check if the applicant is eligible to apply to the university\n * logical_step_details: the applicant must have a SAT score, a high school transcript and must have TOEFL score\n * if is an international student.\n * question_1: What does the following block of code do?\n * answer 1: Check if the applicant is eligible to apply to the university\n * question_2: What is the data type of the variable isElig?\n * answer 2: isElig is a Boolean data type\n * question_3: What is the value of: !isInternational. (value assigned above)\n * answer_3: the value of !isInternational is true\n * question_4: What is the output the following block of code?\n * answer_4: the code displays the following statement \"You eligibility requirement has been evaluated to :true\"\n */\n\n /*\n * stm_comment: isElig contains result of logical operation between the variables. logical and (&&), logical or(||) and not operator is used \n * question_1: Please explain how the value of isElig evaluated.\n * answer_1: isElig contains result of logical operation between the variables\n * question_2: Please state the operators used in the code block below.\n * answer_2: logical and (&&), logical or(||) and not operator is used .\n *\n */\n\n boolean isElig = hasSATscore && hasHighSchoolTranscript && (!isInternational || (isInternational && hasTOFELscore));\n System.out.println(\" Your eligibility requirement has been evaluated to :\" +isElig );\n\n\n }", "boolean check(Env env) {\n // System.out.println (\"Checking block...\");\n for (Iterator it = idList.iterator (); it.hasNext (); ) {\n String id = (String) it.next ();\n env = new Env (id, env); \n }\n // System.out.println (\" Environment = \" + env);\n boolean isOkay = true;\n for (Iterator it = exprList.iterator (); it.hasNext (); ) {\n Expr expr = (Expr) it.next ();\n isOkay = expr.check (env) && isOkay;\n }\n return isOkay;\n }", "protected void assignmentOrIf(INestedIfElseClauseContainer upperIf) \r\n\t\t\tthrows InvalidProbabilityRangeException, \r\n\t\t\t\t TableFunctionMalformedException,\r\n\t\t\t\t SomeStateUndeclaredException,\r\n\t\t\t\t NoDefaultDistributionDeclaredException,\t// if-clause would eventually throw this\r\n\t\t\t\t InvalidConditionantException{\t\t\t// if-clause would eventually throw this\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.tokenLookAhead() == this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\t// this is an if-clause\r\n\t\t\t\tthis.ifStatement(upperIf);\r\n\t\t\t\t// an if-clause doesnt have do return something...\r\n\t\t\t} else {\r\n\t\t\t\t// since it is an assignment, we should check probability consistency as well\r\n\t\t\t\t\r\n\t\t\t\t// Consistency check C09\r\n\t\t\t\t// Structures that allow us to Verify if all states has probability declared\r\n\t\t\t\tList<Entity> declaredStates = new ArrayList<Entity>();\r\n\t\t\t\tList<Entity> possibleStates = null;\t\t\t\r\n\t\t\t\tif (this.node != null) {\r\n\t\t\t\t\tpossibleStates = this.node.getPossibleValueListIncludingEntityInstances();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.assignment(declaredStates, possibleStates);\r\n\t\t\t\t\r\n\r\n\t\t\t\tif (this.look == this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// this is an if-clause after user-defined variable declaration\r\n\t\t\t\t\tthis.ifStatement(upperIf);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// After the assignment, if there are undeclared states, distribute the remaining probability uniformly.\r\n\t\t\t\t\t// obtain undeclared states = possibleStates - declaredStates\r\n\t\t\t\t\tCollection<Entity> undeclaredStates = new HashSet<Entity>(possibleStates);\r\n\t\t\t\t\tundeclaredStates.removeAll(declaredStates);\r\n\t\t\t\t\tif (undeclaredStates.size() > 0) {\r\n\t\t\t\t\t\t// get the current (without the undeclared states) sum of probabilities\r\n\t\t\t\t\t\tfloat sumOfDeclaredProb = currentHeader.getProbCellSum();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// distribute the remaining probability (1-sumOfDeclaredProb) uniformly across the non-declared states\r\n\t\t\t\t\t\tfloat probOfUndeclaredState = (1f-sumOfDeclaredProb)/undeclaredStates.size();\r\n\t\t\t\t\t\tif (!isToNormalize() || (sumOfDeclaredProb >= 1)) {\r\n\t\t\t\t\t\t\t// if we don't need to normalize, then simply set all undeclared states to zero\r\n\t\t\t\t\t\t\tprobOfUndeclaredState = 0f;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (Entity entity : undeclaredStates) {\r\n\t\t\t\t\t\t\tif (entity != null) {\r\n\t\t\t\t\t\t\t\t// distribute the remaining probability (1-retValue) uniformly across the non-declared states, but substitute NaN with 0\r\n\t\t\t\t\t\t\t\tif (this.getSSBNNode() != null) {\r\n\t\t\t\t\t\t\t\t\t// use a special type of cell which will recalculate the probability each time getProbabiity is called, by uniformly distributing 1-(probability of declared states)\r\n\t\t\t\t\t\t\t\t\tthis.currentHeader.addCell(new TempTableProbabilityCell(entity, new UniformComplementProbabilityValue(this.currentHeader, entity)));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tthis.currentHeader.addCell(new TempTableProbabilityCell(entity, new SimpleProbabilityValue(Float.isNaN(probOfUndeclaredState)?0f:probOfUndeclaredState )));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// the following may be irrelevant now, since we fill all undeclared states automatically anyway\r\n//\t\t\t\t\t\t\t\tdeclaredStates.add(entity);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// the following check may be irrelevant now, since we fill all undeclared states automatically anyway\r\n//\t\t\t\t\tif (this.node != null) {\r\n//\t\t\t\t\t\t// Consistency check C09\r\n//\t\t\t\t\t\t// Verify if all states has probability declared\r\n//\t\t\t\t\t\tif (!declaredStates.containsAll(possibleStates)) {\r\n//\t\t\t\t\t\t\tthrow new SomeStateUndeclaredException();\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\r\n\t\t\t\t\t// Consistency check C09\r\n\t\t\t\t\t// Verify if sum of all declared states' probability is 1\r\n\t\t\t\t\t\r\n\t\t\t\t\t// runtime probability bound check (on SSBN generation time)\r\n\t\t\t\t\tif (isToNormalize()\r\n\t\t\t\t\t\t\t&& this.currentHeader.getProbCellSum() < 0.99995\t// check if normalization of probabilities smaller than 1 worked\r\n\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t// Debug.println(\"Testing cell's probability value's sum: \" + currentHeader.getProbCellSum());\r\n\t\t\t\t\t\tif (!Float.isNaN(this.currentHeader.getProbCellSum())) {\r\n\t\t\t\t\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Debug.println(\"=>NaN found!!!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} catch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\t/* \r\n\t\t\t * catching ArrayIndexOutOfBoundsException means that the keyword \"IF\"\r\n\t\t\t * was not found the list of keywords. It is an horrible implementation error!!\r\n\t\t\t */\r\n\t\t\tthrow new RuntimeException(this.getResource().getString(\"FatalError\"),e);\r\n\t\t}\r\n\t\t\r\n\t\t// any other exception should not be treated by this scope (equivalent to \"catch(Exception e){throw e}\")\r\n\t\t\r\n\t}", "public void checkConditions(){\n\t\t// check game over conditions\n\t\tif(!status.isGameOver() && status.isGameStarted()){\n\t\t\tif(status.getShipsLeft() == 0){\n\t\t\n\t\t\t\tsoundMan.StopMusic3();\n\t\t\t\tsoundMan.StopMusic4();\n\t\t\t\tsoundMan.StopMusic5();\n\t\t\t\tsoundMan.StopMusic6();\n\t\t\t\tsoundMan.BackgroundMusic2();\n\t\t\t\tgameOver();\n\t\t\t\tsoundMan.StopMusic();\n\t\t\t}\n\t\t}\n\t\tif(!status.isGameOver() && status.isBossDestroyed()&& status.isGameStarted()){\n\t\t\tif(status.isBossDestroyed()){\n\t\t\t\tsoundMan.StopMusic5();\n\t\t\t\tsoundMan.BackgroundMusic4();\n\t\t\t\tgameWinner();\n\n\t\t\t}\n\n\t\t}\n\t}", "protected boolean checkCandidateStatement(String command, boolean onExecuted) throws Throwable {\n String currentOs = getOsVersion();\n String commandTokens[] = StringUtil.split(command, \" \");\n boolean onOther = false;\n \n if (commandTokens.length < 3) {\n // This can only be the on others case\n if (commandTokens.length == 2) {\n String tmp = commandTokens[1].trim();\n if (ON_OTHERS.equals(tmp)) {\n onOther = true;\n }\n }\n \n if (!onOther) {\n String msg = \"Syntax error in On command, missing os versions\" + command;\n Log.error(TAG_LOG, msg);\n throw new ClientTestException(\"Script syntax error\");\n }\n }\n \n if (!onOther) {\n String minOS = commandTokens[1];\n String maxOS = commandTokens[2];\n \n String min[] = StringUtil.split(minOS.trim(), \".\");\n String max[] = StringUtil.split(maxOS.trim(), \".\");\n String os[] = StringUtil.split(currentOs.trim(), \".\");\n \n min = createVersionArray(min);\n max = createVersionArray(max);\n os = createVersionArray(os);\n \n int low = Integer.parseInt(min[0]) * 100\n + Integer.parseInt(min[1]) * 10\n + Integer.parseInt(min[0]);\n \n int high = Integer.parseInt(max[0]) * 100\n + Integer.parseInt(max[1]) * 10\n + Integer.parseInt(max[0]);\n \n int value = Integer.parseInt(os[0]) * 100\n + Integer.parseInt(os[1]) * 10\n + Integer.parseInt(os[0]);\n \n if (Log.isLoggable(Log.INFO)) {\n Log.info(TAG_LOG, \"current version =\" + value + \", min=\" + min + \", max=\" + max);\n }\n if (value >= low && value <= high) {\n // The on condition matches\n if (onExecuted) {\n String msg = \"Syntax error in On command, more conditions matching\" + command;\n Log.error(TAG_LOG, msg);\n throw new ClientTestException(\"Script syntax error\");\n }\n return true;\n } else {\n return false;\n }\n } else {\n boolean res = !onExecuted;\n return res;\n }\n }", "void compileIf() {\n\n tagBracketPrinter(IF_TAG, OPEN_TAG_BRACKET);\n try {\n compileIfHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(IF_TAG, CLOSE_TAG_BRACKET);\n }", "public double execute(TurtleHistory turtleHistory, List<Object> parameters, List<Map<String, Double>> accessibleVariables, Map<String, List<Object>> definedFunctions) throws BackendException {\n String ifConditionArgument = parameters.get(0).toString();\n String trueBlockCommandArgument = parameters.get(1).toString();\n\n double conditionValue = calculateConditionValue(ifConditionArgument, turtleHistory, accessibleVariables);\n\n if (conditionValue != 0) {\n CommandBlockManager trueBlockManager = new CommandBlockManager(trueBlockCommandArgument, turtleHistory, accessibleVariables, definedFunctions);\n return trueBlockManager.executeInstructionBlock();\n } else {\n return 0;\n }\n }", "public boolean continueExecuting()\n {\n double var1 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ);\n return this.breakingTime <= 240 && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D;\n }", "public boolean execute( Object first, Object second )\n {\n return ifPredicate.execute( first, second )\n ? thenPredicate.execute( first, second )\n : elsePredicate.execute( first, second );\n }", "public void checkAndExecute(){\n if(priceListener.getSecurityPrice() < buyPrice){\n executionService.buy(security, buyPrice, 100);\n // if the price < buyPrice then executionService.buy(buyquantity)\n }else if ( priceListener.getSecurityPrice() > sellPrice ) {\n executionService.sell(security, buyPrice, 100);\n }\n }", "public boolean execute() {\n\t\t\n\t\tfor (int i = 0; i <Network.size(); i++) {\n\t\t\t\n\t\t\tMyNode n = (MyNode)Network.get(i);\n\t\t\t//MyNode n1 = (MyNode) n;\t\t\n \n System.out.println(\"The frobenius_norm at node\"+\"(\"+i+\"):\"+n.frobenius_norm);\n\t\t\tretVal=retVal &&(n.frobenius_norm<=threshold);\n\t\t\tSystem.out.println(retVal);\n }\n if(retVal)\n {\n \t System.out.println(\"ALgorithm Converged...###########################!\");\n \t return myNewSVMCode.end;\n }\n else\t\n {\n\t\treturn false;\n }\n }", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "public boolean initialConditions() {\n\n boolean evaluable;\n\n\n evaluable = diag.directedLinks();\n\n if (evaluable == false) {\n System.out.print(\"Influence Diagram with no directed links\\n\\n\");\n return (false);\n }\n\n evaluable = ((((IDWithSVNodes) diag).hasOnlyOneTerminalSVNode())\n || (((IDWithSVNodes) diag).hasOnlyOneValueNode()));\n\n\n if (evaluable == false) {\n System.out.print(\"Influence Diagram with 0 or more than 1 terminal super value nodes\\n or hasn't got an only utility node\\n\");\n return (false);\n }\n\n evaluable = diag.hasCycles();\n if (evaluable == true) {\n System.out.print(\"Influence Diagram with cycles\\n\\n\");\n return (false);\n }\n\n diag.addNonForgettingArcs();\n\n evaluable = diag.pathBetweenDecisions();\n if (evaluable == false) {\n System.out.print(\"Influence Diagram with non ordered decisions\\n\\n\");\n return (false);\n }\n\n evaluable = ((IDWithSVNodes) diag).isTreeStructureSV();\n if (evaluable == false) {\n System.out.print(\"Influence Diagram whose structure of value nodes isn't a tree\\n\\n\");\n return (false);\n }\n\n // Remove barren nodes\n\n //diag.eliminateRedundancy();\n diag.removeBarrenNodes();\n\n\n\n // Return true if OK\n\n return (true);\n }", "private boolean checkExclusiveStatements(Statement... statements) throws ASTVisitorException{\n for(Statement st : statements){\n HasReturnASTVisitor visitor = new HasReturnASTVisitor();\n st.accept(visitor);\n\n if(!visitor.containsReturn())\n return false;\n }\n return true;\n }", "@Test\n\tpublic void testBooleanTrueMultipleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03a.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "void compileStatements() {\n tagBracketPrinter(STAT_TAG, OPEN_TAG_BRACKET);\n try {\n compileStatementHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(STAT_TAG, CLOSE_TAG_BRACKET);\n }", "Boolean conditionResult();", "public void run(){\n ArrayList<ArrayList<Furniture>> all = getSubsets(getFoundFurniture());\n ArrayList<ArrayList<Furniture>> valid = getValid(all);\n ArrayList<ArrayList<Furniture>> ordered = comparePrice(valid);\n ArrayList<ArrayList<Furniture>> orders = produceOrder();\n checkOrder(orders, false);\n }", "public void updateResult () {\n if (Ohana.isDisposed()) return;\n\n if (m_exprList != null && m_timerStart > 0L) {\n long curTime = System.currentTimeMillis();\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Expressions are being evaluated...\");\n }\n // initial true boolean will be conjoined with at least one expression result;\n // if exprList empty, then automatic true, which is consistent with tactic condition/effect interpretation\n boolean curResult = true;\n for (Expression expr : m_exprList) { // evaluate all expressions, conjoined\n expr.clearState(); // make sure we're really re-evaluating, not using cached value\n expr.evaluate(null);\n if (expr.getResult() != null && expr.getResult() instanceof Boolean) {\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"expr: \" + expr.getResult() + \"; \" + expr.toString());\n }\n curResult &= (Boolean )expr.getResult();\n }\n } // curResult has outcome of evaluating conjunction of expressions\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Result updated\");\n }\n if (m_period == 0L) {\n m_result = curResult;\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"No period, condition changed: \" + m_result);\n }\n setChanged();\n } else if (curTime - m_timerStart <= m_period) {\n if (!m_result && curResult) {\n // condition just turned true from false within time period\n // what about duration?\n if (m_duration == 0L) {\n // no need to consider duration, so result is true\n m_result = true;\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Within time period but no duration, condition changed: \" + m_result);\n }\n setChanged();\n } else if (m_timerTrueDuring == 0L) {\n // duration timer hasn't started, start it\n m_timerTrueDuring = curTime;\n } else if (curTime - m_duration >= m_duration) {\n // duration was specified, timer started, AND\n // we've met duration\n m_result = true;\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Within time period AND met duration, condition changed: \" + m_result);\n }\n setChanged();\n }\n } else if (m_result && !curResult) {\n // condition just turned false from true within time period\n if (m_duration == 0L) {\n // no duration to consider, result turns false\n m_result = false;\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Condition turned false, no duration\");\n }\n setChanged();\n } else if (m_timerTrueDuring > 0L) {\n // duration timer started, check it\n if (curTime - m_timerTrueDuring < m_duration) {\n // condition remained true insufficiently long\n m_result = false;\n m_timerTrueDuring = 0L; // unset duration timer\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Condition turned false, not true sufficiently long!\");\n }\n setChanged();\n }\n // TODO: if condition was true for duration, but turned false before period is up, should we consider result to be true then???\n }\n }\n } else { // period timer no longer relevant, unset it\n m_timerStart = 0L;\n if (Tool.logger().isDebugEnabled()) {\n Tool.logger().debug(\"Period exceeded, unset timer, end result: \" + m_result);\n }\n setChanged();\n }\n }\n }", "public boolean continueExecuting()\n {\n if (!closestEntity.isEntityAlive())\n {\n return false;\n }\n\n if (field_46105_a.getDistanceSqToEntity(closestEntity) > (double)(field_46101_d * field_46101_d))\n {\n return false;\n }\n else\n {\n return field_46102_e > 0;\n }\n }", "public boolean continueExecuting()\n\t{\n\t\treturn this.entity.posX != this.xPosition && this.yPosition != this.entity.posY && this.entity.posZ != this.zPosition;\n\t}", "public void execute(Execution execution, EngineOperations engineOperations) {\n \n Activity currentActivity = execution.getActivity();\n String defaultFlowId = (String) currentActivity.getProperty(\"defaultFlow\");\n \n Activity nextActivity = null;\n SequenceFlow defaultSequenceFlow = null;\n \n boolean found = false;\n Iterator<SequenceFlow> sequenceFlowIterator = currentActivity.getOutgoingSequenceFlow().iterator();\n while (!found && sequenceFlowIterator.hasNext()) {\n \n SequenceFlow sequenceFlow = sequenceFlowIterator.next();\n \n // Get condition, if true -> evaluate\n String conditionExpression = null;\n \n if (sequenceFlow.hasProperty(\"condition\")) {\n conditionExpression = (String) sequenceFlow.getProperty(\"condition\");\n }\n \n if (sequenceFlow.getProperty(\"id\").equals(defaultFlowId)) {\n defaultSequenceFlow = sequenceFlow;\n } else if (conditionExpression != null) {\n \n // TODO: implement expressions! .... for the moment always true\n nextActivity = sequenceFlow.getTargetActivity();\n }\n \n }\n \n if (nextActivity != null) {\n goToNextActivity(nextActivity, execution, engineOperations);\n } else if (defaultSequenceFlow != null) {\n goToNextActivity(defaultSequenceFlow.getTargetActivity(), execution, engineOperations);\n } else {\n throw new RuntimeException(\"Could not find a sequenceflow with true condition nor default flow\");\n }\n }", "@Override\n\tpublic void visit(IfStatement ifStatement) {\n\t\tifStatement.cond().accept(this);\n\t\tif(!isOk)\n\t\t\treturn;\n\t\tcheckType(\"boolean\");\n\t\tif(!isOk)\n\t\t\treturn;\n\t\tSet<String> elseClone = new HashSet<String>(uninit);\n\t\tifStatement.thencase().accept(this);\n\t\tif(!isOk)\n\t\t\treturn;\n\t\tSet<String> thenClone = new HashSet<String>(uninit);\n\t\tuninit = elseClone;\n\t\tifStatement.elsecase().accept(this);\n\t\tif(!isOk)\n\t\t\treturn;\n\t\tuninit.addAll(thenClone);\n\t}", "IfStatement createIfStatement();", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "protected void execute() {\n\t\t// get MP status from each talon\n\t\tleftTalon.getMotionProfileStatus(leftStatus);\n\t\trightTalon.getMotionProfileStatus(rightStatus);\n\n\t\t// Enable MP if not already enabled\n\t\tif ((leftStatus.btmBufferCnt > kMinPointsInTalon) && (rightStatus.btmBufferCnt > kMinPointsInTalon)) {\n\t\t\tstate = SetValueMotionProfile.Enable;\n\t\t}\n\t\tleftTalon.set(ControlMode.MotionProfile, state.value);\n\t\trightTalon.set(ControlMode.MotionProfile, state.value);\n\t\t// System.out.println(\"DriveByMotion: Execute Setting State: \" + state);\n\t\t\n\t\t// did we get an underrun condition since last time we checked?\n\t\tif (leftStatus.hasUnderrun || rightStatus.hasUnderrun) {\n\t\t\t// better log it so we know about it\n\t\t\tSystem.out.println(\"DriveByMotion: A Talon has underrun!!! Left Talon: \" + leftStatus.hasUnderrun + \" Right Talon: \" + rightStatus.hasUnderrun);\n\t\t\t// clear the error. This flag does not auto clear, so this way we never miss logging it.\n\t\t\tleftTalon.clearMotionProfileHasUnderrun(0);\n\t\t\trightTalon.clearMotionProfileHasUnderrun(0);\n\t\t}\n\t}", "public void visit(ConditionElement1 conditionElement1) {\n\t\t\n\t\t// if a != 0, jmp true1\n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jcc+Code.ne);\n\t\tCode.put2(11);\n\t\t\n\t\t// if b != 0, jmp true2\n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jcc + Code.ne);\n\t\tCode.put2(8);\n\t\t\n\t\t// false: put 0,jmp next \n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jmp);\n\t\tCode.put2(5);\n\t\t\n\t\t// true1\n\t\tCode.put(Code.pop);\n\t\t\n\t\t// true2\n\t\tCode.loadConst(1);\n\t\t\n\t\t// next\n\t}", "public static void termsAndConditions() {\n refreshScreen();\n System.out.println(\"\\n\\n\\t\\t\\tTERMS AND CONDITIONS:\\n\\n\");\n \n transitionBuffer();\n }", "protected void execute() {\n\t\tRobotMap.leftMaster.set(ControlMode.PercentOutput, vision.blockCheck() * turnMultiplier(\"left\"));\n\t\tRobotMap.rightMaster.set(ControlMode.PercentOutput, vision.blockCheck() * turnMultiplier(\"right\"));\n\t}", "public static void main(String[] args) {\n int i = 140;\n int j = 150;\n int k = 200;\n\n if (i>j){\n System.out.println(\"I is greater then J\");\n }\n else {\n System.out.println(\"I is Less then J \");\n }\n\n System.out.println(\"------------------------//Example of multiple conditions...---------------------------------------\");\n if (k>j){\n System.out.println(\"K is greater then J\");\n }\n else if (j==k){\n System.out.println(\"I is Equal to K\");\n }\n else {\n System.out.println(\"I is Less then to K \");\n }\n }", "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 showIfMeetsConditions() {\n\n if (!PrefUtils.getStopTrack(mContext) && (checkIfMeetsCondition() || isDebug)) {\n showRatePromptDialog();\n PrefUtils.setStopTrack(true, mContext);\n }\n }", "@Override\n\tpublic boolean execute() {\n\t\treturn false;\n\t}", "public void and(Condition c){\n result.retainAll(c.result);\n Collections.sort(result);\n }", "public boolean conditionFulfilled();", "@Override\n public void run(final String command, final String parameters) {\n KoLmafiaCLI CLI = this.CLI;\n String continuation = this.continuation;\n\n CLI.elseRuns(true);\n while (ConditionalStatement.test(parameters)) {\n CLI.elseInvalid();\n CLI.executeLine(continuation);\n CLI.elseRuns(false);\n }\n }", "public boolean conditionsMet(ExtendedPieceModel model) {\r\n\t\t// check if your turn and model is locked\r\n\t\t// check if not action locking\r\n\t\t// if there's a pending decision, the next decision even locking should\r\n\t\t// execute\r\n\t\t// check if cooldown is 0\r\n\t\tif ((MetaClock.getTurn(model) && !model.isLocked()) || !locking\r\n\t\t\t\t|| model.getPendingDecision() != null) {\r\n\t\t\tif (model.getCooldown(this) == 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}", "public boolean execute(Engine engine) {\r\n\t\t\t\r\n\t\treturn engine.executeEnd();\r\n\t}", "protected void statement(INestedIfElseClauseContainer upperIf) \r\n\t\t\t\t\t\t\t throws NoDefaultDistributionDeclaredException,\r\n\t\t\t\t\t\t\t\t\tInvalidConditionantException,\r\n\t\t\t\t\t\t\t\t\tSomeStateUndeclaredException,\r\n\t\t\t\t\t\t\t\t\tInvalidProbabilityRangeException,\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tTableFunctionMalformedException{\r\n\t\t// Debug.println(\"PARSING STATEMENT, VALUE = \" + value + \", LOOKAHEAD = \" + look);\r\n\t\tif (look == '[') {\r\n\t\t\t\t\t\t\t\r\n\t\t\t// Debug.println(\"\");\r\n\t\t\t// Debug.print(\" \");\r\n\t\t\tmatch('[');\r\n\t\t\t\r\n\t\t\t// initialize currently evaluated temporary table's collumn\r\n\t\t\t//this.currentProbCellList = new ArrayList<TempTableProbabilityCell>();\r\n\t\t\t\r\n\t\t\tassignmentOrIf(upperIf);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tmatch(']');\r\n\t\t\t// Debug.println(\"\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t// Debug.println(\"COULD NOT FIND '['\");\r\n\t\t\tthis.expected(\"[\");\r\n\t\t}\r\n\t}", "protected boolean checkOperators()\n {\n Object loLeft ;\n Object loRight ;\n Object loOperator ;\n Object loConditionType ;\n boolean lboolOK = true ;\n\n for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ )\n {\n loLeft = getData( \"AND_COND_LHS_\" + liCtr ).getObject() ;\n loConditionType = getData( \"AND_COND_TYP_\" + liCtr ).getObject() ;\n loOperator = getData( \"AND_COND_OPR_\" + liCtr ).getObject() ;\n loRight = getData( \"AND_COND_RHS_\" + liCtr ).getObject() ;\n if ( ( loLeft != null ) && ( loOperator == null ) )\n {\n lboolOK = false ;\n raiseException( \"An operator is required for Condition \" + liCtr ) ;\n } /* end if ( ( loLeft != null ) && ( loOperator == null ) ) */\n\n if (loConditionType == null)\n {\n if(loLeft != null)\n {\n lboolOK = false ;\n raiseException( \"%c:Q0150,v: Condition Type for Condition \" +\n liCtr + \",v: Left Hand Side is %\" ) ;\n }\n if(loRight != null)\n {\n lboolOK = false ;\n raiseException( \"%c:Q0150,v: Condition Type for Condition \" +\n liCtr + \",v: Right Hand Side is %\" ) ;\n }\n } /* end if (loConditionType == null) */\n } /* end for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ ) */\n return lboolOK ;\n }", "boolean execute();", "public void doCheckingDump() {\n \tcheckIntPos = true;\n \tcheckFloatPos = true;\n \tif(!framesText.getText().equals(\"\")) {\n \t\tcheckIntPos = checkIntPos && checkPosIntValues(framesText);\n \t}\n \tif(!dtDevcText.getText().equals(\"\")) {\n \t\tcheckFloatPos = checkFloatPos && checkPosFloatValues(dtDevcText);\n \t}\n }", "public void activate() {\n // PROGRAM 1: Student must complete this method\n if (control == 0) { // run and()\n \t\tand();\n \t} else if (control == 1) { //run or()\n \t\tor();\n \t} else if (control == 2) { //run add()\n \t\tadd();\n \t} else if (control == 6) { //run sub()\n \t\tsub();\n \t} else if (control == 7) { //run passB()\n \t\tpassB();\n \t} else {\n \t\tthrow new RuntimeException(\"invalid control\"); //otherwise, there was an invalid control\n \t}\n }", "public void setConditions(Conditions conditions) {\n this.conditions = conditions;\n }", "@Override\n public boolean isDone() {\n // boolean result = true;\n // try {\n // result = !evaluateCondition();\n // } catch (Exception e) {\n // logger.error(e.getMessage(), e);\n // }\n // setDone(true);\n // return result;\n // setDone(false);\n return false;\n }", "public static boolean runAllTests() {\r\n\r\n return testLinkedCart() && testAlphabetListConstructorIsEmpty()\r\n && testAlphabetListConstructorBadInput() && testAlphabetListAddBadInput1()&&\r\n testAlphabetListAddBadInput2()&&testAlphabetListAddBadInput2()&&\r\n testAlphabetListAdd() && testAlphabetListRemove();\r\n }", "public static void main(String args[]) {\n Scanner s = new Scanner(System.in);\n int T = s.nextInt();\n\n for(int i = 0; i < T; i++) {\n \n int hardness = s.nextInt();\n float carbon = s.nextFloat();\n int ts = s.nextInt();\n \n int grade = 5;\n \n boolean a = hardness > 50;\n boolean b = carbon < 0.7f;\n boolean c = ts > 5600;\n \n if (a && b && c) {\n grade = 10;\n } else if(a && b) {\n grade = 9;\n } else if(b && c) {\n grade = 8;\n } else if(a && c) {\n grade = 7;\n } else if(a || b || c) {\n grade = 6;\n }\n \n System.out.println(grade);\n }\n }", "public void run() {\n assertEquals(sendQuery(\"SFO\"), 7);\n assertEquals(sendQuery(\"RHV\"), 1);\n assertEquals(sendQuery(\"xyzzy\"), 0);\n }", "public void msgAllExecuted()\n {\n Alert allExecuted; // message when all block are computed\n allExecuted = new Alert(AlertType.INFORMATION);\n allExecuted.setTitle(\"Block editor\");\n allExecuted.setHeaderText(\"All block were successfully computed!\");\n allExecuted.setContentText(\"Clicking 'step' or 'run' button again will start new computation.\");\n allExecuted.showAndWait().ifPresent(rs -> {\n if (rs == ButtonType.OK) {}\n });\n }", "@Override\n public boolean execute() {\n return false;\n }", "@Override\n public boolean execute() {\n return false;\n }", "@Override\n\tpublic boolean execute() {\n\t\t// Runs the motors so they expel the ball for EXPEL_TIME seconds\n\t\tif (System.currentTimeMillis() - begin < EXPEL_TIME) {\n\t\t\taccumulatorController.systems.getAccumulatorMotors().setSpeed(ACCUMULATOR_POWER);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic void execute() {\n\t\tDMNModel model = getDmnRuntime().getModels().get(0); // assuming there is only one model in the KieBase\n\t\t\n\t\t// setting input data\n\t\tDMNContext dmnContext = createDmnContext(\n\t\t\t\tImmutablePair.of(\"customerData\", new CustomerData(\"Silver\", new BigDecimal(15)))\n\t\t);\n\t\t\n\t\t// executing decision logic\n\t\tDMNResult topLevelResult = getDmnRuntime().evaluateAll(model, dmnContext);\n\t\t\n\t\t// retrieving execution results\n\t\tSystem.out.println(\"--- results of evaluating all ---\");\n\t\ttopLevelResult.getDecisionResults().forEach(this::printAsJson);\n\t}", "protected void scanStatements() {\n\t\tmakToStatementMap = scanStructuredBlocks(\r\n\t\t\t\tbldInfView.makToStatementMap, statementToMakMap, \r\n\t\t\t\tbldInfView.getMakMakeReferences(), IASTBldInfPrjMmpfilesBlockStatement.class,\r\n\t\t\t\tnew MakListConverter(bldInfView, BldInfView.PRJ_MMPFILES_KEYWORD));\r\n\t\ttestMakToStatementMap = scanStructuredBlocks(\r\n\t\t\t\tbldInfView.testMakToStatementMap, statementToTestMakMap, \r\n\t\t\t\tbldInfView.getTestMakMakeReferences(), IASTBldInfPrjMmpfilesBlockStatement.class,\r\n\t\t\t\tnew MakListConverter(bldInfView, BldInfView.PRJ_TESTMMPFILES_KEYWORD));\r\n\t\texportToStatementMap = scanStructuredBlocks(\r\n\t\t\t\tbldInfView.exportToStatementMap, statementToExportMap, \r\n\t\t\t\tbldInfView.getExports(), IASTBldInfPrjExportsBlockStatement.class,\r\n\t\t\t\tnew ExportListConverter(bldInfView, BldInfView.PRJ_EXPORTS_KEYWORD));\r\n\t\ttestExportToStatementMap = scanStructuredBlocks(\r\n\t\t\t\tbldInfView.testExportToStatementMap, statementToTestExportMap, \r\n\t\t\t\tbldInfView.getTestExports(), IASTBldInfPrjExportsBlockStatement.class,\r\n\t\t\t\tnew ExportListConverter(bldInfView, BldInfView.PRJ_TESTEXPORTS_KEYWORD));\r\n\t\textensionToStatementMap = scanStructuredBlocks(\r\n\t\t\t\tbldInfView.extensionToStatementMap, statementToExtensionsMap, \r\n\t\t\t\tbldInfView.getExtensions(), IASTBldInfPrjExtensionsBlockStatement.class,\r\n\t\t\t\tnew ExtensionListConverter(bldInfView, BldInfView.PRJ_EXTENSIONS_KEYWORD));\r\n\t\ttestExtensionToStatementMap = scanStructuredBlocks(\r\n\t\t\t\tbldInfView.testExtensionToStatementMap, statementToTestExtensionsMap, \r\n\t\t\t\tbldInfView.getTestExtensions(), IASTBldInfPrjExtensionsBlockStatement.class,\r\n\t\t\t\tnew ExtensionListConverter(bldInfView, BldInfView.PRJ_TESTEXTENSIONS_KEYWORD));\r\n\t}", "void visit(final AndCondition andCondition);", "private static void postCheck(String condition, HashMap<String, Object> preParams, HashMap<String, Object> postParams, HashMap<String, Object> preFields, HashMap<String, Object> postFields, Object result) throws ContractException {\n Bindings bind = engine.createBindings(); //A binding is used to link java and javascript.\n\n bind.putAll(preParams); //This adds the hashmaps of parameters to the engine.\n bind.putAll(postParams);\n bind.putAll(preFields); //This adds the fields.\n bind.putAll(postFields);\n\n bind.put(\"result\", result); //This adds the result to the script engine.\n\n engine.setBindings(bind, ScriptContext.ENGINE_SCOPE);\n\n testSimpleAssertion(condition, \"Post condition\"); //This runs the test.\n }" ]
[ "0.75013685", "0.66420925", "0.653926", "0.6364895", "0.61819696", "0.61380804", "0.6104452", "0.6032339", "0.5976952", "0.5951171", "0.5936671", "0.58592826", "0.58539724", "0.585007", "0.5821002", "0.5817896", "0.58037573", "0.58027154", "0.5800678", "0.5796141", "0.57584053", "0.5724541", "0.5711728", "0.57070917", "0.5703033", "0.56610894", "0.5644332", "0.56242865", "0.55927676", "0.55843", "0.55758864", "0.5567804", "0.5550639", "0.5540412", "0.55332714", "0.553306", "0.5526781", "0.55112576", "0.5502929", "0.54637843", "0.54497594", "0.5447812", "0.54451615", "0.54255193", "0.54183495", "0.54064775", "0.5381155", "0.53754234", "0.53715754", "0.535799", "0.53532046", "0.5346873", "0.53286374", "0.53262085", "0.5320761", "0.53054327", "0.529275", "0.5291885", "0.5290244", "0.52815676", "0.5280075", "0.5278341", "0.5276996", "0.52735263", "0.5265096", "0.52514136", "0.5246887", "0.5240418", "0.5239024", "0.52281094", "0.5213464", "0.5211591", "0.52110225", "0.5208154", "0.5207194", "0.5204329", "0.5203683", "0.52027", "0.51986593", "0.5195053", "0.51933783", "0.5189827", "0.51835537", "0.5182488", "0.5177532", "0.51752925", "0.5173888", "0.51715857", "0.5171145", "0.51656234", "0.5160855", "0.51603985", "0.5155525", "0.51510495", "0.5150862", "0.5150862", "0.5148956", "0.51450294", "0.5141161", "0.5140596", "0.513565" ]
0.0
-1
/ 1st assert all if statements are false, 2nd assert all if statements are true the 2 assert statements cover the branches in the code
@Test public void method1BC() { assertEquals(-2, FaultyClass.method1(-2)); assertEquals(1, FaultyClass.method1(3)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void assertAll() {\n\t\t\n\t}", "public void testPreConditions() {\r\n\t //fail(\"Precondition check not implemented!\");\r\n\t assertEquals(true,true);\r\n\t }", "@Test(enabled = false)\n\tpublic void HardAssert(){\n\t\t\t\t\n\t\tSystem.out.println(\"Hard Asset Step 1\");\n\t\tAssert.assertEquals(false, false);\n\t\tSystem.out.println(\"Hard Asset Step 2\");\n\t\tAssert.assertEquals(false, true);\n\t\tSystem.out.println(\"Hard Asset Step 3\");\n\t}", "@Test(expected=AssertionError.class)\n public void testAssertionsEnabled() {\n assert false;\n }", "@Test(expected=AssertionError.class)\n public void testAssertionsEnabled() {\n assert false;\n }", "@Test(expected=AssertionError.class)\n public void testAssertionsEnabled() {\n assert false;\n }", "private void validCheck ()\n\t{\n\t\tassert allButLast != null || cachedFlatListOrMore != null;\n\t}", "@Test\r\n\tpublic void testTournamentFileConditions() {\r\n\t\tassertTrue(cl.checkTournamentFileConditions(tags[2]));\r\n\t\tassertFalse(cl.checkTournamentFileConditions(tags2[2]));\r\n\t}", "private void assertTrue(boolean equals) {\n\t\t\r\n\t}", "@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}", "public void testPreConditions() {\n\t\tassertNotNull(activity);\n\t\tassertNotNull(mFragment);\n\t\tassertNotNull(mAdapter);\n\t\tassertTrue(mAdapter instanceof MensaListAdapter);\n\t}", "@Test\r\n void dependentAssertions() {\n \t\r\n assertAll(\"properties\",\r\n () -> {\r\n String firstName = person.getFirstName();\r\n assertNotNull(firstName);\r\n\r\n // Executed only if the previous assertion is valid.\r\n assertAll(\"first name\",\r\n () -> assertTrue(firstName.startsWith(\"J\")),\r\n () -> assertTrue(firstName.endsWith(\"n\"))\r\n );\r\n },\r\n () -> {\r\n // Grouped assertion, so processed independently\r\n // of results of first name assertions.\r\n String lastName = person.getLastName();\r\n assertNotNull(lastName);\r\n\r\n // Executed only if the previous assertion is valid.\r\n assertAll(\"last name\",\r\n () -> assertTrue(lastName.startsWith(\"D\")),\r\n () -> assertTrue(lastName.endsWith(\"e\"))\r\n );\r\n }\r\n );\r\n }", "@Test\n public void sanityCheck() {\n assertThat(true, is(true));\n }", "@VisibleForTesting\n @SuppressWarnings(\"CheckReturnValue\")\n void checkAssertions() {\n checkAssertions(root);\n }", "@Test\r\n\tpublic void testTournamentTurnsConditions() {\r\n\t\tassertTrue(cl.checkTournamentTurnsConditions(Integer.parseInt(tags[8])));\r\n\t\tassertFalse(cl.checkTournamentTurnsConditions(Integer.parseInt(tags2[8])));\r\n\t}", "private void usual() {\n try {\n //testing toString\n assertTrue(\"toString0\",\n f0.toString().equals(\"{...(0 elements)...}\"));\n assertTrue(\"toString1\",\n f1.toString().equals(\"{...(1 elements)...}\"));\n assertTrue(\"toString7\",\n f7.toString().equals(\"{...(2 elements)...}\"));\n\n //testing equals\n\n assertTrue(\"equals00\", f0.equals(f0));\n assertTrue(\"equals33\", f3.equals(f3));\n assertTrue(\"equals55\", f5.equals(f5));\n assertTrue(\"equals46\", f4.equals(f6));\n assertTrue(\"equals64\", f6.equals(f4));\n assertTrue(\"equals27\", f2.equals(f7));\n assertTrue(\"equals72\", f7.equals(f2));\n\n assertFalse(\"equals01\", f0.equals(f1));\n assertFalse(\"equals02\", f0.equals(f2));\n assertFalse(\"equals10\", f1.equals(f0));\n assertFalse(\"equals12\", f1.equals(f2));\n assertFalse(\"equals21\", f2.equals(f1));\n assertFalse(\"equals23\", f2.equals(f3));\n assertFalse(\"equals35\", f3.equals(f5));\n\n assertFalse(\"equals0string\", f0.equals(\"just a string\"));\n assertFalse(\"equals4string\", f4.equals(\"just a string\"));\n\n assertFalse(\"equals0null\", f0.equals(null));\n assertFalse(\"equals1null\", f1.equals(null));\n\n //testing hashCode\n assertTrue(\"hashCode00\", f0.hashCode() == f0.hashCode());\n assertTrue(\"hashCode44\", f4.hashCode() == f4.hashCode());\n assertTrue(\"hashCode46\", f4.hashCode() == f6.hashCode());\n assertTrue(\"hashCode27\", f2.hashCode() == f7.hashCode());\n }\n catch(Exception e) {\n System.out.println(\"Exception thrown during usual tests:\");\n System.out.println(e);\n assertTrue(\"usual\", false);\n }\n }", "private static void page013() {\n int x = 3;\n if (x == 3) {\n System.out.println(\"x must be 3\");\n }\n System.out.println(\"this line runs no matter what\");\n\n // Test 2\n int y = 2;\n if (y == 3) {\n System.out.println(\"y must be 3\");\n } else {\n System.out.println(\"y is NOT 3\");\n }\n }", "@Test\r\n\tpublic void testTournamentStrategiesConditions() {\r\n\t\tassertTrue(cl.checkTournamentStrategiesConditions(tags[4]));\r\n\t\tassertFalse(cl.checkTournamentStrategiesConditions(tags2[4]));\r\n\t}", "private static void assertTrue(boolean flag) {\n if (!flag) {\n throw new AssertionError(\"Case must be true\");\n }\n }", "private static void assertTrue(boolean flag) {\n if (!flag) {\n throw new AssertionError(\"Case must be true\");\n }\n }", "@Test(priority = 3)\n public void testVerifyQuestionTwo() {\n\t\tassertTrue(true);\n }", "@Test(priority = 4)\n public void testVerifyQuestionThree() {\n\t\tassertTrue(true);\n }", "@Test\n public void test5(){\n Assert.assertFalse(0>1, \"verify 0 not big then 1 \");\n }", "private static void assertTrue(boolean condition) {\n if (!condition) {\n throw new AssertionError(\"Expected condition to be true\");\n }\n }", "private static void testStuff(int i1, int i2) {\n\t\tif (i1 != i2)\n\t\t\terrors += 1;\n\t}", "@Test public void testAssertionsEnabled() {\n assertThrows(AssertionError.class, () -> {\n assert false;\n }, \"make sure assertions are enabled with VM argument '-ea'\");\n }", "private void AndOrderIsSentToKitchen() throws Exception {\n assert true;\n }", "@Test\r\n\tpublic void testTournamentGamesConditions() {\r\n\t\tassertTrue(cl.checkTournamentGamesConditions(Integer.parseInt(tags[6])));\r\n\t\tassertFalse(cl.checkTournamentGamesConditions(Integer.parseInt(tags2[6])));\r\n\t}", "@Test(priority = 2)\n public void testVerifyQuestionOne() {\n\t\tassertTrue(true);\n }", "@Test\r\n\tpublic void testDetermineMatchWinner1() {\n\t\tassertTrue(\"Error determining correct winner\", false);\r\n\t\t//Check that player records have been updated correctly\r\n\t\tassertTrue(\"Error updating player records\", false);\r\n\t}", "protected Assert() {\n\t}", "@Test\n public void boolean_true_assert() throws Exception {\n check(\"boolean_true_assert.c\",\n ImmutableMap.of(\"cpa.stator.policy.generateOctagons\", \"true\",\n \"CompositeCPA.cpas\",\n \"cpa.location.LocationCPA, cpa.callstack.CallstackCPA, cpa.functionpointer.FunctionPointerCPA, cpa.loopstack.LoopstackCPA, cpa.value.ValueAnalysisCPA, cpa.policyiteration.PolicyCPA\",\n \"precision.trackIntAddVariables\", \"false\",\n \"precision.trackVariablesBesidesEqAddBool\", \"false\"));\n }", "@Test\r\n\tpublic void testDetermineMatchWinner2() {\n\t\tassertTrue(\"Error determining correct winner\", false);\r\n\t\t//Check that player records have been updated correctly\r\n\t\tassertTrue(\"Error updating player records\", false);\r\n\t}", "boolean assertExpected(Exception e);", "private void ThenPaymentIsProcessed() throws Exception {\n assert true;\n }", "boolean testOnTickTester(Tester t) {\n return t\n .checkExpect(new NBullets(0).onTickTester(), new NBullets(new MtLoGamePiece(),\n new MtLoGamePiece(), 0, 0, 1, new Random()))\n && t.checkExpect(new NBullets(lob2, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(\n new ConsLoGamePiece(\n new Bullet(2, Color.PINK, new MyPosn(250, 292), new MyPosn(0, -8), 1),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(1, 0), 2),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(-1, 0), 2),\n new MtLoGamePiece()))),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(50, 200), new MyPosn(50, 50)),\n new MtLoGamePiece()))),\n 8, 14, 24, new Random()))\n && t.checkExpect(new NBullets(lob5, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(new MtLoGamePiece(),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(50, 200),\n new MyPosn(50, 50)), new MtLoGamePiece()))))),\n 8, 12, 24, new Random()));\n }", "@Test\n\t/**\n\t * Testing the conditional statements.\n\t * Testing:\n\t * - A correct sample program.\n\t * - A sample program containing spelling and context free errors.\n\t * - A sample program containing context errors.\n\t * - A sample program containing runtime errors.\n\t * \n\t * @throws ParseException\n\t * @throws IOException\n\t */\n\tpublic void conditionalTest() throws ParseException, IOException{\n\t\tint[] input = {5, 4, 10, 6, 99};\n\t\tint[] output = {1, -1, 5, 5, 99, 5, -1, 99};\n\t\tcheckRuntime(\"conditionalCorrect\", input, output);\n\t\t\n\t\t/** Check whether a program contains syntax errors. */\n\t\tcheckFail(\"conditionalSpellingContextFreeSyntaxError\");\n\t\t\n\t\t/** Check whether a program contains the given errors. */\n\t\tSet<String> errors = new HashSet<String>();\n\t\terrors.add(\"Line 36:24 - Expected type 'Boolean' but found 'Char'\");\n\t\terrors.add(\"Line 34:10 - Expected type 'Boolean' but found 'Integer'\");\n\t\terrors.add(\"Line 39:9 - Expected type not null but found 'null'\");\n\t\terrors.add(\"Line 44:10 - Expected type not null but found 'null'\");\n\t\terrors.add(\"Line 58:10 - 'ivar4' not defined in scope\");\n\t\terrors.add(\"Line 61:9 - 'ivar3' not defined in scope\");\n\t\terrors.add(\"Line 65:1 - Expected type 'Boolean' but found 'Integer'\");\n\t\terrors.add(\"Line 103:1 - Expected type 'Char' but found 'Boolean'\");\n\t\terrors.add(\"Line 132:1 - Expected type 'Integer' but found 'Char'\");\n\t\tcheckContextFail(\"conditionalContextError\", errors);\n\t\t\n\t\t/** Check whether a program gives a runtime error. */\n\t\tcheckRuntimeFail(\"conditionalRuntimeError\", 1);\n\t}", "@org.junit.Test(timeout = 10000)\n public void testEmptyFoo2_cf26110_failAssert7_add26308() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Foo> foos = new java.util.ArrayList<io.protostuff.Foo>();\n foos.add(new io.protostuff.Foo());\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyFoo2_cf26110_failAssert7_add26308__9 = // MethodCallAdder\nwriteListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyFoo2_cf26110_failAssert7_add26308__9, 2);\n writeListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Foo> parsedFoos = parseListFrom(in, io.protostuff.SerializableObjects.foo.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_5992 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_5992);\n // StatementAdderMethod cloned existing statement\n vc_5992.testBaz();\n // MethodAssertGenerator build local variable\n Object o_20_0 = (parsedFoos.size()) == (foos.size());\n int i = 0;\n for (io.protostuff.Foo f : parsedFoos)\n io.protostuff.SerializableObjects.assertEquals(foos.get((i++)), f);\n \n org.junit.Assert.fail(\"testEmptyFoo2_cf26110 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "private void assertCondition(Condition condition) {\n\t}", "@Test\r\n\tpublic void checkBreathsTest() {\n\t\tassertTrue(boardService.getGameRules().checkBreaths(board.field[10][16])); //we expect to have breaths\r\n\t\t\r\n\t\t//than we check if whites have breaths - expected = false\r\n\t\tassertFalse(boardService.getGameRules().checkBreaths(board.field[11][15])); //we expect no to have breaths\r\n\t}", "private void checkRep() {\n for (Ball ball : balls) {\n assert ball.getPosition().d1 >= 0\n && ball.getPosition().d1 <= WIDTH - 1;\n assert ball.getPosition().d2 >= 0\n && ball.getPosition().d2 <= HEIGHT - 1;\n }\n for (Gadget gadget : gadgets) {\n assert gadget.getPosition().d1 >= 0\n && gadget.getPosition().d1 <= WIDTH - 1;\n assert gadget.getPosition().d2 >= 0\n && gadget.getPosition().d2 <= HEIGHT - 1;\n }\n\n assert GRAVITY > 0 && MU2 > 0 && MU > 0;\n }", "public static void testbed() {\n int s[] = {5, 1, 0, 4, 2, 3};\n int y = length_easy(s, 3);\n\n System.out.println(\"length_easy y = \" + y);\n u.myassert(y == 4);\n int b[] = {5, 1, 0, 4, 2, 3};\n int x = length(s, 3);\n System.out.println(\"length x = \" + x);\n u.myassert(x == y);\n for (int i = 0; i < s.length; ++i) {\n u.myassert(s[i] == b[i]);\n }\n System.out.println(\"Assert passed\");\n }", "private static final void m108assert(boolean value) {\n if (_Assertions.ENABLED && !value) {\n throw new AssertionError(\"Assertion failed\");\n }\n }", "@Test\n\tpublic void testCase2()\n\t{\n\t\tint numberOfCases=-1;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertFalse(valid);\n\t\t\n\t}", "@Test\n\tvoid testCheckCoordinates4() {\n\t\tassertFalse(DataChecker.checkCoordinate(-100));\n\t}", "boolean testOnTick(Tester t) {\n return t\n .checkExpect(new NBullets(0).onTickTester(), new NBullets(new MtLoGamePiece(),\n new MtLoGamePiece(), 0, 0, 1))\n && t.checkExpect(new NBullets(lob2, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(\n new ConsLoGamePiece(\n new Bullet(2, Color.PINK, new MyPosn(250, 292), new MyPosn(0, -8), 1),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(1, 0), 2),\n new ConsLoGamePiece(\n new Bullet(4, Color.PINK, new MyPosn(51, 50), new MyPosn(-1, 0), 2),\n new MtLoGamePiece()))),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(50, 200), new MyPosn(50, 50)),\n new MtLoGamePiece()))),\n 8, 14, 24))\n && t.checkExpect(new NBullets(lob5, los3, 8, 12, 23, new Random(2)).onTickTester(),\n new NBullets(new MtLoGamePiece(), new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(4, 239), new MyPosn(4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(496, 248), new MyPosn(-4, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), new MyPosn(1, 0)),\n new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(50, 200), new MyPosn(50, 50)),\n new MtLoGamePiece()))))),\n 8, 12, 24));\n }", "@Test\n public void directJudgmentCase() {\n\n int num1 = 2;\n int num2 = 2;\n int expected1 = 4;\n int expected2 = 3;\n\n int actual = AssertionCalculator.add(num1, num2);\n\n //直接斷言該值是否為true\n Assertions.assertTrue(expected1 == actual, \"AssertionCalculator.add(\" + num1 + \",\" + num2 + \") == \" + expected1 + \"is false\");\n //直接斷言該值是否為false\n Assertions.assertFalse(expected2 == actual, \"AssertionCalculator.add(\" + num1 + \",\" + num2 + \") == \" + expected2 + \"is true\");\n\n }", "private void checkRep(){\n assert !this.username.equals(\"\");\n assert !this.password.equals(\"\");\n assert accessLevel != null;\n }", "public final void testValidTransaction() {\n assertTrue(testTransaction1.isValidTransaction());\n assertFalse(testTransaction2.isValidTransaction());\n }", "@Test\n\tpublic void testAssertFalse()\n\t{\n\t\tassertFalse(service.MultiplicationCalculator(0, 2)> 0); // False\n\t}", "@Test\n public void testIsValidTap() {\n setUpCorrect();\n assertTrue(boardManager.isValidTap(11));\n assertTrue(boardManager.isValidTap(14));\n assertFalse(boardManager.isValidTap(10));\n }", "@Override\r\n\tpublic boolean CheckConditions() {\n\t\treturn true;\r\n\t}", "@Test\n\tvoid testCheckCoordinates5() {\n\t\tassertFalse(DataChecker.checkCoordinate(100));\n\t}", "@Test\n @DisplayName(\"Test should detect inequality between unequal states.\")\n public void testShouldResultInInequality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Goodbye\");\n\n Assertions.assertThat(os1).isNotEqualTo(os2);\n }", "private static void checkEqualsAndHashCodeMethods(Object lhs, Object rhs,\n boolean expectedResult) {\n if ((lhs == null) && (rhs == null)) {\n Assert.assertTrue(\n \"Your check is dubious...why would you expect null != null?\",\n expectedResult);\n return;\n }\n\n if ((lhs == null) || (rhs == null)) {\n Assert.assertFalse(\n \"Your check is dubious...why would you expect an object \"\n + \"to be equal to null?\", expectedResult);\n }\n\n if (lhs != null) {\n assertEquals(expectedResult, lhs.equals(rhs));\n }\n if (rhs != null) {\n assertEquals(expectedResult, rhs.equals(lhs));\n }\n\n if (expectedResult) {\n String hashMessage =\n \"hashCode() values for equal objects should be the same\";\n Assert.assertTrue(hashMessage, lhs.hashCode() == rhs.hashCode());\n }\n }", "@org.junit.Test(timeout = 10000)\n public void testEmptyFoo_cf21684_failAssert6_add21955() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Foo> foos = new java.util.ArrayList<io.protostuff.Foo>();\n foos.add(new io.protostuff.Foo());\n foos.add(new io.protostuff.Foo());\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyFoo_cf21684_failAssert6_add21955__11 = // MethodCallAdder\nwriteListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyFoo_cf21684_failAssert6_add21955__11, 3);\n writeListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Foo> parsedFoos = parseListFrom(in, io.protostuff.SerializableObjects.foo.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_4982 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_4982);\n // StatementAdderMethod cloned existing statement\n vc_4982.testBarTooLarge3();\n // MethodAssertGenerator build local variable\n Object o_22_0 = (parsedFoos.size()) == (foos.size());\n int i = 0;\n for (io.protostuff.Foo f : parsedFoos)\n io.protostuff.SerializableObjects.assertEquals(foos.get((i++)), f);\n \n org.junit.Assert.fail(\"testEmptyFoo_cf21684 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "private boolean doTestsPass()\r\n {\r\n return minimalSteps(\"ABCDABCE\") == 8 && minimalSteps(\"ABCABCE\") == 5;\r\n }", "@Test\n void basicTest() {\n final OSEntropyCheck.Report report =\n assertDoesNotThrow(() -> OSEntropyCheck.execute(), \"Check should not throw\");\n assertTrue(report.success(), \"Check should succeed\");\n assertNotNull(report.elapsedNanos(), \"Elapsed nanos should not be null\");\n assertTrue(report.elapsedNanos() > 0, \"Elapsed nanos should have a positive value\");\n assertNotNull(report.randomLong(), \"A random long should have been generated\");\n }", "@org.junit.Test(timeout = 10000)\n public void testEmptyBar2_cf10132_failAssert6_add10324() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Bar> bars = new java.util.ArrayList<io.protostuff.Bar>();\n bars.add(new io.protostuff.Bar());\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyBar2_cf10132_failAssert6_add10324__9 = // MethodCallAdder\nwriteListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyBar2_cf10132_failAssert6_add10324__9, 2);\n writeListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Bar> parsedBars = parseListFrom(in, io.protostuff.SerializableObjects.bar.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_2318 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_2318);\n // StatementAdderMethod cloned existing statement\n vc_2318.testBarTooLarge3();\n // MethodAssertGenerator build local variable\n Object o_20_0 = (parsedBars.size()) == (bars.size());\n int i = 0;\n for (io.protostuff.Bar b : parsedBars)\n io.protostuff.SerializableObjects.assertEquals(bars.get((i++)), b);\n \n org.junit.Assert.fail(\"testEmptyBar2_cf10132 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "@Test\n public void TestIlegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisonaz\",5,1,1)\n ,false , \" check horisontal spelling\"\n );\n\n //illegal : check vertical\n Assert.assertEquals(player.CorrectInputCheck(\"verticles\",5,1,1)\n ,false , \" check vertical spelling\"\n );\n\n //illegal : place a 5 ship horisontal at 0,1 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,0,1)\n ,false,\" illegal : place a 5 ship horisontal at 0,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,0 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,0)\n ,false, \" illegal : place a 5 ship horisontal at 1,0 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 7,1 ship is to big it goes outside the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,7,1)\n ,false , \" illegal : place a 5 ship horisontal at 7,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,7)\n ,false , \" illegal : place a 5 ship horisontal at 1,7 outside of the grid \"\n );\n\n\n }", "@Test\n\tpublic void testVerify() {\n\t\t\n\t\tSystem.out.println(\"Before Verfiy\");\n\t\tSoftAssert assert1 = new SoftAssert();\n\t\t\n\t\tassert1.fail();\n\t\t\n\t\tSystem.out.println(\"After Assertion\");\n\t}", "@Test\r\n\tpublic void testStartMatchToMatchLeaguePlayMatch2() {\n\t\tassertTrue(\"Portfolio value does not equal initial balance\", false);\r\n\t\t//Check that players cannot change their portfolios\t\t\r\n\t\tassertTrue(\"Stock holdings may not be modified\", false);\r\n\t}", "@org.junit.Test(timeout = 10000)\n public void testEmptyFooInner_cf31700_failAssert7_add31989() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Bar> bars = new java.util.ArrayList<io.protostuff.Bar>();\n bars.add(new io.protostuff.Bar());\n java.util.ArrayList<io.protostuff.Foo> foos = new java.util.ArrayList<io.protostuff.Foo>();\n io.protostuff.Foo foo = new io.protostuff.Foo();\n foo.setSomeBar(bars);\n foos.add(foo);\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyFooInner_cf31700_failAssert7_add31989__15 = // MethodCallAdder\nwriteListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyFooInner_cf31700_failAssert7_add31989__15, 4);\n writeListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Foo> parsedFoos = parseListFrom(in, io.protostuff.SerializableObjects.foo.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_7288 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_7288);\n // StatementAdderMethod cloned existing statement\n vc_7288.testBaz();\n // MethodAssertGenerator build local variable\n Object o_26_0 = (parsedFoos.size()) == (foos.size());\n int i = 0;\n for (io.protostuff.Foo f : parsedFoos)\n io.protostuff.SerializableObjects.assertEquals(foos.get((i++)), f);\n \n org.junit.Assert.fail(\"testEmptyFooInner_cf31700 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "protected void assertCoverage(final String expectedCoverage) {\n\t\t\n\t\tfinal List<Coverage> expected = Arrays.asList(expectedCoverage.split(\"\\n\")).stream()\n\t\t\t\t.map(o -> new Coverage(o.split(\":\"))).collect(Collectors.toList());\n\t\t\n\t\t// Step A:\n\t\t// Validation of coverage results is split into two steps. Step A checks if all\n\t\t// uncovered (zero) lines are found, step B checks if non-zero lines exist.\t\t\n\t\tfinal Set<Coverage> expectedZero = expected.stream().filter(Coverage::isZero)\n\t\t\t\t.filter(Coverage::isCoverage).collect(Collectors.toSet());\n\t\tfinal Set<Coverage> actualZeroCoverage = recorder.getZeroCoverage().stream().collect(Collectors.toSet());\n\t\tassertEquals(expectedZero, actualZeroCoverage);\n\t\t\n\t\t// Step B1 (coverage):\n\t\tfinal List<Coverage> actualNonZeroCoverage = recorder.getNonZeroCoverage();\n\t\tfinal List<Coverage> expectedNonZeroCoverage = expected.stream().filter(Coverage::isCoverage).\n\t\t\t\tfilter(c -> !c.isCost()).collect(Collectors.toList());\n\t\texpectedNonZeroCoverage.removeAll(actualZeroCoverage);\n\t\tfor (int i = 0; i < actualNonZeroCoverage.size(); i++) {\n\t\t\tfinal Coverage a = actualNonZeroCoverage.get(i);\n\t\t\tfinal Coverage e = expectedNonZeroCoverage.get(i);\n\t\t\tassertEquals(e, a);\n\t\t}\n\t\tassertTrue(expectedNonZeroCoverage.size() == actualNonZeroCoverage.size());\n\t\t\n\t\t// Step B2 (coverage with cost):\n\t\tfinal List<Coverage> actualCostCoverage = recorder.getCostCoverage();\n\t\tfinal List<Coverage> expectedCostCoverage = expected.stream().filter(Coverage::isCoverage)\n\t\t\t\t.filter(Coverage::isCost).collect(Collectors.toList());\n\t\tfor (int i = 0; i < actualCostCoverage.size(); i++) {\n\t\t\tfinal Coverage a = actualCostCoverage.get(i);\n\t\t\tfinal Coverage e = expectedCostCoverage.get(i);\n\t\t\tassertEquals(e, a);\n\t\t}\n\t\tassertTrue(expectedCostCoverage.size() == actualCostCoverage.size());\n\t\t\n\t\t// Step C (actions):\n\t\tfinal List<Coverage> actualActions = recorder.getActionCoverage();\n\t\tfinal List<Coverage> expectedActions = expected.stream().filter(Coverage::isAction).collect(Collectors.toList());\n\t\tfor (int i = 0; i < actualActions.size(); i++) {\n\t\t\tfinal Coverage a = actualActions.get(i);\n\t\t\tfinal Coverage e = expectedActions.get(i);\n\t\t\tassertEquals(e, a);\n\t\t}\n\t\tassertTrue(expectedActions.size() == actualActions.size());\n\t}", "@org.junit.Test(timeout = 10000)\n public void testEmptyBarInner_cf15625_failAssert6_add15826() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n io.protostuff.Bar bar = new io.protostuff.Bar();\n bar.setSomeBaz(new io.protostuff.Baz());\n java.util.ArrayList<io.protostuff.Bar> bars = new java.util.ArrayList<io.protostuff.Bar>();\n bars.add(bar);\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyBarInner_cf15625_failAssert6_add15826__12 = // MethodCallAdder\nwriteListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyBarInner_cf15625_failAssert6_add15826__12, 4);\n writeListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Bar> parsedBars = parseListFrom(in, io.protostuff.SerializableObjects.bar.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_3590 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_3590);\n // StatementAdderMethod cloned existing statement\n vc_3590.testBarTooLarge3();\n // MethodAssertGenerator build local variable\n Object o_23_0 = (parsedBars.size()) == (bars.size());\n int i = 0;\n for (io.protostuff.Bar b : parsedBars)\n io.protostuff.SerializableObjects.assertEquals(bars.get((i++)), b);\n \n org.junit.Assert.fail(\"testEmptyBarInner_cf15625 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "@org.junit.Test(timeout = 10000)\n public void testEmptyFooInner2_cf36313_failAssert8_add36622() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Bar> bars = new java.util.ArrayList<io.protostuff.Bar>();\n io.protostuff.Bar bar = new io.protostuff.Bar();\n bar.setSomeBaz(new io.protostuff.Baz());\n bars.add(bar);\n java.util.ArrayList<io.protostuff.Foo> foos = new java.util.ArrayList<io.protostuff.Foo>();\n io.protostuff.Foo foo = new io.protostuff.Foo();\n foo.setSomeBar(bars);\n foos.add(foo);\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyFooInner2_cf36313_failAssert8_add36622__18 = // MethodCallAdder\nwriteListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyFooInner2_cf36313_failAssert8_add36622__18, 6);\n writeListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Foo> parsedFoos = parseListFrom(in, io.protostuff.SerializableObjects.foo.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_8322 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_8322);\n // StatementAdderMethod cloned existing statement\n vc_8322.testFoo();\n // MethodAssertGenerator build local variable\n Object o_29_0 = (parsedFoos.size()) == (foos.size());\n int i = 0;\n for (io.protostuff.Foo f : parsedFoos)\n io.protostuff.SerializableObjects.assertEquals(foos.get((i++)), f);\n \n org.junit.Assert.fail(\"testEmptyFooInner2_cf36313 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "@Test\r\n public void testEqualscoupon() {\r\n log.info(\"starting testEqualscoupon()\");\r\n\tassertFalse (\"coupon1 NOT equal coupon2\", coupon1.equals(coupon2));\r\n\tlog.info (\"testNOTEqualscoupon PASSED\");\t\t\r\n }", "@Test\n public void altijdWaar() {\n assertThat(\"Altijd waar\", 6, anyOf(even(), not(even())));\n }", "@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }", "@Test\n\tpublic void testTAlive3() {\n\t\tassertEquals(false, (tank.getHealth() == 0));\n\t}", "@Test\n\tpublic void testCase1()\n\t{\n\t\tint numberOfCases=3;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertTrue(valid);\n\t}", "@RepeatedTest(20)\n void logicalOperatorsTest() {\n assertEquals(bi.or(bot), new Binary(\"1\"));\n assertEquals(bi.or(bof), bi);\n assertEquals(bi.and(bot), bi);\n assertEquals(bi.and(bof), new Binary(\"0\"));\n assertEquals(bot.or(bi), new Binary(\"1\"));\n assertEquals(bof.or(bi), bi);\n assertEquals(bot.and(bi), bi);\n assertEquals(bof.and(bi), new Binary(\"0\"));\n assertEquals(bot.and(bot), bot);\n assertEquals(bot.and(bof),bof);\n assertEquals(bof.and(bot),bof);\n assertEquals(bof.and(bof),bof);\n assertEquals(bot.or(bot), bot);\n assertEquals(bot.or(bof),bot);\n assertEquals(bof.or(bot),bot);\n assertEquals(bof.or(bof),bof);\n Binary b1 = new Binary(\"10001\");\n Binary b2 = new Binary(\"1001011\");\n assertEquals(b1.or(b2), new Binary(\"1111011\"));\n assertEquals(b1.and(b2), new Binary(\"1000001\"));\n assertEquals(b1.or(b2), b2.or(b1));\n assertEquals(b1.and(b2),b2.and(b1));\n assertEquals(bi.or(bi), bi);\n assertEquals(bi.and(bi),bi);\n Binary notbi = bi.neg();\n assertEquals(bi.or(notbi), new Binary(\"1\"));\n assertEquals(bi.and(notbi), new Binary(\"0\"));\n\n //nulls\n //Bool or ITypes \\ {Logicals}\n assertEquals(bot.or(st),Null);\n assertEquals(bof.or(st),Null);\n assertEquals(bot.or(f), Null);\n assertEquals(bof.or(i), Null);\n //Float or ITypes\n assertEquals(f.or(st), Null);\n assertEquals(f.or(bot), Null);\n assertEquals(f.or(bof), Null);\n assertEquals(f.or(i), Null);\n assertEquals(f.or(g), Null);\n assertEquals(f.or(bi), Null);\n //Int or ITypes\n assertEquals(i.or(st), Null);\n assertEquals(i.or(bot),Null);\n assertEquals(i.or(bof), Null);\n assertEquals(i.or(j), Null);\n assertEquals(i.or(f), Null);\n assertEquals(i.or(bi), Null);\n //Binary or ITypes \\ {Logicals}\n assertEquals(bi.or(st), Null);\n assertEquals(bi.or(f), Null);\n assertEquals(bi.or(i), Null);\n //NullType or ITypes\n assertEquals(Null.or(st), Null);\n assertEquals(Null.or(bof), Null);\n assertEquals(Null.or(f), Null);\n assertEquals(Null.or(i), Null);\n assertEquals(Null.or(bi), Null);\n assertEquals(Null.or(Null), Null);\n assertEquals(st.or(Null), Null);\n assertEquals(bot.or(Null), Null);\n assertEquals(f.or(Null), Null);\n assertEquals(i.or(Null), Null);\n assertEquals(bi.or(Null), Null);\n\n //Bool and ITypes \\ {Logicals}\n assertEquals(bot.and(st),Null);\n assertEquals(bof.and(st),Null);\n assertEquals(bot.and(f), Null);\n assertEquals(bof.and(i), Null);\n //Float and ITypes\n assertEquals(f.and(st), Null);\n assertEquals(f.and(bot), Null);\n assertEquals(f.and(bof), Null);\n assertEquals(f.and(i), Null);\n assertEquals(f.and(g), Null);\n assertEquals(f.and(bi), Null);\n //Int and ITypes\n assertEquals(i.and(st), Null);\n assertEquals(i.and(bot),Null);\n assertEquals(i.and(bof), Null);\n assertEquals(i.and(j), Null);\n assertEquals(i.and(f), Null);\n assertEquals(i.and(bi), Null);\n //Binary and ITypes \\ {Logicals}\n assertEquals(bi.and(st), Null);\n assertEquals(bi.and(f), Null);\n assertEquals(bi.and(i), Null);\n //NullType and ITypes\n assertEquals(Null.and(st), Null);\n assertEquals(Null.and(bof), Null);\n assertEquals(Null.and(f), Null);\n assertEquals(Null.and(i), Null);\n assertEquals(Null.and(bi), Null);\n assertEquals(Null.and(Null), Null);\n assertEquals(st.and(Null), Null);\n assertEquals(bot.and(Null), Null);\n assertEquals(f.and(Null), Null);\n assertEquals(i.and(Null), Null);\n assertEquals(bi.and(Null), Null);\n\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\" SELECT * FROM \");\n assertFalse(boolean0);\n assertNotNull(boolean0);\n }", "@Test\n\tvoid testCheckCoordinates2() {\n\t\tassertTrue(DataChecker.checkCoordinate(-1));\n\t}", "@Test\n public void isCollideTest0() {\n \n boolean actual = game.isCollide(p1, p2);\n boolean expected = false;\n \n assertEquals(actual, expected);\n }", "@Test\n public void equals_DifferentDiningHallBitfield_Test() {\n Assert.assertFalse(bq1.equals(bq6));\n Assert.assertFalse(bq1.equals(bq7));\n }", "void pass() {\r\n if (m1 >=35 && m2>=35 && m3>=35) {\r\n System.out.println(\"pass\");\r\n } else {\r\n System.out.println(\"fail\");\r\n }\r\n }", "public void test() {\n\tassertTrue(true);\n\t}", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "@Test\r\n public void testIsValidTap() {\r\n assertTrue(boardManager3.isValidTap(7));\r\n assertTrue(boardManager3.isValidTap(5));\r\n assertFalse(boardManager3.isValidTap(0));\r\n }", "@Test\r\n\tpublic void testStartMatchToMatchLeaguePlayMatch1() {\n\t\tassertTrue(\"Portfolio value does not equal initial balance\", false);\r\n\t\t//Check that players cannot change their portfolios\t\t\r\n\t\tassertTrue(\"Stock holdings may not be modified\", false);\r\n\t}", "@Test public void operationTest(){\n assertEquals(calculator.squareOf(8),64);\n assertEquals(calculator.elementOf(9),3);\n assertEquals(calculator.factorial(5),120);\n assertEquals(calculator.isPrimeNumber(2),true);\n assertEquals(calculator.isPrimeNumber(13),true);\n assertEquals(calculator.isPrimeNumber(9),false);\n // assertNotEquals(calculator.factorial(4),10);\n }", "@org.junit.Test(timeout = 10000)\n public void testEmptyBar_cf5610_failAssert10_add5909() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Bar> bars = new java.util.ArrayList<io.protostuff.Bar>();\n bars.add(new io.protostuff.Bar());\n bars.add(new io.protostuff.Bar());\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyBar_cf5610_failAssert10_add5909__11 = // MethodCallAdder\nwriteListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyBar_cf5610_failAssert10_add5909__11, 3);\n writeListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Bar> parsedBars = parseListFrom(in, io.protostuff.SerializableObjects.bar.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_1294 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_1294);\n // StatementAdderMethod cloned existing statement\n vc_1294.testFooTooLarge();\n // MethodAssertGenerator build local variable\n Object o_22_0 = (parsedBars.size()) == (bars.size());\n int i = 0;\n for (io.protostuff.Bar b : parsedBars)\n io.protostuff.SerializableObjects.assertEquals(bars.get((i++)), b);\n \n org.junit.Assert.fail(\"testEmptyBar_cf5610 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "@org.junit.Test(timeout = 10000)\n public void testBar_cf67_failAssert9_add343() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Bar> bars = new java.util.ArrayList<io.protostuff.Bar>();\n bars.add(io.protostuff.SerializableObjects.bar);\n bars.add(io.protostuff.SerializableObjects.negativeBar);\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testBar_cf67_failAssert9_add343__9 = // MethodCallAdder\nwriteListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testBar_cf67_failAssert9_add343__9, 148);\n writeListTo(out, bars, io.protostuff.SerializableObjects.bar.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Bar> parsedBars = parseListFrom(in, io.protostuff.SerializableObjects.bar.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_20 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_20);\n // StatementAdderMethod cloned existing statement\n vc_20.testFooEmpty();\n // MethodAssertGenerator build local variable\n Object o_20_0 = (parsedBars.size()) == (bars.size());\n int i = 0;\n for (io.protostuff.Bar b : parsedBars)\n io.protostuff.SerializableObjects.assertEquals(bars.get((i++)), b);\n \n org.junit.Assert.fail(\"testBar_cf67 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "private void verifyEvents(boolean titleEvent, boolean nameEvent, boolean descriptionEvent) {\n if (titleEvent) {\n Assert.assertEquals(\"Missing title change event\", titleEvent, titleChangeEvent);\n }\n if (nameEvent) {\n Assert.assertEquals(\"Missing name change event\", nameEvent, nameChangeEvent);\n }\n if (descriptionEvent) {\n Assert.assertEquals(\"Missing content description event\", descriptionEvent, contentChangeEvent);\n }\n }", "@Test\n\tvoid testCheckCoordinates6() {\n\t\tassertTrue(DataChecker.checkCoordinate(90));\n\t}", "@Test\n public void testEquals() {\n assertFalse(jesseOberstein.equals(nathanGoodman));\n assertTrue(kateHutchinson.equals(kateHutchinson));\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"SELECT * FROM null WHERE null = null AND null = null AND null = 'oeQdkmCG0DtW' AND null = null AND null = java.lang.Object@1593efe2\");\n assertFalse(boolean0);\n assertNotNull(boolean0);\n }", "private void assertEqual(Iterator expected, Iterator actual) {\n\t\t\n\t}", "@org.junit.Test(timeout = 10000)\n public void testEmptyList_cf41382_failAssert2_add41676() throws java.lang.Exception {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.util.ArrayList<io.protostuff.Foo> foos = new java.util.ArrayList<io.protostuff.Foo>();\n java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();\n // AssertGenerator replace invocation\n int o_testEmptyList_cf41382_failAssert2_add41676__7 = // MethodCallAdder\nwriteListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n // AssertGenerator add assertion\n org.junit.Assert.assertEquals(o_testEmptyList_cf41382_failAssert2_add41676__7, 0);\n writeListTo(out, foos, io.protostuff.SerializableObjects.foo.cachedSchema());\n byte[] data = out.toByteArray();\n java.io.ByteArrayInputStream in = new java.io.ByteArrayInputStream(data);\n java.util.List<io.protostuff.Foo> parsedFoos = parseListFrom(in, io.protostuff.SerializableObjects.foo.cachedSchema());\n // StatementAdderOnAssert create null value\n io.protostuff.DelimiterTest vc_9446 = (io.protostuff.DelimiterTest)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_9446);\n // StatementAdderMethod cloned existing statement\n vc_9446.testBarTooLarge3();\n // MethodAssertGenerator build local variable\n Object o_18_0 = (parsedFoos.size()) == (foos.size());\n int i = 0;\n for (io.protostuff.Foo f : parsedFoos)\n io.protostuff.SerializableObjects.assertEquals(foos.get((i++)), f);\n \n org.junit.Assert.fail(\"testEmptyList_cf41382 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "@Test\n\t\tpublic void orderTest () {\n\t\t\tassertTrue (Demo.isTriangle(2, 1, 4));\t\n\t\t}", "@Test\n void makeCoffee() {\n Assertions.assertFalse(machine.makeCoffee());\n\n //try with cup\n Assertions.assertDoesNotThrow(() -> {\n machine.positionCup();\n });\n\n Assertions.assertThrows(Exception.class, () -> {\n machine.positionCup();\n });\n\n\n Assertions.assertTrue(machine.makeCoffee());\n\n //check if correct amount as been subtracted\n Assertions.assertEquals(machine.getCurrentWater(), 1000 - machine.waterPerCup);\n Assertions.assertEquals(machine.getCurrentBeans(), 800 - machine.beansPerCup);\n\n //reset\n machine.fillWater();\n machine.fillBeans();\n machine.setCupPositioned(true);\n\n //test over boundary\n Assertions.assertTrue(machine.makeCoffee());\n Assertions.assertTrue(machine.makeCoffee());\n\n //set only water to boundary values and below\n machine.setCurrentWater(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentWater(machine.waterPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n //reset water\n machine.fillWater();\n\n //set only beans to boundary value and below\n machine.setCurrentBeans(0);\n Assertions.assertFalse(machine.makeCoffee());\n machine.setCurrentBeans(machine.beansPerCup);\n Assertions.assertTrue(machine.makeCoffee());\n\n\n }", "@Test\n public void questionIfNotAlreadyAccusedTest() throws Exception {\n\n }", "@Test\n void cupTesting() {\n Assertions.assertFalse(machine.isCupPositioned());\n Assertions.assertFalse(machine.removeCup());\n\n Assertions.assertDoesNotThrow(() -> machine.positionCup());\n\n Assertions.assertTrue(machine.removeCup());\n Assertions.assertFalse(machine.isCupPositioned());\n machine.setCupPositioned(true);\n Assertions.assertTrue(machine.isCupPositioned());\n\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkTest() {\n\t\tboolean flag = oTest.checkTest();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "boolean checkVerification();", "@Test\n\t\tpublic void woeIsMeUnreachabletest() {\n\t\t\tassertTrue(System.currentTimeMillis() > 0);\n\t\t}", "@Test\n public void testGetOnlinePosition() {\n assert false : \"testGetOnlinePosition not implemented.\";\n }", "@Test\n void mondayAssertions(){\n assumingThat(DayOfWeek.MONDAY.equals(LocalDate.now().getDayOfWeek()),\n () -> {\n assertEquals(4, 4);\n assertEquals(1, 1);\n });\n\n //assertions executed always\n assertEquals(5, 5);\n }", "@Test\n public void TestLegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" check horisontal \"\n );\n\n //legal : check vertical spelling\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" check vertical \"\n );\n\n //legal : place a 5 ship horisontal at 1,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" legal : place a 5 ship horisontal at 1,1 \"\n );\n\n // legal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,10)\n ,true ,\" legal : place a 5 ship horisontal at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,10,1)\n ,true ,\"000 legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship horisontal at 6,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,6,1)\n ,true , \" legal : place a 5 ship horisontal at 6,1 \"\n );\n\n // legal : place a 5 ship vertical at 1,6\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,6)\n ,true ,\"000 legal : place a 5 ship vertical at 10,6 \"\n );\n\n }", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"execcannot:create iwstance, module ignored.\");\n assertNull(boolean0);\n }" ]
[ "0.7223622", "0.7222011", "0.6752789", "0.65157473", "0.65157473", "0.65157473", "0.6496341", "0.64889586", "0.6485339", "0.6412468", "0.6407731", "0.6384091", "0.6362207", "0.6300283", "0.62969893", "0.6285335", "0.6283997", "0.62366784", "0.62301904", "0.62301904", "0.62267184", "0.6224273", "0.6195103", "0.6181608", "0.6181085", "0.61770725", "0.6176289", "0.61388767", "0.6125877", "0.6124637", "0.6116729", "0.6107295", "0.60776925", "0.6065095", "0.6049968", "0.60419023", "0.6023736", "0.6022716", "0.5994262", "0.5983033", "0.5974935", "0.5974585", "0.59736204", "0.59473497", "0.5923419", "0.59197253", "0.59129274", "0.5909618", "0.590925", "0.590446", "0.5902385", "0.58984816", "0.5895534", "0.588955", "0.58821833", "0.5875713", "0.5874348", "0.5870925", "0.5868578", "0.58643574", "0.58525807", "0.5847298", "0.5847093", "0.5838692", "0.5835298", "0.58351517", "0.5830518", "0.58265424", "0.58219004", "0.5815333", "0.5814803", "0.58132637", "0.58110064", "0.5810077", "0.5807032", "0.58000875", "0.5791069", "0.577374", "0.5772667", "0.57655776", "0.5763596", "0.5751976", "0.57482344", "0.57474595", "0.574604", "0.5743783", "0.57432497", "0.5735109", "0.5729555", "0.57265407", "0.57222795", "0.5721083", "0.5720911", "0.57180077", "0.57109225", "0.57001597", "0.5692896", "0.5684403", "0.56757736", "0.5671867", "0.5664688" ]
0.0
-1
/ because there are only 2 if statements in the code the possible pats are 2^2 = 4. Therefore path test should cover all 4 possible paths. The test below illustrates the 2 paths not covered by path coverage
@Test public void method1PC() { assertEquals(-2, FaultyClass.method1(-2)); assertEquals(1, FaultyClass.method1(3)); //test 1st IF TRUE, 2nd IF FALSE assertEquals(1, FaultyClass.method1(3));; //test 1st IF FALSE, 2nd IF TRUE //Arithmetic Exception and 100 path coverage here FaultyClass.method1(-1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void finiteUTurnCosts() {\n int right0 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(5, 2).setDistance(1000).set(speedEnc, 10, 10);\n int left6 = graph.edge(1, 6).setDistance(10).set(speedEnc, 10, 10).getEdge();\n int left0 = graph.edge(0, 7).setDistance(10).set(speedEnc, 10, 10).getEdge();\n graph.edge(7, 8).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(8, 9).setDistance(10).set(speedEnc, 10, 10);\n int right6 = graph.edge(9, 6).setDistance(10).set(speedEnc, 10, 10).getEdge();\n\n // enforce p-turn (using the loop in clockwise direction)\n setRestriction(0, 1, 6);\n setRestriction(5, 4, 3);\n\n assertPath(calcPath(0, 6, right0, left6), 107.0, 1070, 107000, nodes(0, 1, 2, 3, 4, 5, 2, 1, 6));\n // if the u-turn cost is finite it depends on its value if we rather do the p-turn or do an immediate u-turn at node 2\n assertPath(calcPath(0, 6, right0, left6, createWeighting(5000)), 107.0, 1070, 107000, nodes(0, 1, 2, 3, 4, 5, 2, 1, 6));\n assertPath(calcPath(0, 6, right0, left6, createWeighting(40)), 44, 40, 44000, nodes(0, 1, 2, 1, 6));\n\n assertPath(calcPath(0, 6, left0, right6), 4, 40, 4000, nodes(0, 7, 8, 9, 6));\n assertPath(calcPath(0, 6, left0, left6), 111, 1110, 111000, nodes(0, 7, 8, 9, 6, 1, 2, 3, 4, 5, 2, 1, 6));\n // if the u-turn cost is finite we do a u-turn at node 1 (not at node 7 at the beginning!)\n assertPath(calcPath(0, 6, left0, left6, createWeighting(40)), 46.0, 60, 46000, nodes(0, 7, 8, 9, 6, 1, 6));\n }", "@Test\r\n\tpublic void testTargetsFourSteps() {\r\n\t\tboard.calcTargets(24, 0, 4);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(4, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(24, 4)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 3)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(24, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 1)));\r\n\t\t\r\n\t\tboard.calcTargets(0, 20, 4);\r\n\t\ttargets = board.getTargets();\r\n\t\tassertEquals(4, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(1, 19)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(2, 20)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(3, 19)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(4, 20)));\r\n\t\t\r\n\t\t// Includes a path that doesn't have enough length plus one door\r\n\t\tboard.calcTargets(9, 0, 4);\r\n\t\ttargets= board.getTargets();\r\n\t\tassertEquals(8, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 4)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 3)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 1)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(12, 1)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(8, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 0)));\t\r\n\t}", "@Test\r\n public void testSimplePath() {\r\n int[][] path =\r\n {{1, 1, 0, 0, 0, 0},\r\n {0, 1, 1, 0, 0, 0},\r\n {0, 0, 1, 1, 0, 0},\r\n {0, 0, 0, 1, 1, 0},\r\n {0, 0, 0, 0, 1, 1}};\r\n assertEquals(10, RecursiveMethods.maxPathLength(path));\r\n }", "private boolean shouldReplanPath(State.StateView state, History.HistoryView history, Stack<MapLocation> currentPath)\n {\n \t\t/* TODO: Write this method\n \t\t * Check if the path is blocked every step or check if the next spot is blocked?\n \t\t * Does enemy attack if you get too close?\n \t\t */\n \t\n \t\n \t\t//checking if the next step is blocked\n \t\t//setting up local fields\n \t\tUnitView enemy = state.getUnit(enemyFootmanID);\n \t\tMapLocation next;\n \t\tif (!path.isEmpty()) {\n \t\t\tnext = path.peek();\n \t\t\n \t\t\tif(next.x == enemy.getXPosition() && next.y == enemy.getYPosition()) \n \t\t\t\treturn true;\n \t\t\t\n \t\t}\n \t\t\n return false;\n }", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "@Test\n public void verifyPathsInSequence() {\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n testGetCompanyHome();\n testGetCabinetFolder();\n testGetCaseFolder();\n testGetDocumentLibraryFolder();\n testEvidenceBankFolder();\n\n }", "private static void testAlgorithmOptimality() {\n AlgoFunction testAlgo = SG16Algorithm::new;\n\n //printSeed = false; // keep this commented out.\n Random seedRand = new Random(1241);\n int initial = seedRand.nextInt();\n for (int i=0; i<50000000; i++) {\n int sizeX = seedRand.nextInt(150) + 5;\n int sizeY = seedRand.nextInt(150) + 5;\n int seed = i+initial;\n int ratio = seedRand.nextInt(50) + 5;\n \n int max = (sizeX+1)*(sizeY+1);\n int p1 = seedRand.nextInt(max);\n int p2 = seedRand.nextInt(max-1);\n if (p2 == p1) {\n p2 = max-1;\n }\n \n int sx = p1%(sizeX+1);\n int sy = p1/(sizeX+1);\n int ex = p2%(sizeX+1);\n int ey = p2/(sizeX+1);\n\n double restPathLength = 0, normalPathLength = 0;\n try {\n GridGraph gridGraph = DefaultGenerator.generateSeededGraphOnly(seed, sizeX, sizeY, ratio);\n for (int iii=0;iii<300;++iii) Utility.generatePath(testAlgo, gridGraph, seedRand.nextInt(sizeX+1),seedRand.nextInt(sizeY+1),seedRand.nextInt(sizeX+1),seedRand.nextInt(sizeY+1));\n int[][] path = Utility.generatePath(testAlgo, gridGraph, sx, sy, ex, ey);\n path = Utility.removeDuplicatesInPath(path);\n restPathLength = Utility.computePathLength(gridGraph, path);\n \n path = Utility.computeOptimalPathOnline(gridGraph, sx, sy, ex, ey);\n path = Utility.removeDuplicatesInPath(path);\n normalPathLength = Utility.computePathLength(gridGraph, path);\n }catch (Exception e) {\n e.printStackTrace();\n System.out.println(\"EXCEPTION OCCURRED!\");\n System.out.println(\"Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Start = \" + sx + \",\" + sy + \" End = \" + ex + \",\" + ey);\n throw new UnsupportedOperationException(\"DISCREPANCY!!\");\n }\n \n if (Math.abs(restPathLength - normalPathLength) > 0.000001f) {\n //if ((restPathLength == 0.f) != (normalPathLength == 0.f)) {\n System.out.println(\"============\");\n System.out.println(\"Discrepancy Discovered!\");\n System.out.println(\"Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Start = \" + sx + \",\" + sy + \" End = \" + ex + \",\" + ey);\n System.out.println(\"Actual: \" + restPathLength + \" , Expected: \" + normalPathLength);\n System.out.println(restPathLength / normalPathLength);\n System.out.println(\"============\");\n throw new UnsupportedOperationException(\"DISCREPANCY!!\");\n } else {\n if (i%1000 == 999) {\n System.out.println(\"Count: \" + (i+1));\n System.out.println(\"OK: Seed = \" + seed +\" , Ratio = \" + ratio + \" , Size: x=\" + sizeX + \" y=\" + sizeY);\n System.out.println(\"Actual: \" + restPathLength + \" , Expected: \" + normalPathLength);\n }\n }\n }\n }", "@Test\n\tpublic void testHappyPath() {\n\t\texpected.add(new int[]{94133,94133});\n\t\texpected.add(new int[]{94200,94299});\n\t\texpected.add(new int[]{94600,94699});\n\t\t\n\t\t//interger arrays for happy path\n\t\tint[] a1 = new int[] {94133,94133}, a2 = {94200,94299}, a3 = {94600,94699};\n\n\t\tint canShip1 = 94199, canShip2 = 94300, canShip3 = 65532;\n\t\t\n\t\t//\n\t\tint cantShip1 = 94133, cantShip2 = 94650, cantShip3 = 94230, cantShip4 = 94600, cantShip5 = 94299;\n\t\t\n\t\tSystem.out.println(\"********************************** Start testHappyPath() **********************************\");\n\t\t\n\t\tSystem.out.print(\"Input ZipCode Ranges:---------------> \");\n\t\tZipCodeUtil.printZipRange(a1, a2, a3);\n\t\t\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(a1, a2, a3);\n\t\t\t\n\t\t\tSystem.out.println(\"<----------------------- :Output \");\n\t\t\t\n\t\t\tfor(int[] range : mergedZips){\n\t\t\t\tZipCodeUtil.printZipRange(range);\t\n\t\t\t}\n\t\t\t\n\t\t\tAssert.assertArrayEquals(expected.toArray(), mergedZips.toArray());\n\n\t\t\tSystem.out.println(\"<----------------------- :ZipCode Range\");\n\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tSystem.out.println(\"----------------- Test ZipCodes -------------------\");\n\n\t\t\tAssert.assertTrue(\"Can ship to: \"+ canShip1, ZipCodeUtil.getInstance().canShipTo(canShip1));\n\t\t\tSystem.out.println(\"Can ship to: \"+ canShip1 +\" \"+ ZipCodeUtil.getInstance().canShipTo(canShip1));\n\t\t\t\n\t\t\tAssert.assertTrue(\"Can ship to: \"+ canShip2, ZipCodeUtil.getInstance().canShipTo(canShip2));\n\t\t\tSystem.out.println(\"Can ship to: \"+ canShip2 +\" \"+ ZipCodeUtil.getInstance().canShipTo(canShip2));\n\t\t\t\n\t\t\tAssert.assertTrue(\"Can ship to: \"+ canShip3, ZipCodeUtil.getInstance().canShipTo(canShip3));\n\t\t\tSystem.out.println(\"Can ship to: \"+ canShip3 +\" \"+ ZipCodeUtil.getInstance().canShipTo(canShip3));\n\t\t\t\n\t\t\tAssert.assertFalse(\"Can't ship to: \"+ cantShip1, ZipCodeUtil.getInstance().canShipTo(cantShip1));\n\t\t\tSystem.out.println(\"Can't ship to: \"+ cantShip1 +\" \"+ ZipCodeUtil.getInstance().canShipTo(cantShip1));\n\t\t\t\n\t\t\tAssert.assertFalse(\"Can't ship to: \"+ cantShip2, ZipCodeUtil.getInstance().canShipTo(cantShip2));\n\t\t\tSystem.out.println(\"Can't ship to: \"+ cantShip2 +\" \"+ ZipCodeUtil.getInstance().canShipTo(cantShip2));\n\t\t\t\n\t\t\tAssert.assertFalse(\"Can't ship to: \"+ cantShip3, ZipCodeUtil.getInstance().canShipTo(cantShip3));\n\t\t\tSystem.out.println(\"Can't ship to: \"+ cantShip3 +\" \"+ ZipCodeUtil.getInstance().canShipTo(cantShip3));\n\t\t\t\n\t\t\tAssert.assertFalse(\"Can't ship to: \"+ cantShip4, ZipCodeUtil.getInstance().canShipTo(cantShip4));\n\t\t\tSystem.out.println(\"Can't ship to: \"+ cantShip4 +\" \"+ ZipCodeUtil.getInstance().canShipTo(cantShip4));\n\t\t\t\n\t\t\tAssert.assertFalse(\"Can't ship to: \"+ cantShip5 , ZipCodeUtil.getInstance().canShipTo(cantShip5));\n\t\t\tSystem.out.println(\"Can't ship to: \"+ cantShip5 +\" \"+ ZipCodeUtil.getInstance().canShipTo(cantShip5));\n\t\t\t\n\t\t\tSystem.out.println(\"----------------- End Test ZipCodes -------------------\");\n\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\tSystem.err.println(e.getErrorCode() + \" - \" + e.getMessage());\n\t\t\tAssert.fail(e.getErrorCode() + \" - \" + e.getMessage());\n\t\t}finally{\n\n\t\t\tSystem.out.println(\"********************************** End testHappyPath() **********************************\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Test\r\n public void testVeryShortPath() {\r\n int[][] path =\r\n {{1, 0},\r\n {0, 0}};\r\n assertEquals(1, RecursiveMethods.maxPathLength(path));\r\n }", "@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }", "@Test\n\tpublic void multipleSolutionsTest(){\n\t\tDjikstrasMap m = new DjikstrasMap();\t//Creates new DjikstrasMap object\n\t\t\n\t\tm.addRoad(\"Guildford\", \"Portsmouth\", 20.5, \"M3\");\t//Adds a road from Guildford to portsmouth to the map\n m.addRoad(\"Portsmouth\", \"Guildford\", 20.5, \"M3\");\n \n m.addRoad(\"Guildford\", \"Winchester\", 20.5, \"A33\");\t//Adds a road from Guildford to winchester to the map\n m.addRoad(\"Winchester\", \"Guildford\", 20.5, \"A33\");\n \n m.addRoad(\"Winchester\", \"Fareham\", 20.5, \"M27\");\t//Adds a road from winchester to fareham to the map\n m.addRoad(\"Fareham\", \"Winchester\", 20.5, \"M27\");\n\t\t\n m.addRoad(\"Portsmouth\", \"Fareham\", 20.5, \"M25\");\t//Adds a road from fareham to portsmouth to the map\n m.addRoad(\"Fareham\", \"Portsmouth\", 20.5, \"M25\");\n \n m.findShortestPath(\"Fareham\");\t//Starts the algorithm to find the shortest path\n \n List<String> temp = new ArrayList<String>();\t//Holds the route plan\n temp = m.createRoutePlan(\"Guildford\");\t//Calls methods to assign the route plan to temp\n \n assertEquals(\"1. Take the M27 to Winchester\",temp.get(0));\t//tests that the different lines in the route plan are correct and that the algorithm did indeed take the shortest route\n assertEquals(\"2. Take the A33 to Guildford\", temp.get(1));\n assertEquals(\"\", temp.get(2));\n assertEquals(\"The Journey will take 41 hours and .00 minutes long.\", temp.get(3));\n assertEquals(\"\", temp.get(4));\n \n assertEquals(5, temp.size());\t//tests to see that the route plan is 5 line large as it should be\n\t}", "@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }", "public static boolean checkPath(int[][] bs, int i) {\n\t\tArrayList<Integer> temp_cP = new ArrayList<Integer>();\n\t\tSet<Integer> temp_setcP = new HashSet<Integer>();\n\t\tboolean denoter = true;\n\t\twhile (i == 3) {\n\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\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\twhile (i == 6) {\n\n\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn denoter;\n\t}", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public static boolean checkPath(int[][] bs, int i) {\n ArrayList<Integer> temp_cP = new ArrayList<Integer>();\r\n Set<Integer> temp_setcP = new HashSet<Integer>();\r\n boolean denoter = true;\r\n while (i == 3) {\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n while (i == 6) {\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n return denoter;\r\n }", "@Test\n\tpublic void testGetPathLength() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.setSkillLevel(0);\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\tassertTrue(explorer.getPathLength() == 0);\n\t\t// moving the robot one unit and checking the odometer\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\tassertTrue(explorer.getPathLength() > 0);\n\t\t\n\t\t// moving the robot again to get a reading of 2\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\t\n\t\t\n\t\t// moving the robot a third time to make sure that the odometer is updating correctly\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t}", "@Test\n void test015_testGetShortestPath() {\n try {\n christmasBuddENetwork.addFriendship(\"HarrE\", \"Prancer\");\n\n christmasBuddENetwork.addFriendship(\"Santa\", \"Rudolph\");\n christmasBuddENetwork.addFriendship(\"Comet\", \"Santa\");\n christmasBuddENetwork.addFriendship(\"Rudolph\", \"Comet\");\n\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Comet\");\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Donder\");\n\n List<User> shortestPathFromSantaToDonder =\n christmasBuddENetwork.getShortestPath(\"Santa\", \"Donder\");\n ArrayList<String> shortestPathFromSantaToGrinchList =\n new ArrayList<String>();\n for (int i = 0; i < shortestPathFromSantaToDonder.size(); i++) {\n User currentUser = shortestPathFromSantaToDonder.get(i);\n String userName = currentUser.getName();\n shortestPathFromSantaToGrinchList.add(userName);\n }\n int numElementsShortestPath = shortestPathFromSantaToDonder.size();\n if (numElementsShortestPath != 4) {\n fail(\"test015_testGetShortestPath: FAILED! :(. Did NOT return 2 \"\n + \"elements for the shortest path, but instead: \"\n + numElementsShortestPath);\n }\n if ((!shortestPathFromSantaToGrinchList.get(1).equals(\"Comet\"))\n || (!shortestPathFromSantaToGrinchList.get(2).equals(\"Grinch\"))) {\n fail(\"test015_testGetShortestPath: FAILED! :( Did NOT return the proper\"\n + \" BuddEs on the way!\");\n }\n } catch (Exception e) {\n fail(\"test015_testGetShortestPath: FAILED! :( Threw an incorrect \"\n + \"exception!\");\n }\n }", "private void checkPaths(){\r\n\t\tif(noBeepersPresent()){\r\n\t\t\tif(leftIsClear()){\r\n\t\t\t\tif(frontIsBlocked()&&rightIsBlocked()&&cornerColorIs(RED)){\r\n\t\t\t\t\tturnLeft(); \r\n\t\t\t\t\tmakeMove();\r\n\t\t\t\t\tpaintCorner(RED);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tturnLeft(); \r\n\t\t\t\t\tcheckColors();\r\n\t\t\t\t}\r\n\t\t\t\tfollowPath();\r\n\t\t\t}\r\n\t\t\tif(frontIsClear()){\r\n\t\t\t\tcheckColors();\r\n\t\t\t\tfollowPath();\r\n\t\t\t}\r\n\t\t\tif(rightIsClear()){\r\n\t\t\t\tif(frontIsBlocked()&&leftIsBlocked()&&cornerColorIs(RED)){\r\n\t\t\t\t\tturnRight();\r\n\t\t\t\t\tmakeMove();\r\n\t\t\t\t\tpaintCorner(RED);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tturnRight();\r\n\t\t\t\t\tcheckColors();\r\n\t\t\t\t}\r\n\t\t\t\tfollowPath();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void checkPath( int[] path, int index, int x, int y, int distance ){\n if( x < 0 || x > 7 || y < 0 || y > 7 ){\n return;\n }\n //if the current path's length is 0 and we have found the board\n if( path[ index ] == 0 && gamepieces[ x ][ y ] == BACKGROUND_COLOR){\n //set the index to -1 to signify no flips are possible\n path[ index ] = -1;\n }else if( path[ index ] == 0 && gamepieces[ x ][ y ] == currentPlayer ){\n //if the path's length is 0 but we found a piece from the current player\n //note that location in the path\n path[ index ] = distance;\n }\n }", "public String canWalkExactly(int N, int[] from, int[] to) {\n isVisited = new boolean[N];\n steps = new int[N];\n minSteps = new int[N];\n path = new Stack<>();\n adj = new ArrayList<>(N);\n allSCC = new ArrayList<>();\n for (int i = 0; i < N; i++)\n adj.add(new ArrayList<>());\n\n // populate adj based on from, to\n for (int i = 0; i < from.length; i++) {\n adj.get(from[i]).add(to[i]);\n }\n\n totalSteps = 0;\n Arrays.fill(isVisited, false);\n Arrays.fill(steps, UNVISITED);\n Arrays.fill(minSteps, UNVISITED);\n tarjanSCC(0);\n\n // check if 0 and 1 are in the same scc\n System.out.println(\"CHECKING\");\n boolean found = false;\n for (List<Integer> scc : allSCC) {\n if (scc.contains(0) && scc.contains(1)) {\n found = true;\n break;\n }\n }\n if (!found) return NO;\n// if(minSteps[0] != minSteps[1]) return NO;\n System.out.println(\"0 and 1 in the same scc\");\n /*\n Check if gcd of the length of all simple cycles is 1\n by checking if it is an aperiodic graph\n https://en.wikipedia.org/wiki/Aperiodic_graph\n */\n depths = new int[N];\n Arrays.fill(depths, UNVISITED);\n depths[0] = 0;\n findDepths(0);\n\n int res = -1;\n for (int i = 0; i < from.length; i++) {\n int s = from[i];\n int t = to[i];\n if (depths[s] == UNVISITED || depths[t] == UNVISITED) continue;\n int len = depths[t] - depths[s] - 1;\n if (len == 0) continue;\n if (len < 0) len *= -1;\n if (res == -1) res = len;\n else res = gcd(res, len);\n }\n\n return res == 1 ? YES : NO;\n }", "@Test\n public void testGetShortestPath02() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n LinkedList<City> shortestPathCities = new LinkedList();\n Double expResult = 76.0;\n Double result = sn10.getShortestPath(userA, userB, shortestPathCities);\n assertFalse(expResult.intValue() == result.intValue());\n }", "@Test\n public void worksWithTurnCosts() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 4).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(0, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 2).setDistance(1).set(speedEnc, 10, 10);\n\n setRestriction(0, 3, 4);\n setTurnCost(4, 5, 2, 6);\n\n // due to the restrictions we have to take the expensive path with turn costs\n assertPath(calcPath(0, 2, 0, 6), 6.4, 4, 6400, nodes(0, 1, 4, 5, 2));\n // enforcing going south from node 0 yields no path, because of the restricted turn 0->3->4\n assertNotFound(calcPath(0, 2, 3, ANY_EDGE));\n // without the restriction its possible\n assertPath(calcPath(0, 2, ANY_EDGE, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n }", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "@Test\n\tpublic void checkShortestRoute() {\n\t\tassertEquals(Trains.shortestRoute(\"A\",\"C\"), 9);\n\t\t//assertEquals(Trains.shortestRoute(\"B\",\"B\"), 9);\n\t}", "private boolean isPathH(Board B, Move M, Graph G, int row, int column, Tile tile) {\n\n Tile t = tile;\n\n boolean result = true;\n boolean tempa = true;\n\n int sourceid = 0;\n\n\n int c = M.getX(), r = M.getY();\n\n if (r <= 0 && c <= 0) {\n\n\n } else if (r <= 0 && c >= 0) {\n\n\n } else if (r >= 0 && c >= 0) {\n\n for (int y = 0; y != 2; y++) {\n\n sourceid = (row * B.width) + column;\n\n // System.out.println(\"source id: \" + sourceid);\n\n if (y == 0) {\n\n\n //aab\n for (int i = 0; i != r; i++) {\n\n System.out.println(G.adj(sourceid).toString());\n\n if (G.adj.get(sourceid).contains(sourceid + B.width)) {\n\n // System.out.println(\"row artı\");\n\n } else {\n\n result = false;\n\n }\n\n sourceid += B.width;\n\n }\n\n for (int i = 0; i != c; i++) {\n\n\n if (G.adj.get(sourceid).contains(sourceid + 1)) {\n\n // System.out.println(\"okk\");\n\n } else {\n\n //return false;\n\n }\n\n sourceid += 1;\n\n System.out.println(\"b\");\n\n }\n } else {\n\n sourceid = row * B.width + column;\n\n for (int i = 0; i != c; i++) {\n // System.out.println(\"a\");\n\n }\n for (int i = 0; i != r; i++) {\n // System.out.println(\"b\");\n\n }\n }\n\n\n }\n\n\n }\n\n\n return result;\n }", "private void findPath1(List<Coordinate> path) {\n\n // records the start coordinate in a specific sequence.\n ArrayList<Coordinate> starts = new ArrayList<>();\n // records the end coordinate in a specific sequence.\n ArrayList<Coordinate> ends = new ArrayList<>();\n // records the total cost of the path in a specific sequence.\n ArrayList<Integer> cost = new ArrayList<>();\n\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(o1);\n graph.printPath(d1);\n starts.add(o1);\n ends.add(d1);\n cost.add(graph.getPathCost(d1));\n }\n }\n int index = getMinIndex(cost);\n\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(starts.get(index));\n graph.printPath(ends.get(index));\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n setSuccess(path);\n }", "@Test\n public void testPathAlongBorder() {\n try {\n //link row 1\n largeMaze.linkPillars(Maze.position(0, 0), Maze.position(1, 0));\n largeMaze.linkPillars(Maze.position(1, 0), Maze.position(2, 0));\n largeMaze.linkPillars(Maze.position(2, 0), Maze.position(3, 0));\n largeMaze.linkPillars(Maze.position(3, 0), Maze.position(4, 0));\n largeMaze.linkPillars(Maze.position(4, 0), Maze.position(4, 1));\n\n //link row 2\n largeMaze.linkPillars(Maze.position(4, 1), Maze.position(4, 2));\n\n //link row 3\n largeMaze.linkPillars(Maze.position(4, 2), Maze.position(4, 3));\n\n //link row 4\n largeMaze.linkPillars(Maze.position(4, 3), Maze.position(4, 4));\n\n //set beginning and end\n largeMaze.setBegin(Maze.position(0, 0));\n largeMaze.setEnd(Maze.position(4, 4));\n shortestPath = MazeSolver.pStar(largeMaze, 25);\n\n assertEquals(\"<0, 0>\", shortestPath.get(0).getCoordinateString());\n assertEquals(\"<1, 0>\", shortestPath.get(1).getCoordinateString());\n assertEquals(\"<2, 0>\", shortestPath.get(2).getCoordinateString());\n assertEquals(\"<3, 0>\", shortestPath.get(3).getCoordinateString());\n assertEquals(\"<4, 0>\", shortestPath.get(4).getCoordinateString());\n assertEquals(\"<4, 1>\", shortestPath.get(5).getCoordinateString());\n assertEquals(\"<4, 2>\", shortestPath.get(6).getCoordinateString());\n assertEquals(\"<4, 3>\", shortestPath.get(7).getCoordinateString());\n assertEquals(\"<4, 4>\", shortestPath.get(8).getCoordinateString());\n\n assertEquals(9, shortestPath.size());\n\n } catch (Exception e) {\n fail(\"Unexpected exception was thrown while linking pillars.\");\n }\n }", "@Test\r\n public void testSimpleDeadEnd() {\r\n int[][] path =\r\n {{1, 1, 0, 0, 0, 0},\r\n {0, 1, 1, 0, 0, 0},\r\n {0, 0, 1, 1, 0, 0},\r\n {0, 0, 0, 0, 0, 0},\r\n {0, 0, 0, 0, 0, 0}};\r\n assertEquals(6, RecursiveMethods.maxPathLength(path));\r\n }", "@Test\r\n public void testVeryVeryShortPath() {\r\n int[][] path =\r\n {{1}};\r\n assertEquals(1, RecursiveMethods.maxPathLength(path));\r\n }", "public int[][] isAnyPath(/*int [] Start, int[] End,*/Board B) {\r\n \t//Trace Moveset, determine if moveset is valid for current position [Exceptions are knight, which can move OVER pieces\r\n \t//As long as knight's ending position is not taken.\r\n \t//If Pawn\r\n \t\r\n \t//8X8 Board\r\n \t//int BoundR = 8;\r\n \t//int BoundC = 8;\r\n \t\r\n \t//int[][]Seq = null;\r\n \t\r\n \t//int[][]C_ = null;\r\n \t\r\n \t//LinkedList<int[]> L = new LinkedList<int []>();\r\n \t\r\n \tint Max_Mv_ln = 0;\r\n \tfor(int k=0;k<this.Movesets.length;k++) {\r\n \t\tSystem.out.printf(\"Compare Mx %s\\n\",this.Movesets[k]);\r\n \t\tif(this.Movesets[k]!=null)\r\n \t\tif(this.Movesets[k].toCharArray().length>Max_Mv_ln) {\r\n \t\t\tMax_Mv_ln = this.Movesets[k].toCharArray().length;\r\n \t\t}\r\n \t}\r\n \t\r\n \tSystem.out.printf(\"Maximum Move Size for Piece:%c,%d:\",this.type,Max_Mv_ln);\r\n \t\r\n \t//Each row is a moveset, each column is sets of two integers corresponding \r\n \t//to each move position\r\n \t\r\n \t//List of Path Sequence freedoms for each moveset of this PIECE \r\n \tLinkedList<int[][]> LAll = new LinkedList<int[][]>();\r\n \t\r\n \t//int Ct = 0;\r\n \t\r\n \tfor(int i=0;i<this.Movesets.length;i++) { \r\n \t//Found MoveSet[ith]\r\n \t\tif(this.Movesets[i]!=null) {\r\n \tchar []Mv = this.Movesets[i].toCharArray();\r\n \tint [] C2 = null;\r\n \tint[][]C = new int[Mv.length][1];\r\n \tSystem.out.printf(\"\\n\\nAnalyze Moveset:%s\\n\\n\", this.Movesets[i]);\r\n \tfor(int j=0;j<Mv.length;j++) {\r\n \t//Iterate through each movement pattern\r\n //Return Collision list of endpoints for pieces\r\n \tif(Mv[j]=='R'||Mv[j]=='D'||Mv[j]=='L'||Mv[j]=='U') {\r\n \t\t\r\n \t\tchar v = Character.toLowerCase(Mv[j]);\r\n \t\r\n \t}\r\n \t\r\n \telse {\r\n \t\tif(this.type=='k'&&j<Mv.length-2) {\r\n \t\t\tif(j>0)\r\n \t\t\tC2 = Collisions(Mv[j],Mv[j+1],/*Start,End,*/B,true,C[j-1]);\r\n \t\t\telse\r\n \t\t\tC2 = Collisions(Mv[j],Mv[j+1],/*Start,End,*/B,true,null);\r\n \t\t}\r\n \t\telse {\r\n \t\t\tif(j>0)\r\n \t\t\tC2 = Collisions(Mv[j],Mv[j+1],/*Start,End,*/B,false,C[j-1]);\r\n \t\t\telse\r\n \t\t\tC2 = Collisions(Mv[j],Mv[j+1],/*Start,End,*/B,false,null);\r\n \t\t\t\r\n \t\t}\r\n \t\tj++;\r\n \t\r\n \t}\r\n \t\r\n \tif(C2==null) {\r\n \t\t//MoveSet failed, on to next moveset for piece...\r\n \t\tC=null;\r\n \t\tbreak;\r\n \t}\r\n \telse {\r\n \t\t\r\n \t\tif(C2[0]<0) {\r\n \t\t\tC = null;\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tC[j] = C2;//ReSize(C2,LengthMvSet(this.Movesets[i]));\r\n \t\t//Ct++;\r\n \t\t//System.out.println(\"Add Moveset:\\n\");\r\n \t\t//PrintAll(C2,(C2.length/2));\r\n \t\t//PrintAll(C2,LengthMvSet(this.Movesets[i]));\r\n \t\t//C[j].length = (C[j].length/2)+6;\r\n \t\t//Ct++;\r\n \t}\r\n \t\r\n \t}\r\n \t//Add Path seq possibilities to list\r\n \tLAll.add(C);\r\n \t//System.out.println(\"Add Moveset:\\n\");\r\n \t/*\r\n \tif(C2!=null)\r\n \tPrintAll(C2,(C2.length/2)//+6//);\r\n \t*/\r\n \t}\r\n \t}\r\n \t\r\n \tSystem.out.printf(\"\\nALL possible paths for piece %c in position [%d,%d]\\n\",this.type,this.Position[0],this.Position[1]);\r\n \t\r\n \t//Object[] A = LAll.toArray();\r\n \tSystem.out.printf(\"LENGTH Of LIST:%d\", LAll.toArray().length);\r\n \t\r\n \tint [] E = new int[2];\r\n \t\r\n \tint[][] EAll = new int[this.Movesets.length][1];\r\n \t\r\n \tfor(int i=0;i<LAll.toArray().length;i++) {\r\n \t\tSystem.out.printf(\"Player %c Possibilities for %d Moveset:%s\\n\",super.Player,i,this.Movesets[i]);\r\n \t\tint[][]C2 = LAll.get(i);\r\n \t\tif(C2!=null) {\r\n \t\t\tfor(int k=0; k<C2.length;k++) {\r\n \t\t\t//System.out.printf(\"Length of this moveset: %d\\n\",LengthMvSet(this.Movesets[i]));\r\n \t\t\tif(C2[k]!=null) {\r\n \t\t\tfor(int l=0; l<(C2[k].length/2);l=l+2) {\r\n \t\t\t\tSystem.out.printf(\"[%d,%d]\\n\", C2[k][l], C2[k][l+1]);\r\n \t\t\t\tif(l==0) {\r\n \t\t\t\t\t//System.out.printf(\"Effective position to Traverse to: [%d,%d]\\n\", LastElem(C2)[l],LastElem(C2)[l+1]);\r\n \t\t\t\t\tE = C2[k];\r\n \t\t\t\t\t//E[0] = C2[k][0];\r\n \t\t\t\t\t//E[1] = C2[k][1];\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t//PrintAll(C2[k],(C2[k].length/2));\r\n \t\t\t}\r\n \t\t}\r\n \t\t\tEAll[i] = E;\r\n \t\t\tSystem.out.printf(\"Effective position to Traverse to: [%d,%d]\\n\",E[0],E[1]);\r\n \t\t}\r\n \t\telse {\r\n \t\t\tSystem.out.println(\"NO Effective Position to Traverse to!\");\r\n \t\t}\r\n \t}\r\n \t\r\n \t//System.out.printf(\"Effective Position to Traverse to: [%d,%d]\", LAll.get(LAll.size()-1)[LAll.get(LAll.size()-1).length-1][0],LAll.get(LAll.size()-1)[LAll.get(LAll.size()-1).length-1][1]);\r\n \t\r\n \t\r\n \treturn EAll;\r\n }", "@Test\n public void testShortestPathEstacoes() {\n completeMap = new Graph(false);\n incompleteMap = new Graph(false);\n\n completeMap.insertVertex(porto);\n Company.getParkRegistry().getParkMap().put(porto, portoL);\n completeMap.insertVertex(braga);\n Company.getParkRegistry().getParkMap().put(braga, bragaL);\n completeMap.insertVertex(vila);\n Company.getParkRegistry().getParkMap().put(vila, vilaL);\n completeMap.insertVertex(aveiro);\n Company.getParkRegistry().getParkMap().put(aveiro, aveiroL);\n completeMap.insertVertex(coimbra);\n Company.getParkRegistry().getParkMap().put(coimbra, coimbraL);\n completeMap.insertVertex(leiria);\n Company.getParkRegistry().getParkMap().put(leiria, leiriaL);\n\n completeMap.insertVertex(viseu);\n Company.getParkRegistry().getParkMap().put(viseu, viseuL);\n completeMap.insertVertex(guarda);\n Company.getParkRegistry().getParkMap().put(guarda, guardaL);\n completeMap.insertVertex(castelo);\n Company.getParkRegistry().getParkMap().put(castelo, casteloL);\n completeMap.insertVertex(lisboa);\n Company.getParkRegistry().getParkMap().put(lisboa, lisboaL);\n completeMap.insertVertex(faro);\n Company.getParkRegistry().getParkMap().put(faro, faroL);\n\n completeMap.insertEdge(porto, aveiro, c, 75);\n completeMap.insertEdge(porto, braga, c2, 60);\n completeMap.insertEdge(porto, vila, c3, 100);\n completeMap.insertEdge(viseu, guarda, c4, 75);\n completeMap.insertEdge(guarda, castelo, c5, 100);\n completeMap.insertEdge(aveiro, coimbra, c6, 60);\n completeMap.insertEdge(coimbra, lisboa, c7, 200);\n completeMap.insertEdge(coimbra, leiria, c8, 80);\n completeMap.insertEdge(aveiro, leiria, c9, 120);\n completeMap.insertEdge(leiria, lisboa, c10, 150);\n\n completeMap.insertEdge(aveiro, viseu, c11, 85);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n completeMap.insertEdge(lisboa, faro, c13, 280);\n\n incompleteMap = completeMap.clone();\n\n incompleteMap.removeEdge(aveiro, viseu);\n incompleteMap.removeEdge(leiria, castelo);\n incompleteMap.removeEdge(lisboa, faro);\n\n System.out.println(\"Test of shortest path\");\n\n LinkedList<String> shortPath = new LinkedList<>();\n double lenpath = 0;\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, l, shortPath);\n assertTrue(\"Length path should be 0 if vertex does not exist\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, porto, faro, shortPath);\n assertTrue(\"Length path should be 0 if there is no path\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, porto, shortPath);\n assertTrue(\"Number of nodes should be 1 if source and vertex are the same\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPath(incompleteMap, porto, lisboa, shortPath);\n assertTrue(\"Path between Porto and Lisboa should be 335 Km\", lenpath == 335);\n\n Iterator<String> it = shortPath.iterator();\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Lisboa\", it.next().equals(lisboa));\n completeMap.insertEdge(porto, lisboa, c, 10);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, braga, leiria, shortPath);\n assertEquals(\"Path between Braga and Leiria should be close to 152.89\", lenpath, 152, 1);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Braga\", it.next().equals(braga));\n assertTrue(\"then Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Leiria\", it.next().equals(leiria));\n\n shortPath.clear();\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, castelo, shortPath);\n assertEquals(\"Path between Porto and Castelo Branco should be close to 202.86\", lenpath, 202, 1);\n assertTrue(\"N. cities between Porto and Castelo Branco should be 5 \", shortPath.size() == 5);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Viseu\", it.next().equals(viseu));\n assertTrue(\"then Viseu\", it.next().equals(guarda));\n assertTrue(\"then Castelo Branco\", it.next().equals(castelo));\n\n //Changing Edge: aveiro-viseu with Edge: leiria-C.Branco \n //should change shortest path between porto and castelo Branco\n completeMap.removeEdge(aveiro, viseu);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n shortPath.clear();\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, castelo, shortPath);\n assertTrue(\"Path between Porto and Castelo Branco should now be 330 Km\", lenpath == 330);\n assertTrue(\"Path between Porto and Castelo Branco should be 4 cities\", shortPath.size() == 4);\n\n }", "@Test\r\n public void testNonExistentPath() {\r\n int[][] path =\r\n {{0, 0, 0, 0, 0, 0},\r\n {0, 0, 0, 0, 0, 0},\r\n {0, 0, 0, 0, 0, 0},\r\n {0, 0, 0, 0, 0, 0},\r\n {0, 0, 0, 0, 0, 0}};\r\n assertEquals(0, RecursiveMethods.maxPathLength(path));\r\n }", "private boolean doTestsPass()\r\n {\r\n return minimalSteps(\"ABCDABCE\") == 8 && minimalSteps(\"ABCABCE\") == 5;\r\n }", "public int a(PathPoint[] var0, PathPoint var1) {\n/* 53 */ int var2 = 0;\n/* 54 */ int var3 = 1;\n/* */ \n/* 56 */ BlockPosition var4 = new BlockPosition(var1.a, var1.b, var1.c);\n/* 57 */ double var5 = b(var4);\n/* */ \n/* 59 */ PathPoint var7 = a(var1.a, var1.b, var1.c + 1, 1, var5);\n/* 60 */ PathPoint var8 = a(var1.a - 1, var1.b, var1.c, 1, var5);\n/* 61 */ PathPoint var9 = a(var1.a + 1, var1.b, var1.c, 1, var5);\n/* 62 */ PathPoint var10 = a(var1.a, var1.b, var1.c - 1, 1, var5);\n/* 63 */ PathPoint var11 = a(var1.a, var1.b + 1, var1.c, 0, var5);\n/* 64 */ PathPoint var12 = a(var1.a, var1.b - 1, var1.c, 1, var5);\n/* */ \n/* 66 */ if (var7 != null && !var7.i) {\n/* 67 */ var0[var2++] = var7;\n/* */ }\n/* 69 */ if (var8 != null && !var8.i) {\n/* 70 */ var0[var2++] = var8;\n/* */ }\n/* 72 */ if (var9 != null && !var9.i) {\n/* 73 */ var0[var2++] = var9;\n/* */ }\n/* 75 */ if (var10 != null && !var10.i) {\n/* 76 */ var0[var2++] = var10;\n/* */ }\n/* 78 */ if (var11 != null && !var11.i) {\n/* 79 */ var0[var2++] = var11;\n/* */ }\n/* 81 */ if (var12 != null && !var12.i) {\n/* 82 */ var0[var2++] = var12;\n/* */ }\n/* */ \n/* 85 */ boolean var13 = (var10 == null || var10.l == PathType.OPEN || var10.k != 0.0F);\n/* 86 */ boolean var14 = (var7 == null || var7.l == PathType.OPEN || var7.k != 0.0F);\n/* 87 */ boolean var15 = (var9 == null || var9.l == PathType.OPEN || var9.k != 0.0F);\n/* 88 */ boolean var16 = (var8 == null || var8.l == PathType.OPEN || var8.k != 0.0F);\n/* */ \n/* 90 */ if (var13 && var16) {\n/* 91 */ PathPoint var17 = a(var1.a - 1, var1.b, var1.c - 1, 1, var5);\n/* 92 */ if (var17 != null && !var17.i) {\n/* 93 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 96 */ if (var13 && var15) {\n/* 97 */ PathPoint var17 = a(var1.a + 1, var1.b, var1.c - 1, 1, var5);\n/* 98 */ if (var17 != null && !var17.i) {\n/* 99 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 102 */ if (var14 && var16) {\n/* 103 */ PathPoint var17 = a(var1.a - 1, var1.b, var1.c + 1, 1, var5);\n/* 104 */ if (var17 != null && !var17.i) {\n/* 105 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 108 */ if (var14 && var15) {\n/* 109 */ PathPoint var17 = a(var1.a + 1, var1.b, var1.c + 1, 1, var5);\n/* 110 */ if (var17 != null && !var17.i) {\n/* 111 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* */ \n/* 115 */ return var2;\n/* */ }", "private boolean validatePath(BoardSquareInfo start, BoardSquareInfo target, ArrayList<BoardSquareInfo> path) {\n\t\tLog.d(LOG_TAG, String.format(\"Validating path: [%s]\",path));\n\t\t\n\t\t// Invalid if start and target row are separated \n\t\t// by 2 spaces and columns are the same\n\t\tboolean valid = !(Math.abs(start.row-target.row) == 2 \n\t\t\t\t&& start.column == target.column);\n\t\t\n\t\t// Invalid if start and target columns are separated \n\t\t// by 2 spaces and rows are the same\n\t\tvalid = valid && !(start.row == target.row\n\t\t\t\t&& Math.abs(start.column-target.column) == 2);\n\t\t\n\t\tif(valid && path.size() > 1) {\n\t\t\tBoardSquareInfo square = path.get(path.size()-2);\n\t\t\t\n\t\t\t// Invalid if start and target row are separated \n\t\t\t// by 2 spaces and columns are the same\n\t\t\tvalid = valid && !(Math.abs(square.row-target.row) == 2 \n\t\t\t\t\t&& square.column == target.column);\n\t\t\t\n\t\t\t// Invalid if start and target columns are separated \n\t\t\t// by 2 spaces and rows are the same\n\t\t\tvalid = valid && !(square.row == target.row\n\t\t\t\t\t&& Math.abs(square.column-target.column) == 2);\n\t\t}\n\t\t\n\t\tif(valid) {\n\t\t\tstart.swap(target);\n\t\t\tfor(BoardSquareInfo square : path) {\n\t\t\t\tsquare.makeEmpty();\n\t\t\t}\n\t\t\tswitchPlayer();\n\t\t}\n\t\t\n\t\treturn valid;\n\t}", "@Test\n\tpublic void testErrorPath() {\n\t\tint[] e1 = new int[] {4133}, // error too not 5 digits ZIPE003\n\t\t\t e2 = {942004299}, // error greater than 5 digits ZIPE003\n\t\t\t e3 = {-94600}, // error zip negative number ZIPE004\n\t\t\t e4 = {50000, 40000}, // lower bound larger than upper bound ZIPE002\n\t\t\t e5 = {30000, 40000, 50000}, // too many zipCodes ZIPE001\n\t\t\t e6 = {}, //Empty ZIPE006\n\t\t e7 = {99999, -99999},//ZIPE005 = Upper range bound needs to be greater than zero.\n\t\t e8 = {99999},//ZIPE000 = Must provide more than one range to compare.\n\t e9 = {00000};//ZIPE007 = Zip Code greater than 0\n\t \t\n\t\tSystem.out.println(\"********************************** Start testErrorPath() **********************************\");\n\t\t\n\t\tSystem.out.print(\"Input ZipCode Ranges:---------------> \");\n\t\tZipCodeUtil.printZipRange(e1, e2, e3, e4, e5,e6, e7,e8, e9);\n\t\t\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e1);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE003, e.getErrorCode());\n\t\t}\n\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e2);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE003, e.getErrorCode());\n\t\t}\n\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e3);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE004, e.getErrorCode());\n\t\t}\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e4);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE002, e.getErrorCode());\n\t\t}\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e5);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE001, e.getErrorCode());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e6);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE006, e.getErrorCode());\n\t\t}\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e7);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE005, e.getErrorCode());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tmergedZips = ZipCodeUtil.getInstance().mergeUniqueRanges(e8);\n\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE000, e.getErrorCode());\n\t\t}\n\n\t\ttry{\n\t\t\tZipCodeUtil.getInstance().canShipTo(e9[0]);\n\t\t\t\n\t\t} catch(InvalidZipCode e){\n\t\t\t\n\t\t\tAssert.assertEquals(ZipMsg.ZIPE007, e.getErrorCode());\n\t\t}\n\t\tfinally{\n\n\t\t\tSystem.out.println(\"********************************** End testErrorPath() **********************************\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "private void adjustPathConditions() {\n List<ProgramCondition> pcList;\n for (ProgramPath pp : progPath){\n pcList = pp.getConditions();\n final List<ProgramCondition> pcList2 = pcList;\n List<ProgramCondition> collect = pcList2.stream().filter(p -> (pcList2.stream().anyMatch(q -> q.condition.equals(p.condition) \n && q.pred == ProgramConditionTruthValue.False && p.pred == ProgramConditionTruthValue.True))).collect(Collectors.toList());\n \n collect.forEach(p -> p.z3Allowable = false);\n }\n }", "@Test\n\t\t\tpublic void testTargetsTwoSteps() {\n\t\t\t\t//Length of 2\n\t\t\t\tboard.calcTargets(8, 16, 2);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(10, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(7, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(9, 15)));\n\t\t\t\t//Length of 2\n\t\t\t\tboard.calcTargets(15, 15, 2);\n\t\t\t\ttargets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(17, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(14, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(15, 17)));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "private boolean thereispath(Move m, Tile tile, Integer integer, Graph g, Board B) {\n\n boolean result = true;\n boolean result1 = true;\n\n int start_dest_C = tile.COLUMN;\n int start_dest_R = tile.ROW;\n\n int move_column = m.getX();\n int move_row = m.getY();\n\n int TEMP = 0;\n int TEMP_ID = 0;\n int TEMP_ID_F = tile.id;\n int TEMP_ID_FIRST = tile.id;\n\n int final_dest_R = (integer / B.width);\n int final_dest_C = (integer % B.width);\n\n //System.out.println(\"* \" + tile.toString() + \" \" + integer + \" \" + m.toString());\n\n // Y ROW - X COLUMN\n\n for (int i = 0; i != 2; i++) {\n\n TEMP_ID_FIRST = tile.id;\n\n // possibility 1\n if (i == 0) {\n\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result != false; c++) {\n\n if (c == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n // System.out.println(\"OK\");\n\n } else {\n\n result = false;\n\n // System.out.println(\"NOPE\");\n\n\n }\n }\n\n for (int r = 0; r != Math.abs(move_row) && result != false; r++) {\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n // System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n\n } else {\n\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == true) {\n return true;\n }\n\n\n }\n\n TEMP_ID = 0;\n\n if (i == 1) {\n\n result = true;\n\n start_dest_C = tile.COLUMN;\n start_dest_R = tile.ROW;\n // first move row\n for (int r = 0; r != Math.abs(move_row) && result1 != false; r++) {\n\n if (r == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n\n //System.out.println(\"NOPE\");\n\n result = false;\n\n }\n\n\n }\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result1 != false; c++) {\n\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == false) {\n return false;\n\n }\n\n\n }\n\n\n }\n\n\n return true;\n }", "@Test\n public void testGetShortestPath04() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n\n LinkedList<City> expResult = new LinkedList();\n\n LinkedList<City> result = new LinkedList();\n sn10.getShortestPath(userA, userB, result);\n assertFalse(expResult.equals(result));\n }", "@Test\n public void testPart2Example1() {\n var droid = new MockDroidState(\n from(WEST, SOUTH, SOUTH, EAST),\n Set.of(\n from(),\n from(WEST),\n from(WEST, SOUTH),\n from(WEST, SOUTH, SOUTH),\n from(WEST, SOUTH, SOUTH, EAST),\n from(WEST, SOUTH, SOUTH, EAST, EAST),\n from(WEST, SOUTH, SOUTH, EAST, EAST, NORTH),\n from(WEST, SOUTH, SOUTH, EAST, EAST, NORTH, EAST)));\n var ship = new ShipState(droid);\n Assert.assertEquals(ship.longestPathFromOxygen(), 4);\n }", "public static void main(String[] args) {\n\t\tint cost[][] = { {1, 2, 3},\n {4, 8, 2},\n {1, 5, 3} };\n\t\tint len=3;\n\t\tdp=new int[len+1][len+1];\n\t\tfor(int i=0;i<len;++i)\n\t\t\tArrays.fill(dp[i], Integer.MAX_VALUE);\n\t\n\tSystem.out.println(getMinCost(cost, 2, 2, len));\n\tprintPath(cost, 2, 2);\n\t}", "@Test\n public void computePaymentTargetIntermediatePrefixWithOtherPath() {\n spspController = new SpspController(() -> connectorSettingsMock, streamReceiverMock, \"/p\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\" \")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"//\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/ \")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo/\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo.bar\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo.bar/\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo/bar\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo.bar/baz\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/foo.bar/baz/\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p//\")).isEqualTo(\"\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo\")).isEqualTo(\"foo\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo/\")).isEqualTo(\"foo\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo//\")).isEqualTo(\"foo\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo.bar\")).isEqualTo(\"foo.bar\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo.bar/\")).isEqualTo(\"foo.bar\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo/bar\")).isEqualTo(\"foo.bar\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo.bar/baz\")).isEqualTo(\"foo.bar.baz\");\n assertThat(spspController.computePaymentTargetIntermediatePrefix(\"/p/foo.bar/baz/\")).isEqualTo(\"foo.bar.baz\");\n }", "@Test\n public void testShortestPath() {\n Pillar p = new Pillar(0, 0);\n Pillar q = new Pillar(0, 1);\n q.setPrevious(p);\n List<Pillar> path = MazeSolver.shortestPath(q);\n assertEquals(2, path.size());\n assertEquals(p, path.get(0));\n assertEquals(q, path.get(1));\n }", "@Test\n public void testTargetSquares_cannotEnterGate() {\n Board board = new Board(p1, p2);\n Token ant = p1.getFromSupply(BugType.SPIDER);\n board.addToken(ant, 0, 3);\n board.addToken(p2.getFromSupply(BugType.QUEEN_BEE), 1, 0);\n board.addToken(p2.getFromSupply(BugType.SPIDER), 2, 0);\n board.addToken(p2.getFromSupply(BugType.GRASSHOPPER), 2, 1);\n board.addToken(p2.getFromSupply(BugType.SOLDIER_ANT), 0, 1);\n board.addToken(p2.getFromSupply(BugType.BEETLE), 0, 2);\n\n List<Hex> targets = Rules.getInstance().getTargetHexes(ant, board);\n assertEquals(2, targets.size());\n assertTrue(targets.contains(board.getHex(-1, 1)));\n assertTrue(targets.contains(board.getHex(3, 1)));\n }", "@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }", "@Test\n public void sourceEqualsTarget() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(0, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n assertPath(calcPath(0, 0, 0, 1), 0.3, 3, 300, nodes(0, 1, 2, 0));\n assertPath(calcPath(0, 0, 1, 0), 0.3, 3, 300, nodes(0, 2, 1, 0));\n // without restrictions the weight should be zero\n assertPath(calcPath(0, 0, ANY_EDGE, ANY_EDGE), 0, 0, 0, nodes(0));\n // in some cases no path is possible\n assertNotFound(calcPath(0, 0, 1, 1));\n assertNotFound(calcPath(0, 0, 5, 1));\n }", "@Test\r\n public void testGetRoute() {\r\n // Test 1 (Short Path)\r\n Path route = backend.getRoute(\"Observatory & Babcock\", \"Liden & Babcock\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 460)\r\n fail(\"Failed to get shortest path\");\r\n // Verify path starts at 'Observatory & Babcock' and ends at 'Liden & Babcock'\r\n if(!route.getPath().get(0).getName().equalsIgnoreCase(\"Observatory & Babcock\") ||\r\n !route.getPath().get(1).getName().equalsIgnoreCase(\"Liden & Babcock\"))\r\n fail(\"Failed to get shortest path\");\r\n\r\n //Test 2 (Short Path w/ POIs)\r\n route = backend.getRoute(\"Mills & Johnson\", \"Brooks & Johnson\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 441)\r\n fail(\"Failed to get shortest path\");\r\n // Verify point of interest\r\n if(!route.getPOI().get(0).equalsIgnoreCase(\"Grand Central\"))\r\n fail(\"Failed to find point of interest\");\r\n }", "@Test\n public void test1() {\n System.out.println(\"A* Test i1\"); \n \n Solver solver = new Solver(new TileWorld(\"i1.png\"), SearchStrategy.A_STAR);\n AlgorithmResults expResult = new AlgorithmResults(580, 967);\n AlgorithmResults result = solver.solve();\n \n print(result, expResult);\n \n assertEquals(\"BestPathCost does not match!\", expResult.getBestPathCost(), result.getBestPathCost());\n }", "@Test\n public void testWithObstacle4() {\n Grid g = new Grid(4, 4, 0, 0, 0, 0);\n Obstacle o = new Obstacle(1, 1);\n g.setObject(o, 0, 3);\n g.setObject(o, 1, 1);\n g.setObject(o, 1, 2);\n g.setObject(o, 3, 0);\n g.setObject(o, 3, 1);\n AStarStrategy strategy = new AStarStrategy();\n\n Location to = new Location(0, 0);\n Location from = new Location(3, 3);\n Path path = strategy.generatePath(g, from, to);\n assertNotNull(path);\n assertEquals(6, path.getMoves().size());\n assertEquals(Move.UP, path.getMoves().get(0).direction);\n assertEquals(Move.LEFT, path.getMoves().get(1).direction);\n assertEquals(Move.LEFT, path.getMoves().get(2).direction);\n assertEquals(Move.LEFT, path.getMoves().get(3).direction);\n assertEquals(Move.UP, path.getMoves().get(4).direction);\n assertEquals(Move.UP, path.getMoves().get(5).direction);\n }", "@Test\n public void testGetShortestPath01() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n LinkedList<City> shortestPathCities = new LinkedList();\n Double expResult = 66.0;\n Double result = sn10.getShortestPath(userA, userB, shortestPathCities);\n assertEquals(expResult, result, 0.1);\n }", "public static void main(String[] args) {\n String path = \"NNSWWEWSSESSWENNW\";\n PathCrossing pathCrossing = new PathCrossing();\n System.out.println(pathCrossing.isPathCrossing(path));\n }", "@Test\n public void testMultiplePlankPositionsMaze() {\n try {\n //link row 1\n smallMaze.linkPillars(Maze.position(0, 0), Maze.position(1, 0));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(2, 0));\n\n //link row 2\n smallMaze.linkPillars(Maze.position(0, 1), Maze.position(0, 2));\n smallMaze.linkPillars(Maze.position(1, 1), Maze.position(2, 1));\n smallMaze.linkPillars(Maze.position(1, 1), Maze.position(1, 2));\n\n //link row 3\n smallMaze.linkPillars(Maze.position(0, 2), Maze.position(1, 2));\n smallMaze.linkPillars(Maze.position(1, 2), Maze.position(2, 2));\n\n //set beginning and end\n smallMaze.setBegin(Maze.position(0, 0));\n smallMaze.setEnd(Maze.position(2, 2));\n shortestPath = MazeSolver.pStar(smallMaze, 9);\n\n assertEquals(5, shortestPath.size());\n\n } catch (Exception e) {\n fail(\"Unexpected exception was thrown while linking pillars.\");\n }\n }", "@Test\r\n public void testNonExistentPath2() {\r\n int[][] path = new int[0][0];\r\n assertEquals(0, RecursiveMethods.maxPathLength(path));\r\n }", "@Test\r\n\tpublic void testAdjacencyWalkways()\r\n\t{\r\n\t\t// Test on top edge of board, two walkway pieces\r\n\t\tSet<BoardCell> testList = board.getAdjList(0, 7);\r\n\t\tassertTrue(testList.contains(board.getCellAt(0, 8)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(1, 7)));\r\n\t\tassertEquals(2, testList.size());\r\n\t\t\r\n\t\t// Test on left edge of board, one walkway piece\r\n\t\ttestList = board.getAdjList(8, 0);\r\n\t\tassertTrue(testList.contains(board.getCellAt(9, 0)));\r\n\t\tassertEquals(1, testList.size());\r\n\r\n\t\t// Test a walkway next to closet, 2 walkway pieces\r\n\t\ttestList = board.getAdjList(12, 9);\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 10)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(13, 9)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t\t// Test surrounded by 4 walkways\r\n\t\ttestList = board.getAdjList(11,4);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 5)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 3)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 4)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 4)));\r\n\t\tassertEquals(4, testList.size());\r\n\t\t\r\n\t\t// Test on bottom edge of board, next to 1 room piece\r\n\t\ttestList = board.getAdjList(24, 18);\r\n\t\tassertTrue(testList.contains(board.getCellAt(23, 18)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(24, 17)));\r\n\t\tassertEquals(2, testList.size());\r\n\t\t\r\n\t\t// Test on right edge of board, next to 1 room piece\r\n\t\ttestList = board.getAdjList(10, 24);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 24)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 23)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t\t// Test on walkway next to door that is not in the needed\r\n\t\t// direction to enter\r\n\t\ttestList = board.getAdjList(12, 21);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(13, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 20)));\r\n\t\tassertEquals(3, testList.size());\r\n\t}", "@Test\n\t\t\tpublic void testTargetsThreeSteps() {\n\t\t\t\t//Using walkway space that will go near a door with the wrong direction\n\t\t\t\tboard.calcTargets(8, 16, 2);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(10, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(7, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(9, 15)));\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "public void testConjunctionFailsToResolveWhenSecondPathFails() throws Exception\n {\n resolveAndAssertFailure(new String[] { \"g\", \"f :- g, h\" }, \"?- f\");\n }", "@Test\n\tpublic void checkNumberOfDifferentRoutes() {\n\t\tassertEquals(Trains.numberDifferentRoutes(\"C\",\"C\",30), 7);\n\t}", "@Test\n\tpublic void testTargetsFourSteps() {\n\t\tboard.calcTargets(14, 24, 4);\n\t\tSet<BoardCell> targets= board.getTargets();\n\t\tassertEquals(7, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(14, 20)));\n\t\tassertTrue(targets.contains(board.getCellAt(15, 21)));\n\t\tassertTrue(targets.contains(board.getCellAt(16, 22)));\n\t\tassertTrue(targets.contains(board.getCellAt(17, 23)));\t\t\t\n\t\tassertTrue(targets.contains(board.getCellAt(15, 23)));\n\t\tassertTrue(targets.contains(board.getCellAt(16, 24)));\t\t\t\n\t\tassertTrue(targets.contains(board.getCellAt(14, 22)));\n\t}", "@Test\n\tpublic void testLongPath() {\n\t\tPosition start = new Position(0,0);\n\t\tPosition end = new Position(20,10);\n\n\t\t// The distance should equal integer value of (20^2 + 10^2)*weight\n\t\tint distance = euclideanSquaredMetric.calculateCost(start, end);\n\t\tassertEquals(500*lateralDistanceWeight, distance);\n\t}", "static public void main(String[] args){\n\t\tint apples = 1; \n\t\tint bananas = 1;\n\t\tint coconuts = 1;\n\t\tFruitPuzzle fp = new FruitPuzzle();\n\t\tif (fp.test(apples, bananas, coconuts)) {\n\t\t\t//System.out.println(\"Eq result = \" + Integer.toString(apples+bananas+coconuts));\n\t\t\tDebug.printPC(\"\\n Path condition: \");\n\t\t\t//throw new RuntimeException(\"found solution\");\n\t\t}\n\t}", "@Test\n public void connectionNotFound() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 0);\n\n Path path = calcPath(0, 3, 0, 1);\n assertNotFound(path);\n }", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "public static void main(String args[]) {\n int V = 4;\n Graph g = new Graph(V);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n\n int src = 1;\n int dest = 3;\n boolean[] visited = new boolean[V];\n\n // To store the complete path between source and destination\n Stack<Integer> path1 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path1)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path1);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n src = 3;\n dest = 1;\n // To store the complete path between source and destination\n Stack<Integer> path2 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path2)) System.out.println(\"There is a path from \" + src + \" to \" + dest);\n else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n // total number of nodes in the graph (labeled from 0 to 7)\n int n = 8;\n\n // List of graph edges as per the above diagram\n Graph g2 = new Graph(n);\n /**\n * There is a path from 1 to 3\n * The complete path is [1, 2, 3]\n * There is no path from 3 to 1\n * There is a path from 0 to 7\n * The complete path is [0, 3, 4, 6, 7]\n */\n\n g2.addEdge(0, 3);\n g2.addEdge(1, 0);\n g2.addEdge(1, 2);\n g2.addEdge(1, 4);\n g2.addEdge(2, 7);\n g2.addEdge(3, 4);\n g2.addEdge(3, 5);\n g2.addEdge(4, 3);\n g2.addEdge(4, 6);\n g2.addEdge(5, 6);\n g2.addEdge(6, 7);\n\n // source and destination vertex\n src = 0;\n dest = 7;\n\n // To store the complete path between source and destination\n Stack<Integer> path = new Stack<>();\n boolean[] visited2 = new boolean[n];\n\n if (hasPathDFS(g2, src, dest, visited2, path)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n\n }", "@Test\n\t\t\tpublic void testTargetsFourSteps() {\n\t\t\t\t//Using random walkway space\n\t\t\t\tboard.calcTargets(5, 18, 3);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(10, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(5, 21)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 20)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(4, 20)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(5, 19)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(3, 17)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(4, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(5, 17)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(4, 18)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 18)));\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "@Test\n public void testDoWork() {\n MapMatching mapMatching = new MapMatching(hopper, algoOptions);\n List<GPXEntry> inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.358735, 12.360574),\n new GHPoint(51.358594, 12.360032));\n MatchResult mr = mapMatching.doWork(inputGPXEntries);\n\n // make sure no virtual edges are returned\n int edgeCount = hopper.getGraphHopperStorage().getAllEdges().length();\n for (EdgeMatch em : mr.getEdgeMatches()) {\n assertTrue(\"result contains virtual edges:\" + em.getEdgeState().toString(),\n em.getEdgeState().getEdge() < edgeCount);\n }\n\n // create street names\n assertEquals(Arrays.asList(\"Platnerstraße\", \"Platnerstraße\", \"Platnerstraße\"),\n fetchStreets(mr.getEdgeMatches()));\n assertEquals(mr.getGpxEntriesLength(), mr.getMatchLength(), 1.5);\n assertEquals(mr.getGpxEntriesMillis(), mr.getMatchMillis());\n\n PathWrapper matchGHRsp = new PathWrapper();\n new PathMerger().doWork(matchGHRsp, Collections.singletonList(mr.getMergedPath()), translationMap.get(\"en\"));\n InstructionList il = matchGHRsp.getInstructions();\n\n assertEquals(il.toString(), 2, il.size());\n assertEquals(\"Platnerstraße\", il.get(0).getName());\n\n inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.33099, 12.380267),\n new GHPoint(51.330689, 12.380776));\n mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(Arrays.asList(\"Windmühlenstraße\", \"Windmühlenstraße\", \"Bayrischer Platz\",\n \"Bayrischer Platz\", \"Bayrischer Platz\"), fetchStreets(mr.getEdgeMatches()));\n assertEquals(mr.getGpxEntriesLength(), mr.getMatchLength(), .1);\n assertEquals(mr.getGpxEntriesMillis(), mr.getMatchMillis(), 1);\n\n matchGHRsp = new PathWrapper();\n new PathMerger().doWork(matchGHRsp, Collections.singletonList(mr.getMergedPath()), translationMap.get(\"en\"));\n il = matchGHRsp.getInstructions();\n\n assertEquals(il.toString(), 3, il.size());\n assertEquals(\"Windmühlenstraße\", il.get(0).getName());\n assertEquals(\"Bayrischer Platz\", il.get(1).getName());\n\n // full path\n inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.377781, 12.338333),\n new GHPoint(51.323317, 12.387085));\n mapMatching = new MapMatching(hopper, algoOptions);\n mapMatching.setMeasurementErrorSigma(20);\n mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(mr.getGpxEntriesLength(), mr.getMatchLength(), 0.5);\n assertEquals(mr.getGpxEntriesMillis(), mr.getMatchMillis(), 200);\n assertEquals(138, mr.getEdgeMatches().size());\n\n // TODO full path with 20m distortion\n // TODO full path with 40m distortion\n }", "private boolean dfs(int n, int[] P) { // 0 is empty, 1 is false, 2 is true\n if (P[n] != 0) {\n if (P[n] == 1) {\n return false;\n }\n else {\n return true;\n }\n }\n\n if (n == 1) {\n P[1] = 2;\n //return true;\n }\n else if (n == 2) {\n P[2] = 2;\n //return true;\n }\n else if (n == 3) {\n P[3] = 1;\n //return false;\n }\n else {\n boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n P[n] = res ? 2 : 1;\n }\n\n return P[n] == 2;\n\n //P[n] = P[n-2] + P[n-3] == 4 || P[n-3] + P[n-4] == 4 ? 2 : 1;\n //boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n //P[n] = res ? 2 : 1;\n //return res;\n }", "@Test\n public void testNoBenefitFromPlankMaze() {\n try {\n //link row 1\n smallMaze.linkPillars(Maze.position(0, 0), Maze.position(1, 0));\n smallMaze.linkPillars(Maze.position(0, 0), Maze.position(0, 1));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(2, 0));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(1, 1));\n\n //link row 2\n smallMaze.linkPillars(Maze.position(0, 1), Maze.position(0, 2));\n smallMaze.linkPillars(Maze.position(1, 1), Maze.position(2, 1));\n\n //link row 3\n smallMaze.linkPillars(Maze.position(0, 2), Maze.position(1, 2));\n smallMaze.linkPillars(Maze.position(1, 2), Maze.position(2, 2));\n\n //set beginning and end\n smallMaze.setBegin(Maze.position(0, 0));\n smallMaze.setEnd(Maze.position(2, 2));\n shortestPath = MazeSolver.pStar(smallMaze, 9);\n\n assertEquals(5, shortestPath.size());\n\n } catch (Exception e) {\n fail(\"Unexpected exception was thrown while linking pillars.\");\n }\n }", "@Test\n\tpublic void testTargetsTwoSteps() {\n\t\tboard.calcTargets(7, 6, 2);\n\t\tSet<BoardCell> targets= board.getTargets();\n\t\tassertEquals(7, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(5, 6)));\n\t\tassertTrue(targets.contains(board.getCellAt(6, 7)));\n\t\tassertTrue(targets.contains(board.getCellAt(6, 5)));\n\t\tassertTrue(targets.contains(board.getCellAt(8, 7)));\n\t\tassertTrue(targets.contains(board.getCellAt(8, 5)));\n\t\tassertTrue(targets.contains(board.getCellAt(9, 6)));\n\t\tassertTrue(targets.contains(board.getCellAt(7, 4)));\n\t\tboard.calcTargets(14, 24, 2);\n\t\ttargets= board.getTargets();\n\t\tassertEquals(3, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(14, 22)));\n\t\tassertTrue(targets.contains(board.getCellAt(15, 23)));\t\n\t\tassertTrue(targets.contains(board.getCellAt(16, 24)));\t\t\t\n\t}", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void testAdjacencyWalkways()\n\t{\n\t\t// Test on top edge of board, just one walkway piece\n\t\tSet<BoardCell> testList = board.getAdjList(22, 9);\n\t\tassertTrue(testList.contains(board.getCellAt(21, 9)));\n\t\tassertEquals(1, testList.size());\n\n\t\t// Test left edge of board, edge of room\n\t\ttestList = board.getAdjList(16, 0);\n\t\tassertTrue(testList.contains(board.getCellAt(17, 0)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 1)));\n\t\tassertEquals(2, testList.size());\n\n\t\t// Test on left edge of board, three walkway pieces\n\t\ttestList = board.getAdjList(6, 0);\n\t\tassertTrue(testList.contains(board.getCellAt(5, 0)));\n\t\tassertTrue(testList.contains(board.getCellAt(6, 1)));\n\t\tassertTrue(testList.contains(board.getCellAt(7, 0)));\n\t\tassertEquals(3, testList.size());\n\n\t\t// Test surrounded by 4 walkways\n\t\ttestList = board.getAdjList(16,19);\n\t\tassertTrue(testList.contains(board.getCellAt(15, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(17, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 20)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 18)));\n\t\tassertEquals(4, testList.size());\n\n\t\t// Test on bottom edge of board, next to 1 room piece\n\t\ttestList = board.getAdjList(22, 15);\n\t\tassertTrue(testList.contains(board.getCellAt(21, 15)));\n\t\tassertTrue(testList.contains(board.getCellAt(22, 16)));\n\t\tassertEquals(2, testList.size());\n\n\n\t\t// Test on walkway next to door that is not in the needed\n\t\t// direction to enter\n\t\ttestList = board.getAdjList(9, 6);\n\t\tassertTrue(testList.contains(board.getCellAt(8, 6)));\n\t\tassertTrue(testList.contains(board.getCellAt(9, 7)));\n\t\tassertTrue(testList.contains(board.getCellAt(10, 6)));\n\t\tassertEquals(3, testList.size());\n\t}", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "public void testConjunctionResolvesWhenSecondPathRevisitsFirst() throws Exception\n {\n resolveAndAssertSolutions(\"[[g, (h :- g), (f :- g, h)], (?- f), [[]]]\");\n }", "@Test\n\t\t\tpublic void testTargetOneStep()\n\t\t\t{\n\t\t\t\t//Test one step and check for the right space\n\t\t\t\tboard.calcTargets(0, 7, 1);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(1, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(1, 7)));\n\n\t\t\t\t// Test one step near a door with the incorrect direction\n\t\t\t\tboard.calcTargets(13, 6, 1);\n\t\t\t\ttargets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(3, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(14, 6)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 5)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 7)));\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Test\r\n\tpublic void testPatternCase2() {\r\n\t\t// Expected return from Cd\r\n\t\texpectedCd = null;\r\n\t\t// Expected current working directory\r\n\t\texpectedPath = \"/\";\r\n\t\tfs.setCurrent(fs.user1);\r\n\t\t// Actual return from Cd\r\n\t\tactualCd = cd.run(fs, \"../..\".split(\" \"), \"cd ../.. \", false);\r\n\t\t// Returns the current working directory\r\n\t\tactualPath = fs.getCurrentPath();\r\n\t\t// Checks if the values are equal or not\r\n\t\tassertTrue(actualCd == expectedCd && actualPath.equals(expectedPath));\r\n\t}", "@Test\n public void testTraverseOnlyWithPlankMaze() {\n try {\n //link row 1\n smallMaze.linkPillars(Maze.position(0, 0), Maze.position(1, 0));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(2, 0));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(1, 1));\n\n //link row 2\n smallMaze.linkPillars(Maze.position(1, 1), Maze.position(2, 1));\n\n //link row 3\n smallMaze.linkPillars(Maze.position(0, 2), Maze.position(1, 2));\n smallMaze.linkPillars(Maze.position(1, 2), Maze.position(2, 2));\n\n //set beginning and end\n smallMaze.setBegin(Maze.position(0, 0));\n smallMaze.setEnd(Maze.position(2, 2));\n shortestPath = MazeSolver.pStar(smallMaze, 9);\n\n assertEquals(5, shortestPath.size());\n\n } catch (Exception e) {\n fail(\"Unexpected exception was thrown while linking pillars.\");\n }\n }", "@Test\r\n\tpublic void testTargetsSixSteps() {\r\n\t\tboard.calcTargets(24, 17, 6);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(8, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(18, 17)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(20, 17)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(22, 17)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(19, 18)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(21, 18)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 18)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(22, 19)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(22, 17)));\r\n\t\t\r\n\t}", "@Test\r\n\tpublic void testTargetsTwoSteps() {\r\n\t\tboard.calcTargets(10, 1, 2);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(6, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 0)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 0)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(12, 1)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 3)));\r\n\t\t\r\n\t\tboard.calcTargets(17, 13, 2);\r\n\t\ttargets= board.getTargets();\r\n\t\tassertEquals(5, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(17, 15)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(18, 14)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(16, 14)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(16, 12)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(15, 13)));\r\n\t}", "public static void main(String[] args) {\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 3, 4, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 3, 5, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 3, 4, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 3, 5, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 5, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 5, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(6, 6, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(6, 6, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 3, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(7, 7, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(7, 7, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 4, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 4, true, null)));\n measureTime(()->checkInterruptSequential(4, 4, 3, false));\n measureTime(()->checkInterruptSequential(4, 4, 3, true));\n }", "private boolean clearPath(Square square1, Square square2) {\n int x1 = square1.getCoords()[0];\n int x2 = square2.getCoords()[0];\n int y1 = square1.getCoords()[1];\n int y2 = square2.getCoords()[1];\n\n int targetX;\n int targetY;\n int startX;\n int startY;\n\n if (y1 > y2) {\n targetY = y1;\n startY = y2 + 1;\n } else {\n targetY = y2;\n startY = y1 + 1;\n }\n\n if (x1 > x2) {\n targetX = x1;\n startX = x2 + 1;\n } else {\n targetX = x2;\n startX = x1 + 1;\n }\n\n // Straight path along Y axis\n if (x1 == x2) {\n\n // Go along y\n while (startY < targetY) {\n if (!squares[x1][startY].isEmpty()) {\n return false;\n } else {\n startY++;\n }\n }\n // Straight path along X axis\n } else if (y1 == y2) {\n // Go along x\n while (startX < targetX) {\n if (!squares[startX][y1].isEmpty()) {\n return false;\n } else {\n startX++;\n }\n }\n }\n\n // Angled path\n if (Math.abs(x1 - x2) == Math.abs(y1 - y2)) {\n int smallerX;\n int largerX;\n if (x1 > x2) {\n largerX = x1;\n smallerX = x2;\n } else {\n smallerX = x1;\n largerX = x2;\n }\n // If the angle is down and to the left\n if ((x1 > x2 && y1 < y2) || (x1 < x2 && y1 > y2)) {\n targetX = smallerX;\n startX = largerX - 1;\n while (startX > targetX && startY < targetY) {\n if (!squares[startX][startY].isEmpty()) {\n return false;\n } else {\n startX--;\n startY++;\n }\n }\n // If the angle is down and to the right\n } else if ((x1 < x2 && y1 < y2) || (x1 > x2 && y1 > y2)) {\n targetX = largerX;\n startX = smallerX + 1;\n // Go to the right and down\n while (startX < targetX && startY < targetY) {\n if (!squares[startX][startY].isEmpty()) {\n return false;\n } else {\n startX++;\n startY++;\n }\n }\n }\n }\n return true;\n }", "@Test\n public void badChoicePunisher() {\n Edge[] edgelist = {new Edge(new int[] {1, 7}), new Edge(new int[] {1, 8}),\n new Edge(new int[] {7, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist, 8, 2);\n\n\n Edge[] edgelist1 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist1, 7, 1);\n\n Edge[] edgelist2 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5}), new Edge(new int[] {2, 8})};\n timeMethod(edgelist2, 8, 2);\n\n Edge[] edgelist3 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist3, 7, 1);\n }", "protected void verifyShortestPaths(final Map<String, ShortestPath> expectedPaths,\n final Graph graph, List<Path> paths) throws Exception {\n assertFalse(paths.isEmpty());\n Set<Vertex> unreachedVertices = new HashSet<Vertex>(graph.getVertices());\n unreachedVertices.remove(SOURCE_VERTEX);\n\n for (Path path : paths) {\n assertEquals(path.getStart(), SOURCE_VERTEX);\n unreachedVertices.remove(path.getEnd());\n List<Vertex> vertices = path.asList();\n \n // all edges should be in the original graph, hence they all\n // should be part of the graph.\n if (vertices.size() > 1) {\n Iterator<Vertex> verticesIterator = vertices.iterator();\n Vertex start = verticesIterator.next();\n Vertex end = verticesIterator.next();\n graph.getEdge(start, end);\n while (verticesIterator.hasNext()) {\n start = end;\n end = verticesIterator.next();\n graph.getEdge(start, end);\n }\n }\n\n ShortestPath expectedPath = expectedPaths.get(path.getEnd().label());\n assertNotNull(expectedPath);\n assertEquals(expectedPath.asList(), vertices);\n }\n\n // all vertices should have been reached\n assertTrue(unreachedVertices.isEmpty());\n }", "public static int distinctPaths4(int n) {\n\t\tint[][] mem = new int[n+1][n+1];\n\t\tfor(int j = 1; j <= n; ++j) {\n\t\t\tmem[1][j] = 1;\n\t\t\tmem[j][1] = 1;\n\t\t}\n\t\tfor(int i = 2; i <= n; ++i) {\n\t\t\tfor(int j = 2; j <= n; ++j) {\n\t\t\t\tmem[i][j] = mem[i-1][j] + mem[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn mem[n][n];\n\t}", "@Test\n public void testSolution() throws Exception {\n assertEquals(4, new Task5().solution(4, new int[]{1, 2, 3}));\n // 1. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n // 2. 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n // 3. 2, 2, 1, 1, 1, 1, 1, 1, 1, 1\n // 4. 2, 2, 2, 1, 1, 1, 1, 1, 1\n // 5. 2, 2, 2, 2, 1, 1, 1, 1\n // 6. 2, 2, 2, 2, 2, 1, 1\n // 7. 2, 2, 2, 2, 2, 2\n // 8. 5, 1, 1, 1, 1, 1, 1, 1\n // 9. 5, 2, 1, 1, 1, 1, 1\n // 10. 5, 2, 2, 1, 1, 1\n // 11. 5, 2, 2, 2, 1\n // 12. 5, 5, 1, 1\n // 13. 5, 5, 2\n assertEquals(13, new Task5().solution(12, new int[]{1, 2, 5}));\n // 1. 2, 2, 2, 2, 2, 2\n // 2. 5, 5, 2\n assertEquals(2, new Task5().solution(12, new int[]{2, 5}));\n }", "private int uniquePaths(int x, int y, int[][] dp) {\n \t\tif (x == 0 || y == 0) return 1;\n \t\tif (dp[x][y] == 0)\n \t\t\tdp[x][y] = uniquePaths(x - 1, y, dp) + uniquePaths(x, y - 1, dp);\n \t\treturn dp[x][y];\n \t}", "@Test\n public void runTest()\n { // Pueblo start to finish 34.97s\n\n\n this.myMap = myReader.readMapFile(\"data/AlamosaNetwork.xml\");\n myMap.setupMapAsServer();\n this.testAgent001 = getTestAgent();\n\n //System.out.println(\"Intersections2: \"+myMap.getIntersections());\n\n testLW.log(Level.INFO, \"this is another nother test\");\n\n System.out.println(\"\\nStarting test. . .\");\n // Pueblo start to finish 34.97s\n // from.setId(\"1040921516\"); // from.setId(\"01\"); // 1040921516 // 2\n // to.setId(\"864162469\"); // to.setId(\"10\"); // 864162469 // 50\n Long startTime = System.nanoTime();\n\n //GRIDheapAlg greedy = new GRIDheapAlg();\n GRIDpathfinder theALG = new GRIDpathfinder(myMap, \"BPR\");\n //GRIDheapDynamicAlg dyna = new GRIDheapDynamicAlg(myMap); //\n //myPathGreedy = greedy.shortestPath(networkMap,\"1040921516\",\"864162469\");\n\n //GRIDselfishAlg test001 = new GRIDselfishAlg(testAgent001, networkMap, 0L); // GRIDpathrecalc GRIDselfishAlg\n //GRIDpathrecalc test001 = new GRIDpathrecalc(testAgent001, networkMap, 0L); // GRIDpathrecalc GRIDselfishAlg\n //GRIDroute outRoute = new GRIDroute();\n /*GRIDpathrecalc test001 = new GRIDpathrecalc(testAgent001, networkMap, 0L); // GRIDpathrecalc GRIDselfishAlg\n outRoute = test001.findPath();*/\n GRIDroute outRoute = theALG.findPath(testAgent001, 0L);\n\n //ListIterator<String> pathIterator = outRoute.Intersections.listIterator();\n\n /*assertNotNull(myMap);\n assertNotNull(outRoute);\n assertTrue(outRoute.Intersections.size() > 0);*/\n\n //System.out.println(\"\\nShortest path: \"+myPathGreedy);\n //System.out.println(\"\\nShortest path: \"+myPathDynamic);\n\n //System.out.print(\"\\nPath:\\n\");\n //for (String intrx : outRoute.getIntersections())\n //{\n // System.out.print(intrx);\n // if(!intrx.equals(testAgent001.getDestination()))\n // System.out.print(\",\");\n //}\n\n //ArrayList<String> tempPathList = myMap.getPathByRoad(outRoute.getIntersections());\n\n //System.out.print(\"\\n\\nPath by Link:\\n\");\n //for (String path : tempPathList)\n //{\n // System.out.print(path);\n // if(!tempPathList.isEmpty()\n // && !path.equals(tempPathList.get(tempPathList.size() - 1)))\n // System.out.print(\",\");\n // }\n\n if(outRoute.getAgent_ID() != \"Destination unreachable\"){\n logWriter.log(Level.INFO, \"Route is: \" + outRoute.toString());\n\n System.out.println(\"Route is: \" + testAgent001.getOrigin() + outRoute.toString()\n +\" \"+testAgent001.getDestination());\n\n System.out.println(\"\\n\\nCalculated Travel Time: \"+outRoute.getcalculatedTravelTime());\n }\n else{\n System.out.println(\"Destination Unreachable\");\n }\n\n long stopTime = System.nanoTime();\n long timeToRun = ((stopTime - startTime)/1000000);\n\n System.out.print(\"\\nTook \" + timeToRun/1000.0 + \" Seconds\");\n System.out.print(\"\\n\\nAnd we're done.\\n\");\n }", "@Test\n public void testWithObstacle3() {\n Grid g = new Grid(4, 4, 0, 0, 0, 0);\n Obstacle o = new Obstacle(1, 1);\n g.setObject(o, 0, 3);\n g.setObject(o, 1, 1);\n g.setObject(o, 1, 2);\n g.setObject(o, 3, 0);\n g.setObject(o, 3, 1);\n AStarStrategy strategy = new AStarStrategy();\n\n Location from = new Location(0, 0);\n Location to = new Location(3, 3);\n Path path = strategy.generatePath(g, from, to);\n assertNotNull(path);\n assertEquals(6, path.getMoves().size());\n assertEquals(Move.DOWN, path.getMoves().get(0).direction);\n assertEquals(Move.DOWN, path.getMoves().get(1).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(2).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(3).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(4).direction);\n assertEquals(Move.DOWN, path.getMoves().get(5).direction);\n }", "@Test\r\n\tpublic void testPatternCase3() {\r\n\t\t// Expected return from Cd\r\n\t\texpectedCd = null;\r\n\t\t// Expected current working directory\r\n\t\texpectedPath = \"/\";\r\n\t\tfs.setCurrent(fs.week1);\r\n\t\t// Actual return from Cd\r\n\t\tactualCd = cd.run(fs, \"../../../\".split(\" \"), \"cd ../../../\", false);\r\n\t\t// Returns the current working directory\r\n\t\tactualPath = fs.getCurrentPath();\r\n\t\t// Checks if the values are equal or not\r\n\t\tassertTrue(actualCd == expectedCd && actualPath.equals(expectedPath));\r\n\t}", "void lineTestPattern2()\n\t{\n\t float theta,d_theta,d_petal,petal,radius,p;\n\t int cx,cy;\n\t int i;\n\t int n_steps =( Nsteps == 18 )?64:4*Nsteps;\n\t Point2D v0 = new Point2D(),v1 = new Point2D();\n\n\t d_theta = (float)(2.0*Math.PI / n_steps);\n\t d_petal = (float)(12.0*Math.PI / n_steps);\n\n\t cx = buff.getWidth()/2;\n\t cy = buff.getHeight()/2;\n\n\t radius = (float) (0.75 * ((cx < cy) ? cx : cy));\n\t p = (float) (radius*0.25);\n\n\t /* draw the outer petals first */\n\n\t v0.x = cx;\n\t v0.y = (int)Math.floor(0.5 + radius + p) + cy;\n\t v0.c.r = 1;\n\t v0.c.g = (float) (128+Math.sin(2*Math.PI)*127.0)/255.0f;\n\t v0.c.b = (float) (128+Math.cos(2*Math.PI)*127.0)/255.0f;\n\n\t for(petal=d_petal,theta=d_theta,i=0;i<=n_steps;++i,theta+=d_theta,petal+=d_petal)\n\t {\n\t v1.x = (int)Math.floor(0.5 + radius*Math.sin(theta) + p*Math.sin(petal)) + cx;\n\t v1.y = (int)Math.floor(0.5 + radius*Math.cos(theta) + p*Math.cos(petal)) + cy;\n\n\t v1.c.r = 1;\n\t v1.c.g = (float) ((128+Math.sin(theta*5)*127.0)/255.0f);\n\t v1.c.b = (float) ((128+Math.cos(theta*5)*127.0)/255.0f);\n\t SketchBase.drawLine(buff,v0,v1);\n\n\t v0.x = v1.x;\n\t v0.y = v1.y;\n\t v0.c = v1.c;\n\t }\n\n\t /* draw circle at center */\n\t radius *= 0.5;\n\t v0.x = cx;\n\t v0.y = (int)Math.floor(0.5 + radius) + cy;\n\n\t /* color = orange */\n\t v1.c.r = v0.c.r = 1;\n\t v1.c.g = v0.c.g = 97.0f/255.0f;\n\t v1.c.b = v0.c.b = 0; \n\n\t for(theta=d_theta,i=0;i<=n_steps;++i,theta+=d_theta)\n\t {\n\t v1.x = (int)Math.floor(0.5 + radius*Math.sin(theta)) + cx;\n\t v1.y = (int)Math.floor(0.5 + radius*Math.cos(theta)) + cy;\n\n\t SketchBase.drawLine(buff,v0,v1);\n\n\t v0.x = v1.x;\n\t v0.y = v1.y;\n\t }\n\t}", "private void checkTargetsReachable(){\n\t\tPathfinder pathfinder = new Pathfinder(collisionMatrix);\n\t\tLinkedList<Node> removeList = new LinkedList<Node>();\n\t\tboolean pathWasFound = false;\n\t\tLinkedList<Node> currentPath;\n\t\tLinkedList<Node> reversePath;\n\t\t\n\t\t//Go through all starting positions\n\t\tfor(LinkedList<Node> startList : targets){\n\t\t\tprogress += 8;\n\t\t\tsetProgress(progress);\n\t\t\tfor(Node startNode : startList){\n\t\t\t\t\n\t\t\t\tboolean outsideMap = (startNode.getCollisionXPos(scaleCollision) < 0 || startNode.getCollisionXPos(scaleCollision) >= (collisionMatrix.length-1) || startNode.getCollisionYPos(scaleCollision) < 0 || startNode.getCollisionYPos(scaleCollision) >= (collisionMatrix.length-1));\n\t\t\t\t\n\t\t\t\tpathWasFound = false;\n\t\t\t\t//Make sure that target is inside of map\n\t\t\t\tif(!outsideMap){\n\t\t\t\t\t//Check against all target positions\n\t\t\t\t\tfor(LinkedList<Node> targetList : targets){\n\t\t\t\t\t\tfor(Node targetNode : targetList){\n\t\t\t\t\t\t\t//Only check against targets that have not already been marked as unreachable\n\t\t\t\t\t\t\tboolean selfCheck = (targetNode.getXPos() != startNode.getXPos() || targetNode.getYPos() != startNode.getYPos());\n\t\t\t\t\t\t\tif(!removeList.contains(targetNode) && selfCheck){\n\t\t\t\t\t\t\t\t//Check if this path has already been checked\n\t\t\t\t\t\t\t\tif(!preCalculatedPaths.containsKey(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision))){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcurrentPath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t//Check if a path can be found for this start and target node\n\t\t\t\t\t\t\t\t\tif(pathfinder.findPath(startNode.getCollisionXPos(scaleCollision), startNode.getCollisionYPos(scaleCollision), targetNode.getCollisionXPos(scaleCollision), targetNode.getCollisionYPos(scaleCollision), currentPath)){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(Frame.USE_PRECALCULATED_PATHS)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision), currentPath);\n\t\t\t\t\t\t\t\t\t\t\treversePath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t\t\treversePath.addAll(currentPath);\n\t\t\t\t\t\t\t\t\t\t\tCollections.reverse(reversePath);\n\t\t\t\t\t\t\t\t\t\t\treversePath.removeFirst();\n\t\t\t\t\t\t\t\t\t\t\treversePath.add(startNode);\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(targetNode.toStringCollision(scaleCollision) + \"-\" + startNode.toStringCollision(scaleCollision) ,reversePath);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpathWasFound = true;\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\telse{\n\t\t\t\t\t\t\t\t\tpathWasFound = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Remove nodes which we cannot find a path from\n\t\t\t\tif(!pathWasFound){\n\t\t\t\t\tremoveList.add(startNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Go through the remove list and remove unreachable nodes\n\t\tfor(Node node : removeList){\n\t\t\tfor(LinkedList<Node> startList : targets){\n\t\t\t\tstartList.remove(node);\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testRun_DecisionOtherwise_IN_A1_D_A3_FN() {\n // Final node creation\n final Node fn = NodeFactory.createNode(\"#6\", NodeType.FINAL);\n\n // Action node 3 (id #5) creation and flow to final node\n final String A3_ID = \"#5\";\n final Node an3 = NodeFactory.createNode(A3_ID, NodeType.ACTION);\n final ExecutableActionMock objAn3 = ExecutableActionMock.create(KEY, A3_ID);\n ((ContextExecutable) an3).setObject(objAn3);\n ((ContextExecutable) an3).setMethod(objAn3.getPutIdInContextMethod());\n ((SingleControlFlowNode) an3).setFlow(fn);\n\n // Action node 2 (id #4) creation and flow to final node\n final String A2_ID = \"#4\";\n final Node an2 = NodeFactory.createNode(A2_ID, NodeType.ACTION);\n final ExecutableActionMock objAn2 = ExecutableActionMock.create(KEY, A2_ID);\n ((ContextExecutable) an2).setObject(objAn2);\n ((ContextExecutable) an2).setMethod(objAn2.getPutIdInContextMethod());\n ((SingleControlFlowNode) an2).setFlow(fn);\n\n final String A1_KEY = \"a1_key\";\n final String A1_ID = \"#2\";\n\n // Decision node (id #3) creation\n final Node dNode = NodeFactory.createNode(\"#3\", NodeType.DECISION);\n // Flow control from decision to action node 2 (if KEY == #2 goto A2)\n Map<FlowCondition, Node> flows = new HashMap<>(1);\n final FlowCondition fc2a2 = new FlowCondition(A1_KEY, ConditionType.EQ, \"ANYTHING WRONG\");\n flows.put(fc2a2, an2);\n // Otherwise, goto A3\n ((ConditionalControlFlowNode) dNode).setFlows(flows, an3);\n\n // Action node 1 (id #2) creation. Sets the context to be used by the decision\n final Node an1 = NodeFactory.createNode(A1_ID, NodeType.ACTION);\n final ExecutableActionMock objAn1 = ExecutableActionMock.create(A1_KEY, A1_ID);\n ((ContextExecutable) an1).setObject(objAn1);\n ((ContextExecutable) an1).setMethod(objAn1.getPutIdInContextMethod());\n ((SingleControlFlowNode) an1).setFlow(dNode);\n\n // Initial node (id #1) creation and flow to action node 1\n final Node iNode = NodeFactory.createNode(\"#1\", NodeType.INITIAL);\n ((SingleControlFlowNode) iNode).setFlow(an1);\n\n final Jk4flowWorkflow wf = Jk4flowWorkflow.create(iNode);\n\n ENGINE.run(wf);\n\n Assert.assertEquals(A3_ID, wf.getContext().get(KEY));\n }", "public static void main(String[] args) {\n\t\tTreeNode treeNode1 = new TreeNode(1);\n\t\tTreeNode treeNode11 = new TreeNode(2);\n\t\tTreeNode treeNode12 = new TreeNode(4);\n\t\tTreeNode treeNode13 = new TreeNode(8);\n\t\tTreeNode treeNode14 = new TreeNode(6);\n\t\tTreeNode treeNode15 = new TreeNode(4);\n\t\tTreeNode treeNode16 = new TreeNode(4);\n\t\tTreeNode treeNode17 = new TreeNode(4);\n\t\tTreeNode treeNode18 = new TreeNode(4);\n\t\ttreeNode1.left = treeNode11;\n\t\ttreeNode1.right = treeNode12;\n\t\ttreeNode11.left = treeNode13;\n\t\ttreeNode11.right = treeNode14;\n\t\ttreeNode13.left = treeNode15;\n\t\ttreeNode13.right = treeNode16;\n\t\ttreeNode15.left = treeNode17;\n\t\ttreeNode17.right = treeNode18;\n\t\tSystem.out.println(hasPathSum(treeNode1, 8));\n\t}", "static private void npcPath() {\n\n if (Time.secondsPassed % 45 == 44) {\n Random picker = new Random();\n while (true) {\n if (josephSchnitzel.getCurrentRoom().equals(mountain)) {\n String[] newRoomString = {\"south\"};\n int index = picker.nextInt(newRoomString.length);\n Room next = josephSchnitzel.getCurrentRoom().getExit(newRoomString[index]);\n josephSchnitzel.setCurrentRoom(next);\n break;\n }\n\n if (josephSchnitzel.getCurrentRoom().equals(beach)) {\n String[] newRoomString = {\"north\"};\n int indexOfNewRoomString = picker.nextInt(newRoomString.length);\n Room nextRoom = josephSchnitzel.getCurrentRoom().getExit(newRoomString[indexOfNewRoomString]);\n josephSchnitzel.setCurrentRoom(nextRoom);\n break;\n }\n\n if (josephSchnitzel.getCurrentRoom().equals(jungle)) {\n String[] newRoomString = {\"north\", \"south\"};\n int indexOfNewRoomString = picker.nextInt(newRoomString.length);\n Room nextRoom = josephSchnitzel.getCurrentRoom().getExit(newRoomString[indexOfNewRoomString]);\n josephSchnitzel.setCurrentRoom(nextRoom);\n break;\n }\n }\n }\n }", "public static void pathMethod (int x, int y, int rows, int columns, int startPointX, int startPointY, int endPointX, int endPointY, String [][]copyArray, String [][]realArray, int decider) throws Exception{ \r\n \r\n String up = copyArray[y-1][x];\r\n String down = copyArray[y+1][x];\r\n String right = copyArray[y][x+1]; //moves the coordinate up one, down one, right one, left one and stores it into up down left right; \r\n String left = copyArray[y][x-1];\r\n \r\n if(up.equals(\"X\")||down.equals(\"X\")||right.equals(\"X\")||left.equals(\"X\")){ //if up right left or down is equal to the endpoint, the maze is solvable, and we can now print the final array\r\n System.out.println(\"\\nThe maze is solvable!\");\r\n// printFinalArray(realArray, counter, xvalues, yvalues); //solution is found already - sends back to another method to print final solution\r\n regenerate(decider); //then sends to regenerate method where it asks if user would like to create another maze\r\n }\r\n \r\n else if(copyArray[startPointY+1][startPointX].equals(\"B\")&&copyArray[startPointY-1][startPointX].equals(\"B\")&&copyArray[startPointY][startPointX+1].equals(\"B\")&&copyArray[startPointY][startPointX-1].equals(\"B\")){\r\n \r\n System.out.println(\"\\nSorry, your maze is unsolvable.\\n\\n\"); //if at the start point we cannot go up down left or right - no possible moves - not solvable - end of maze \r\n regenerate(decider); //call the method that gives users the option to recreate the maze if it was unsolvable \r\n } \r\n \r\n else if(up.equals(\"O\")){ //if the coordinate in the up direction is O\r\n counter=counter+1; //incrementing counter so we can input it the coordinate arrays\r\n copyArray[y][x] = \"V\"; //changing the values to 'V' so we can know that we already visited it\r\n y=y-1; //moving coordinate up one \r\n xvalues[counter]=x; //storing this coordinate into the arrays with the counter\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider); //recalling method\r\n }\r\n \r\n else if(down.equals(\"O\")){ //if down = O\r\n copyArray[y][x] = \"V\";\r\n counter=counter+1;\r\n y=y+1; \r\n xvalues[counter]=x;\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider);\r\n }\r\n \r\n else if(right.equals(\"O\")){ //if right equals O\r\n copyArray[y][x] = \"V\";\r\n counter=counter+1;\r\n x=x+1;\r\n xvalues[counter]=x;\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider);\r\n }\r\n \r\n else if(left.equals(\"O\")){ //if left equals O\r\n copyArray[y][x] = \"V\";\r\n counter=counter+1;\r\n x=x-1;\r\n xvalues[counter]=x;\r\n yvalues[counter]=y;\r\n pathMethod(x, y, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider);\r\n }\r\n \r\n else { //if neither up down left or right work\r\n for(int i = 0; i<rows; i++){ //makes all the 'V's go back to O\r\n for(int j = 0; j<columns; j++){\r\n if(copyArray[i][j].equals(\"V\")){\r\n copyArray[i][j] = \"O\";\r\n }\r\n }\r\n }\r\n copyArray[y][x] = \"B\"; //make the coordinate that you cant make a move with B, so it shortens the possible path options\r\n for(int i = 0 ; i<counter; i++){\r\n xvalues[i] = 0; //resets the coordinate arrays back to 0\r\n yvalues[i] = 0;\r\n }\r\n counter=0; //resets counter back to 0;\r\n pathMethod(startPointX, startPointY, rows, columns, startPointX, startPointY, endPointX, endPointY, copyArray, realArray, decider); //resends the startpoints instead of x and y; only thing different is that one coordinate is now marked \"B\"\r\n } \r\n }", "@Test\n public void testGetShortestPath03() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n\n LinkedList<City> expResult = new LinkedList();\n expResult.add(new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n expResult.add(new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n expResult.add(new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n\n LinkedList<City> result = new LinkedList();\n sn10.getShortestPath(userA, userB, result);\n assertEquals(expResult, result);\n }", "public static int csQuestions(int csPathway) {\r\n int questionNumber = (int) (Math.random() * 20) + 1;\r\n\r\n switch (questionNumber) {\r\n case 1:\r\n System.out.println(\r\n \"\\r\\n\" + \"Which of the following is not one of the 8 ethics of programming\\r\\n\" + \"1.) Self\\r\\n\"\r\n + \"2.) Product\\r\\n\" + \"3.) Gracious Professionalism \\r\\n\" + \"4.) Public\\r\\n\");\r\n break;\r\n case 2:\r\n System.out.println(\r\n \"What’s wrong with the following main method? Public static boolean main(String args[]) {\\r\\n\"\r\n + \"1.) The main should be private\\r\\n\" + \"2.) The p in public should be lowercase\\r\\n\"\r\n + \"3.) The arguments should be int\\r\\n\"\r\n + \"4.) The p in public should be lowercase and boolean should be void\\r\\n\");\r\n break;\r\n case 3:\r\n System.out.println(\r\n \"What are the primitive types?\\r\\n\"\r\n + \"1.) byte, String, int, double, char, boolean, float, long\\r\\n\"\r\n + \"2.) double, char, boolean, float\\r\\n\"\r\n + \"3.) byte, short, int, long, float, double, char, boolean\\r\\n\"\r\n + \"4.) double, class, boolean, float\\r\\n\");\r\n break;\r\n case 4:\r\n System.out.println(\r\n \"The “less than or equal to” comparison operator in Java is _______.\\r\\n\" + \"1.) =<\\r\\n\"\r\n + \"2.) !=\\r\\n\" + \"3.) <=\\r\\n\" + \"4.) <\\r\\n\");\r\n break;\r\n case 5:\r\n System.out.println(\r\n \"What are the benefits of modular programming?\\r\\n\"\r\n + \"1.) Methods are used to break code into manageable pieces\\r\\n\"\r\n + \"2.) Make code more reusable\\r\\n\" + \"3.) Help to debug code\\r\\n\"\r\n + \"4.) All of the above\\r\\n\");\r\n break;\r\n case 6:\r\n System.out.println(\r\n \"The following code displays ______.\\r\\n\" + \" double temp = 50;\\r\\n\" + \" \\r\\n\"\r\n + \" if (temp >= 100)\\r\\n\" + \" System.out.println(“too hot’);\\r\\n\"\r\n + \" else if (temp <=40)\\r\\n\" + \" System.out.println(“too cold”);\\r\\n\"\r\n + \" else \\r\\n\" + \" System.out.println(“just right”);\\r\\n\"\r\n + \"1.) too hot too cold just right\\r\\n\" + \"2.) too hot\\r\\n\" + \"3.) too cold\\r\\n\"\r\n + \"4.) just right\\r\\n\");\r\n break;\r\n case 7:\r\n System.out.println(\r\n \"The order of precedence (from high to low) of the operators +,*, &&, ||, ! is\\r\\n\"\r\n + \"1.) *, +, !, &&, ||\\r\\n\" + \"2.) *, +, &&, ||, !\\r\\n\" + \"3.) &&, ||, !, +, *\\r\\n\"\r\n + \"4.) *, +, !, ||, &&\\r\\n\");\r\n break;\r\n case 8:\r\n System.out.println(\r\n \"What does the String Class, s.length() do?\\r\\n\" + \"1.) returns the character at index x\\r\\n\"\r\n + \"2.) returns true/false if the string stored in s is the same as that in t ignoring the case\\r\\n\"\r\n + \"3.) returns the number of characters in the string\\r\\n\"\r\n + \"4.) returns the string in all lowercase\\r\\n\");\r\n break;\r\n case 9:\r\n System.out.println(\r\n \"What does the Math Class, Math.random() do?\\r\\n\"\r\n + \"1.) returns a double from 0.0 and less than 1.0\\r\\n\"\r\n + \"2.) return a double of the square root of the value given\\r\\n\"\r\n + \"3.) returns the minimum of the two values given\\r\\n\"\r\n + \"4.) returns a double of the base raised to the exponent\\r\\n\");\r\n break;\r\n case 10:\r\n System.out.println(\r\n \"What does void in the following method, public static void main(String[] args), mean?\\r\\n\"\r\n + \"1.) when called on, this method will not have a return value\\r\\n\"\r\n + \"2.) void is the method name\\r\\n\"\r\n + \"3.) when called on, this method will return a boolean\\r\\n\"\r\n + \"4.) void represent that this method needs no parameters\\r\\n\");\r\n break;\r\n case 11:\r\n System.out.println(\r\n \"What is wrong with the following line, System.out.println(“Hello World”)\\r\\n\"\r\n + \"1.) System should be lowercase\\r\\n\" + \"2.) missing a semicolon at the end\\r\\n\"\r\n + \"3.) Hello World needs to be in single quotations\\r\\n\"\r\n + \"4.) missing a comma at the end\\r\\n\");\r\n break;\r\n case 12:\r\n System.out.println(\r\n \"What is // used for?\\r\\n\" + \"1.) print a new line\\r\\n\" + \"2.) block comments\\r\\n\"\r\n + \"3.) single line comments\\r\\n\" + \"4.) print double space\\r\\n\");\r\n break;\r\n case 13:\r\n System.out.println(\r\n \"What does the String Class, s.equalsIgnoreCase(t) do?\\r\\n\"\r\n + \"1.) returns the string in all lowercase\\r\\n\" + \"2.) returns the character at index x\\r\\n\"\r\n + \"3.) returns true/false if the string stored in s is the same as that in t\\r\\n\"\r\n + \"4.) returns true/false if the string stored in s is the same as that in t ignoring the case\\r\\n\");\r\n break;\r\n case 14:\r\n System.out.println(\r\n \"If you run a program and it returns with ArrayIndexOutOfBoundsException. There’s a ______.\\r\\n\"\r\n + \"1.) runtime error\\r\\n\" + \"2.) syntax error\\r\\n\" + \"3.) format error \\r\\n\"\r\n + \"4.) logic error\\r\\n\");\r\n break;\r\n case 15:\r\n System.out.println(\r\n \"What are two ways to make code more readable?\\r\\n\" + \"1.) comments and arrays\\r\\n\"\r\n + \"2.) descriptive names and randomized casing\\r\\n\"\r\n + \"3.) descriptive names and comments\\r\\n\" + \"4.) indentation and return statements \\r\\n\");\r\n break;\r\n case 16:\r\n System.out.println(\r\n \"A for statement is a _________.\\r\\n\" + \"1.) conditional loop\\r\\n\" + \"2.) counter loop \\r\\n\"\r\n + \"3.) selection statement\\r\\n\" + \"4.) selection loop\\r\\n\");\r\n break;\r\n case 17:\r\n System.out.println(\r\n \"// are used for what in Java?\\r\\n\" + \"1.) single line commenting \\r\\n\"\r\n + \"2.) end of a java statement \\r\\n\" + \"3.) block comment\\r\\n\"\r\n + \"4.) Java doc comment\\r\\n\");\r\n break;\r\n case 18:\r\n System.out.println(\r\n \"Which of the following is the correct way to name a variable?\\r\\n\" + \"1.) StudentNumber\\r\\n\"\r\n + \"2.) _student_number\\r\\n\" + \"3.) STUDENTNUMBER\\r\\n\" + \"4.) studentNumber\\r\\n\");\r\n break;\r\n case 19:\r\n System.out.println(\r\n \"What will the following code execute?\\r\\n\" + \" int x = 10;\\r\\n\" + \" x += 5;\\r\\n\"\r\n + \" System.out.println(“X equals” + x);\\r\\n\" + \"1.) prints out “X equals x”\\r\\n\"\r\n + \"2.) prints out “X equals 10”\\r\\n\" + \"3.) prints out “X equals 15”\\r\\n\"\r\n + \"4.) prints out “X equals 5”\\r\\n\");\r\n break;\r\n case 20:\r\n System.out.println(\r\n \"What does the Math Class, Math.pow(base, exp) do?\\r\\n\"\r\n + \"1.) return a double of the square root of the value given\\r\\n\"\r\n + \"2.) returns a double from 0.0 and less than 1.0\\r\\n\"\r\n + \"3.)returns the maximum of the two values given\\r\\n\"\r\n + \"4.) returns a double of the base raised to the exponent\\r\\n\");\r\n }\r\n\r\n return questionNumber;\r\n }", "private boolean matches(int[] sublist, PointBreakdownObject points, int windoftheround, int playerwind)\n\t{\n\t\t// switch based on what we need to match \n\t\tint target = sublist[MARKER];\n\n\t\t// cascade\n\t\tif ((target==SINGLE || target==CONCEALED_SINGLE) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"single\"),windoftheround,playerwind)) {\n\t\t\treturn match(\"single\",sublist,lookuptable.get(\"single\"),points,windoftheround,playerwind); }\n\t\telse if ((target==CONNECTEDPAIR || target==CONCEALED_CONNECTEDPAIR)\n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"connectedpair\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"connectedpair\",sublist,lookuptable.get(\"connectedpair\"),points,windoftheround,playerwind); }\n\t\telse if ((target==PAIR || target==CONCEALED_PAIR) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"pair\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"pair\",sublist,lookuptable.get(\"pair\"),points,windoftheround,playerwind); }\n\t\telse if ((target==CHOW || target==CONCEALED_CHOW) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"chow\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"chow\",sublist,lookuptable.get(\"chow\"),points,windoftheround,playerwind); }\n\t\telse if ((target==PUNG || target==CONCEALED_PUNG) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"pung\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"pung\",sublist,lookuptable.get(\"pung\"),points,windoftheround,playerwind); }\n\t\telse if ((target==KONG || target==CONCEALED_KONG) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"kong\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"kong\",sublist,lookuptable.get(\"kong\"),points,windoftheround,playerwind); }\n\n\t\t// if nothing worked, no.\n\t\treturn false;\n\t}", "@Test\r\n\tpublic void testPatternCase4() {\r\n\t\t// Expected return from Cd\r\n\t\texpectedCd = null;\r\n\t\t// Expected current working directory\r\n\t\texpectedPath = \"/documents\";\r\n\t\t// Actual return from Cd\r\n\t\tactualCd = cd.run(fs, \"../../documents\".split(\" \"), \"cd ../../documents\", false);\r\n\t\t// Returns the current working directory\r\n\t\tactualPath = fs.getCurrentPath();\r\n\t\t// Checks if the values are equal or not\r\n\t\tassertTrue(actualCd == expectedCd && actualPath.equals(expectedPath));\r\n\t}", "@Override\r\n public Set<List<String>> findAllPaths(int sourceId, int targetId, int reachability) {\r\n //all paths found\r\n Set<List<String>> allPaths = new HashSet<List<String>>();\r\n //collects path in one iteration\r\n Set<List<String>> newPathsCollector = new HashSet<List<String>>();\r\n //same as the solution but with inverted edges\r\n Set<List<String>> tmpPathsToTarget = new HashSet<List<String>>();\r\n //final solution\r\n Set<List<String>> pathsToTarget = new HashSet<List<String>>();\r\n \r\n String[] statementTokens = null; \r\n Set<Integer> allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n List<String> statementsFound = new ArrayList<String>();\r\n \r\n for (int i = 0; i < reachability; i++) {\r\n if (i == 0) { \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(sourceId);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n //allProcessedNodes.add(inNodeId); \r\n //Incoming nodes are reversed\r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n allPaths.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(sourceId);\r\n \r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n statementsFound.add(outEdge);\r\n allPaths.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n } else {\r\n newPathsCollector = new HashSet<List<String>>();\r\n\r\n for (List<String> statements: allPaths) {\r\n allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n int lastNodeInPath = 0;\r\n \r\n for (String predicate: statements) {\r\n if (predicate.contains(\">-\")) {\r\n statementTokens = predicate.split(\">-\");\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[0]).reverse().toString()));\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString()));\r\n lastNodeInPath = Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString());\r\n } else {\r\n statementTokens = predicate.split(\"->\"); \r\n allProcessedNodes.add(Integer.parseInt(statementTokens[0]));\r\n allProcessedNodes.add(Integer.parseInt(statementTokens[2]));\r\n lastNodeInPath = Integer.parseInt(statementTokens[2]);\r\n }\r\n }\r\n \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(lastNodeInPath);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n if (allProcessedNodes.contains(inNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n newPathsCollector.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(lastNodeInPath);\r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n if (allProcessedNodes.contains(outNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(outEdge);\r\n newPathsCollector.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n }\r\n allPaths.addAll(newPathsCollector);\r\n }\r\n \r\n //System.out.println(\"*****End of iteration \" + i);\r\n //System.out.println(\"#SIZE OF allPaths: \" + allPaths.size());\r\n int numItems = 0;\r\n for (List<String> currList: allPaths) {\r\n numItems = numItems + currList.size();\r\n }\r\n //System.out.println(\"#NUMBER OF ELEMS OF ALL LISTS: \" + numItems);\r\n //System.out.println(\"#SIZE OF tmpPathsToTarget : \" + tmpPathsToTarget.size());\r\n }\r\n \r\n //We need to reverse back all the predicates\r\n for (List<String> statements: tmpPathsToTarget) { \r\n List<String> fixedStatements = new ArrayList<String>(); \r\n for (int i = 0; i < statements.size(); i++) { \r\n String statement = statements.get(i); \r\n if (statement.contains(\">-\")) {\r\n fixedStatements.add(new StringBuilder(statement).reverse().toString());\r\n } else {\r\n fixedStatements.add(statement);\r\n } \r\n }\r\n pathsToTarget.add(fixedStatements);\r\n }\r\n return pathsToTarget;\r\n }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}" ]
[ "0.6314642", "0.61095977", "0.61049557", "0.60981244", "0.60571975", "0.6055202", "0.60317445", "0.60214317", "0.6020346", "0.6010904", "0.59091675", "0.59033275", "0.59006464", "0.58916765", "0.58711416", "0.58656836", "0.58518606", "0.5840483", "0.5835638", "0.58320165", "0.5794431", "0.57899535", "0.57471997", "0.5739692", "0.5728953", "0.5717655", "0.5705863", "0.5694598", "0.5690591", "0.5685096", "0.56845564", "0.567226", "0.5670394", "0.56687015", "0.5642241", "0.564201", "0.5640857", "0.563702", "0.5628127", "0.56260455", "0.56258905", "0.56185037", "0.5607471", "0.55697846", "0.5565127", "0.5562226", "0.55618644", "0.55609983", "0.55516416", "0.5548196", "0.5540652", "0.55358166", "0.5532393", "0.5522774", "0.55218786", "0.55212855", "0.5520456", "0.5513494", "0.55111104", "0.55050087", "0.5494159", "0.548061", "0.5459253", "0.5456706", "0.5446828", "0.54389256", "0.5437238", "0.54229754", "0.5421911", "0.5415765", "0.5414265", "0.5397295", "0.53962827", "0.53961647", "0.53934795", "0.53871745", "0.53813636", "0.5375028", "0.5374844", "0.5366984", "0.5362122", "0.53502387", "0.5348442", "0.53466535", "0.53427035", "0.5341846", "0.53413355", "0.5329451", "0.5322751", "0.53197205", "0.5316573", "0.53145516", "0.529941", "0.5297365", "0.5293724", "0.52930486", "0.5289412", "0.52847034", "0.52791166", "0.52695227" ]
0.620794
1
send msg to jdbc
public void send(String topic,Object content,String actionType) { //maxkey.server.message.queue , if not none if(applicationConfig.isProvisionSupport()) { ProvisionMessage message = new ProvisionMessage( UUID.randomUUID().toString(), //message id as uuid topic, //TOPIC actionType, //action of content DateUtils.getCurrentDateTimeAsString(), //send time null, //content Object to json message content content ); //sand msg to provision topic Thread thread = null; if(applicationConfig.isProvisionSupport()) { _logger.trace("message..."); thread = new ProvisioningThread(jdbcTemplate,message); thread.start(); }else{ _logger.trace("no send message..."); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean send_message(String SID, String RID, String message)\r\n {\r\n DBConnect db = new DBConnect();\r\n try\r\n {\r\n \r\n String SQL = \"insert into MESSAGES(SID, RID,message) values ('\" + SID + \"', '\" + RID + \"', '\"+ message + \"')\";\r\n System.out.println(\"\"+SQL);\r\n try\r\n {\r\n \r\n db.pstmt = db.conn.prepareStatement(SQL);\r\n \r\n try\r\n {\r\n if (db.pstmt.executeUpdate() != 0)\r\n return true;\r\n }\r\n catch(Exception e)\r\n {\r\n\r\n }\r\n } \r\n catch(Exception e)\r\n {\r\n \r\n }\r\n finally\r\n {\r\n try\r\n {\r\n db.conn.close();\r\n }\r\n catch (Exception e)\r\n {\r\n \r\n }\r\n }\r\n } \r\n catch(Exception e)\r\n {\r\n \r\n }\r\n return false;\r\n}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttry{\n\t\t\t\t\tString query =\"insert into message (username, msg) values (?,?)\";\n\t\t\t\t\tPreparedStatement pst = conn.prepareStatement(query);\n\t\t\t\t\tpst.setString(1, touserFeild.getText());\n\t\t\t\t\tpst.setString(2, msgFeild.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"post message success\");\n\t\t\t\t\t\n\t\t\t\t\tpst.close();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcatch (Exception e7)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"post message fail\");\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Message Failed to post\");\n\t\t\t\t}\n\t\t\t\t//msgObject.refreshTable();\n\t\t\t\tdispose();\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void messageArrived(String topic, MqttMessage message) throws Exception {\n\t\t\t\t\t\t try { \r\n//\t\t\t\t\t\t\t SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\"); \r\n//\t\t\t\t\t\t\t String date = sdf.format(new Date());\r\n\t\t\t\t\t System.out.println(\" From:\"+message.toString()); \r\n\t\t\t\t\t \r\n\t\t\t\t\t Connection conn = null;\r\n\t\t\t\t\t Class.forName(\"com.mysql.jdbc.Driver\"); \r\n\t\t\t\t\t conn = DriverManager.getConnection(\r\n\t\t\t\t\t \t\t\"jdbc:mysql://localhost:3306/mqtt?useUnicode=true&characterEncoding=UTF-8\",\r\n\t\t\t\t\t \t\t\"root\",\r\n\t\t\t\t\t \t\t\"tmu2012\");\r\n\t\t\t\t\t System.out.println(\"connected to the database\");\r\n\r\n\t\t\t\t\t Statement stmt = conn.createStatement();\r\n\t\t\t\t\t System.out.println(\"Inserting records\");\r\n\t\t\t\t\t \r\n\t\t\t\t\t String qry1 = \"INSERT INTO mymqtts (mqtt) VALUES('\"+message.toString()+\"')\";\r\n\t\t\t\t\t stmt.executeUpdate(qry1);\r\n\t\t\t\t\t System.out.println(\"ok\");\r\n\t\t\t\t\t\t }catch (Exception e) { \r\n\t\t\t\t\t e.printStackTrace(); \r\n\t\t\t\t\t System.out.println(\"error\"); \r\n\t\t\t\t\t } \r\n\t\t\t\t\t}", "public void insert(String linkid, String msisdn, String scode, String correlator, String message) {\n try {\r\n MysqlConnectionPoolDataSource dataSource = new MysqlConnectionPoolDataSource();\r\n //poole.set\r\n//\t\t\tMysqlDataSource dataSource = new MysqlDataSource();\r\n dataSource.setServerName(\"127.0.0.1\");\r\n // dataSource.setServerName(\"192.168.100.202\");\r\n dataSource.setDatabaseName(\"dspDelivery\");\r\n dataSource.setUser(\"root\");\r\n dataSource.setPassword(\"1root2\");\r\n//\t\t\t Open a connection\r\n //System.out.println(\"Connecting to the database...\");\r\n Connection conn = dataSource.getConnection();\r\n String insert = \"\";\r\n if (scode.equals(\"22260\")) {\r\n insert = \"insert into SICinbox(linkid,msisdn,message,scode,correlator) values (?,?,?,?,?)\";\r\n } else if (scode.equals(\"22261\")) {\r\n insert = \"insert into APEXinbox(linkid,msisdn,message,scode,correlator) values (?,?,?,?,?)\";\r\n } else if (scode.equals(\"20078\")) {\r\n insert = \"insert into 20078inbox(linkid,msisdn,message,scode,correlator) values (?,?,?,?,?)\";\r\n try {\r\n ToKnec.postInbox(linkid, msisdn, message);\r\n } catch (IOException ex) {\r\n Logger.getLogger(sms.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n } else {\r\n insert = \"insert into ondemand(linkid,msisdn,message,scode,correlator) values (?,?,?,?,?)\";\r\n }\r\n\r\n PreparedStatement prep = conn.prepareStatement(insert);\r\n prep.setString(1, linkid);\r\n prep.setString(2, msisdn);\r\n prep.setString(3, message);\r\n prep.setString(4, scode);\r\n prep.setString(5, correlator);\r\n prep.execute();\r\n prep.close();\r\n conn.close();\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n /*if(scode.equals(\"22260\")||scode.equals(\"22225\") ){\r\n //if(scode.equals(\"22260\") ){\r\n System.out.println(\"Scode is \"+scode);\r\n sendNormalMes(msisdn,message,linkid,scode);\r\n }*/\r\n }", "@FXML\n public void sendAmessage(ActionEvent event) throws SQLException{\n DBConnect db = DBConnect.getInstance();\n db.sendMessage(message.getText(), selectedCustomer.getChat_id());\n message.setText(\"\");\n updateChat();\n }", "void saveMessage(int id,String msg) throws SQLException {\n\t\tpst=con.prepareStatement(\"INSERT INTO message VALUES(?,?)\");\n\t\tpst.setInt(1, id);\n\t\tpst.setString(2, msg);\n\t\t\n\t\tpst.executeUpdate();\n\t}", "private void sendQuery(String sqlQuery) {\n getRemoteConnection();\n try {\n statement = conn.createStatement();{\n // Execute a SELECT SQL statement.\n resultSet = statement.executeQuery(sqlQuery);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "void sendTransactionToServer()\n \t{\n \t\t//json + sql magic\n \t}", "public void executeSQlQuery(String query, String message) {\n Connection con = getConnection();\n Statement st;\n try {\n st = con.createStatement();\n if ((st.executeUpdate(query)) == 1) {\n // refresh jtable data\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n model.setRowCount(0);\n GetData();\n\n JOptionPane.showMessageDialog(null, message);\n } else {\n JOptionPane.showMessageDialog(null, \"Wystapił błąd\");\n }\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"Zostały wprowadzone niepoprawne dane\");\n\n }\n }", "@Override\n @SuppressWarnings({\"lgtm [java/database-resource-leak]\"})\n public void doService(AdaptrisMessage msg) throws ServiceException {\n log.trace(\"Beginning doService\");\n JdbcResult result = null;\n Connection conn = null;\n try {\n Connection c = getConnection(msg);\n if (!c.equals(actor.getSqlConnection())) {\n actor.reInitialise(c);\n }\n conn = actor.getSqlConnection();\n initXmlHelper(msg);\n String statement = getStatementCreator().createStatement(msg);\n PreparedStatement preparedStatement = actor.getQueryStatement(statement); \n preparedStatement.clearParameters();\n log.trace(\"Executing statement [{}]\", statement);\n \n this.getParameterApplicator().applyStatementParameters(msg, preparedStatement, getStatementParameters(), statement);\n try {\n // closed by the finally block which closes the JdbcResult\n ResultSet rs = preparedStatement.executeQuery();\n result = new JdbcResultBuilder().setHasResultSet(true).setResultSet(rs).build();\n } catch (SQLException e) {\n if (ignoreExecuteQueryErrors()) {\n log.debug(\"Ignore ExecuteQuery Errors enabled); using empty ResultSet\");\n result = new JdbcResultBuilder().setHasResultSet(false).build();\n } else {\n throw e;\n }\n }\n resultSetTranslator.translate(result, msg);\n destroyXmlHelper(msg);\n JdbcUtil.commit(conn, msg);\n }\n catch (Exception e) {\n JdbcUtil.rollback(conn, msg);\n throw ExceptionHelper.wrapServiceException(e);\n }\n finally {\n JdbcUtil.closeQuietly(result);\n JdbcUtil.closeQuietly(conn);\n }\n }", "@Override\n\tpublic String execute() throws Exception {\n\t\treturn \"send\";\n\t}", "public void SendNewMessage(DBMethods dbm) {\r\n\t\t\r\n\t\tScanner SendNewMessageSC=new Scanner(System.in);\r\n\t\tString ReceiverUsername=null;\r\n\t\tString ContinueSendMessageAnswer=\"\";\r\n\t\tString MessageSendAnswer=\"\";\r\n\t\tString MessageText=\"\";\r\n\t\t//String ContinueSendingMessages=\"\";\r\n\t\tboolean b1=true;\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tdo {\r\n\t\t\t\t//SEND NEW MESSAGE MENU Structure\r\n\t\t\t\tSystem.out.println(\"\\n\"+\"-----------SEND NEW MESSAGE------------\"+\"\\n\"+\r\n\t\t\t \"Please type in the receiver's username:\");\r\n\t\t\t\tReceiverUsername=SendNewMessageSC.next();\r\n\t\t\t\t\r\n\t\t\t\t//Query that searches the DB to find out if the username exists in the 'users' TABLE\r\n\t\t\t\tString query4=\"SELECT users.username AS 'Username'\"+\"\\n\"+\r\n\t\t \"FROM dont_shoot_the_messenger.users\"+\"\\n\"+\r\n\t\t\t\t \"WHERE users.username='\"+ReceiverUsername+\"'\"+\"\\n\"+\r\n\t\t \"LIMIT 1;\";\r\n\t\t\t\t\r\n\t\t\t\tStatement stm4 = dbm.getConnection().createStatement();\r\n\t\t\t\tResultSet rs3 = stm4.executeQuery(query4);\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.print(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\t//Returns FALSE if the username doesn't exist\r\n\t\t\t\tb1=rs3.next();\r\n\t\t\t\t\r\n\t\t\t\t//Case that the username does NOT exist in the 'users' Table\r\n\t\t\t\tif (b1==false) {\r\n\t\t\t\t\tSystem.out.println(\"User not found\"+\"\\n\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"Do you want to continue sending messages? (y/n): \");\r\n\t\t\t\t\tContinueSendMessageAnswer=SendNewMessageSC.next();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//While Loop for preventing Wrong Input\r\n\t\t\t\t\twhile(!ContinueSendMessageAnswer.equalsIgnoreCase(\"y\")&&!ContinueSendMessageAnswer.equalsIgnoreCase(\"n\")) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid input\"+\"\\n\"+\r\n\t\t\t\t\t \"Do you want to continue sending messages? (y/n): \");\r\n\t\t\t\t\t\tContinueSendMessageAnswer=SendNewMessageSC.next();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Case that the username Exists in the 'users' Table\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(\"Please type in the message you want to send (250 characters max): \");\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Way to put the whole message to a string called 'MessageText'\r\n\t\t\t\t\tMessageText=SendNewMessageSC.next();\r\n\t\t\t\t\tMessageText=MessageText+SendNewMessageSC.nextLine();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Replacing the \" and ' characters from MessageText with /\r\n\t\t\t\t\tMessageText=MessageText.replace('\"','/');\r\n\t\t\t\t\tMessageText=MessageText.replaceAll(\"'\",\"/\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Asking for confirmation to send the message\r\n\t\t\t\t\tSystem.out.println(\"Do you want to continue sending the message? (y/n): \");\r\n\t\t\t\t\tMessageSendAnswer=SendNewMessageSC.next();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//While Loop for preventing Wrong Input\r\n\t\t\t\t\twhile(!MessageSendAnswer.equalsIgnoreCase(\"y\")&&!MessageSendAnswer.equalsIgnoreCase(\"n\")) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid input\"+\"\\n\"+\r\n\t\t\t\t\t\t\t\t \"Do you want to continue sending the message? (y/n): \");\r\n\t\t\t\t\t\tMessageSendAnswer=SendNewMessageSC.next();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tswitch(MessageSendAnswer) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Case that the user wants to send the message\r\n\t\t\t\t\tcase \"y\":\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Query that inserts all message data to 'messages' Table\r\n\t\t\t\t\t\tString query5=\"INSERT INTO `dont_shoot_the_messenger`.`messages`\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"(`sender_id`, `receiver_id`, `text`)\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"VALUES\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"(\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"(SELECT users.id\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"FROM dont_shoot_the_messenger.users\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"WHERE users.username='\"+getUsername()+\"'\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"LIMIT 1),\"+\r\n\t\t\t\t\t\t\t \"(SELECT users.id\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"FROM dont_shoot_the_messenger.users\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"WHERE users.username='\"+ReceiverUsername+\"'\"+\"\\n\"+\r\n\t\t\t\t\t\t\t \"LIMIT 1),\"+\r\n\t\t\t\t\t\t\t \"'\"+MessageText+\"');\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.println(\"Sending Message to \"+ReceiverUsername+\" ...\"+\"\\n\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdbm.executeStatement(query5);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.print(\"Message Sent\"+\"\\n\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Keeping Log of the action\r\n\t\t\t\t\t\tLog.appendStrToFile(\"Dont_Shoot_The_Messenger_Log_File.txt\", getUsername()+\r\n\t\t\t\t\t\t\t\t \" Sent a Message To: \"+ReceiverUsername+\" at \"+timeStamp+\" Message text: \"+MessageText);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Case that the user does NOT want to send the message\r\n\t\t\t\t\tcase \"n\":\r\n\t\t\t\t\t\tSystem.out.println(\"Canceling the sending of the message...\"+\"\\n\"+\"Sent Canceled\"); \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"Do you want to continue sending messages? (y/n): \");\r\n\t\t\t\t\tContinueSendMessageAnswer=SendNewMessageSC.next();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//While Loop for preventing Wrong Input\r\n\t\t\t\t\twhile(!ContinueSendMessageAnswer.equalsIgnoreCase(\"y\")&&!ContinueSendMessageAnswer.equalsIgnoreCase(\"n\")) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid input\"+\"\\n\"+\r\n\t\t\t\t\t \"Do you want to continue sending messages? (y/n): \");\r\n\t\t\t\t\t\tContinueSendMessageAnswer=SendNewMessageSC.next();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Do...While Loop for keeping User to the SEND NEW MESSAGE Menu Unless he/she chooses 'n'\r\n\t\t\t\t}while(ContinueSendMessageAnswer.equals(\"y\"));\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\\n\"+\"Returning to Main Menu...\"+\"\\n\");\r\n\t\t\t}\r\n\t\t\r\n\t\tcatch (SQLException e) {\r\n\t\t\t//e.printStackTrace();\r\n\t\t\t}\r\n\t\t\r\n\t\t}", "void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Não foi possível enviar a mesagem !!!\");\n\t\t}\n\t}", "private int sendUpdate(String sqlQuery) {\n int result = 0;\n getRemoteConnection();\n try {\n statement = conn.createStatement();{\n // Execute a SELECT SQL statement.\n result = statement.executeUpdate(sqlQuery);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return result;\n }", "private void updateDatabase(users.Message msg, DatabaseConnection dc) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT into \" + this.messagesTable + \" \");\n\t\tsb.append(\"(id, type, datesent, timesent, senderid, receiverid, opened, replied, subject, body) \");\n\t\tsb.append(\"VALUES \"); //(1, 2, 3, \"20141225\", 100, 5);\");\n\t\tsb.append(\"(\" + msg.id + \", \" + msg.type + \", \");\n\t\tsb.append(\"\\\"\"+msg.datesent + \"\\\", \\\"\" + msg.timesent + \"\\\", \");\n\t\tsb.append(msg.senderid + \", \\\"\" + msg.receiverid + \"\\\", \");\n\t\tsb.append(msg.opened + \", \" + msg.replied + \", \");\n\t\tsb.append(\"\\\"\"+msg.subject + \"\\\", \\\"\" + msg.body + \"\\\");\");\n\t\tdc.executeUpdate(sb.toString());\n\t}", "private void setext() {\n\n\t\ttry {\n\t\t\tString databaseUser = \"blairuser\";\n\t\t\tString databaseUserPass = \"password!\";\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tConnection connection = null;\n\t\t\tString url = \"jdbc:postgresql://13.210.214.176/test\";\n\t\t\tconnection = DriverManager.getConnection(url, databaseUser, databaseUserPass);\n//\t\t\tStatement s = connection.createStatement();\n\t\t\ts = connection.createStatement();\n\t\t\ts.executeQuery(\"insert into chatmachine (name,message,ip,time) values ('testuser2','\" + msgfield.getText()\n\t\t\t\t\t+ \"','9.9.9.9',CURRENT_TIMESTAMP);\");\n\n//\t\t\twhile (rs.next()) {\n//\t\t\t\toutput.setText(rs.getString(\"name\")+\": \"+rs.getString(\"message\"));\n\t\t\t// System.out.println(rs.getString(\"name\")+\" \"+rs.getString(\"message\"));\n//\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\n\t}", "void sendMessage(String msg) {\n\t\ttry {\n\t\t\tout.writeObject(msg);\n\t\t\tout.flush();\n\t\t\tSystem.out.println(\"Sending to server => \" + msg);\n\t\t} catch (IOException ioException) {\n\t\t\tioException.printStackTrace();\n\t\t}\n\t}", "public void executeSQlQuery(String query, String message)\n {\n Connection con = DB.getConnection();\n Statement st;\n try{\n st = con.createStatement();\n if((st.executeUpdate(query)) == 1)\n {\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n model.setRowCount(0);\n showTable();\n \n JOptionPane.showMessageDialog(null, \"Data \"+message+\" Succefully\");\n }else{\n JOptionPane.showMessageDialog(null, \"Data Not \"+message);\n }\n }catch(SQLException | HeadlessException ex){\n }\n }", "public void sendMessage(String msg) {\n try {\n out.write(msg);\n out.newLine();\n out.flush();\n \n } catch (IOException e) {\n \tshutdown();\n e.printStackTrace();\n }\n }", "private void sendDataMsgToClient(String msg) {\n if (dataConnection == null || dataConnection.isClosed()) {\n sendMsgToClient(\"425 No data connection was established\");\n debugOutput(\"Cannot send message, because no data connection is established\");\n } else {\n dataOutWriter.print(msg + '\\r' + '\\n');\n }\n\n }", "public void insertemail(String querytelephone, String lianxiren, String telephonenum, String address, String qq,\r\n\t\t\tString email, String websource) {\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tSystem.out.println(\"kkkk\");\r\n\t\t\tcon = DriverManager.getConnection(\r\n\t\t\t// \"jdbc:mysql://192.168.32.19:3306/weibo_sina?useUnicode=true&amp&characterEncoding=UTF-8\", \"weibosina\",\"OyiaV5M53qTqlZjmN0OOtA==\");\r\n\t\t\t\t\t\"jdbc:mysql://127.0.0.1:3306/xiaohe\", \"root\", \"20121028mmhct1314\");\r\n\t\t\t//\"jdbc:mysql://192.168.32.19:3306/weibo_sina\", \"weibosina\",\"OyiaV5M53qTqlZjmN0OOtA==\");\r\n\t\t\tStatement stat = con.createStatement();\r\n\t\t\tString sql = \"insert into \" + \"emailresult\" + \" values('\" + querytelephone + \"','\" + lianxiren + \"','\"\r\n\t\t\t\t\t+ telephonenum + \"','\" + address + \"','\" + qq + \"','\" + email + \"','\" + \" \" + \"')\";\r\n\t\t\t//\"\"+signname+\"','\"+realname+\"','\"+nickname+\"','\"+lianxiren+\"','\"+age+\"','\"+sex+\"','\"+telephonenum+\"','\"+phonepicture+\"','\"+address+\"','\"+duty+\"','\"+area+\"','\"+qq+\"','\"+email+\"','\"+websource+\"','\"+dataresource+\"','\"+deletedd+\"')\";\r\n\t\t\tstat.executeUpdate(sql);\r\n\t\t\tSystem.out.println(\"***++++\" + sql);\r\n\t\t\tstat.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tcon.close();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void databaseInsertServer() {\n\t\ttry {\r\n\t\t\t Socket server=new Socket(ipAddress,portNumer);\r\n\t //Socket server=new Socket(\"localhost\",8800);\r\n\t BufferedReader sin=new BufferedReader(new InputStreamReader(server.getInputStream()));\r\n\t PrintStream sout=new PrintStream(server.getOutputStream());\r\n\t BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));\r\n\t \r\n\t String sendMessage =requestMessage+'-'+','+carType+','+balancePost+','+paymentType+\r\n\t \t\t','+phoneno.getText(); \r\n\r\n\t sout.println(sendMessage);\r\n\t \r\n\t String s1=sin.readLine(); \r\n\t String[] splitResult=s1.split(\",\");\r\n\t \r\n\t //System.out.println(\"Return Message:\"+s1);\r\n\t if(splitResult[0].equals(\"Insert Done\")) {\r\n\t \tJOptionPane.showMessageDialog(null,\"New VIP User Is Registered with RFID No: \"+splitResult[1]);\r\n\t }\r\n\t else if(splitResult[0].equals(\"Insert Error\")) {\r\n\t \tJOptionPane.showMessageDialog(null,\"Registration Cannot be done;Try Again\");\r\n\t }\r\n\t /*\r\n\t if(s1.equals(\"Aleadt\")) {\r\n\t \tSystem.out.println(\"\");\r\n\t \t\r\n\t }\r\n\t else {\r\n\t \tSystem.out.println(\"Insert is not done\");\r\n\t }*/\r\n\t // cardno.setText(null);\r\n\t \r\n\t server.close();\r\n\t sin.close();\r\n\t sout.close();\r\n\t stdin.close();\r\n\t } catch (UnknownHostException e) {\r\n\t // TODO Auto-generated catch block\r\n\t e.printStackTrace();\r\n\t } catch (IOException e) {\r\n\t // TODO Auto-generated catch block\r\n\t e.printStackTrace();\r\n\t }\r\n\t}", "@Override\n\tpublic void sendMsg(String msg) {\n\n\t}", "public void sendMessage2Client(String msg){\n\t\t\t\n\t\t\toutPrintStream.println(msg);\n\t\t\t\n\t\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n MessageProducer messageProducer;\n TextMessage textMessage;\n response.setContentType(\"text/html;charset=UTF-8\");\n try {\n String subject = request.getParameter(\"usuario\");\n ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);\n javax.jms.Connection connection = connectionFactory.createConnection();\n connection.start();\n Session session = connection.createSession(false /*Transacter*/, Session.AUTO_ACKNOWLEDGE);\n Destination destination = session.createTopic(subject);\n messageProducer = session.createProducer(destination);\n textMessage = session.createTextMessage();\n textMessage.setText(request.getParameter(\"mensaje\"));\n messageProducer.send(textMessage);\n messageProducer.close();\n session.close();\n connection.close();\n \n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\n java.sql.Connection con2 = DriverManager.getConnection(\"jdbc:derby://localhost:1527/Chirruper\", \"root\", \"root\");\n java.sql.Connection con3 = DriverManager.getConnection(\"jdbc:derby://localhost:1527/Chirruper\", \"root\", \"root\");\n Statement query = con2.createStatement();\n Statement query2 = con3.createStatement();\n ResultSet rs = query2.executeQuery(\"SELECT * FROM SUSCRIPCIONES WHERE SUSCRITO = '\" + subject + \"'\");\n while(rs.next()){\n query.executeUpdate(\"INSERT INTO MENSAJES VALUES ('\" + subject + \"', '\" + textMessage.getText() + \"', '\" + new java.sql.Timestamp(textMessage.getJMSTimestamp()).toString() + \"', '\" + rs.getString(\"SUSCRIBIDO\") + \"')\");\n }\n }\n catch (JMSException e) {\n } \n catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(ServletPublicar.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public synchronized boolean write_to_sock(StringBuilder msg){\n\t\t/**\n\t\t * TRY SEND TO SERVER\n\t\t */\n\t\ttry {\n\t\t\tout.print(msg.toString());\n\t\t\tmysock.getOutputStream().flush();\n\t\t\tout.flush();\n\t\t\tSystem.out.println(TAG +\": Tuple injected.\");\n\t\t} catch (IOException ioException) {\n\t\t\tSystem.out.println(TAG + \": I could not connect\");\n\t\t\tsrvDisconnect();\n\t\t\treturn false;\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(TAG + \": Null Pointer Exception\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public void sendMessage(ChatMessage msg) {\n try{\n loginOutput.writeObject(msg);\n }\n catch(IOException e){\n display(\"Exception on send message to server: \" + e);\n }\n }", "public void executeQuery(String query,String message){\n Connection conn = MysqlConnect.ConnectDB();\n Statement st;\n \n try{\n st=conn.createStatement();\n if((st.executeUpdate(query))== 1)\n {\n \n //refresh the jtable\n DefaultTableModel model = ( DefaultTableModel)jTablefaculty.getModel();\n model.setRowCount(0);\n Show_Facultyc_In_JTable();\n \n JOptionPane.showMessageDialog(null,\"data\"+ message +\"Successfully\");\n }else\n JOptionPane.showMessageDialog(null,\"data not\"+ message);\n \n \n }catch(Exception e){\n JOptionPane.showMessageDialog(null,e);\n }\n \n \n }", "void sendMessage(String msg) {\n\t\ttry {\n\t\t\tout.writeObject(msg);\n\t\t\tout.flush();\n\t\t\tSystem.out.println(\"Sending to client => \" + msg);\n\t\t} catch (IOException ioException) {\n\t\t\tioException.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic boolean excuteSql(String sql) {\n\t\tint result = 0;\r\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tresult = ps.executeUpdate();\r\n\t\t\tif(result == 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private void sendMsgToClient(String msg) {\n controlOutWriter.println(msg);\n }", "private void executeRequest(String sql) {\n\t}", "public int Edbroker(Long broker_id, String firstname, String lastname,\r\n\t\tString address, String gender, String eMail, Long phone,\r\n\t\tString experience) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"update broker set first_name='\"+firstname+\"',last_name='\"+lastname+\"',address='\"+address+\"',gender='\"+gender+\"',e_mail='\"+eMail+\"',phone=\"+phone+\",experience='\"+experience+\"' where broker_id=\"+broker_id+\"\");\r\n\treturn i;\r\n}", "public void enviarTexto(String n,String s) {\r\n \t try {\r\n \t\t\t//dos = new DataOutputStream( socket.getOutputStream() );\r\n \t\t\t//System.out.println(s);\r\n \t\t\tdos.writeInt(Integer.valueOf(n));\r\n \t\t\tdos.flush();\r\n // Enviamos el nombre del archivo \r\n \t\t\tdos.writeUTF( s ); \r\n \tdos.flush();\r\n \tdos.close();\r\n \tsocket.close();\r\n \t\t} catch (IOException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tSystem.out.println(\"------------ERROR AL ENVIAR SQL----------\");\r\n \t\t}//\r\n }", "public ResultSet Apmail(Long id)throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"select * from broker where login_id=\"+id+\"\");\r\n\treturn rs;\r\n}", "public int Appbr(Long broker_id)throws SQLException {\nint i=DbConnect.getStatement().executeUpdate(\"update login set status='approved' where login_id=\"+broker_id+\"\");\r\n\treturn i;\r\n}", "@Override\r\n\tpublic void addMessage(Integer receive_id, Integer send_id, String content,Timestamp createtime) {\n\t\tString sql=\"insert into message(receive_id,send_id,content,createtime,isread,result) values(?,?,?,?,?,?)\";\r\n\t\tObject[] args=new Object[] {receive_id,send_id,content,createtime,0,0};\r\n\t\ttry {\r\n\t\t\tupdate(conn, sql, args);\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\r\n public void runCode(String sql)\r\n throws DatabaseException {\r\n try {\r\n Class.forName(driverClassName);\r\n conn = DriverManager.getConnection(url, userName, password);\r\n \r\n } catch (ClassNotFoundException ex) {\r\n throw new DatabaseException(\"Could not load JDBC driver\");\r\n }\r\n catch(SQLException sq){\r\n throw new DatabaseException(\"Connection Failed\");\r\n }\r\n \r\n try {\r\n stmt = conn.createStatement();\r\n stmt.executeUpdate(sql); \r\n } catch (SQLException sqle) {\r\n throw new DatabaseException(\"Execution of SQL failed\");\r\n } catch (Exception e) {\r\n } finally {\r\n try {\r\n stmt.close();\r\n conn.close();\r\n } catch (Exception e) {\r\n throw new DatabaseException(\"Unknown error\");\r\n }\r\n }\r\n }", "public void insert(String type, String querynum, String lianxiren, String telephonenum, String address, String qq,\r\n\t\t\tString email, String websource) {\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tSystem.out.println(\"kkkk\");\r\n\t\t\tcon = DriverManager.getConnection(\r\n\t\t\t// \"jdbc:mysql://192.168.32.19:3306/weibo_sina?useUnicode=true&amp&characterEncoding=UTF-8\", \"weibosina\",\"OyiaV5M53qTqlZjmN0OOtA==\");\r\n\t\t\t\t\t\"jdbc:mysql://127.0.0.1:3306/xiaohe\", \"root\", \"20121028mmhct1314\");\r\n\t\t\t//\"jdbc:mysql://192.168.32.19:3306/weibo_sina\", \"weibosina\",\"OyiaV5M53qTqlZjmN0OOtA==\");\r\n\t\t\tStatement stat = con.createStatement();\r\n\t\t\tString sql = \"insert into \" + type + \" values('\" + querynum + \"','\" + lianxiren + \"','\" + telephonenum\r\n\t\t\t\t\t+ \"','\" + address + \"','\" + qq + \"','\" + email + \"','\" + \" \" + \"')\";\r\n\t\t\t//\"\"+signname+\"','\"+realname+\"','\"+nickname+\"','\"+lianxiren+\"','\"+age+\"','\"+sex+\"','\"+telephonenum+\"','\"+phonepicture+\"','\"+address+\"','\"+duty+\"','\"+area+\"','\"+qq+\"','\"+email+\"','\"+websource+\"','\"+dataresource+\"','\"+deletedd+\"')\";\r\n\t\t\tstat.executeUpdate(sql);\r\n\t\t\tSystem.out.println(\"***\" + sql);\r\n\t\t\tstat.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tcon.close();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void send(String msg) {\n\t\t\n\t\t\n\t\n\t}", "public void sendmsg(Message msg){\n try {\n oos.writeObject(new Datapacket(1, null, msg,null, null));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public int insertChatMessage(String username, String message)throws SQLException {\n String query = \"INSERT INTO \"+TABLE+\" VALUES(?,?,?)\";\n java.sql.Timestamp date = new java.sql.Timestamp(new java.util.Date().getTime());\n PreparedStatement ps = connection.prepareStatement(query);\n ps.setTimestamp(1, date);\n ps.setString(2, username);\n ps.setString(3, message);\n \n int res = ps.executeUpdate();\n return res;\n }", "public void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.print(\"\\n\\tException writing to destination: \\n\\t\\t\" + e\n\t\t\t\t\t+ \"\\n\\tIf error persists, terminate connection and reconnect.\");\n\t\t}\n\t}", "public void onMessage(Message msg) {\n\t\tMapMessage message = null;\n\t\tQueueConnection conn = null;\n\t\tQueueSession session = null;\n\t\tQueueSender sender = null;\n\t\tQueryProcessorUtil qpUtil = QueryProcessorUtil.getInstance();\n\t\tQueue replyToQueue = null;\n\t\tUserTransaction transaction = sessionContext.getUserTransaction();\n\t\t//default timeout three minutes\n\t\tint transactionTimeout = 180;\n\t\ttry {\n\t\t\t\n\t\t\tif (callingMDBName.equalsIgnoreCase(QueryManagerBeanUtil.MEDIUM_QUEUE_NAME)) {\n\t\t\t\t//four hours\n\t\t\t\ttransactionTimeout = 14400;\n\t\t\t} else if (callingMDBName.equalsIgnoreCase(QueryManagerBeanUtil.LARGE_QUEUE_NAME)) {\n\t\t\t\t//twelve hours\n\t\t\t\ttransactionTimeout = 43200;\n\t\t\t} \n\t\t\t\n\t\t\ttransaction.setTransactionTimeout(transactionTimeout);\n\t\t\t\n\t\t\t\n\t\t\ttransaction.begin();\n\t\t\tmessage = (MapMessage) msg;\n\t\t\tString sessionId = msg.getJMSCorrelationID();\n\t\t\treplyToQueue = (Queue) msg.getJMSReplyTo();\n\t\t\tlog.debug(\"Extracting the message [\" + msg.getJMSMessageID());\n\t\t\tString patientSetId = \"\";\n\t\t\ttransaction.commit();\n\t\t\tif (message != null) {\n\t\t\t\tString sqlString = message.getString(QueryManagerBeanUtil.QUERY_MASTER_GENERATED_SQL_PARAM);\n\t\t\t\tString queryInstanceId = message.getString(QueryManagerBeanUtil.QUERY_INSTANCE_ID_PARAM);\n\t\t\t\tpatientSetId = message.getString(QueryManagerBeanUtil.QUERY_PATIENT_SET_ID_PARAM);\n\t\t\t\tString xmlRequest = message.getString(QueryManagerBeanUtil.XML_REQUEST_PARAM);\n\t\t\t\t\n\t\t\t\tString dsLookupDomainId = message.getString(QueryManagerBeanUtil.DS_LOOKUP_DOMAIN_ID);\n\t\t\t\tString dsLookupProjectId = message.getString(QueryManagerBeanUtil.DS_LOOKUP_PROJECT_ID);\n\t\t\t\tString dsLookupOwnerId = message.getString(QueryManagerBeanUtil.DS_LOOKUP_OWNER_ID);\n\t\t\t\t\n\t\t\t\tDAOFactoryHelper daoFactoryHelper = new DAOFactoryHelper(dsLookupDomainId, dsLookupProjectId, dsLookupOwnerId);\n\t\t\t\n\t\t\t\tDataSourceLookupHelper dataSourceHelper = new DataSourceLookupHelper();\n\t\t\t\tDataSourceLookup dsLookup = dataSourceHelper.matchDataSource(dsLookupDomainId, dsLookupProjectId, dsLookupOwnerId);\n\t\t\t\t\n\t\t\t\tIDAOFactory daoFactory = daoFactoryHelper.getDAOFactory();\n\t\t\t\t\n\t\t\t\tSetFinderDAOFactory sfDAOFactory = daoFactory.getSetFinderDAOFactory();\n\t\t\t\ttry { \n\t\t\t\t\t \n\t\t\t\t\tpatientSetId = processQueryRequest(transaction,transactionTimeout,dsLookup,sfDAOFactory ,xmlRequest,sqlString, sessionId,queryInstanceId,patientSetId);\n\t\t\t\t\tlog.debug(\"QueryExecutorMDB completed processing query instance [\" + queryInstanceId + \"]\");\n\t\t\t\t} catch (CRCTimeOutException daoEx) {\n\t\t\t\t\t//catch this error and ignore. send general reply message. \n\t\t\t\t\tlog.error(daoEx.getMessage(),daoEx);\n\t\t\t\t\tif (callingMDBName.equalsIgnoreCase(LARGE_QUEUE)) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t// set status to error\n\t\t\t\t\t\tsetQueryInstanceStatus(sfDAOFactory,queryInstanceId, 4) ;\n\t\t\t\t\t\t\n\t\t\t\t\t} else { \n\t\t\t\t\t\t//send message to next queue and if the there is no next queue then update query instance to error\n\t\t\t\t\t\ttryNextQueue(sfDAOFactory,sessionId, message,queryInstanceId);\n\t\t\t\t\t}\n\t\t\t\t} catch (I2B2DAOException daoEx) {\n\t\t\t\t\t//catch this error and ignore. send general reply message. \n\t\t\t\t\tlog.error(daoEx.getMessage(),daoEx);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsendReply(sessionId,patientSetId, replyToQueue);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\ttry {\n\t\t\t\ttransaction.rollback();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t\tlog.error(\"Error extracting message\", ex);\n\t\t} finally {\n\t\t\tQueryManagerBeanUtil qmBeanUtil = new QueryManagerBeanUtil();\n\t\t\tqmBeanUtil.closeAll(sender, null, conn, session);\n\t\t}\n\t}", "public void handleMessageFromClient (Object msg, ConnectionToClient client) \r\n { \r\n\t Envelope en=(Envelope)msg;\r\n\t User user=null;\r\n\t int write=0;\r\n\t String str=msg.toString();\r\n try{\r\n\t Statement stmt = conn.createStatement();\r\n\r\n\t if((en.getTask()).equals(\"login\")) //search Login\r\n\t {\r\n\t\t logInMod showfiles=(logInMod)en.getObject();\r\n\t\t file f;\r\n\t\t String username;\r\n\t\t String pass;\r\n\t\t String mail;\r\n\t\t int status;\r\n\t\t ArrayList<file> files=new ArrayList<>();\r\n\t\t String re = \"SELECT * FROM users WHERE users.username= '\"+(showfiles.getUserName()+\"' AND users.password='\"+showfiles.getPassword()+\"'\");\r\n\t\t rs = stmt.executeQuery(re);\r\n\t\t \r\n\t\t if(rs.next()==true)\r\n\t\t { \r\n\t\t\t username=rs.getString(1);\r\n\t\t\t pass=rs.getString(2);\r\n\t\t\t mail=rs.getString(3);\r\n\t\t\t status=rs.getInt(4);\r\n\t\t\t String re2 = \"SELECT * FROM files WHERE files.username= '\"+(showfiles.getUserName()+\"'\");\r\n\t\t\t\trs1 = stmt.executeQuery(re2);\r\n\t\t\t\twhile(rs1.next()==true)\r\n\t\t\t\t {\r\n\t\t\t\t\t f=new file(rs1.getString(2),rs1.getString(3));\r\n\t\t\t\t\t files.add(f);\r\n\t\t\t\t }\r\n\t \t user = new User(username,pass,mail,status,files);\r\n\t \t en=new Envelope(user,\"log in handle\");\r\n\t \t client.sendToClient(en);\r\n\t\t }\r\n\t\t\r\n\t\t else \r\n\t\t\t client.sendToClient(\"Not found User\");\r\n\t }\r\n\t\r\n\t if(en.getTask().equals(\"forgotPass\"))\r\n\t {\r\n\t\t forgetPassCon forgot=(forgetPassCon)en.getObject();\r\n\t\t String re = \"SELECT * FROM users WHERE users.email= '\"+(forgot.getUserMail()+\"'\");\r\n\t\t rs = stmt.executeQuery(re);\r\n\t\t if(rs.next()==true)\r\n\t\t {\r\n\t\t\t client.sendToClient(\"we found the mail!\");\r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t else\r\n\t\t\t client.sendToClient(\"mail doesn't exists\");\r\n\t }\r\n\t \r\n\tif(en.getTask().equals(\"log in status\"))\r\n\t{\r\n\t User userloged=(User)en.getObject();\r\n\t String upd = \"UPDATE users SET status= '1' WHERE users.username = '\"+(userloged.getUsreName()+\"' AND users.password='\"+userloged.getUpassword())+\"'\";\r\n\t stmt.executeUpdate(upd);\r\n controller.SetLog(userloged,\"login\"); //update the login serverLogGui\r\n\t}\r\n if(en.getTask().equals(\"log out status\"))\r\n\t{\r\n\t User userloged=(User)en.getObject();\r\n\t String upd = \"UPDATE users SET status= '0' WHERE users.username = '\"+(userloged.getUsreName()+\"' AND users.password='\"+userloged.getUpassword())+\"'\";\r\n\t stmt.executeUpdate(upd);\r\n\t controller.SetLog(userloged,\"logout\"); //update the logout serverLogGui\r\n }\r\n if(en.getTask().equals(\"show user interest groups\"))\r\n {\r\n \tinterestGroups s= null;\r\n \tinterestGroups s2= null;\r\n \tuser=(User)en.getObject();\r\n \tArrayList<interestGroups> interestGroup=new ArrayList<>();\r\n \tArrayList<interestGroups> allGroup=new ArrayList<>();\r\n \tString re=\"select * from test.interstgroups where interstgroups.username= '\"+user.getUserName() +\"'\";\r\n \t rs = stmt.executeQuery(re);\r\n \t while(rs.next()==true)\r\n \t {\r\n \t\ts=new interestGroups(rs.getString(2));\r\n \t\tinterestGroup.add(s);\r\n \t\r\n \t }\r\n \t user.setInterestGroupInDB(interestGroup);\r\n \t String temp;\r\n \t String re2=\"select distinct groupname from test.interstgroups\";\r\n \t rs = stmt.executeQuery(re2);\r\n \t while(rs.next()==true)\r\n \t {\r\n \t\t temp = rs.getString(1);\r\n \t\t s2=new interestGroups(temp);\r\n \t\t allGroup.add(s2);\r\n \t }\r\n \t user.setAllGroupInDB(allGroup);\r\n \t en=new Envelope(user,\"show user interest groups\");\r\n \t\t client.sendToClient(en);\r\n \t \r\n }\r\n\t \r\n\t \r\n }\r\n catch (SQLException e) {\r\n \te.printStackTrace();\r\n } \r\n catch (IOException e) {\r\n e.printStackTrace();}\r\n }", "public void sendMessage(String message, JButton b1, JButton b2){\n port +=1;\n serverConnect.sendMessage(message);\n if(\"prepare\".equals(message)){\n serverConnect.sendMessage(parameters);\n }\n new CCWorker(b1, b2, port).execute();\n }", "public void insertqq(String querytelephone, String lianxiren, String telephonenum, String address, String qq,\r\n\t\t\tString email, String websource) {\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tSystem.out.println(\"kkkk\");\r\n\t\t\tcon = DriverManager.getConnection(\r\n\t\t\t// \"jdbc:mysql://192.168.32.19:3306/weibo_sina?useUnicode=true&amp&characterEncoding=UTF-8\", \"weibosina\",\"OyiaV5M53qTqlZjmN0OOtA==\");\r\n\t\t\t\t\t\"jdbc:mysql://127.0.0.1:3306/xiaohe\", \"root\", \"20121028mmhct1314\");\r\n\t\t\t//\"jdbc:mysql://192.168.32.19:3306/weibo_sina\", \"weibosina\",\"OyiaV5M53qTqlZjmN0OOtA==\");\r\n\t\t\tStatement stat = con.createStatement();\r\n\t\t\tString sql = \"insert into \" + \"qqresult\" + \" values('\" + querytelephone + \"','\" + lianxiren + \"','\"\r\n\t\t\t\t\t+ telephonenum + \"','\" + address + \"','\" + qq + \"','\" + email + \"','\" + \" \" + \"')\";\r\n\t\t\tstat.executeUpdate(sql);\r\n\t\t\tSystem.out.println(\"***++++\" + sql);\r\n\t\t\tstat.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tcon.close();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Exception writing to server: \" + e);\n\t\t}\n\t}", "public void enviarMensaje(String msg) throws JMSException {\n\tMapMessage message = producer.createMapMessage();\n\n\tmessage.setString(\"from\", user.getLogin());\n\tmessage.setString(\"message\", msg);\n\tmessage.setLong(\"date\", new Date().getTime());\n\tmessage.setLong(\"idViaje\", viaje.getId());\n\n\tproducer.send(message);\n }", "public int req(Long req_id)throws SQLException {\nint i=DbConnect.getStatement().executeUpdate(\"update requested set status='processed',remark='bought fail' where reqid=\"+req_id+\"\");\t\r\n\treturn i;\r\n}", "public void replyBoard(BoardDto dto) {\n\t\t\r\n\t\ttry {\r\n\t\t\t//DataSource(커넥션풀)에서 DB와 미리 연결된 Connection 객체를 얻어온다.\r\n\t\t\tcon = ds.getConnection();\r\n\t\t\t\r\n\t\t\t// 1. 부모 글의 pos 보다 큰 글은 pos를 1씪 증가시켜야 한다.\r\n\t\t\tString sql = \"update Board set pos = pos+1 where pos > (select * from (select pos from Board b where num = ? ) as b)\";\r\n\t\t\tpstmt = con.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, dto.getNum()); // 전달 받은 num은 부모의 num\r\n\t\t\tpstmt.executeUpdate();\r\n\r\n\t\t\t// dto에 있는 데이터를 DB에 저장\r\n\t\t\tsql = \"insert into Board(name,email,subject,content,pw,count,regdate,pos,depth) values (?,?,?,?,?,0,now(),?,?)\";\r\n\t\t\t\r\n\t\t\t//Connection객체의 힘을 빌려! insert구문을 DB에 실행할!\r\n\t\t\t//PreparedStatement객체를 얻을 수있는데\r\n\t\t\t//이 PreparedStatement객체를 얻어 올때는????를 제외한 나머지 insert구문을\r\n\t\t\t//PreparedStatement객체에 저장하여!!\r\n\t\t\t//PreparedStatement객체 자제를 리턴받아온다.\r\n\t\t\t//아래의 메소드에서!!\r\n\t\t\tpstmt = con.prepareStatement(sql); //insert구문을 실행할 PreparedStatement객체\r\n\t\t\tpstmt.setString(1, dto.getName());\r\n\t\t\tpstmt.setString(2, dto.getEmail());\r\n\t\t\tpstmt.setString(3, dto.getSubject());\r\n\t\t\tpstmt.setString(4, dto.getContent());\r\n\t\t\tpstmt.setString(5, dto.getPw());\r\n\t\t\tpstmt.setInt(6, dto.getPos()+1); \t// 부모의 pos + 1\r\n\t\t\tpstmt.setInt(7, dto.getDepth()+1); \t// 부모의 depth + 1\r\n\t\t\t\r\n\t\t\tpstmt.executeUpdate();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.out.println(\"BoardDao클래스의 replyBoard() 메서드의 오류 : \" + e);\r\n\t\t} finally {\r\n\t\t\tfreeResource();\r\n\t\t}\r\n\t\t\r\n\t}", "private void bluetoothSendMsg(String s) {\n byte [] msgOnBuf;\n msgOnBuf = s.getBytes();\n try {\n outStream.write(msgOnBuf);\n } catch (IOException e) {\n Log.d(TAG,\"send message fail!\");\n }\n }", "private void sendUpdateConnectionInfo() {\n\n }", "public static int write(final ILogger aLogger, final PreparedStatement aStm) {\r\n String method= \"write\";\r\n try {\r\n return aStm.executeUpdate();\r\n } catch (Exception e) {\r\n error(aLogger, method, e.toString(), e);\r\n return -1;\r\n }\r\n }", "public static int executePreparedStatement(String query, Fee fee){\n\t\tSystem.out.println(query);\n\t\tPreparedStatement statement = null;\n\t\ttry{\n\t\t\tconnectDatabase();\n\t\t\tstatement = connection.prepareStatement(query);\n\t\t\t// set the parameters\n\t\t\tstatement.setString(1,fee.getUuid().toString());\n\t\t\tstatement.setString(2,fee.getRollno());\n\t\t\tstatement.setString(3, String.valueOf(fee.getAmount()));\n\t\t\treturn statement.executeUpdate();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry{\n\t\t\t\tif (statement != null) statement.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tdisconnectDatabase();\n\t\t}\n\t\treturn 0;\n\t}", "public void sendMessage(String msg){\n \n try{\n out.writeObject(msg.toString()); \n \n }catch(Exception e){\n e.printStackTrace();\n }\n }", "public void writeSQL(SQLOutput stream) throws SQLException{\r\n}", "@Override\n\tpublic void onMessage(Message message) {\n\t\tTextMessage textMessage = (TextMessage) message;\n\t\ttry {\n\t\t\tString id = textMessage.getText();\n\t\t\tint i = Integer.parseInt(id);\n\t\t\tgoodsService.out(i);\n\t\t\tList<Goods> list = goodsService.findByZt();\n\t\t\tsolrTemplate.saveBeans(list);\n\t\t\tsolrTemplate.commit();\n\t\t} catch (JMSException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "static void dataToevoegen(String querry) {\n try {\n Statement stmt = connectieMaken().createStatement(); //\n stmt.execute(querry);\n } catch (SQLException se) {\n se.printStackTrace();\n }\n }", "private void sendMessage(ChatMessage msg) {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\r\n\t\t\t\t\tconnection = SqlServerConnection.dbConnecter();\r\n\t\t\t\t\t\r\n\t\t\t\t\tString pasessionid =comboParalle.getSelectedItem().toString();\r\n\t\t\t\t\tString paroom=roomcombo2.getSelectedItem().toString();\r\n\t\t\t\t\t\r\n\t\t\t\t\tPreparedStatement stat1,stat2;\r\n\t\t\t\t\t\r\n\t\t\t\t\tstat1=connection.prepareStatement(\"update ParallelSession set room=? where SessionId=?\");\r\n\t\t\t\t\tstat1.setString(1, paroom);\r\n\t\t\t\t\tstat1.setString(2, pasessionid);\r\n\t\t\t\t\tstat1.executeUpdate();\r\n\t\t\t\t\t\r\n\t\t\t\t\tstat2=connection.prepareStatement(\"update session set room=? where SessionId=?\");\r\n\t\t\t\t\tstat2.setString(1, paroom);\r\n\t\t\t\t\tstat2.setString(2, pasessionid);\r\n\t\t\t\t\tstat2.executeUpdate();\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Data Insertion sucessfully!...\");\r\n\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tconnection.close();\r\n\t\t\t\t\r\n\t\t\t\t}catch(Exception e1){\r\n\t\t\t\t\t\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\tBBGJDB tdd = new BBGJDB(_context);\r\n\t\t\ttdd.clearreply();\r\n\t\t\tString qurl = MessengerService.URL;\r\n\t\t\tString qmethodname = MessengerService.METHOD_GETCOMUNREPLY;\r\n\t\t\tString qnamespace = MessengerService.NAMESPACE;\r\n\t\t\tString qsoapaction = qnamespace + \"/\" + qmethodname;\r\n\r\n\t\t\tSoapObject rpc = new SoapObject(qnamespace, qmethodname);\r\n\t\t\trpc.addProperty(\"id\", webid);\r\n\t\t\trpc.addProperty(\"pagesize\", 30);\r\n\t\t\trpc.addProperty(\"pageindex\", 1);\r\n\t\t\tSoapSerializationEnvelope envelope = new SoapSerializationEnvelope(\r\n\t\t\t\t\tSoapEnvelope.VER11);\r\n\t\t\tenvelope.bodyOut = rpc;\r\n\t\t\tenvelope.dotNet = true;\r\n\t\t\tenvelope.setOutputSoapObject(rpc);\r\n\t\t\tHttpTransportSE ht = new HttpTransportSE(qurl);\r\n\t\t\tht.debug = true;\r\n\t\t\ttry {\r\n\t\t\t\tht.call(qsoapaction, envelope);\r\n\t\t\t\tSoapObject replylist = (SoapObject) envelope.bodyIn;\r\n\t\t\t\tfor (int i = 0; i < replylist.getPropertyCount(); i++) {\r\n\t\t\t\t\tSoapObject soapchilds = (SoapObject) replylist\r\n\t\t\t\t\t\t\t.getProperty(0);\r\n\t\t\t\t\tfor (int j = 0; j < soapchilds.getPropertyCount(); j++) {\r\n\t\t\t\t\t\tSoapObject soapchildsson = (SoapObject) soapchilds\r\n\t\t\t\t\t\t\t\t.getProperty(j);\r\n\r\n\t\t\t\t\t\tString rtitle = soapchildsson.getProperty(\"Content\")\r\n\t\t\t\t\t\t\t\t.toString();\r\n\t\t\t\t\t\tString rtime = soapchildsson.getProperty(\"Crtime\")\r\n\t\t\t\t\t\t\t\t.toString();\r\n\t\t\t\t\t\tString ruser = soapchildsson.getProperty(\"Userid\")\r\n\t\t\t\t\t\t\t\t.toString();\r\n\t\t\t\t\t\tString rusername = soapchildsson\r\n\t\t\t\t\t\t\t\t.getProperty(\"RealName\").toString();\r\n\r\n\t\t\t\t\t\tContentValues values = new ContentValues();\r\n\t\t\t\t\t\tvalues.put(tdd.RPL_CONTENT, rtitle);\r\n\t\t\t\t\t\tvalues.put(tdd.RPL_TIME, rtime);\r\n\t\t\t\t\t\tvalues.put(tdd.RPL_WEBID, ruser);\r\n\t\t\t\t\t\tvalues.put(tdd.RPL_NAME, rusername);\r\n\t\t\t\t\t\ttdd.insertreply(values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tMessage msg = new Message();\r\n\t\t\tmsg.obj = lvbt;\r\n\t\t\tthreadMessageHandler.sendMessage(msg);\r\n\t\t}", "protected void sendMessage(String msg) {\n message = msg; \n newMessage = true;\n }", "public void sendMsgToClient() {\n\n try {\n\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);\n\n Log.d(TAG, \"The transmitted data:\" + msg);\n\n writer.println(msg);\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }", "public void enviar() {\r\n\r\n Socket sock = null;\r\n\r\n try {\r\n sock = new Socket(host, PORT);\r\n\r\n InputStream inputStream = sock.getInputStream();\r\n ObjectInputStream in = new ObjectInputStream(inputStream);\r\n\r\n PrintWriter out = new PrintWriter(sock.getOutputStream(),true);\r\n //muestro en consola el script\r\n out.println(scriptSQL);\r\n\r\n //recibe el objeto mandado por el socket del server\r\n Lista<Object> objectLista = (Lista<Object>) in.readObject();\r\n\r\n //se lo envia al controlador para graficar el resultado\r\n Control_PantallaComprobante.recibirParaMostrarConfirmacion(objectLista);\r\n\r\n\r\n }\r\n catch (IOException | ClassNotFoundException error){\r\n error.printStackTrace();\r\n System.out.println(error);\r\n }\r\n finally {\r\n try{\r\n sock.close();\r\n }catch (IOException error){\r\n error.printStackTrace();\r\n }\r\n }\r\n\r\n\r\n }", "public void actionPerformed(ActionEvent e) \n {\n\t\t\t\tWrapper conn = null;\n\t\t\t\ttry //try block\n {\n //declare variables\n\t\t\t\tString username = \"\";\n\t\t\t\tString password = \"\";\n\t\t\t\t\n\t\t\t\t//get values using getText() method\n\t\t\t\tusername = txtUser.getText().trim();\n\t\t\t\tpassword = txtPassword.getText().trim();\n\t\t\t\t\n // check condition it field equals to blank throw error message\n\t\t\t\tif (username.equals(\"\")|| password.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\" name or password or Role is wrong\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t\telse //else insert query is run properly\n {\n\t\t\t\t\tString IQuery = \"INSERT INTO `demo`.`loginaccount`(`username`,`password`,`ts`) VALUES('\"+username+\"', '\"+password+\"',current_timestamp)\";\n\t\t\t\t\tSystem.out.println(IQuery);//print on console\n\t\t\t\t\tSystem.out.println(\"Connecting to a selected database...\");\n\t\t\t\t\n\t\t\t\t//STEP 3: Open a connection\n\t\t\t\tconn = DriverManager.getConnection(DB_URL, USER, PASS);\n\t\t\t\t\tSystem.out.println(\"Connected database successfully...\");\n\t\t\t\t\t \n\t\t\t\t((Connection)conn).createStatement().execute(IQuery);//select the rows\n\t\t\t\t\t// define SMessage variable\n\t\t\t\t\tString SMessage = \"Record added for \"+username;\n\t\t\t\t\t\n // create dialog ox which is print message\n\t JOptionPane.showMessageDialog(null,SMessage,\"Message\",JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t//close connection\n\t\t\t\t\t((java.sql.Connection)conn).close();\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tcatch (SQLException se) \n\t\t\t{\n\t\t\t\t//handle errors for JDBC\n\t\t\t\tse.printStackTrace();\n\t\t\t}\n\t\t\tcatch (Exception a) //catch block\n\t\t\t{\n\t\t\t\ta.printStackTrace();\n\t\t\t}\n\t\t }", "public void insertaMensaje(InfoMensaje m) throws Exception;", "public void sendMsg(Msg msg) throws Exception {\n\t\tsendMsg(msg, host, port);\n\t}", "public static void testIBMMQSendData(){\n\n MQParam param = new MQParam();\n param.setHost(\"10.86.92.194\");\n param.setPort(30099);\n param.setCcsid(1208);\n param.setChannel(\"SVRCONN_GW_OUT\");\n param.setQueueManager(\"ESB_OUT\");\n param.setQueueName(\"EIS.QUEUE.REQUEST.OUT.GCDCHZWMES\");\n param.setUserId(\"mqm\");\n param.setPassword(\"mqm\");\n new Thread(new IBMReceiverThread(param)).run();\n }", "public void commit() {\n\t\ttry {\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"完了したコミット/Commit Done\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Commit Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 911:\n\t\t\t\tqueryMsg();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public ResultSet addbroker(String firstname, String lastname, String username,\r\n\t\tString password, String address, String gender, String eMail,\r\n\t\tNumber phone, String experience, String security, String answer, Long demat, Long bankacc, Double amt) throws SQLException {\n\tLong logid=null;\r\n\tint i=DbConnect.getStatement().executeUpdate(\"insert into login values(login_seq.nextval,'\"+username+\"'||username_seq.nextval,'\"+password+\"','not approved','broker','\"+security+\"','\"+answer+\"') \");\r\n\tint j=DbConnect.getStatement().executeUpdate(\"insert into broker values(broker_seq.nextval,'\"+firstname+\"','\"+lastname+\"','\"+address+\"','\"+gender+\"','\"+eMail+\"',\"+phone+\",'\"+experience+\"',login_seq.nextval-1,\"+demat+\",\"+bankacc+\")\");\r\n int k=DbConnect.getStatement().executeUpdate(\"insert into account values(\"+bankacc+\",\"+amt+\")\");\r\n\tResultSet rss=DbConnect.getStatement().executeQuery(\"select login_seq.nextval-2 from dual\");\r\n\tif(rss.next())\r\n\t{\r\n\t\tlogid=rss.getLong(1);\r\n\t}\r\n\trs=DbConnect.getStatement().executeQuery(\"select username from login where login_id=\"+logid+\"\");\r\n\treturn rs;\r\n\t\r\n}", "private static void writeToMysql(Publication publication) {\n\tSystem.out.println(publication); \n //1.加载driver驱动 \n try { \n // 加载MySql的驱动类 \n Class.forName(\"com.mysql.jdbc.Driver\"); \n } catch (ClassNotFoundException e) { \n System.out.println(\"找不到驱动程序类 ,加载驱动失败!\"); \n e.printStackTrace(); \n } \n //2.建立连接 \n Statement st = null; \n //调用DriverManager对象的getConnection()方法,获得一个Connection对象 \n Connection con =null; \n try { \n \t String sqlStr = \"jdbc:mysql://localhost:3306/huo\"; \n \t String rootName = \"root\";//数据库名 \n \t String rootPwd = \"1234\";//数据库密码 \n\t\t//建立数据库连接 \n con = DriverManager.getConnection(sqlStr, rootName,rootPwd); \n //INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....) \n String paperId= publication.getId(); \n String authors = publication.getAuthors(); \n //插入语句格式 \n String sql = \"insert into publication1(paperId,Authors) values(\\\"\"+paperId+\"\\\",\\\"\"+authors+\"\\\")\"; \n System.out.println(sql); \n st = con.createStatement(); //创建一个Statement对象 \n st.executeUpdate(sql);//提交数据更新 \n } catch (SQLException e) { \n e.printStackTrace(); \n }finally{ \n try { \n st.close(); \n con.close(); \n } catch (SQLException e) { \n e.printStackTrace(); \n } \n } \n\t\n}", "public void insert() {\n String sqlquery = \"insert into SCORE (NICKNAME, LEVELS,HIGHSCORE, NUMBERKILL) values(?, ?, ?,?)\";\n try {\n ps = connect.prepareStatement(sqlquery);\n ps.setString(1, this.nickname);\n ps.setInt(2, this.level);\n ps.setInt(3, this.highscore);\n ps.setInt(4, this.numofKill);\n ps.executeUpdate();\n //JOptionPane.showMessageDialog(null, \"Saved\", \"Insert Successfully\", JOptionPane.INFORMATION_MESSAGE);\n System.out.println(\"Insert Successfully!\");\n ps.close();\n connect.close();\n } catch (Exception e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n\n }", "public static void Binaryconnectioninsert(int id,String FQN,String name, String container,int potency,String directtype,String label ,String particpant1,\n\t\t\t \t\tString particpant2, String roleName1 ,String roleName2,String lower1, String lower2 ,\tString upper1 ,String upper2 , \n\t\t\t \t\tString navigalbeTo1, String navigableTo2,String table )\n\t\t\t { \n\t\t\t \n\t\t\t \ttry \n\t\t\t { \n\t\t\t Statement stmt=null; \n\t\t\t ResultSet res=null; \n\t\t\t Class.forName(\"com.mysql.jdbc.Driver\"); \n\t\t\t Connection conn = DriverManager.getConnection(sqldatabase,mysqluser,mysqlpassword); \n\t\t\t stmt = (Statement)conn.createStatement(); \n\t\t\t res= stmt.executeQuery(\"SELECT * from binaryconnection\"); \n\n\n\t\t\t // 增加数据\n\t\t\t Statement stm = (Statement) conn.createStatement();// 提交查巡\n\t\t\t String sql = \"select * from binaryconnection\";\n\t\t\t ResultSet rs = stm.executeQuery(sql);// 取得查巡結果\n//\t\t\t sql = \"insert into entity (id,name,FQN,container) values ('6','AccountType','Example2.O2.AccountType','Example2.O10')\";\n\t\t\t \n\t\t\t int n = stm.executeUpdate(\"insert into \"+table+\"(id,FQN,name, container,potency,direct_type,label ,particpant1, particpant2, roleName1 ,roleName2, lower1, lower2 ,upper1 ,upper2 ,navigalbeTo1, navigableTo2) values (\"\n\t\t\t +\"'\"+id+\"'\"+\",\"+\"'\"+FQN+\"'\"+\",\"+\"'\"+name+\"'\"+\",\"+\"'\"+container+\"'\"+\",\"+\"'\"+potency+\"'\"+\",\"+\"'\"+directtype+\"'\"+\",\"+\"'\"+label+\"'\"+\",\"+\"'\"+particpant1+\"'\"+\",\"+\"'\"+particpant2+\"'\"+\",\"+\"'\"+roleName1+\"'\"+\",\"+\"'\"+roleName2+\"'\"+\",\"+\"'\"+lower1+\"'\"+\",\"+\"'\"+lower2+\"'\"+\",\"+\"'\"+upper1+\"'\"+\",\"+\"'\"+upper2+\"'\"+\",\"+\"'\"+navigalbeTo1+\"'\"+\",\"+\"'\"+navigableTo2+\"'\"+\")\"); // 增加数据 \n\t\t\t if (n > 0) {\n//\t\t\t JOptionPane.showMessageDialog(null, \"成功\");\n\t\t\t \n\t\t\t \n\t\t\t } else {\n//\t\t\t JOptionPane.showMessageDialog(null, \"失败\");\n\t\t\t }\n\t\t\t //增加数据结束\n\n\t\t\t while (res.next()) \n\t\t\t { \n\t\n\t\t\t } \n\t\t\t } \n\t\t\t \n\t\t\t catch(Exception ex) \n\t\t\t { \n\t\t\t ex.printStackTrace(); \n\t\t\t } \n\t\t\t}", "public void sendMessage(String message, JButton b1, JButton b2, JTextField corn){\n port +=1;\n serverConnect.sendMessage(message);\n if(\"prepare\".equals(message)){\n serverConnect.sendMessage(parameters);\n }\n new CCWorker(b1, b2, port, corn).execute();\n }", "int insert (EmpBean emp) throws ClassNotFoundException, SQLException {\n\t\t\n\tConnection con = DBUtil.getConnection();\n\tString sql= \"insert into empTab values(?,?,?)\";\n\tPreparedStatement ps = con.prepareStatement(sql);\n\tps.setString(1, emp.getEmpName());\n\tps.setString(2, emp.getEmpemailid());\n\tps.setInt(3, emp.getEmpphoneno());\n\t\n\n\treturn ps.executeUpdate(); //1 row inserted\n\t\n\t\n\t\n}", "@Override\n protected Void doInBackground(Void... params) {\n try{\n System.setProperty(\"FBAdbLog\", \"true\");\n Class.forName(\"org.firebirdsql.jdbc.FBDriver\");\n String sCon = \"jdbc:firebirdsql:\"+Server+\":C:/\"+Database+\".FDB?allowMultiQueries=true?encoding=ISO8859_1\";\n if(con == null){\n // Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n }\n Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n Statement stmt = con.createStatement();\n con.setAutoCommit(false);\n String sql = \"INSERT INTO CLIENT VALUES ('1','NASSER','2222222')\";\n String sql2 = \"INSERT INTO CLIENT VALUES ('2','SALIM','3333333')\";\n stmt.addBatch(sql);\n stmt.addBatch(sql2);\n stmt.executeBatch();\n // Statement stmt1 = con.createStatement();\n con.commit();\n //con.setAutoCommit(true);\n etatCon = true;\n }\n catch(Exception e){\n Log.e(\"FirebirdExample\", e.getMessage());\n etatCon = false;\n }\n return null;\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif (e.getSource() == jb)// 发送消息\r\n\t\t{\r\n\t\t\tMessage m = new Message();\r\n\t\t\tm.setMesType(\"20\");// MessageType.message_comm_mes\r\n\t\t\tm.setSender(this.ownerId);\r\n\t\t\tm.setGetter(\"\");\r\n\t\t\tm.setCon(jtf.getText());\r\n\t\t\tthis.jta.append(\"我说:\" + jtf.getText() + \"\\r\\n\");\r\n\t\t\ttry {\r\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(\r\n\t\t\t\t\t\tManageClientConServerThread\r\n\t\t\t\t\t\t\t\t.getClientConServerThread(ownerId).getS()\r\n\t\t\t\t\t\t\t\t.getOutputStream());\r\n\t\t\t\toos.writeObject(m);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public ResultSet Editbroker(Long broker_id) throws SQLException {\n\t\r\nSystem.out.println(\"edit broker\");\r\n\trs=DbConnect.getStatement().executeQuery(\"select * from broker where broker_id=\"+broker_id+\" \");\r\n\treturn rs;\r\n}", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "public void handleMessageFromClient\n (Object msg, ConnectionToClient client)\n \t{\n\t System.out.println(\"Message received: \" + msg + \" from \" + client);\n\t try {\n\t \tObject rs = dbConnector.accessToDB(msg);\n\t \tif(rs != null)\t\n\t \t\tclient.sendToClient(rs);\n\t \t}\n\t\tcatch (ClassCastException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t catch (IOException q)\n\t {\n\t \t\n\t }\n\t }", "public static void main(String[] args) {\n String url = \"jdbc:mysql://obiwan2.univ-brest.fr/zfm1-zparlanme\";\r\n String user = \"zparlanme\";\r\n String password = \"y4alfp4y\";\r\n\r\n Livre livre = new Livre();\r\n livre.setTitre(\"Salammbô\");\r\n livre.setAuteur(\"Flaubert\");\r\n livre.setAnnee(1862);\r\n\r\n try {\r\n Connection co = (Connection) DriverManager.getConnection(url, user, password);\r\n\r\n Statement st = (Statement) co.createStatement();\r\n\r\n // st.executeUpdate(\r\n // \"insert into t_livre (titre, auteur, annee) values ('Salammbô', 'Flaubert',\r\n // 1862)\");\r\n\r\n // V2\r\n st.executeUpdate(\"insert into t_livre (titre, auteur, annee) values ('\" + livre.getTitre()\r\n + \"', '\" + livre.getAuteur() + \"', \" + livre.getAnnee() + \")\");\r\n\r\n st.close();\r\n co.close();\r\n } catch (SQLException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n\tpublic void sendMsg(MsgVO mvo) {\n\t\tsession.insert(namespace + \".sendMsg\", mvo);\n\t}", "public void sendMessage(String message){\n\t if (mOut != null && !mOut.checkError()) {\n\t mOut.println(message+\"\\n\");\n\t mOut.flush();\n\t }\n\t }", "static void sendMsg(String msg){\r\n for(ServerThread t: threads){\r\n t.sendMsgToClient(msg);\r\n }\r\n }", "@Override\n\tpublic void sendMessage() {\n\t\t\n\t}", "void sendMessage(String msg);", "@Override\n\tpublic void send(String msg) {\n\t}", "private void sendRequest( String msg ){ \r\n\r\n\t\tRequest message = new Request(); // construction of Request object\r\n\t\tmessage.c = c_id;\r\n\t\tmessage.s = seq_number;\r\n\t\tmessage.op = msg;\r\n\t\t\r\n\t\tString str_msg = message.toString(); //generate string message\r\n\t\tdisplayArea.append( \"\\nCLI\"+c_id+\" Sending packet containing: \" + str_msg + \"\\n\" );\r\n\t\t\t\t\r\n\t\tbyte data[] = str_msg.getBytes(); // convert to bytes\r\n\t\t \r\n\t\ttry{\t\t\t\t\t\t\t\t\t\r\n\t\t\tDatagramPacket sendPacket = new DatagramPacket( data, data.length, InetAddress.getLocalHost(), serverPort );\r\n\t\t\tsocket.send( sendPacket ); // send packet\r\n\t\t\tdisplayArea.append( \"Packet sent\\n\" );\r\n\t\t\tdisplayArea.setCaretPosition(\r\n\t\t\tdisplayArea.getText().length() );\r\n\t\t\tseq_number++; //increment seq_number\r\n\t\t}\r\n\t\tcatch ( IOException ioException )\r\n\t\t{\r\n\t\t\tdisplayMessage( ioException.toString() + \"\\n\" );\r\n\t\t\tioException.printStackTrace();\r\n\t\t} // end catch\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"-------- MySQL JDBC Connection Demo ------------\");\n try\n {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n } \n catch (ClassNotFoundException e) {\n System.out.println(\"MySQL JDBC Driver not found !!\");\n return;\n }\n System.out.println(\"MySQL JDBC Driver Registered!\");\n Connection connection = null;\n try {\n connection = DriverManager\n .getConnection(\"jdbc:mysql://localhost:3306/jdbcdemo\", \"root\", \"root\");\n System.out.println(\"SQL Connection to database established!\");\n // Statement stm=connection.createStatement();\n \tPreparedStatement ps = connection.prepareStatement(\"insert into abc values(?, ?);\");\n \tps.setInt(1, 202);\n \tps.setString(2, \"shubhi\");\n \tint x = ps.executeUpdate();\n \tSystem.out.println(x+ \" updated\");\n \tconnection.close();\n \t\n \t\n }catch(Exception e){\n \t\n }\n\n\t}", "public void sendMsg(){\r\n\t\tsuper.getPPMsg(send);\r\n\t}", "public void iniciar(String user, String pass, String db_name) {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n Conexion = DriverManager.getConnection(\"jdbc:mysql://\" + serverMySQL + \":3306/\" + db_name, user, pass);\n conectado = true;\n printLog(\"Conexion establecida con el sevidor de MySQL en \" + serverMySQL);\n //JOptionPane.showMessageDialog(null, \"Bien\");\n } catch (ClassNotFoundException ex) {\n Logy.me(ex.getMessage());\n } catch (SQLException ex) {\n Logy.me(ex.getMessage());\n }\n }", "public void sendToServer(String msg) throws IOException {\n if (clientSocket == null || output == null) {\n throw new SocketException(\"socket does not exist\");\n }\n\n // messageQueue.offer(msg);\n // sendFromMessageQueue();\n \n // 發送中文\n byte[] bytes = msg.getBytes(\"big5\");\n int[] ints = new int[bytes.length];\n for (int i = 0, l = bytes.length; i < l; i++) {\n ints[i] = bytes[i] & 0xff;\n output.write(ints[i]);\n }\n output.writeBytes(\"\\n\");\n }", "public void executeSQlQuery(String query,String message){\n \n Connection con= getConnection();\n Statement st;\n \n try{\n st= con.createStatement();\n if((st.executeUpdate(query))==1){\n \n //refresh Jtable data\n\n DefaultTableModel model2=(DefaultTableModel) notoverlappingsessions.getModel();\n model2.setRowCount(0);\n show_NotOverlappingSessions();\n\n JOptionPane.showMessageDialog(null, message+ \" Successfully\");\n }else{\n JOptionPane.showMessageDialog(null, message+\"can Not be done \");\n }\n }catch(Exception e){}\n \n }", "void insert(TbMessage record);", "public boolean addNotification(Notification notification) throws SQLException{\n// connection = Db.instance().getConnection();\n try{\n ps = connection.prepareStatement(\"INSERT INTO notification(user_email, text) VALUES (?,?)\");\n ps.setString(1,notification.getUserEmail());\n ps.setString(2,notification.getText());\n int res = ps.executeUpdate();\n return res==1;\n }\n finally {\n Db.close(ps);\n }\n }", "private boolean writeMsg(String msg) {\n // if Client is still connected send the message to it\n if (!socket.isConnected()) {\n close();\n return false;\n }\n // write the message to the stream\n try {\n sOutput.writeObject(msg);\n }\n // if an error occurs, do not abort just inform the server GUI\n catch(IOException e) {\n displayEvent(\"Error sending message to \" + username);\n displayEvent(e.toString());\n }\n return true;\n }", "public synchronized void writeToSocket(String msg) {\n try {\n bluetoothSocket.getOutputStream().println(msg);\n } catch (Exception e) {\n Log.e(TAG, General.OnWriteToSocketFailed, e);\n }\n }", "void sendMessage() {\n\n\t}", "private void sendMessageToClient(String message) {\n try {\n outputStream.writeObject(message);\n outputStream.flush();\n } catch (IOException e) {\n System.out.println(\"Erreur lors de l'envoi du message au client\");\n }\n }" ]
[ "0.68866587", "0.64458144", "0.6393537", "0.634242", "0.63128644", "0.6279478", "0.6215945", "0.62011516", "0.5920801", "0.5887", "0.5835484", "0.5819493", "0.5817988", "0.5792407", "0.57780564", "0.57328314", "0.57208276", "0.57171154", "0.56699485", "0.5660236", "0.56546974", "0.56518346", "0.5649581", "0.56455344", "0.56204087", "0.5619154", "0.5609723", "0.55956", "0.5558303", "0.5546712", "0.55466485", "0.551636", "0.55154103", "0.55135256", "0.5507917", "0.550148", "0.5500311", "0.54878086", "0.5481138", "0.547968", "0.54792285", "0.546747", "0.546381", "0.54634327", "0.54614216", "0.5460679", "0.5434292", "0.5431854", "0.5431279", "0.5429661", "0.54081506", "0.5406777", "0.5402459", "0.5396745", "0.5395117", "0.539082", "0.538828", "0.53881377", "0.53761995", "0.5375248", "0.53691036", "0.5367639", "0.53615063", "0.53539133", "0.53493834", "0.53429425", "0.53329885", "0.53309435", "0.53303814", "0.53231937", "0.53228515", "0.5316802", "0.5315315", "0.5313695", "0.53121233", "0.53105265", "0.5306235", "0.5302402", "0.52995706", "0.5295701", "0.52900386", "0.5288847", "0.5287836", "0.52859485", "0.5282711", "0.52816105", "0.5278466", "0.5273732", "0.527279", "0.5262134", "0.52584684", "0.5254647", "0.5253297", "0.5252214", "0.5250805", "0.5242801", "0.52396274", "0.5235433", "0.5220362", "0.5217368", "0.52164423" ]
0.0
-1
write your code in Java SE 8
public String solution(String s) { Stream<Character> tmp = s.chars().mapToObj(value -> (char)value); return tmp.collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().filter(characterLongEntry -> characterLongEntry.getValue() == 2).findFirst().get().getKey().toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\tnew Action() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(String content) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tSystem.out.println(content);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}.execute(\"jdk1.8之前匿名内部类实现方式\");\r\n\t\t\r\n\t\t\r\n\t\t//lambda\r\n\t\tAction login=(String content)->{\r\n\t\t\tSystem.out.println(\"jdk1.8的lambda语法实现\");\r\n\t\t};\r\n\t\tlogin.execute(\"jdk1.8的lambda语法实现\");\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tnew Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tSystem.out.println(\"Before JAVA 8, too much code for too little to do\");\r\n\t\t\t}\r\n\t\t}).start();\r\n\t\t\r\n\t\t// Java 8 way:\r\n\t\t\r\n\t\tnew Thread( () -> System.out.println(\"In Java 8, Lambda Expression rocks !!\") ).start();\r\n\t\t\r\n\t\tSystem.out.println(\"-----------*************************-------------\");\r\n\t\t\r\n\t\t// Iterating Over List Using Lambda Expressions\r\n\t\t\r\n\t\tList features = Arrays.asList(\"Lambdas\",\"Default Method\",\"Stream API\",\"DAte and Time API\");\r\n\t\t\r\n\t\tfeatures.forEach(n -> System.out.println(n));\r\n\r\n\t\tSystem.out.println(\"-----------*************************-------------\");\r\n\t\t\t\t\r\n\t\t// Even better use method reference feature of Java 8\r\n\t\t// method reference is denoted by :: ****double colon***** operator\r\n\t\t// looks similar to scope resolution operator of C++\r\n\t\t\r\n\t\tfeatures.forEach(System.out::println);\r\n\r\n\t}", "public static void main(String[] args) {\r\n\t\tSomeJava8Features obj = new SomeJava8Features();\r\n\r\n\t\t// StringJoiner\r\n\t\texampleStringJoiner();\r\n\t\t\r\n\t\t// Default\r\n\t\tint ary[] = {3,6,8,9,0};\r\n\t\tSystem.out.println(\"\\nsumOfGivenIntArray ... \" + obj.sumOfGivenIntArray(ary));\r\n\t\tobj.sayMore(\"Hello Rohini\");\r\n\t\t\r\n\t\t// ForEach & Lambda Expression\r\n\t\texampleForEach_FindMaximum(ary);\r\n\t\t\r\n\r\n\t}", "@Deprecated\n\tprivate void oldCode()\n\t{\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private void level7() {\n }", "Compatibility compatibility();", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "public static void main(String[] args) {\n throw new NotImplementedException();\n }", "public static void main(String[] args) {\n Foo foo = new Java8Default();\n foo.sumDefault(2,4);\n\n }", "@Test\n public void source8() throws Exception {\n ImmutableList<String> options = (GeneratedAnnotationsTest.isJdk9OrLater()) ? ImmutableList.of(\"--release\", \"8\") : ImmutableList.of(\"-source\", \"8\", \"-target\", \"8\");\n String generated = runProcessor(options, null);\n assertThat(generated).contains(GeneratedAnnotationsTest.JAVAX_ANNOTATION_GENERATED);\n assertThat(generated).doesNotContain(GeneratedAnnotationsTest.JAVAX_ANNOTATION_PROCESSING_GENERATED);\n }", "void compileToJava();", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public final void mo8775b() {\n }", "public static void main(String[] args) {\n\t\t//Até o java 7\n\t\tnew Thread(new Runnable() {\n\n\t\t @Override\n\t\t public void run() {\n\t\t System.out.println(\"Executando um Runnable\");\n\t\t }\n\n\t\t}).start();\n\t\t//A partir do java 8\n\t\tnew Thread(() -> System.out.println(\"Executando um Runnable\")).start();\n\t\t\n\t\t//iterando com java 8: classe anonima\n\t\ttexto.forEach(new Consumer<String>() {\n\t\t public void accept(String s) {\n\t\t System.out.println(s);\n\t\t }\n\t\t});\n\t\t//iterando com java 8: lambda\n\t\t//Essa sintaxe funciona para qualquer interface \n\t\t//que tenha apenas um método abstrato\n\t\ttexto.forEach((String s) -> {\n\t\t System.out.println(s);\n\t\t});\n\t\t//ou\n\t\ttexto.forEach((s) -> {\n\t\t System.out.println(s);\n\t\t});\n\t\t//ou\n\t\ttexto.forEach(s -> {\n\t\t System.out.println(s);\n\t\t});\n\t\t//ou\n\t\ttexto.forEach(s -> System.out.println(s));\n\t\t// Uma interface que possui apenas um método abstrato \n\t\t//é agora conhecida como interface funcional e pode ser utilizada dessa forma\n\t\t\n\t\t//Outro exemplo é o próprio Comparator. Se utilizarmos a forma \n\t\t//de classe anônima, teremos essa situação: \n\t\ttexto.sort(new Comparator<String>() {\n\t\t public int compare(String s1, String s2) {\n\t\t if (s1.length() < s2.length())\n\t\t return -1;\n\t\t if (s1.length() > s2.length())\n\t\t return 1;\n\t\t return 0;\n\t\t }\n\t\t});\n\t\t//ou com lambda\n\t\ttexto.sort((s1, s2) -> {\n\t\t if (s1.length() < s2.length())\n\t\t return -1;\n\t\t if (s1.length() > s2.length())\n\t\t return 1;\n\t\t return 0;\n\t\t});\n\t\t//ou\n\t\ttexto.sort((s1, s2) -> {\n\t\t return Integer.compare(s1.length(), s2.length());\n\t\t});\n\t\t//ou como há apenas um único statement, podemos remover as chaves\n\t\ttexto.sort((s1, s2) -> Integer.compare(s1.length(), s2.length()));\n\t}", "public void mo38117a() {\n }", "void mo57277b();", "public static void main(String[] args) {\n version1WhileLoop();\n version1DoWhileLoop();\n version1ForLoop();\n version2ForLoop();\n version3ForLoop();\n }", "public abstract boolean mo2163j();", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "private NativeSupport() {\n\t}", "private static IRIProvider makeProviderJDK() { return new IRIProviderJDK(); }", "public void mo21785J() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public static void generateCode()\n {\n \n }", "private UsingSwig() {\n\t}", "public static void main(String[] args) {\n\t\tlanceur8();\n\t}", "void mo1941j();", "public abstract void mo2624j();", "private final boolean updateState(java.lang.Object r7, java.lang.Object r8) {\n /*\n // Method dump skipped, instructions count: 101\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlinx.coroutines.flow.StateFlowImpl.updateState(java.lang.Object, java.lang.Object):boolean\");\n }", "void mo72113b();", "static void feladat7() {\n\t}", "void mo28306a();", "private static void cajas() {\n\t\t\n\t}", "private void habilitar() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public static void main(String[] args) {\n\n\t\tUnaryOperator<Integer> func=x->x*7;\t\t\n\t\tint num=func.apply(10);\n\t\tSystem.out.println(num);\n\t\t\n\t\tFunction<Integer, Integer> func1=x->x*10;\n\t\tSystem.out.println(func1.apply(10));\n\t\t\n\t\tList<String> langList=new ArrayList<String>();\n\t\tlangList.add(\"Java\");\n\t\tlangList.add(\"Ruby\");\n\t\tlangList.add(\"Python\");\n\t\t\n\t\tSystem.out.println(langList);\n\t\t\n\t\tlangList.replaceAll(ele -> ele +\" Deeps\");\n\t\tSystem.out.println(langList);\n\t}", "void mo57278c();", "interface DefaultMethod extends SingleMethod {\r\n\tdefault public void myMethod() {\r\n\t\tSystem.out.println(\"from Java 1.8 version can have method with a body\");\r\n}\r\n}", "void mo80457c();", "public void mo21792Q() {\n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public void mo21787L() {\n }", "public void method_4270() {}", "static void feladat8() {\n\t}", "public static void main() {\n \n }", "private void level6() {\n }", "void mo57275a();", "void mo80452a();", "private Quantify()\n {\n throw new UnsupportedOperationException(\"Instantiation of utility classes is not supported.\");\n }", "public void m9741j() throws cf {\r\n }", "@Before\n public void setUp() {\n Assume.assumeThat(JavaVersion.getMajorVersion(), Matchers.lessThanOrEqualTo(8));\n }", "private stendhal() {\n\t}", "void mo41083a();", "public static void main(String[] args) {\n\t\tisPolindrom(\"abcd\");\r\n\t\tfibJava8(2);\r\n\t\tfactJava8(5);\r\n\t}", "void m8368b();", "@Override\n\tpublic void implementionSeven(String[] args) throws Exception {\n\n\t}", "public void mo6081a() {\n }", "java.lang.String getS8();", "public void mo21879u() {\n }", "void mo119582b();", "public abstract void mo27385c();", "public abstract void mo70713b();", "public void mo21781F() {\n }", "public interface AnonymousClass1lE {\n void A7X(String str, String str2, String str3);\n\n void A7Z(String str, String str2, @Nullable Map<String, String> map);\n\n void A7b(String str, String str2, Throwable th, @Nullable Map<String, String> map);\n\n void A7d(String str, String str2, @Nullable Map<String, String> map);\n\n void A7f(String str, String str2);\n\n void A8G(String str, String str2, boolean z);\n\n boolean A9J(String str);\n}", "void mo41086b();", "public static void main(String[] args) {\n\n // Creating object of class in main() method\n JEP306_StritfpSample t = new JEP306_StritfpSample();\n\n // Here we have error of putting strictfp and\n // error is not found public static void main method\n System.out.println(t.sum());\n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n \n \n }", "private void kk12() {\n\n\t}", "public static void main(String[] args) {\n //Ersetzt jetzt mal unseren Parser, Stell Dir vor\n // das Ding liest das Beispiel da oben ^^.\n final StatementNode[] statementNodes = readStatements();\n \n //Zustände:\n // - FillSymbolTable (was für Symbole [variablen, ...] gibt es)\n // - TypInferenz (Was für Typen haben die Expressions und sind die eingaben semantisch korrekt)\n // - CodeGenerierung oder Ausführung (ersetzen wir mit \"schreibe die Werte aller Variablen nach Ende der Ausführung\")\n \n \n final SymbolTabelle symbolTabelle = new SymbolTabelle();\n //IDEE 2:\n //Ich gebe Statements und Expressions nur eine Methode mit Visitor als Callback\n final StatementVisitorSymbolTabelle statementVisitorSymbolTabelle = new StatementVisitorSymbolTabelle(symbolTabelle);\n for(StatementNode statementNode : statementNodes) {\n statementNode.accept(statementVisitorSymbolTabelle);\n }\n \n final StatementVisitorTypInferenz statementVisitorTypInferenz = new StatementVisitorTypInferenz(symbolTabelle);\n for(StatementNode statementNode : statementNodes) {\n statementNode.accept(statementVisitorTypInferenz);\n }\n \n PseudoLaufContext laufContext = new PseudoLaufContext();\n final StatementVisitorCodeGen statementVisitorCodeGen = new StatementVisitorCodeGen(laufContext);\n for(StatementNode statementNode : statementNodes) {\n statementNode.accept(statementVisitorCodeGen);\n }\n \n laufContext.druckeVariablen();\n \n //Zusammenfassung:\n //Reduktion des Problems darauf, den Code nur noch von einem Abhängig zu machen\n //Jetzt nur noch abhängig vom Typ des Statements\n \n \n //Problem hierbei:\n //Ich muss selbst angeben, in welchem Zustand ich bin\n //Code-Duplizierung\n }", "public static void main(String[] args) {\n \n \n \n\t}", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "void mo80455b();", "interface C15937b {\n /* renamed from: a */\n void mo13368a();\n\n /* renamed from: a */\n void mo13369a(int i, int i2, int i3, boolean z);\n\n /* renamed from: a */\n void mo13370a(int i, int i2, List<C15929a> list) throws IOException;\n\n /* renamed from: a */\n void mo13371a(int i, long j);\n\n /* renamed from: a */\n void mo13372a(int i, ErrorCode errorCode);\n\n /* renamed from: a */\n void mo13373a(int i, ErrorCode errorCode, ByteString byteString);\n\n /* renamed from: a */\n void mo13374a(boolean z, int i, int i2);\n\n /* renamed from: a */\n void mo13375a(boolean z, int i, int i2, List<C15929a> list);\n\n /* renamed from: a */\n void mo13376a(boolean z, int i, BufferedSource bufferedSource, int i2) throws IOException;\n\n /* renamed from: a */\n void mo13377a(boolean z, C15943j c15943j);\n }", "void mo88521a();", "void mo20141a();", "public static void main(String[] args) {\n \n \n \n \n }", "public final void mo51373a() {\n }", "private final boolean shouldProposeGenerics(IJavaProject project) {\n\t\treturn true;\n\t\t/*\n\t\tString sourceVersion;\n\t\tif (project != null)\n\t\t\tsourceVersion= project.getOption(JavaCore.COMPILER_SOURCE, true);\n\t\telse\n\t\t\tsourceVersion= JavaCore.getOption(JavaCore.COMPILER_SOURCE);\n\n\t\treturn sourceVersion != null && JavaCore.VERSION_1_5.compareTo(sourceVersion) <= 0;\n\t\t*/\n\t}", "public static void main(String[] args) {\n way8();\n }", "private JacobUtils() {}", "void mo60893b();", "public interface JavaCode {\n\n /**\n * Get an unique identification code for an object\n * TODO: This method is not reliable as hash codes are not unique, should use an UUID generator singleton instead.\n *\n * @param obj the object\n * @return the unique identification code\n */\n static int getUniqueID(Object obj) {\n return obj.hashCode();\n }\n\n /**\n * Compiles this code. If an object implements both {@link JavaCode}\n * and {@link JavaExpression}, only one of this method and\n * {@link JavaExpression#compileExpression(Subroutine, JavaScope)} should be called.\n *\n * @param subroutine the subroutine which this code belongs to\n * @param parent the parent scope of this code\n * @throws JTAException if an error occurs\n */\n void compileCode(Subroutine subroutine, JavaScope parent) throws JTAException;\n}", "public void mo8738a() {\n }", "public void mo1972o() throws cf {\r\n }", "public static void main (String[] args) {import java.util.*;%>\n//&&&staticSymbol&&&<%import org.eclipse.emf.codegen.ecore.genmodel.*;%>\n//&&&staticSymbol&&&<%\n\n/**\n * Copyright (c) 2002-2010 IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors:\n * IBM - Initial API and implementation\n */\n\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nGenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel(); /* Trick to import java.util.* without warnings */Iterator.class.getName();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nboolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nString publicStaticFinalFlag = isImplementation ? \"public static final \" : \"\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%include(\"../Header.javajetinc\");%>\n//&&&staticSymbol&&&<%\nif (isInterface || genModel.isSuppressInterfaces()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&package <%\n//&&&staticSymbol&&&=genPackage.getReflectionPackageName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&package <%\n//&&&staticSymbol&&&=genPackage.getClassPackageName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addPseudoImport(\"org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addPseudoImport(\"org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container.Dynamic\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addImport(\"org.eclipse.emf.ecore.EClass\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addImport(\"org.eclipse.emf.ecore.EObject\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + \".*\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.markImportLocation(stringBuffer);\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (isInterface) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&/**\n//&&&staticSymbol&&& * <!-- begin-user-doc -->\n//&&&staticSymbol&&& * The <b>Factory</b> for the model.\n//&&&staticSymbol&&& * It provides a create method for each non-abstract class of the model.\n//&&&staticSymbol&&& * <!-- end-user-doc -->\n//&&&staticSymbol&&&<%\nif (!genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& * @see <%\n//&&&staticSymbol&&&=genPackage.getQualifiedPackageInterfaceName()\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& * @generated\n//&&&staticSymbol&&& */\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&/**\n//&&&staticSymbol&&& * <!-- begin-user-doc -->\n//&&&staticSymbol&&& * An implementation of the model <b>Factory</b>.\n//&&&staticSymbol&&& * <!-- end-user-doc -->\n//&&&staticSymbol&&& * @generated\n//&&&staticSymbol&&& */\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&public class <%\n//&&&staticSymbol&&&=genPackage.getFactoryClassName()\n//&&&staticSymbol&&&%> extends <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.impl.EFactoryImpl\")\n//&&&staticSymbol&&&%><%\nif (!genModel.isSuppressInterfaces()) {\n//&&&staticSymbol&&&%> implements <%\n//&&&staticSymbol&&&=genPackage.getImportedFactoryInterfaceName()\n//&&&staticSymbol&&&%><%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&public interface <%\n//&&&staticSymbol&&&=genPackage.getFactoryInterfaceName()\n//&&&staticSymbol&&&%><%\nif (!genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%> extends <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EFactory\")\n//&&&staticSymbol&&&%><%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&{\n//&&&staticSymbol&&&<%\nif (genModel.hasCopyrightField()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.String\")\n//&&&staticSymbol&&&%> copyright = <%\n//&&&staticSymbol&&&=genModel.getCopyrightFieldLiteral()\n//&&&staticSymbol&&&%>;<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isImplementation && (genModel.isSuppressEMFMetaData() || genModel.isSuppressInterfaces())) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * The singleton instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genPackage.getFactoryClassName()\n//&&&staticSymbol&&&%> eINSTANCE = init();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isInterface && genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * The singleton instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genPackage.getFactoryInterfaceName()\n//&&&staticSymbol&&&%> INSTANCE = <%\n//&&&staticSymbol&&&=genPackage.getQualifiedFactoryClassName()\n//&&&staticSymbol&&&%>.eINSTANCE;\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n} else if (isInterface && !genModel.isSuppressInterfaces()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * The singleton instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genPackage.getFactoryInterfaceName()\n//&&&staticSymbol&&&%> eINSTANCE = <%\n//&&&staticSymbol&&&=genPackage.getQualifiedFactoryClassName()\n//&&&staticSymbol&&&%>.init();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Creates the default factory implementation.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&<%\nString factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic static <%\n//&&&staticSymbol&&&=factoryType\n//&&&staticSymbol&&&%> init()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\t<%\n//&&&staticSymbol&&&=factoryType\n//&&&staticSymbol&&&%> the<%\n//&&&staticSymbol&&&=genPackage.getFactoryName()\n//&&&staticSymbol&&&%> = (<%\n//&&&staticSymbol&&&=factoryType\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EPackage\")\n//&&&staticSymbol&&&%>.Registry.INSTANCE.getEFactory(<%\n//&&&staticSymbol&&&=genPackage.getPackageInterfaceName()\n//&&&staticSymbol&&&%>.eNS_URI);\n//&&&staticSymbol&&&\t\t\tif (the<%\n//&&&staticSymbol&&&=genPackage.getFactoryName()\n//&&&staticSymbol&&&%> != null)\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\treturn the<%\n//&&&staticSymbol&&&=genPackage.getFactoryName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (Exception exception)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.plugin.EcorePlugin\")\n//&&&staticSymbol&&&%>.INSTANCE.log(exception);\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genPackage.getImportedFactoryClassName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Creates an instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genPackage.getFactoryClassName()\n//&&&staticSymbol&&&%>()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tsuper();\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Override\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic EObject create(EClass eClass)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tswitch (eClass.getClassifierID())\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&<%\nfor (GenClass genClass : genPackage.getGenClasses()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (!genClass.isAbstract()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tcase <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genClass.getClassifierID()\n//&&&staticSymbol&&&%>: return <%\n//&&&staticSymbol&&&*%%storeSymbol%%*0\n//&&&staticSymbol&&&%>create<%\n//&&&staticSymbol&&&=genClass.getName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tdefault:\n//&&&staticSymbol&&&\t\t\t\tthrow new IllegalArgumentException(\"The class '\" + eClass.getName() + \"' is not a valid classifier\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (!genPackage.getAllGenDataTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Override\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic Object createFromString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, String initialValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tswitch (eDataType.getClassifierID())\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&<%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tcase <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genDataType.getClassifierID()\n//&&&staticSymbol&&&%>:\n//&&&staticSymbol&&&\t\t\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>FromString(eDataType, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tdefault:\n//&&&staticSymbol&&&\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + eDataType.getName() + \"' is not a valid classifier\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Override\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic String convertToString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, Object instanceValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tswitch (eDataType.getClassifierID())\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&<%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tcase <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genDataType.getClassifierID()\n//&&&staticSymbol&&&%>:\n//&&&staticSymbol&&&\t\t\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>ToString(eDataType, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tdefault:\n//&&&staticSymbol&&&\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + eDataType.getName() + \"' is not a valid classifier\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nfor (GenClass genClass : genPackage.getGenClasses()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (!genClass.isAbstract()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genClass.getTypeParameters()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getImportedInterfaceName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getInterfaceTypeArguments()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genClass.getName()\n//&&&staticSymbol&&&%>()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genClass.isDynamic()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genClass.getImportedInterfaceName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getInterfaceTypeArguments()\n//&&&staticSymbol&&&%> <%\n//&&&staticSymbol&&&=genClass.getSafeUncapName()\n//&&&staticSymbol&&&%> = <%\n//&&&staticSymbol&&&=genClass.getCastFromEObject()\n//&&&staticSymbol&&&%>super.create(<%\n//&&&staticSymbol&&&=genClass.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genClass.getImportedClassName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getClassTypeArguments()\n//&&&staticSymbol&&&%> <%\n//&&&staticSymbol&&&=genClass.getSafeUncapName()\n//&&&staticSymbol&&&%> = new <%\n//&&&staticSymbol&&&=genClass.getImportedClassName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getClassTypeArguments()\n//&&&staticSymbol&&&%>()<%\nif (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {\n//&&&staticSymbol&&&%>{}<%\n}\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genClass.getSafeUncapName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) { String eDataType = genDataType.getQualifiedClassifierAccessor();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useGenerics() && genDataType.isUncheckedCast() && !genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@SuppressWarnings(\"unchecked\")\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedInstanceClassName()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>final <%\n}\n//&&&staticSymbol&&&%>String <%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>it<%\n} else {\n//&&&staticSymbol&&&%>literal<%\n}\n//&&&staticSymbol&&&%>)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getCreatorBody(genModel.getIndentation(stringBuffer))\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%> result = <%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%>.get(literal);\n//&&&staticSymbol&&&\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + literal + \"' is not a valid enumerator of '\" + <%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>.getName() + \"'\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(3)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (isPrimitiveConversion && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genBaseType.getGenPackage().isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (isPrimitiveConversion && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (literal == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedInstanceClassName()\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.ArrayList\")\n//&&&staticSymbol&&&%><%\nif (genModel.useGenerics()) {\n//&&&staticSymbol&&&%><<%=genItemType.getObjectType().getImportedParameterizedInstanceClassName()%>><%\n}\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%> stringTokenizer = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%>(literal); stringTokenizer.hasMoreTokens(); )\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (String item : split(literal))\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString item = stringTokenizer.nextToken();\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>(item));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>(item));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (literal == null) return <%\n//&&&staticSymbol&&&=genDataType.getStaticValue(null)\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%> result = <%\n//&&&staticSymbol&&&=genDataType.getStaticValue(null)\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t\tRuntimeException exception = null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = (<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = (<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tif (<%\nif (!genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>result != null && <%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.util.Diagnostician\")\n//&&&staticSymbol&&&%>.INSTANCE.validate(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, <%\nif (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(result)<%\n} else {\n//&&&staticSymbol&&&%>result<%\n}\n//&&&staticSymbol&&&%>, null, null))\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\treturn result;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (RuntimeException e)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\texception = e;\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (<%\nif (!genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>result != null || <%\n}\n//&&&staticSymbol&&&%>exception == null) return result;\n//&&&staticSymbol&&& \n//&&&staticSymbol&&&\t\tthrow exception;\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn (<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)super.createFromString(literal);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else if (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn ((<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)super.createFromString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, literal)).<%\n//&&&staticSymbol&&&=genDataType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>super.createFromString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (!genPackage.isDataTypeConverters() && genModel.useGenerics() && genDataType.isUncheckedCast() && !genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@SuppressWarnings(\"unchecked\")\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, String initialValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=((GenEnum)genDataType).getImportedInstanceClassName()\n//&&&staticSymbol&&&%> result = <%\n//&&&staticSymbol&&&=((GenEnum)genDataType).getImportedInstanceClassName()\n//&&&staticSymbol&&&%>.get(initialValue);\n//&&&staticSymbol&&&\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enumerator of '\" + eDataType.getName() + \"'\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(3)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.getObjectInstanceClassName().equals(genBaseType.getObjectInstanceClassName())) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (initialValue == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.ArrayList\")\n//&&&staticSymbol&&&%><%\nif (genModel.useGenerics()) {\n//&&&staticSymbol&&&%><<%=genItemType.getObjectType().getImportedParameterizedInstanceClassName()%>><%\n}\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%> stringTokenizer = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%>(initialValue); stringTokenizer.hasMoreTokens(); )\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (String item : split(initialValue))\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString item = stringTokenizer.nextToken();\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(<%\nif (!genItemType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genItemType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (initialValue == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%> result = null;\n//&&&staticSymbol&&&\t\tRuntimeException exception = null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = <%\nif (!genDataType.isObjectType() && !genDataType.getObjectInstanceClassName().equals(genMemberType.getObjectInstanceClassName())) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tif (result != null && <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.util.Diagnostician\")\n//&&&staticSymbol&&&%>.INSTANCE.validate(eDataType, result, null, null))\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\treturn result;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (RuntimeException e)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\texception = e;\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (result != null || exception == null) return result;\n//&&&staticSymbol&&& \n//&&&staticSymbol&&&\t\tthrow exception;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>super.createFromString(initialValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>super.createFromString(eDataType, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) { String eDataType = genDataType.getQualifiedClassifierAccessor();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic String convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>final <%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%> <%\nif (genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>it<%\n} else {\n//&&&staticSymbol&&&%>instanceValue<%\n}\n//&&&staticSymbol&&&%>)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getConverterBody(genModel.getIndentation(stringBuffer))\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : instanceValue.toString();\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (isPrimitiveConversion) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(instanceValue<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genBaseType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>()<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genBaseType.getGenPackage().isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedFactoryInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&&\t\tif (instanceValue.isEmpty()) return \"\";\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nString item; if (!genModel.useGenerics()) { item = \"i.next()\"; \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.Iterator\")\n//&&&staticSymbol&&&%> i = instanceValue.iterator(); i.hasNext(); )\n//&&&staticSymbol&&& <%\n} else { item = \"item\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.Object\")\n//&&&staticSymbol&&&%> item : instanceValue)\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genItemType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genItemType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(' ');\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result.substring(0, result.length() - 1);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (!genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>.isInstance(instanceValue))\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\ttry\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genMemberType.getQualifiedInstanceClassName().equals(genDataType.getQualifiedInstanceClassName())) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else if (genMemberType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(((<%\n//&&&staticSymbol&&&=genMemberType.getObjectType().getImportedInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue).<%\n//&&&staticSymbol&&&=genMemberType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>());\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genMemberType.getObjectType().getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage().isDataTypeConverters()) { genMemberType = genMemberType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genMemberType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tif (value != null) return value;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t\tcatch (Exception e)\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\t// Keep trying other member types until all have failed.\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>new <%\n//&&&staticSymbol&&&=genMemberType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(instanceValue)<%\n} else {\n//&&&staticSymbol&&&%>instanceValue<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage().isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>new <%\n//&&&staticSymbol&&&=genMemberType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(instanceValue)<%\n} else {\n//&&&staticSymbol&&&%>instanceValue<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tif (value != null) return value;\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (Exception e)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\t// Keep trying other member types until all have failed.\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>.getName());\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(instanceValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else if (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(instanceValue));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useGenerics() && (genDataType.getItemType() != null || genDataType.isUncheckedCast()) && (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody())) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@SuppressWarnings(\"unchecked\")\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic String convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, Object instanceValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : instanceValue.toString();\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n} else { final String singleWildcard = genModel.useGenerics() ? \"<?>\" : \"\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.List\")\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=singleWildcard\n//&&&staticSymbol&&&%> list = (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.List\")\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=singleWildcard\n//&&&staticSymbol&&&%>)instanceValue;\n//&&&staticSymbol&&&\t\tif (list.isEmpty()) return \"\";\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nString item; if (!genModel.useGenerics()) { item = \"i.next()\"; \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.Iterator\")\n//&&&staticSymbol&&&%> i = list.iterator(); i.hasNext(); )\n//&&&staticSymbol&&& <%\n} else { item = \"item\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.Object\")\n//&&&staticSymbol&&&%> item : list)\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(' ');\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result.substring(0, result.length() - 1);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(((<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue)<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genDataType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>()<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>.isInstance(instanceValue))\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\ttry\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tif (value != null) return value;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t\tcatch (Exception e)\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\t// Keep trying other member types until all have failed.\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+eDataType.getName());\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>(<%\n}\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>).<%\n//&&&staticSymbol&&&=genDataType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>()<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(instanceValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(eDataType, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nfor (GenClass genClass : genPackage.getGenClasses()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genClass.hasFactoryInterfaceCreateMethod()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns a new object of class '<em><%\n//&&&staticSymbol&&&=genClass.getFormattedName()\n//&&&staticSymbol&&&%></em>'.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @return a new object of class '<em><%\n//&&&staticSymbol&&&=genClass.getFormattedName()\n//&&&staticSymbol&&&%></em>'.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=genClass.getTypeParameters()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getImportedInterfaceName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getInterfaceTypeArguments()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genClass.getName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns an instance of data type '<em><%\n//&&&staticSymbol&&&=genDataType.getFormattedName()\n//&&&staticSymbol&&&%></em>' corresponding the given literal.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @param literal a literal of the data type.\n//&&&staticSymbol&&&\t * @return a new instance value of the data type.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedInstanceClassName()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(String literal);\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns a literal representation of an instance of data type '<em><%\n//&&&staticSymbol&&&=genDataType.getFormattedName()\n//&&&staticSymbol&&&%></em>'.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @param instanceValue an instance value of the data type.\n//&&&staticSymbol&&&\t * @return a literal representation of the instance value.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tString convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%> instanceValue);\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (!isImplementation && !genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns the package supported by this factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @return the package supported by this factory.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=genPackage.getPackageInterfaceName()\n//&&&staticSymbol&&&%> get<%\n//&&&staticSymbol&&&=genPackage.getBasicPackageName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n} else if (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%> get<%\n//&&&staticSymbol&&&=genPackage.getBasicPackageName()\n//&&&staticSymbol&&&%>()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\treturn (<%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>)getEPackage();\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @deprecated\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Deprecated\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic static <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%> getPackage()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.eINSTANCE;\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&} //<%\n//&&&staticSymbol&&&*%%storeSymbol%%*1\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.emitSortedImports();\n//&&&staticSymbol&&&%>\n\n}", "static void feladat9() {\n\t}", "@Override\n public boolean isVersionCodeCompatible(int version) {\n return true;\n }", "public void mo4359a() {\n }", "private static List<String> getJavasSourceCodeFiels(Map<String,Object> map){\r\n \t\t\r\n \t\t\r\n \t\tSystem.out.println(\"............\");\r\n \t\tLinkedList<String> list = new LinkedList<String>();\r\n \t\tfor(String key : map.keySet()){\r\n \t\t\tObject o = map.get(key);\r\n \r\n \t\t\t//package...\r\n \t\t\tif(o instanceof IPackageFragment){\r\n \t\t\t\t//System.out.println(\"Package --> \" + key);\r\n \t\t\t\tkey = key.substring(0,key.indexOf('[')).trim();\r\n \t\t\t\tkey = PACKAGE + \"(\" + key + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t\t//class...\r\n \t\t\tif(o instanceof ICompilationUnit){\r\n \t\t\t\t//System.out.println(\"Class --> \" + key);\r\n \t\t\t\tString classname = key.substring(0,key.indexOf('[')).trim();\r\n \t\t\t\tString packagename = key.substring(key.indexOf(PACKAGE),key.indexOf('\\n',key.indexOf(PACKAGE)));\r\n \t\t\t\tkey = CLASS_WITH_MEMBERS + \"(\" + packagename + \",\" + classname + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}//method\r\n \t\t\tif(o instanceof IMethod){\r\n \t\t\t\tSystem.out.println(\"Methode --> \" + key);\r\n \t\t\t\tkey = METHOD + \"(\" + getQueryFromMethod((IMethod)o) + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(o instanceof IField){\r\n \t\t\t\tSystem.out.println(\"Attribut --> \" + key);\r\n \t\t\t\tkey = FIELD + \"(\" + getQueryFromField((IField)o) + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn list;\r\n \t\t\r\n \t\t\r\n \t\t/*\r\n \t\tfor(String key : map.keySet()){\r\n \t\t\tObject o = map.get(key);\r\n \t\t\t//if(o instanceof ISourceAttribute)\r\n \t\t\t\t//System.out.println(\"attribute\");\r\n \t\t\t//if(o instanceof ISourceMethod)\r\n \t\t\t\t//System.out.println(\"methode\");\r\n \t\t\tif(o instanceof IPackageFragment) \r\n \t\t\t\tSystem.out.println(\"Package\");\r\n \t\t\tif(o instanceof ICompilationUnit)\r\n \t\t\t\tSystem.out.println(\"sour code file\");\r\n \t\t\t\t\r\n \t\t\t//\"oldquery or class('voller packagename', klassenname)\"\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\tif(o instanceof IField)\r\n \t\t\t\tSystem.out.println(\"Attribut\");\r\n \t\t\tif(o instanceof IType)\r\n \t\t\t\tSystem.out.println(\"classe also class ... in einem file\");\r\n \t\t\tif(o instanceof IMethod)\r\n \t\t\t\tSystem.out.println(\"Methode\");\r\n \t\t\tif(o instanceof IPackageFragmentRoot) \r\n \t\t\t\tSystem.out.println(\"jar package / src Ordner\");\r\n \t\t\tif(o instanceof IProject)\r\n \t\t\t\tSystem.out.println(\"Projekt Ordner\");\r\n \t\t\tif(o instanceof IClassFile)\r\n \t\t\t\tSystem.out.println(\"ClassFile\");\r\n \t\t\tif(o instanceof IAdaptable) //trieft auch auf viele ander sachen zu\r\n \t\t\t\tSystem.out.println(\"Libaraycontainer\");\r\n \t\t\tif(o instanceof IFile)\r\n \t\t\t\tSystem.out.println(\"file\"); //je nach ausgewlter ansicht knnen file auch *.java datein sein\r\n \t\t\tif(o instanceof IFolder)\r\n \t\t\t\tSystem.out.println(\"folder\");\r\n \t\t\tSystem.out.println(o.getClass());\r\n \t\t\t\r\n \t\r\n \t\t}\r\n \t\treturn null;\r\n \t\t*/\r\n \t}", "public void mo1531a() {\n }", "public void mo1976s() throws cf {\r\n }", "void mo119581a();", "static void feladat6() {\n\t}", "private void generateSolution() {\n\t\t// TODO\n\n\t}" ]
[ "0.5890391", "0.58054996", "0.57008785", "0.56167847", "0.54946315", "0.54761344", "0.524263", "0.52340496", "0.5233149", "0.52029705", "0.5160466", "0.51574665", "0.5143396", "0.5094738", "0.5084682", "0.5069909", "0.50661004", "0.50645214", "0.5064437", "0.50475377", "0.5041245", "0.5039573", "0.5037435", "0.50317824", "0.5007829", "0.500209", "0.49986184", "0.4996393", "0.49733046", "0.49654463", "0.49482828", "0.49374196", "0.49367213", "0.49362347", "0.4931423", "0.49300268", "0.49164099", "0.49096605", "0.4893169", "0.48904118", "0.4883474", "0.4883474", "0.4883474", "0.4883474", "0.4883474", "0.4883474", "0.4869394", "0.48675945", "0.4863796", "0.4849808", "0.48444158", "0.48439786", "0.48421556", "0.4838581", "0.48383453", "0.4837389", "0.4833218", "0.48310906", "0.4830076", "0.4827487", "0.481306", "0.48097232", "0.4807137", "0.48028547", "0.4801506", "0.47964317", "0.47952133", "0.479351", "0.4792214", "0.4791279", "0.47875714", "0.47851777", "0.47851777", "0.47834784", "0.47784257", "0.47747812", "0.47722042", "0.47722042", "0.47719148", "0.47705945", "0.47705132", "0.47681588", "0.47653475", "0.47629744", "0.47611335", "0.47570732", "0.47566834", "0.47548115", "0.4751401", "0.47484854", "0.47464594", "0.47460574", "0.47457317", "0.4742769", "0.47399607", "0.47344413", "0.47313395", "0.47252822", "0.47233605", "0.4721698", "0.47122636" ]
0.0
-1
Once you use Dynamic Programming, map will have right numbers. Without Dynamic Programming, values in the map will be overwritten.
@SuppressWarnings("Duplicates") private static int findMax_with_included_pieces_printed_brute_force(int[] prices, int[] pieceLengths, int start, int end, int expectedRodLength, Map<Integer, Integer> map) { // exit condition if (expectedRodLength <= 0) return 0; // reducing the problem by 1. Selecting last pieceLength and its price. int pieceLength = pieceLengths[end]; int priceOfSelectedPiece = prices[end]; // exit condition if (end == start) {//there is only one possible pieceLength possible of the rod if (pieceLength <= expectedRodLength) { if ((expectedRodLength % pieceLength) != 0) { return 0; } int num = expectedRodLength / pieceLength; map.put(pieceLength, num); return num * priceOfSelectedPiece; } return 0; } if (pieceLength == expectedRodLength) { int maxPriceExcludingThisPiece = findMax_with_included_pieces_printed_brute_force(prices, pieceLengths, start, end - 1, expectedRodLength, map); if (priceOfSelectedPiece >= maxPriceExcludingThisPiece) { map.put(pieceLength, 1); return priceOfSelectedPiece; } return maxPriceExcludingThisPiece; } if (pieceLength > expectedRodLength) { return findMax_easy_brute_force(prices, pieceLengths, start, end - 1, expectedRodLength); } int maxPriceIncludingThisPiece = priceOfSelectedPiece + findMax_with_included_pieces_printed_brute_force(prices, pieceLengths, start, end, expectedRodLength - pieceLength, map); int maxPriceExcludingThisPiece = findMax_with_included_pieces_printed_brute_force(prices, pieceLengths, start, end - 1, expectedRodLength, map); if (maxPriceExcludingThisPiece >= maxPriceIncludingThisPiece) { return maxPriceExcludingThisPiece; } map.put(pieceLength, 1); return maxPriceIncludingThisPiece; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Scanner read = new Scanner(System.in);\n int n = read.nextInt();\n int d = read.nextInt();\n int[] arr = new int[n];\n for(int i=0;i<n;i++)\n arr[i]=read.nextInt();\n \n int[] a = new int[n];\n int temp=0;\n for(int i=0;i<n;i++){\n temp = i-d >= 0 ? i-d : n + (i-d);\n a[temp] = arr[i];\n }\n for(int i=0;i<n;i++)\n System.out.print(a[i]+\" \");\n \n read.close();\n HashMap<String,Integer> map = new HashMap<String,Integer>();\n \n }", "public static void main(String[] args) {\n System.out.println(\"HW1\");\n Map<String, Integer> map = new HashMap<>();\n map.put(\"Ivan\",19);\n map.put(\"Dm\",20);\n map.put(\"Petr\",19);\n\n\n }", "public void populateMap(int playerNumber){\n\t\tint factor = 1;\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tHashMap<String, Integer> map = new HashMap<>();\n\t\t\n\t\tmap.put(\"Pune\", 4111014);\n\t\tmap.put(\"nsk\", 40000014);\n\t\tmap.put(\"Mumbai\", 40000001);\n\t\t\n\t\t\n\t\tSystem.out.println(map);\n\t\t\n\t\tSystem.out.println(map.keySet());\n\t\tSystem.out.println(map.values());\n\t\t\n\t\tSystem.out.println(map.size());\n\t\t\n\t\tmap.replace(\"Pune\",10000001);\n\t\tSystem.out.println(map);\n\t\t\n\t\tSystem.out.println(map.containsKey(\"Nashik\"));\n\t\t\n\t\t//System.out.println(map.remove(\"Pune\", 000000000));\n\t}", "private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}", "public static void main(String[] args) {\n HashMap<Character,Integer> hMapOutPut = new HashMap<>();\n //HashMap map = new HashMap();\n String sInput = \"india\";\n char[] strInputArray = sInput.toCharArray();\n for(char fLoop: strInputArray) {\n System.out.println(fLoop);\n if(hMapOutPut.containsKey(fLoop)) {\n int temp=hMapOutPut.get(fLoop)+1;\n hMapOutPut.put(fLoop,temp );\n }else {\n hMapOutPut.put(fLoop, 1);\n }\n }\nSystem.out.println(hMapOutPut);\n }", "abstract Map<String, Integer> mapOfNamesToSalary();", "public void generateRandomMap() {\n\n\t}", "public int askMap();", "private void populateMaps() {\n\t\t//populate the conversion map.\n\t\tconvertMap.put(SPACE,(byte)0);\n\t\tconvertMap.put(VERTICAL,(byte)1);\n\t\tconvertMap.put(HORIZONTAL,(byte)2);\n\n\t\t//build the hashed numbers based on the training input. 1-9\n\t\tString trainingBulk[] = new String[]{train1,train2,train3,\"\"};\n\t\tbyte[][] trainer = Transform(trainingBulk);\n\t\tfor(int i=0; i < 9 ;++i) {\n\t\t\tint val = hashDigit(trainer, i);\n\t\t\tnumbers.put(val,i+1);\n\t\t}\n\t\t//train Zero\n\t\ttrainingBulk = new String[]{trainz1,trainz2,trainz3,\"\"};\n\t\tint zeroVal = hashDigit(Transform(trainingBulk), 0);\n\t\tnumbers.put(zeroVal,0);\n\n\n\t}", "public static void main (String[] args){\n CustomHashMap<String,String> map = new CustomHashMap<String,String>();\n for(int i = 0; i < 100; i++){\n map.put(i+\"\",i+\"\");\n }\n for(int i = 0; i < 100; i++){\n System.out.println(\"map取值: \"+ i + \" = \"+map.get(i+\"\"));\n }\n }", "public static void addToMap()\n {\n Map<String, Integer> map = new HashMap<>();\n\n BiConsumer<String, Integer> mapAdderEveryTime = (s, i) -> map.put(s, i);\n\n mapAdderEveryTime.accept(\"key1\", 4);\n mapAdderEveryTime.accept(\"key2\", 4);\n\n BiConsumer<String, Integer> mapAdderIfPresent = (s, i) -> {\n map.computeIfPresent(s, (key, value) -> (value % 4 == 0) ? 0 : value +1);\n };\n\n mapAdderIfPresent.accept(\"key1\", 1);\n\n System.out.println(map);\n }", "private void getMapping() {\n double [][] chars = new double[CHAR_SET_SIZE][1];\n for (int i = 0; i < chars.length; i++) {\n chars[i][0] = i;\n }\n Matrix b = new Matrix(key).times(new Matrix(chars));\n map = b.getArray();\n }", "public static void main(String[] args) {\n\t\tString2Int.put(\"Location1\", new Integer(0));\n\t\tString2Int.put(\"Location2\", new Integer(1));\n\t\tString2Int.put(\"Location3\", new Integer(2));\n\t\tString2Int.put(\"Location4\", new Integer(3));\n\t\t\n\t\t\n\t\t// populate it\n\t\tInt2String.put(new Integer(0), \"Location1\");\n\t\tInt2String.put(new Integer(1), \"Location2\");\n\t\tInt2String.put(new Integer(2), \"Location3\");\n\t\tInt2String.put(new Integer(3), \"Location4\");\n\t\t\n\t\t\n\t\t//HashMap<String,List<Integer>> NHMap = new HashMap<String,List<Integer>>();\n\t\tArrayList<Integer[]> NHMap = new ArrayList<Integer[]>();\n\t\tInteger[] NHMapedge1 ={String2Int.get(\"Location1\"),100,30};\n\t\tInteger[] NHMapedge2 ={String2Int.get(\"Location2\"),20,40};\n\t\tInteger[] NHMapedge3 ={String2Int.get(\"Location4\"),30,15};\n\t\tInteger[] NHMapedge4 ={String2Int.get(\"Location3\"),140,60};\n\t\t//edges.add(edge);\n\t\tNHMap.add(NHMapedge1);\n\t\tNHMap.add(NHMapedge2);\n\t\tNHMap.add(NHMapedge3);\n\t\tNHMap.add(NHMapedge4);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//HashMap<String,List<Integer>> EHMap = new HashMap<String,List<Integer>>();\n\t\tArrayList<Integer[]> EHMap = new ArrayList<Integer[]>();\n\t\tInteger[] EHMapedge1 ={String2Int.get(\"Location1\"),String2Int.get(\"Location2\"),10,30};\n\t\tInteger[] EHMapedge2 ={String2Int.get(\"Location2\"),String2Int.get(\"Location3\"),20,40};\n\t\tInteger[] EHMapedge3 ={String2Int.get(\"Location4\"),String2Int.get(\"Location4\"),30,50};\n\t\tInteger[] EHMapedge4 ={String2Int.get(\"Location3\"),String2Int.get(\"Location2\"),40,60};\n\t\t//edges.add(edge);\n\t\tEHMap.add(EHMapedge1);\n\t\tEHMap.add(EHMapedge2);\n\t\tEHMap.add(EHMapedge3);\n\t\tEHMap.add(EHMapedge4);\n\t\t\n\t\tArrayList<Integer[]> edges = new ArrayList<Integer[]>();\n\t\tInteger[] edge ={String2Int.get(\"Location1\"),String2Int.get(\"Location2\"),10};\n\t\tInteger[] edge1 ={String2Int.get(\"Location2\"),String2Int.get(\"Location3\"),20};\n\t\tInteger[] edge2 ={String2Int.get(\"Location1\"),String2Int.get(\"Location3\"),30};\n\t\tInteger[] edge4 ={String2Int.get(\"Location3\"),String2Int.get(\"Location4\"),40};\n\t\tInteger[] edge5 ={String2Int.get(\"Location4\"),String2Int.get(\"Location3\"),40};\n\t\t\n\t\t\n\t\tedges.add(edge);\n\t\tedges.add(edge1);\n\t\tedges.add(edge2);\n\t\tedges.add(edge4);\n\t\tedges.add(edge5);\n\t\t\n\t\t\n \n\t //int[][] adj_matrix = MapArrayList(edges1);\n int[][] adj_matrix = MapArrayList(edges);\n\t\tfor(int i=0;i<5;i++){\n\t\t\t//System.out.println(\"\");\n\t\t\tfor(int j=0;j<5;j++){\n\t\t\t\t\n\t\t\t\t//System.out.print(adj_matrix[i][j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//dijkstra(edges1);\n\t\t//System.out.print(edges2);\n\t\t//System.out.println(\"Ehtesham\");\n\t\tArrayList<ArrayList<Integer>> finalpaths = dijkstra(adj_matrix);\n\t\t for (ArrayList<Integer> item : finalpaths) { \n\t\t\t System.out.println(\"\");\n\t\t\t \tfor(Integer node: item)\n\t\t\t \t{\t\n\t\t\t \t\tSystem.out.print(Int2String.get(node)+\"->\");\n\t\t\t \t}\n\t\t\n\t\t }\n\t\t int cost = 210;\n\t\t int time = 190;\n\t\t //ArrayList<ArrayList<Integer>> finalp1aths1 = Pathinbound(finalp1aths1);\n\t\t ArrayList<ArrayList<Integer>> finalp1aths1 = Pathinbound(NHMap,EHMap,finalpaths,cost,time);\n\t\t System.out.println(\"\");\n\t\t System.out.println(\"-----------------------------Final answer-------------------------------\");\n\t\t for (ArrayList<Integer> item : finalp1aths1) { \n\t\t\t\tSystem.out.println(item);\n\t\t\t\t\n\t\t }\n\t\t\t\t \n\t}", "private static Map<DiscreteState,Double> createMap(int vectSize, int mapSize) {\n\t\tMap<DiscreteState,Double> map = new HashMap<DiscreteState,Double>();\n\t\tint n = (int) Math.min(mapSize, Math.pow(2, vectSize));\n\t\twhile (map.size() < n) {\n\t\t\tdouble[] addition = new double[vectSize];\n\t\t\tfor (int i = 0; i < vectSize; i++) addition[i] = Math.round(Math.random());\n\t\t\tmap.put(new DiscreteState(addition), Math.random());\n\t\t}\n\t\treturn map;\n\t}", "private static void createMap(Map<Character, Integer> map) {\n Scanner scanner = new Scanner(System.in); // create scanner\n System.out.println(\"Enter a string:\"); // prompt for user input\n String input = scanner.nextLine();\n\n char[] chars = input.replace(\" \", \"\").toCharArray();\n\n for (Character chr : chars) {\n if (map.containsKey(chr)) {\n int count = map.get(chr); // get current count\n map.put(chr, count + 1); // increment count\n } else\n map.put(chr, 1); // add new char with a count of 1 to map\n }\n }", "private static double exerciseMap(int threadCount, int perThread, int range, \n final OurMap<Integer, String> map) {\n Thread[] threads = new Thread[threadCount];\n for (int t=0; t<threadCount; t++) {\n final int myThread = t;\n threads[t] = new Thread(() -> {\n Random random = new Random(37 * myThread + 78);\n for (int i=0; i<perThread; i++) {\n Integer key = random.nextInt(range);\n if (!map.containsKey(key)) {\n // Add key with probability 60%\n if (random.nextDouble() < 0.60) \n map.put(key, Integer.toString(key));\n } \n else // Remove key with probability 2% and reinsert\n if (random.nextDouble() < 0.02) {\n map.remove(key);\n map.putIfAbsent(key, Integer.toString(key));\n }\n }\n final AtomicInteger ai = new AtomicInteger();\n map.forEach(new Consumer<Integer,String>() { \n public void accept(Integer k, String v) {\n ai.getAndIncrement();\n }});\n // System.out.println(ai.intValue() + \" \" + map.size());\n });\n }\n for (int t=0; t<threadCount; t++) \n threads[t].start();\n map.reallocateBuckets();\n try {\n for (int t=0; t<threadCount; t++) \n threads[t].join();\n } catch (InterruptedException exn) { }\n return map.size();\n }", "public static void main(String[] args) {\n\t\tMap map = new Map();\n\t\tHashMap<Integer,Integer> hashmap = new HashMap<>();\n\t\tmap.addValue(11);\n\t\tmap.addValue(12);\n\t\tmap.addValue(13);\n\t\tmap.updateValue(2, 100);\n\t\tmap.removeData(1);\n\t\thashmap = map.getAllData();\n\t\t\n\t\tSystem.out.println(hashmap);\n\t}", "public MapSum() {\n map = new HashMap<>();\n }", "public abstract java.util.Map<java.lang.Double, java.util.List<java.lang.Integer>> pnlListMap();", "public static void func(){\n\t\tHashMap<Integer,Integer> map = new HashMap<Integer,Integer>();\n\t\tint limit = 1000;\n\t\tboolean psb[] = generatePrime(limit);\n\t\t\n\t\tint ps[] = MathTool.generatePrime(100000);\n\t\tfor (int i = 1; ps[i]<1000; i++) {\n\t\t\t//System.out.println(ps[i]);\n\t\t}\n\t\tint max=0;\n\t\tfor (int i = 0; ps[i] < limit; i++) {\n\t\t\tint n = ps[i];\n\t\t\tint j=i;\n\t\t\twhile(n<limit){\n\t\t\t\tif(!psb[n]){\n\t\t\t\t\tint num =j-i+1;\n\t\t\t\t\tif(map.containsKey(n)){\n\t\t\t\t\t\tif(map.get(new Integer(n)) < num){\n\t\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t}\n\t\t\t\t\tif(num > max){\n\t\t\t\t\t\tmax=num;\n\t\t\t\t\t\tSystem.out.println(num+\" \"+n+\" \"+i+\" \"+j);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t\tn+=ps[j];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n int[][] map = new int[N][N];\r\n // 1D to 2D index map\r\n CustomPair[] indToVal = new CustomPair[(N * N) + 1];\r\n // 2D to value map\r\n Map<CustomPair, Integer> gridToValue = new HashMap<>();\r\n // Direction to start\r\n Direction dir = Direction.RIGHT;\r\n int j = 1;\r\n int y = N / 2;\r\n // shift left for even n's\r\n int x = (N % 2 == 0) ? y - 1 : y;\r\n /**\r\n * We use y, x here because the grid is sort of turned around.\r\n * */\r\n while(j <= ((N * N))) {\r\n CustomPair currentIndex = new CustomPair(y, x);\r\n // if the number is not prime it is traversable\r\n if (!isPrime(j)) {\r\n map[y][x] = 1;\r\n gridToValue.put(currentIndex, j);\r\n } else {\r\n map[y][x] = -1;\r\n }\r\n // add the value to 1d to 2d index values\r\n indToVal[j] = currentIndex;\r\n switch(dir){\r\n case RIGHT:\r\n if(x <= (N - 1) && map[y - 1][x] == 0 && j > 1)\r\n dir = Direction.UP;\r\n break;\r\n case UP:\r\n if(map[y][x - 1] == 0)\r\n dir = Direction.LEFT;\r\n break;\r\n case LEFT:\r\n if(x == 0 || map[y + 1][x] == 0)\r\n dir = Direction.DOWN;\r\n break;\r\n case DOWN:\r\n if(map[y][x + 1] == 0)\r\n dir = Direction.RIGHT;\r\n break;\r\n }\r\n // update the grid index\r\n switch(dir){\r\n case RIGHT:\r\n x++;\r\n break;\r\n case UP:\r\n y--;\r\n break;\r\n case LEFT:\r\n x--;\r\n break;\r\n case DOWN:\r\n y++;\r\n break;\r\n }\r\n // update 1D index\r\n j++;\r\n }\r\n\r\n Scanner sc = new Scanner(System.in);\r\n int caseNum = 1;\r\n while (sc.hasNextInt()) {\r\n int start = sc.nextInt();\r\n int goal = sc.nextInt();\r\n // find the shortest path\r\n Queue<CustomPair> q = new LinkedList<>();\r\n // 2D grid to distance values\r\n Map<CustomPair, Integer> distMap = new HashMap<>();\r\n // start is 0\r\n distMap.put(indToVal[start], 0);\r\n q.add(indToVal[start]);\r\n while (!q.isEmpty()) {\r\n CustomPair cur = q.remove();\r\n // for each neighbour (4 potential moves)\r\n for (int i = 0; i < 4; i++) {\r\n int nx = cur.a + X_NEIG_INDEX[i];\r\n int ny = cur.b + Y_NEIG_INDEX[i];\r\n CustomPair neighP = new CustomPair(nx, ny);\r\n // if the value is not in the grid\r\n if (!gridToValue.containsKey(neighP))\r\n continue;\r\n // if the value is already visited\r\n if (distMap.containsKey(neighP))\r\n continue;\r\n distMap.put(neighP, distMap.get(cur) + 1);\r\n q.add(neighP);\r\n }\r\n }\r\n // print for Kattis reasons\r\n String msg = \"Case \" + caseNum + \": \";\r\n if (!distMap.containsKey(indToVal[goal]) ||\r\n distMap.getOrDefault(indToVal[goal], -1) == -1 && start != goal)\r\n System.out.println(msg + \" impossible\");\r\n else\r\n System.out.println(msg + \"\" + distMap.get(indToVal[goal]));\r\n caseNum++;\r\n }\r\n }", "AdaptiveProbMap(int n, int rate) \n {\n this.rate = rate;\n this.data = new int[n*33];\n\n for (int i=0, k=0; i<n; i++, k+=33)\n {\n for (int j=0; j<33; j++)\n this.data[k+j] = (i == 0) ? Global.squash((j-16)<<7) << 4 : this.data[j];\n }\n }", "private static void testMap(final OurMap<Integer, String> map) {\n System.out.printf(\"%n%s%n\", map.getClass());\n assert map.size() == 0;\n assert !map.containsKey(117);\n assert !map.containsKey(-2);\n assert map.get(117) == null;\n assert map.put(117, \"A\") == null;\n assert map.containsKey(117);\n assert map.get(117).equals(\"A\");\n assert map.put(17, \"B\") == null;\n assert map.size() == 2;\n assert map.containsKey(17);\n assert map.get(117).equals(\"A\");\n assert map.get(17).equals(\"B\");\n assert map.put(117, \"C\").equals(\"A\");\n assert map.containsKey(117);\n assert map.get(117).equals(\"C\");\n assert map.size() == 2;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n assert map.remove(117).equals(\"C\");\n assert !map.containsKey(117);\n assert map.get(117) == null;\n assert map.size() == 1;\n assert map.putIfAbsent(17, \"D\").equals(\"B\");\n assert map.get(17).equals(\"B\");\n assert map.size() == 1;\n assert map.containsKey(17);\n assert map.putIfAbsent(217, \"E\") == null;\n assert map.get(217).equals(\"E\");\n assert map.size() == 2;\n assert map.containsKey(217);\n assert map.putIfAbsent(34, \"F\") == null;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n }", "private void storeValues(int source,\n Map<VWBetw, Double> map,\n DiskBufferDriver output) throws DriverException {\n for (Entry<VWBetw, Double> e : map.entrySet()) {\n storeValue(source, e.getKey().getID(), e.getValue(), output);\n }\n }", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "private int map(String key) throws Exception\n {\n if (key == null)\n {\n throw new Exception(\"Invalid value passed to map\");\n }\n\n return 0 % hashMapSize;\n }", "public static void main(String[] args) {\n\r\n for (int i = 0; i < 10; i++) {\r\n Hashmap[i] = 0;\r\n }\r\n try {\r\n Scanner input = new Scanner(System.in);\r\n System.out.println(\"Enter the number you want to store in the map\");\r\n for (int j = 0; j < 10; j++) {\r\n int Number = input.nextInt();\r\n int UniCode = Number % 10;\r\n\r\n if (Hashmap[UniCode] == 0) {\r\n Hashmap[UniCode] = Number;\r\n } else {\r\n while (Hashmap[UniCode] != 0) {\r\n UniCode++;\r\n if (UniCode > 9) {\r\n UniCode = 0;\r\n }\r\n }\r\n Hashmap[UniCode] = Number;\r\n }\r\n }\r\n System.out.println(\"Enter the number you want to crosscheck\");\r\n int SearchNumber = input.nextInt();\r\n int SearchMatch = Search(SearchNumber, Hashmap);\r\n\r\n System.out.println(\"Enter the number you want to delete\");\r\n int DeleteNumber = input.nextInt();\r\n SearchMatch = Search(DeleteNumber, Hashmap);\r\n Hashmap[SearchMatch] = 0;\r\n\r\n System.out.println(\"The numbers Stored are\");\r\n for (int i = 0; i < 10; i++) {\r\n System.out.println(+Hashmap[i]);\r\n }\r\n\r\n } catch (NullPointerException e) {\r\n System.out.println(\" map\");\r\n }\r\n }", "@Test\n public void test10() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n cashRegister.addPennies(199);\n map1.put(1,199);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(2);\n map1.put(10,2);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(3);\n map1.put(10,5);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addFives(10);\n map1.put(500,10);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addNickels(4);\n map1.put(5,4);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addOnes(1);\n map1.put(100,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addQuarters(1);\n map1.put(25,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addTens(5);\n map1.put(1000,5);\n assertEquals(map1, cashRegister.getContents());\n }", "public void inc(String key) { \n \t//a 1 b 1 a 2\n // get key and update\n int val=\tmap.getOrDefault(key, 0)+1;\n if(val>max) {\n \t max=val;\n \t maxkey=key;\n }\n if(val==1||val<min) {\n \t min=val;\n \t minkey=key;\n }\n \t map.put(key,val); \t\n }", "public Map(){\n this.matrix = new int[10][10];\n }", "@Override\n\tpublic void updateMemory(Map map) {\n\t\tif(!memory.used)\n\t\t\treset(map);\n\t\tspiral();\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint N,K,i,value,count=0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tHashMap<Integer,Integer> hmap = new HashMap<Integer,Integer>();\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\t\n\t\tfor(i=0;i<N;i++)\n\t\t{\n\t\t\tvalue = sc.nextInt();\n\t\t\tint key = K - value;\n\t\t\tif(hmap.containsKey(key))\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t\tSystem.out.println(key + \" - \"+value);\n\t\t\t}\n\t\t\thmap.put(value, 1);\n\t\t}\n\t\tSystem.out.println(count);\n\t}", "public CountingMap( Map<K, Integer> map ) {\n this.map = map;\n }", "private void initMaps()\r\n\t{\r\n\t\tenergiesForCurrentKOppParity = new LinkedHashMap<Integer, Double>();\r\n\t\tinputBranchWithJ = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedR = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedP = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedQ = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularP = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularQ = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularR = new LinkedHashMap<Integer, Double>();\r\n\t\tupperEnergyValuesWithJ = new LinkedHashMap<Integer, Double>();\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tMap<Integer,Employee> map = new HashMap<Integer, Employee>();\n\t\tMap<String, Employee> hashMap = new HashMap();\n\t\tMap<Employee, Integer> hashMap1 = new HashMap();\n\t\tfor (int i =1; i<=10; i++){\n\t\t\t\n\t\t\tmap.put(i, new Employee(i+3, \"Manish\"+(i+3)));\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tEmployee emp1 = new Employee(4, \"Manish3\");\n\t\t//Use of Contains\n\t\tSystem.out.println(map.containsValue(emp1)); \n\t\t\n\t\t//Key Set\n\t\tSystem.out.println(map.keySet());\n\t\t\n\t\t//retrieve entry set\n\t\tSystem.out.println(map.entrySet());\n\t\t\n\t\t//map.forEach(action);; TO DO- need to understand this method\n\t\t\n\n\t\t//Returns in sorted order when Key is natural (permitives or String or Enum)\n\t\thashMap.put(\"A\", new Employee(1, \"Manish\"));\n\t\thashMap.put(\"C\", new Employee(3, \"Gaurav\"));\n\t\thashMap.put(\"B\", new Employee(2, \"Vinay\"));\n\t\tSystem.out.println(hashMap);\n\t\t\n\t\t//maintains insertion order when key is Object type(dont have any natural order)\n\t\thashMap1.put(new Employee(1, \"Manish\"),1);\n\t\thashMap1.put(new Employee(3, \"Gaurav\"),3);\n\t\thashMap1.put(new Employee(2, \"Vinay\"),2);\n\t\tSystem.out.println(hashMap1);\n\t\tHashMap<Long, String> masterRoomPoolMapping = new HashMap<Long, String>();\n\t\tmasterRoomPoolMapping.put(new Long(123), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(124), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(125), \"Manish\");\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSet<Long> keySet = masterRoomPoolMapping.keySet();\n\t\tSet<Long> newKeySet = new HashSet<Long>();\n\t\tfor(Long key : keySet){\n\t\t\tnewKeySet.add(new Long(key));\n\t\t}\n\t\tSystem.out.println(\"newKeySet***************************************************\");\n\t\tif(newKeySet.contains(new Long(123)))\n\t\t\tnewKeySet.remove(new Long(123));\n\t\tfor(Long key : newKeySet){\n\t\t\tSystem.out.println(key);\n\t\t}\n\t\tSystem.out.println(\"keySet1***************************************************\");\n\t\tSet<Long> keySet1 = masterRoomPoolMapping.keySet();\n\t\tfor(Long key : keySet1){\n\t\t\tSystem.out.println(masterRoomPoolMapping.get(key));\n\t\t}\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSystem.out.println(masterRoomPoolMapping);\n\t}", "public static void main(String[] args) {\n\n Map<Integer, String> map = new HashMap<>();\n\n for (int i = 0; i < 10; i++) {\n map.putIfAbsent(i, \"val\" + i);\n }\n\n map.forEach((id, val) -> System.out.println(id + \": \" + val));\n\n// This example shows how to compute code on the map by utilizing functions:\n\n map.computeIfPresent(3, (num, val) -> val + num);\n map.get(3); // val33\n\n map.computeIfPresent(9, (num, val) -> null);\n map.containsKey(9); // false\n\n map.computeIfAbsent(23, num -> \"val\" + num);\n map.containsKey(23); // true\n\n map.computeIfAbsent(3, num -> \"bam\");\n map.get(3); // val33\n\n\n// Next, we learn how to remove entries for a given key, only if it's currently mapped to a given value:\n\n map.remove(3, \"val3\");\n map.get(3); // val33\n\n map.remove(3, \"val33\");\n map.get(3); // null\n\n\n// Another helpful method:\n\n map.getOrDefault(42, \"not found\"); // not found\n\n\n// Merging entries of a map is quite easy:\n\n map.merge(9, \"val9\", (value, newValue) -> value.concat(newValue));\n map.get(9); // val9\n\n map.merge(9, \"concat\", (value, newValue) -> value.concat(newValue));\n map.get(9); // val9concat\n// Merge either put the key/value into the map if no entry for the key exists, or the merging function will be called to change the existing value.\n\n\n }", "@Override\r\n\tpublic Integer[] getDynamicMapVariables() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Integer[] getDynamicMapVariables() {\n\t\treturn null;\r\n\t}", "public static void main(String[] args) {\n String [] ar = {\"String\", \"A\"};\n Integer [] arr = {5,43,2,1, 1,1, 5,43};\n Map<Integer,Integer>map = new HashMap<>();\n\n for (int i = 0; i <arr.length ; i++) {\n if (map.containsKey(arr[i])){\n map.put(arr[i], map.get(arr[i])+1);\n } else {\n map.put(arr[i], 1);\n }\n }\n\n System.out.println(map);\n\n// System.out.println(ExampleLesson9.findMin(ar));\n// System.out.println(ExampleLesson9.findMin(arr));\n }", "private void hashMapPutPlusOne(Map<String, Integer> map, String key) {\n Integer value = map.get(key);\n if (value == null)\n map.put(key, 1);\n else\n map.put(key, value + 1);\n }", "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 static void main(String[] args) \r\n {\n TreeMap<Employee, Integer> hashMap = new TreeMap<Employee, Integer>(); \r\n \r\n // Mapping string values to int keys \r\n hashMap.put(new Employee(10,\"uday\"), 10); \r\n hashMap.put(new Employee(11,\"uday\"), 11); \r\n hashMap.put(new Employee(12,\"uday\"), 12); \r\n hashMap.put(new Employee(13,\"uday\"), 13); \r\n \r\n for (Entry<Employee, Integer> e : hashMap.entrySet()) \r\n System.out.println(e.getKey().toString() + \" \" + e.getValue()); \r\n \r\n HashMap<String, Integer> map = new HashMap<>(); \r\n \r\n }", "public void add(int number) {\n // Write your code here\n if(map.containsKey(number)){\n map.put(number, map.get(number) + 1);\n }else{\n list.add(number);\n map.put(number, 1);\n }\n }", "public static void main(String[] args) {\n\t\tString[] arr= new String[]{\"insert\", \n\t\t\t\t \"insert\", \n\t\t\t\t \"addToKey\", \n\t\t\t\t \"addToKey\", \n\t\t\t\t \"addToKey\", \n\t\t\t\t \"insert\", \n\t\t\t\t \"addToValue\", \n\t\t\t\t \"addToKey\", \n\t\t\t\t \"addToKey\", \n\t\t\t\t \"get\"};\n\t\tint[][] arr1=new int[][] {{-5,-2}, \n\t\t\t {2,4}, \n\t\t\t {-1}, \n\t\t\t {-3}, \n\t\t\t {1}, \n\t\t\t {3,-2}, \n\t\t\t {-4}, \n\t\t\t {-2}, \n\t\t\t {2}, \n\t\t\t {-8}}; \n\t\tHashMapNew vik= new HashMapNew();\n\t\tSystem.out.println(\"The answer is: \" + vik.createHashMap(arr, arr1));\n\t\t\n\t}", "private int mapping(int p, int q) {\n if (p < 1 || q < 1)\n throw new IllegalArgumentException(\"either p or q or both are below 1\");\n// return -1;\n int k = count * (p - 1) + q - 1;\n return k;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int tripCount = sc.nextInt();\n for(int i=0;i<tripCount;i++){\n int totalMoney = sc.nextInt();\n int flavorCount = sc.nextInt();\n Map<Integer,Integer> costMap = new HashMap<Integer,Integer>();\n for(int j=0;j<flavorCount;j++){\n int cur = sc.nextInt();\n if(costMap.containsKey(totalMoney-cur)){\n int firstIdx = costMap.get(totalMoney-cur)+1;\n int secondIdx = j +1;\n System.out.println(firstIdx +\" \"+secondIdx);\n }\n costMap.put(cur,j);\n }\n }\n }", "public static void main(String[] args) throws IOException {\n Map<String, Integer> map = new HashMap<>();\n map.put(\"A\", 9);\n map.put(\"B\", 4);\n map.put(\"C\", 8);\n map.put(\"D\", 6);\n map.put(\"E\", 5);\n map.put(\"F\", 3);\n map.put(\"G\", 7);\n map.put(\"H\", 2);\n map.put(\"I\", 1);\n map.put(\"J\", 0);\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int count = Integer.parseInt(br.readLine());\n int[] eng = new int[count];\n for (int i = 0; i < count; i++) {\n String s = br.readLine();\n StringBuilder temp = new StringBuilder();\n for (int j = 0; j < s.length(); j++) {\n temp.append(map.get(String.valueOf(s.charAt(j))));\n }\n eng[i] = Integer.parseInt(temp.toString());\n }\n\n int result = 0;\n for (int element : eng) {\n result += element;\n }\n System.out.println(result);\n }", "private void generateMap () {\n for (int i = 0 ; i < n ; i++) {\n mapCoordinate[i] = new CoordinateInfo(100 * random.nextFloat(), 100 * random.nextFloat());\n\n for (int j = 0 ; j <= i ; j++) {\n mapDistance[i][j] = mapDistance[j][i] = getDistance(mapCoordinate[i], mapCoordinate[j]);\n }\n }\n }", "public Map<Integer, Integer> generateMap(int size){\n Map<Integer, Integer> data = new HashMap<>();\n for (int i = 0; i < size; i++){\n data.put(i, i);\n }\n return data;\n }", "@Override\n\tpublic HashMap<Position, Node> generate(){\n\t\tNode tempNode;\n\t\tPosition tempPosition;\n\t\tif(map != null && map.isEmpty()){\n\t\t\tfor(int y=0; y<numNodesY; y++){\n\t\t\t\tfor(int x=0; x<numNodesX; x++){\n\t\t\t\t\ttempPosition = new Position(x*nodeDistance, \n\t\t\t\t\t\t\ty*nodeDistance);\n\t\t\t\t\ttempNode = new Node(field, tempPosition,\n\t\t\t\t\t\t\tnodeSignalStrength,\n\t\t\t\t\t\t\tagentLife,\n\t\t\t\t\t\t\trequestLife);\n\t\t\t\t\tmap.put(tempPosition, tempNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new HashMap<Position, Node>(map);\n\t}", "public void generate()\n {\n System.out.println(\"Initial allocated space for Set: Not supported\");\n// System.out.println(\"Initial allocated space for Set: \" + theMap.capacity());\n final long startTime = TimeUtils.nanoTime();\n Mnemonic m = new Mnemonic(123456789L);\n// GridPoint2 gp = new GridPoint2(0, 0);\n for (int x = -width; x < width; x++) {\n for (int y = -height; y < height; y++) {\n// for (int z = -height; z < height; z++) {\n\n// long z = (x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL);\n// z = ((z & 0x00000000ffff0000L) << 16) | ((z >>> 16) & 0x00000000ffff0000L) | (z & 0xffff00000000ffffL);\n// z = ((z & 0x0000ff000000ff00L) << 8 ) | ((z >>> 8 ) & 0x0000ff000000ff00L) | (z & 0xff0000ffff0000ffL);\n// z = ((z & 0x00f000f000f000f0L) << 4 ) | ((z >>> 4 ) & 0x00f000f000f000f0L) | (z & 0xf00ff00ff00ff00fL);\n// z = ((z & 0x0c0c0c0c0c0c0c0cL) << 2 ) | ((z >>> 2 ) & 0x0c0c0c0c0c0c0c0cL) | (z & 0xc3c3c3c3c3c3c3c3L);\n// z = ((z & 0x2222222222222222L) << 1 ) | ((z >>> 1 ) & 0x2222222222222222L) | (z & 0x9999999999999999L);\n// theMap.put(z, null); // uses 23312536 bytes of heap\n// long z = szudzik(x, y);\n// theMap.put(z, null); // uses 18331216 bytes of heap?\n// unSzudzik(pair, z);\n// theMap.put(0xC13FA9A902A6328FL * x ^ 0x91E10DA5C79E7B1DL * y, null); // uses 23312576 bytes of heap\n// theMap.put((x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL), null); // uses 28555456 bytes of heap\n theMap.add(new Vector2(x - width * 0.5f, y - height * 0.5f)); // crashes out of heap with 720 Vector2\n// gp.set(x, y);\n// theMap.add(gp.hashCode());\n// long r, s;\n// r = (x ^ 0xa0761d65L) * (y ^ 0x8ebc6af1L);\n// s = 0xa0761d65L * (z ^ 0x589965cdL);\n// r -= r >> 32;\n// s -= s >> 32;\n// r = ((r ^ s) + 0xeb44accbL) * 0xeb44acc8L;\n// theMap.add((int)(r - (r >> 32)));\n\n// theMap.add(m.toMnemonic(szudzik(x, y)));\n }\n }\n// }\n// final GridPoint2 gp = new GridPoint2(x, y);\n// final int gpHash = gp.hashCode(); // uses the updated GridPoint2 hashCode(), not the current GDX code\n// theMap.put(gp, gpHash | 0xFF000000); //value doesn't matter; this was supposed to test ObjectMap\n //theMap.put(gp, (53 * 53 + x + 53 * y) | 0xFF000000); //this is what the hashCodes would look like for the current code\n \n //final int gpHash = x * 0xC13F + y * 0x91E1; // updated hashCode()\n //// In the updated hashCode(), numbers are based on the plastic constant, which is\n //// like the golden ratio but with better properties for 2D spaces. These don't need to be prime.\n \n //final int gpHash = 53 * 53 + x + 53 * y; // equivalent to current hashCode()\n long taken = TimeUtils.timeSinceNanos(startTime);\n System.out.println(taken + \"ns taken, about 10 to the \" + Math.log10(taken) + \" power.\");\n// System.out.println(\"Post-assign allocated space for Set: \" + theMap.capacity());\n System.out.println(\"Post-assign allocated space for Set: Not supported\");\n }", "public static void main(String[] args) {\n HashMap<String, Integer> productMap = new HashMap<>();\n createMap(productMap);\n\n System.out.println(\"How much is the fish?\");\n System.out.println(productMap.get(\"Fish\"));\n System.out.println(\"What is the most expensive product?\");\n System.out.println(mostExpensive(productMap));\n System.out.println(\"What is the average price?\");\n System.out.println(averagePrice(productMap));\n System.out.println(\"How many products' price is below 300?\");\n System.out.println(below300(productMap));\n System.out.println(\"Is there anything we can buy for exactly 125?\");\n if (productMap.containsValue(125)) {\n System.out.println(\"Yes, we can buy something for exactly 125.\");\n } else {\n System.out.println(\"No, there is nothing for exactly 125.\");\n }\n System.out.println(\"What is the cheapest product?\");\n System.out.println(cheapest(productMap));\n System.out.println(\"Which products cost less than 201?\");\n System.out.println(lessThan201(productMap));\n System.out.println(\"Which products cost more than 150?\");\n System.out.println(moreThan150(productMap));\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s = \"asdfasdfafk asd234asda\";\n\t //Map<Character, Integer> charMap = new HashMap<Character, Integer>();\n\t \n\t Map<Character,Integer> map = new HashMap<Character,Integer>();\n\t for (int i = 0; i < s.length(); i++) {\n\t char c = s.charAt(i);\n\t System.out.println(c);\n\t //if (Character.isAlphabetic(c)) {\n\t if (map.containsKey(c)) {\n\t int cnt = map.get(c);\n\t System.out.println(cnt);\n\t map.put(c,++cnt);\n\t } else {\n\t map.put(c, 1);\n\t }\n\t \n\t }\n\t // }\n\t System.out.println(map);\n\t \n\t \n\t /* char[] arr = str.toCharArray();\n\t System.out.println(arr);\n\t \n\n\t\t\n\t\tfor (char value: arr) {\n\t\t \n\t\t if (Character.isAlphabetic(value)) { \n\t\t\t if (charMap.containsKey(value)) {\n\t\t charMap.put(value, charMap.get(value) + 1);\n\t\t \n\t\t } \n\t\t\t else { charMap.put(value, 1); \n\t\t } \n\t\t\t } \n\t\t }\n\t\t \n\t\t System.out.println(charMap);*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n \t}", "HashMap<String,Integer> mapCode(String[] splitwords){\n\t\t\tHashMap<String,Integer> wordsOfCode= new HashMap<String,Integer>();\n\t\t\tLovinsStemmer nonSuffixes=new LovinsStemmer();\n\t\t\t//PorterStemmer nonSuffixes=new PorterStemmer();\n\t\t\tint num=0;\n\t\t\tfor(int i=0; i<splitwords.length;i++) {\n\t\t\t\tString temp=nonSuffixes.stem(splitwords[i]);\n\t\t\t\tif(!totalWords.containsKey(temp)) {\n\t\t\t\t\ttotalWords.put(temp, num);\n\t\t\t\t\t\n\t\t\t\t\twordsOfCode.put(temp,num);\n\t\t\t\t\tnum++;\n\t\t\t\t}else if(!wordsOfCode.containsKey(temp)) {\n\t\t\t\t\twordsOfCode.put(temp,totalWords.get(temp));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn wordsOfCode;\n\t\t\t\n\t\t}", "private static void addOrIncrement(HashMap<Pair<String, String>, Integer> m, Pair<String, String> p){\n // In python, this is a defaultdict.\n if(!m.containsKey(p)){\n m.put(p, 0);\n }\n m.put(p, m.get(p)+1);\n }", "void mapChosen(int map);", "public static void main(String[] args) {\n\n\t\tint[] a = {1,2,3,8,8,9,6,4};\n\t String s = \"hello2java\"; \n\t\tHashMap<Integer,Integer> countMap1 = new HashMap<Integer,Integer>();\n\t\tHashMap<Character,Integer> countMap2 = new HashMap<Character,Integer>();\n \n\t\tchar[] ch = s.toCharArray();\n\t\t\n\t\t\tfor(int i=0;i<a.length;i++){\n\t\t\t\tif(countMap1.containsKey(a[i])){\n\t\t\t\t\tcountMap1.put(a[i], countMap1.get(a[i])+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcountMap1.put(a[i],1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//}\n\t\tSystem.out.println(countMap1);\n\t\t\n\t\tfor(int i=0;i<ch.length;i++){\n\t\t\tif(countMap2.containsKey(ch[i])){\n\t\t\t\tcountMap2.put(ch[i], countMap2.get(ch[i])+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap2.put(ch[i],1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(countMap2);\n\t\t\n\t\tSet<Character> ket = countMap2.keySet();\n for(Character c:ket){\n \tif(countMap2.get(c)>1){\n \t\tSystem.out.println(c+\"-->\"+countMap2.get(c));\n \t}\n }\n\t}", "private void calculateMapSize() {\n calculateMapSize(true);\n }", "private void createMaps() {\r\n\t\tint SIZE = 100;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tshipStateMap.put(new Point(x, y), 0);\r\n\t\t\tshipTypeMap.put(new Point(x, y), 0);\r\n\t\t\tx++;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void populate_map() {\n\t\t//Arrange\n\t\t//testSteve.populateProductMap();\n\t\t\n\t\t//Act\n\t\ttestSteve.populateProductMap();\n\t\t\n\t\t//Assert\n\t\tAssert.assertEquals(testSteve.getProductGenerator().size(), (16));\n\t}", "@Test\n public void test4 ()\n {\n MyMap m = new MyMap();\n int SIZE = 10000;\n \n // Add SIZE mappings\n for (int i = 0; i < SIZE; i++)\n {\n m.put(i+\"\", (i*17)+\"\");\n }\n \n // Add some of the keys again with new values.\n for (int i = 0; i < SIZE; i+=2)\n {\n m.put(i+\"\", (i*18)+\"\");\n }\n \n // Remove every third element.\n for (int i = 0; i < SIZE; i += 3)\n {\n m.remove(i+\"\");\n }\n \n // Remove some of them again. This should make no difference.\n for (int i = 0; i < SIZE; i += 6)\n {\n m.remove(i+\"\");\n }\n \n // Assert that the size is as expected\n assertEquals(SIZE - (int) Math.ceil(SIZE / 3.0), m.size());\n \n // Assert that membership is as expected\n for (int i = 0; i < SIZE; i++)\n {\n if (i%3 == 0)\n {\n assertNull(m.get(i+\"\"));\n }\n else if (i%2 == 0)\n {\n assertEquals((i*18)+\"\", m.get(i+\"\"));\n }\n else\n {\n \tassertEquals((i*17)+\"\", m.get(i+\"\"));\n }\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tHashMap <Character, Integer> lhmap = new LinkedHashMap<Character, Integer>();\n\t\t\n\t\t\tString nom = \"Javier del Moral Asensio\";\n\t\t\tchar[] myName= nom.toLowerCase().toCharArray();\n\t\t\n\t\t//for loop to check characters one by one and sum it if are repeated\n\t\t\t\t\n\t\t\tfor(int c=0; c < nom.length(); c++) {\n\t\t\t\n\t\t\t\tint value=1;\n\t\t\n\t\t//if the char is new store it\n\t\t\t\t\n\t\t\t\tif(lhmap.containsKey(myName[c]) == false) {\n\t\t\t\t\tlhmap.put(myName[c], value);\n\t\t\t\t\t\n\t\t//if is not +1 to the original char\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tvalue = lhmap.get(myName[c]);\n\t\t\t\t\tlhmap.put(myName[c], value+1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\tSystem.out.println(lhmap);\t\t\n\n\t}", "@Override\n public void record2Map(final Map<String, Integer> map) {\n }", "public void addToMap(){\n\t\tInteger hc = currentQuery.hashCode();\n\t\tif (!hmcache.containsKey(hc)) {\n\t\t\thmcache.put(hc, 0);\n\t\t}else{\n\t\t\tInteger val = hmcache.get(hc) + (currentQuery.getWords().size());\n\t\t\thmcache.put(hc, val);\n\t\t}\n\t}", "private void insertIntegers(Map<String,Integer> mapValues) {\n mapFieldsIntegers.putAll(mapValues);\n }", "private static void addEntriesToMap(\n\t\tMap<Character,Integer> map,String toSort, String poolOfOccurances\n\t\t){\n\n\t\t//Loop the toStort\n\t\tfor(int i=0;i<toSort.length();i++){\n\t\t\tmap.put(toSort.charAt(i),new Integer(getCharacterFrequence(toSort.charAt(i),poolOfOccurances)));\n\t\t}\n\n\t}", "private void updateCountersOfMap(final Map<String, Integer> map, final String key) {\n Integer visitTimes = map.get(key);\n visitTimes = (visitTimes != null ? visitTimes : 0);\n map.put(key, visitTimes + 1);\n }", "public void add(int number) {\n // Write your code here\n if(map.containsKey(number)) {\n map.put(number, map.get(number) + 1);\n }else {\n map.put(number, 1);\n }\n }", "public static void main(String [] args){\n Map m = new HashMap();\n m.put(\"Tim\", 5);\n m.put(\"Joe\", \"x\");\n m.put(\"11\", 999);\n System.out.println(m);\n System.out.println(m.get(\"Tim\"));\n }", "public void set_map(int[][] map) \n\t{\n\t\tthis.map = map;\n\t}", "private static void simpleMapExamples() {\n\t\tSystem.out.println(\"simpleMapExamples Start ----\");\n\t\t\n\t\tMap<String,Integer> mapEx1 = new HashMap<>();\n\t\t\n\t\tmapEx1.put(\"Amit\", 35);\n\t\tmapEx1.put(\"Gunjan\", 45);\n\t\tmapEx1.put(\"Vidut\", 55);\n\t\t\n\t\t//Loop over Map\n\t\tfor(Entry<String, Integer> entry : mapEx1.entrySet()) {\n\t\t\t\n\t\t\tString key = entry.getKey();\n\t\t\tInteger val = entry.getValue();\n\t\t\t\n\t\t\tSystem.out.println(\"KEY : \" + key + \" : VAL : \" + val);\n\t\t\t\n\t\t}\n\t\t\n\t\t//API to get collection of values from the map\n\t\tCollection<Integer> values = mapEx1.values();\n\t\t\n\t\t//Now browse over collection values using java8 lambda\n\t\tSystem.out.println(\"Printing values ...\");\n\t\tvalues.forEach((val) -> System.out.println(val));\n\t\t\n\t\t//Replace values in the map using \n\t\t//Here we are replacing each key's value to 46\n\t\tmapEx1.replaceAll(( s, i) -> {\n\t\t\treturn 46;\n\t\t});\n\t\t\n\t\tSystem.out.println(\"Printing after firing replaceAll...\");\n\t\t//Now print the key/value pair of map using lambda\n\t\tmapEx1.forEach((k,v) -> {\n\t\t\tSystem.out.println(\"Key : \" + k + \" Val \" + v);\n\t\t});\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"simpleMapExamples End ----\");\n\t}", "private void generateMaps() {\r\n\t\tthis.tablesLocksMap = new LinkedHashMap<>();\r\n\t\tthis.blocksLocksMap = new LinkedHashMap<>();\r\n\t\tthis.rowsLocksMap = new LinkedHashMap<>();\r\n\t\tthis.waitMap = new LinkedHashMap<>();\r\n\t}", "private static void incExp(Map<Integer, Integer> map, int prime, int by) {\n \tif (by > 0) {\n \t\tInteger n = map.get(prime);\n \t\tif (n == null)\n \t\t\tmap.put(prime, by);\n \t\telse\n \t\t\tmap.put(prime, n+by);\n \t}\n }", "public int allocate_map()\n {\n int size = MAX_PID - MIN_PID;\n //allocating memory for the pid map\n pid_map = new boolean[size];\n //incase the map is null i.e allocation is failed we return -1\n if(pid_map == null)\n return -1;\n //initializing the map with false values\n for(int i=0;i<size;i++)\n {\n pid_map[i] = false;\n }\n //returning 1\n return 1;\n }", "public static void mapHashMap(Map<Integer, String> mapHashMap) {\n System.out.println(\"----------------------------- HashMap ----------------------------\");\n System.out.println(\"\\\"HashMap\\\" is unordered!\");\n mapHashMap.put(7, \"Cristiano Ronaldo\");\n mapHashMap.put(10, \"Leo Messi\");\n mapHashMap.put(8, \"Avi Nimni\");\n mapHashMap.put(24, \"Kobi Brian\");\n PrintUtils.printMap(mapHashMap);\n System.out.println();\n // STEP 2 - set p3 name to \"Moshe\"\n System.out.println(\"Set the name of player number 8 to be \\\"Moshe\\\":\");\n mapHashMap.replace(8, \"Avi Nimni\", \"Moshe\");\n // if you use \"put\" instead of \"replace\" it will work to!\n PrintUtils.printMap(mapHashMap);\n System.out.println();\n // STEP 3 - add p5 to the end of the list using using ADD method\n System.out.println(\"Add p5 to the end of the list using ADD method:\");\n System.out.println(\"Not an option!\");\n System.out.println();\n // STEP 4 - add p6 to position 3 the end of the list using ADD method\n System.out.println(\"Add p6 to position 3 the end of the list using ADD method:\");\n System.out.println(\"Not an option, you can wright over it!\");\n System.out.println();\n // STEP 5 - remove p2 from the list\n System.out.println(\"Remove p2 from the list and printing the list using a static method in a utility class:\");\n mapHashMap.remove(10, \"Leo Messi\");\n PrintUtils.printMap(mapHashMap);\n System.out.println();\n }", "public int sizeOfMap(){return size;}", "private void generateMap() {\n\n\t\t//Used to ensure unique locations of each Gameboard element\n\t\tboolean[][] spaceUsed = new boolean[12][12];\n\n\t\t//A running total of fences generated\n\t\tint fencesGenerated = 0;\n\n\t\t//A running total of Mhos generated\n\t\tint mhosGenerated = 0;\n\n\t\t//Fill the board with spaces and spikes on the edge\n\t\tfor (int i = 0; i < 12; i++) {\n\t\t\tfor (int j = 0; j < 12; j++) {\n\t\t\t\tmap[i][j] = new BlankSpace(i, j, board);\n\t\t\t\tif (i == 0 || i == 11 || j ==0 || j == 11) {\n\t\t\t\t\tmap[i][j] = new Fence(i, j, board);\n\t\t\t\t\tspaceUsed[i][j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Generate 20 spikes in unique locations\n\t\twhile (fencesGenerated < 20) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Fence(x, y, board);\n\t\t\t\tspaceUsed[x][y] = true;\n\t\t\t\tfencesGenerated++;\n\t\t\t}\n\t\t}\n\n\t\t//Generate 12 mhos in unique locations\n\t\twhile (mhosGenerated < 12) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Mho(x, y, board);\n\n\t\t\t\tmhoLocations.add(x);\n\t\t\t\tmhoLocations.add(y);\n\n\t\t\t\tspaceUsed[x][y] = true;\n\n\t\t\t\tmhosGenerated++;\n\t\t\t}\n\t\t}\n\n\t\t//Generate a player in a unique location\n\t\twhile (true) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Player(x, y, board);\n\t\t\t\tplayerLocation[0] = x;\n\t\t\t\tplayerLocation[1] = y;\n\t\t\t\tnewPlayerLocation[0] = x;\n\t\t\t\tnewPlayerLocation[1] = y;\n\t\t\t\tspaceUsed[x][y] = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public int allocate_map() {\r\n\t\tp_id = new int[idSize];\r\n\t\tif (p_id == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1;\r\n\t}", "public _No_706_DesignHashMap() {\n// Arrays.fill(arr, -1);\n }", "private static void sortMap(HashMap<Integer, Integer> map) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tHashMap<String, Integer> map1 = new HashMap<String, Integer> ();\n\t\t\n //2. Creating HashMap with some initial capacity\n\t\tHashMap<String,Integer> map2 = new HashMap<String,Integer> (30);\n\t\t\n\t\t//3. Creating HashMap with some initial capacity and some load factor\n\t\tHashMap<String, Integer> map3 = new HashMap<String, Integer> (30, .60f);\n\t\t\n\t\t//4. Creating HashMap by copying another HashMap\n\t\tHashMap<String, Integer> map4= new HashMap<String, Integer> (map1);\n\t\t\n\t}", "public abstract void putAll(AbstractIntHashMap map);", "private void genLoadMapCode(String name, String keyClassSimpleName, String valueClassSimpleName, boolean valueIsPersistable) {\n\n int tabLevel = 1;\n String tabs = tabs(tabLevel);\n\n String keyCppType = cppType(keyClassSimpleName);\n String valueCppType = cppType(valueClassSimpleName);\n\n String mapType = \"std::map< \" + keyCppType + \", \" + valueCppType + \" >\";\n\n load.println(\"\\t// \" + mapType + \" this->\" + name);\n genDebug(load, \"\\tstd::cout << \\\"load \" + mapType + \" \" + name + \"\\\" << std::endl;\");\n\n String vVarName = \"v\" + \"_\" + name;\n String lenVarName = vVarName + \"_length\";\n\n // read the length of the map\n load.println(tabs + \"int \" + lenVarName + \";\");\n\n load.println();\n load.println(tabs + INSTREAM_VAR_NAME + \".readInt(\" + lenVarName + \");\");\n\n genDebugDumpValue(load, lenVarName, tabs);\n\n load.println(tabs + mapType + \"& \" + vVarName + \" = this->\" + name + \";\");\n\n // initialize & pre-allocate the map\n // load.println( tabs + vVarName + \".reserve( \" + lenVarName + \" );\");\n\n load.println();\n load.println(tabs + \"for( int i = 0; i < \" + lenVarName + \"; i++ ){\");\n\n tabs = tabs(++tabLevel);\n\n // load key\n String keyVarName = vVarName + \"_key\";\n load.println(tabs + keyCppType + \" \" + keyVarName + \";\");\n load.println(tabs + genReadCode(keyVarName, keyCppType));\n\n // load value\n String valueVarName = vVarName + \"_value\";\n load.println(tabs + valueCppType + \" \" + valueVarName + \";\");\n\n if (valueIsPersistable) {\n load.println(tabs + valueVarName + \".load( \" + INSTREAM_VAR_NAME + \" );\");\n } else {\n load.println(tabs + genReadCode(valueVarName, valueCppType));\n }\n\n // add the new pair to the map\n load.println(tabs + vVarName + \".insert( std::make_pair( \" + keyVarName + \", \" + valueVarName + \" ));\");\n\n tabs = tabs(--tabLevel);\n load.println(tabs + \"}\");\n }", "protected void rehash() {\n // TODO: fill this in.\n //double number of maps, k, each time it is called\n\t\t//use MyBetterMap.makeMaps and MyLinearMap.getEntries\n\t\t//collect entries in the table, resize the table, then put the entries back in\n\t\tList<MyLinearMap<K, V>> newmaps = MyBetterMap.makeMaps(maps.size()*2);\n\t\tfor(MyLinearMap<K, V> curr: this.maps) {\n\t\t\tfor(Entry ent: MyLinearMap.getEntries()) {\n\t\t\t\tnewmaps.put(ent.key, ent.value);\n\t\t\t}\n\t\t}\n\t\tthis.maps = newmaps;\n\t\treturn;\n\t}", "public MapSum() {\n root = new Node();\n size = 0;\n }", "public void setUp()\n {\n map = new Map(5, 5, null);\n }", "public int[][] giveMap(){\n\t\treturn map;\n\t}", "public static void main(String[] args) \r\n\t{\n\t\tString str=\"pizzapan\";\r\n\t\t//int c=0;\r\n\t\t\r\n\t\tHashMap<Character,Integer> hm=new HashMap<>();\r\n\t\t\r\n\t\tchar s[]=str.toCharArray();\r\n\t\t\r\n\t\t//for(int i=0;i<=s.length;i++)\r\n\t\t\r\n\t\tfor(char var:s)\r\n\t\t{\r\n\t\t\t//c++;\r\n\t\t\tif(hm.containsKey(var))\r\n\t\t\t{\r\n\t\t\t\t//System.out.println( hm.get(var));\r\n\t\t\t\thm.put(var, hm.get(var)+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\thm.put(var, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(hm);\r\n\t\t\r\n\t\tSet<Entry<Character, Integer>>en=hm.entrySet();\r\n\t\t\r\n\t\tIterator<Entry<Character, Integer>>itr=en.iterator();\r\n\t\twhile(itr.hasNext())\r\n\t\t{\r\n\t\t\r\n\t\t\tMap.Entry<Character, Integer> data=itr.next();\r\n\t\t\tchar ch=data.getKey();\r\n\t\t\tint occ=data.getValue();\r\n\t\t\tSystem.out.println(ch+\" \"+occ);\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tInteger u=new Integer(10);\n\t\tInteger u1=new Integer(10);\n\t\tIdentityHashMap<Integer,String> g=new IdentityHashMap();\n\t\tg.put(u, \"dhdanas\");\n;\n\t\tg.put(u1,\"dtttt\");\n\t\t\nSystem.out.println(g);\n}", "private void fillMap(Grid tablero) { // reads the board and fill auxiliary map\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n if (tablero.getCell(i, j) == 0) {\n Cell c = new Cell(i, j);\n ArrayList<Integer> elements = fillDomain();\n map.put(c, elements);\n } else {\n Cell c = new Cell(i, j);\n ArrayList<Integer> elements = new ArrayList<>();\n elements.add(tablero.getCell(i, j));\n map.put(c, elements);\n }\n }\n }\n }", "public Map<Entity, Integer> computeHyponymCountMap()\r\n\t{\n\t\treturn null;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\r\n\t\tn = in.nextInt();\r\n\t\tmap = new int[n][n];\r\n\t\tbook = new boolean[n][n];\r\n\t\tcol = new int[n];\r\n\t\trow = new int[n];\r\n\t\tcolTemp = new int[n];\r\n\t\trowTemp = new int[n];\r\n\t\tint count = 0;\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tmap[i][j] = count++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tcol[i] = in.nextInt();\r\n\t\t}\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\trow[i] = in.nextInt();\r\n\t\t}\r\n\t\tcolTemp[0]++;\r\n\t\trowTemp[0]++;\r\n\t\tbook[0][0] = true;\r\n\t\tlist.add(map[0][0]);\r\n\t\tdfs(0, 0);\r\n\t}", "public static void main(String[] args) {\n String s = new Scanner(System.in).nextLine();\n HashMap<Character,Integer> map = new HashMap(26);\n for(Character c : s.toCharArray())\n {\n if(map.containsKey(c))\n {\n int val = map.get(c);\n map.put(c,++val);\n }\n else\n {\n map.put(c,1);\n }\n }\n int min = Collections.min(map.values());\n int max = Collections.max(map.values());\n HashMap<Integer,Integer> intMap = new HashMap();\n for(int count : map.values())\n {\n Integer val = intMap.get(count);\n if(null != val)\n {\n intMap.put(count,++val);\n }\n else\n {\n intMap.put(count,1);\n }\n }\n\n String output= intMap.size() == 1 ||( intMap.size() <= 2 && (intMap.get(min) <= 1 || intMap.get(max) <= 1)) ? \"YES\" : \"NO\";\n System.out.println(output);\n }", "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "public static void main(String arg[]) {\n\t\tScanner in = new Scanner(System.in);\n\n\t\tn = in.nextInt();\n\t\tm = in.nextInt();\n\n\t\tmap = new int[n + 1][n + 1];\n\n\t\tinit();\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint from = in.nextInt();\n\t\t\tint to = in.nextInt();\n\t\t\tmap[from][to] = map[to][from] = 1;\n\t\t}\n\n\t\tfloyd();\n\n\t\tint sum = 0;\n\t\tint min = 999999;\n\t\tint who = 0;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= n; j++) {\n\t\t\t\tsum += map[i][j];\n\t\t\t}\n\n\t\t\tif (min > sum) {\n\t\t\t\tmin = sum;\n\t\t\t\twho = i;\n\t\t\t}\n\n\t\t\tsum = 0;\n\t\t}\n\n\t\tSystem.out.println(who);\n\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n HashMap<Integer, Character> hashMap = new HashMap<Integer, Character>();\n hashMap.put(0,'F');hashMap.put(1,'G');hashMap.put(2,'R');\n hashMap.put(3,'S');hashMap.put(4,'T');hashMap.put(5,'L');\n hashMap.put(6,'M');hashMap.put(7,'N');hashMap.put(8,'O');\n hashMap.put(9,'P');hashMap.put(10,'Q');hashMap.put(11,'W');\n hashMap.put(12,'X');hashMap.put(13,'Y');hashMap.put(14,'Z');\n hashMap.put(15,'U');hashMap.put(16,'A');hashMap.put(17,'G');\n hashMap.put(18,'H');hashMap.put(19,'I');hashMap.put(20,'J');\n hashMap.put(21,'K');hashMap.put(22,'B');hashMap.put(23,'C');\n hashMap.put(24,'D');hashMap.put(25,'E');hashMap.put(26,'l');\n hashMap.put(27,'m');hashMap.put(28,'n');hashMap.put(29,'o');\n hashMap.put(30,'p');hashMap.put(31,'i');hashMap.put(32,'j');\n hashMap.put(33,'k');hashMap.put(34,'f');hashMap.put(35,'g');\n hashMap.put(36,'h');hashMap.put(37,'a');hashMap.put(38,'b');\n hashMap.put(39,'c');hashMap.put(40,'d');hashMap.put(41,'e');\n hashMap.put(42,'q');hashMap.put(43,'r');hashMap.put(44,'w');\n hashMap.put(45,'x');hashMap.put(46,'y');hashMap.put(47,'z');\n hashMap.put(48,'s');hashMap.put(49,'t');hashMap.put(50,'u');\n hashMap.put(51,'v');\n while(in.hasNext()){\n String str = in.next();\n\n String[] arr = str.split(\"[#]+\");\n\n StringBuffer ss = new StringBuffer();\n\n for (int i = 0; i < arr.length; i++) {\n\n //System.out.println(arr[i]);\n\n StringBuffer sb = new StringBuffer();\n\n for (int j = 0; j < arr[i].length(); j++) {\n\n int a = arr[i].charAt(j)=='-'?0:1;\n sb.append(a);\n }\n\n long b = Long.valueOf(sb.toString(),2);\n\n if (b>51||b<0){\n ss.replace(0,ss.length(),\"\");\n ss.append(\"ERROR\");\n break;\n }else {\n ss.append(hashMap.get((int)b));\n }\n }\n System.out.println(ss);\n\n }\n }", "public static void main(String[] args) {\n \n\t\tHashMap <String ,Double> Hm = new HashMap <String ,Double>();\n\t\t\n\t\tHm.put(\"Brad\", new Double(3452.34));\n\t\tHm.put(\"Ninja\", new Double (6454.56));\n\t\tHm.put(\"Insta\", new Double (6574.33));\n\t\tHm.put(\"Nathan\", new Double (7684.87));\n\t\t\n\t\tSystem.out.println(\"count \" + Hm);\n\t\t\n\t\t//getting a entries set\n\t\tSet<Map.Entry<String, Double>> set = Hm.entrySet();\n\t\t\n\t\t//Diaplay that \n\t\tfor(Map.Entry<String, Double> me : set) {\n\t\t\tSystem.out.println(me.getKey());\n\t\t\tSystem.out.println(me.getValue());\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\t\n\t\tdouble balance = Hm.get(\"Ninja\");\n\t\tHm.put(\"Ninja\", balance + 1000);\n\t\tSystem.out.println(\"Ninja's new balance: \" +\n\t\tHm.get(\"Ninja\"));\n\t\t\t\n\t\tSystem.out.println();\n\t\t}", "public HashMap<String, NeonValue> getMap();", "public static void main(String[] args) {\n\t\t\r\n\t Map<String,Integer> hashmap= new HashMap<String,Integer>();\r\n\t hashmap.put(\"Hiamsnhu\",12);\r\n\t hashmap.put(\"Khaneja\", 15);\r\n\t int size=hashmap.size();\r\n\t int hash=hashmap.hashCode();\r\n\t System.out.println(size);\r\n\r\n\t}" ]
[ "0.66290194", "0.654606", "0.6540295", "0.63944775", "0.62326187", "0.6230195", "0.6170948", "0.6081278", "0.60781366", "0.6068297", "0.6043623", "0.6019857", "0.6005615", "0.5979523", "0.5961223", "0.5930301", "0.59269595", "0.59188175", "0.59145916", "0.59087634", "0.5881631", "0.5879098", "0.5835161", "0.58298814", "0.58285874", "0.5828148", "0.58168095", "0.5805676", "0.5804562", "0.5738851", "0.5737962", "0.57376486", "0.57368815", "0.5729896", "0.5724722", "0.5722491", "0.5710871", "0.5702414", "0.5699623", "0.5699623", "0.56984603", "0.5696683", "0.56847256", "0.56821", "0.5675475", "0.5673394", "0.567212", "0.5668174", "0.56663126", "0.5661401", "0.5659344", "0.5651946", "0.564729", "0.5637737", "0.562614", "0.5621922", "0.5605661", "0.55894256", "0.5587461", "0.55789757", "0.5572711", "0.5562977", "0.55562925", "0.5555567", "0.5552476", "0.55510265", "0.5549674", "0.55465066", "0.55445105", "0.55366373", "0.55348617", "0.55310166", "0.5529043", "0.5528373", "0.5527486", "0.55260926", "0.55180466", "0.55164164", "0.5508122", "0.5497147", "0.54838836", "0.54827344", "0.5482189", "0.5479818", "0.5476863", "0.54684985", "0.54664046", "0.5464623", "0.54640424", "0.54629946", "0.5461325", "0.5447741", "0.54446894", "0.5442885", "0.54400426", "0.54354906", "0.54348755", "0.5427795", "0.54272556", "0.542621", "0.54207665" ]
0.0
-1
pointWorld = lambda(from + affineCoordto)
public Hit(SceneGraphPath path, double[] pointWorld, double dist, double affineCoord, int pickType, int index,int triIndex) { this.path = (SceneGraphPath) path; Matrix m = new Matrix(); path.getInverseMatrix(m.getArray()); this.pointWorld= pointWorld; this.pointObject=m.multiplyVector(pointWorld); this.dist = dist; this.affineCoordinate = affineCoord; this.pickType=pickType; this.index=index; this.triIndex=triIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int apply(int x, int y, int origin);", "public void transform(float a11, float a12, float a21, float a22, float x, float y);", "public Point2D translatePoint( Figure f, Point2D p, Point2D dir);", "public boolean apply(int x0, int y0, int x, int y);", "public void translate(int x, int y);", "void vectorToWorld(double px, double py, double pz, DVector3 result);", "public void setTransform(float a11, float a12, float a21, float a22, float x, float y);", "public void translate(float x, float y);", "void vectorFromWorld(double px, double py, double pz, DVector3 result);", "public void apply(Position p);", "@Override\r\n\t\tpublic void translate(Point3D vec) {\r\n\t\t\t// TODO Auto-generated method stub \r\n\t\t\tMyCoords mc= new MyCoords();\r\n\t\t\tPoint3D p=new Point3D(vec);\r\n\t\t\tPoint3D newPoint=mc.add(p, vec);\r\n\t\t\tthis.point=newPoint;\r\n\t\t}", "public abstract void mv(int y, int x);", "private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }", "public GJPoint2D center();", "public abstract Vector computeCenter();", "public void worldToImageCoords(Point2D.Double p, boolean isDistance);", "private void mouseEventToWorldSpace(MouseEvent e) {\n\n Point2D mousePoint = new Point2D.Double();\n mousePoint.setLocation(e.getPoint());\n\n Point2D newPoint = new Point2D.Double();\n this.viewModel.getViewToWorld().transform(mousePoint, newPoint);\n\n int xDiff = (int) ( newPoint.getX() - mousePoint.getX() );\n int yDiff = (int) ( newPoint.getY() - mousePoint.getY() );\n\n e.translatePoint(xDiff, yDiff);\n }", "public Point2D getLocation();", "protected abstract void calcOrigin();", "@FunctionalInterface\n\tinterface ColorTransformer {\n\t\t// change the color at (x,y)\n\t\tint apply(int x, int y, int origin);\n\t}", "public Point2D project(double longitudeInRadians, double latitudeInRadians);", "abstract void translate(double x, double y, double z);", "private Point transform(Point pt1) {\n Point pt2 = new Point(0,0) ;\n pt2.x = pos.x + new Double(pt1.x*Math.cos(heading)+pt1.y*Math.sin(heading)).intValue() ;\n pt2.y = pos.y + new Double(-pt1.x*Math.sin(heading)+pt1.y*Math.cos(heading)).intValue() ;\n return pt2 ;\n }", "MazePoint getActivePlayerCoordinates();", "public void setToCoordinates(int toX, int toY);", "public void draw(WorldLocation coord){\n \n }", "public abstract Point2D getPosition();", "public void changePos(double xP, double yP){ \n this.xCoor += xP;\n this.yCoor += yP;\n \n }", "private PointF s2c(float x, float y) {\n return new PointF(- (originX - x), originY - y);\n }", "public Point transform(int x, int y) {\n\t\tdouble pixelWidth = this.plainWidth / this.resolutionX;\n\n\t\tdouble rightFactor = pixelWidth * (x - (this.resolutionX / 2.0));\n\t\tdouble upFactor = pixelWidth * ((this.resolutionY / 2.0) - y);\n\n\t\treturn plainCenterPoint\n\t\t\t\t.add(upVec.mult(upFactor))\n\t\t\t\t.add(rightVec.mult(rightFactor));\n\t}", "void addTextureCoordinate(Vector t);", "Coordinate createCoordinate();", "private static int encodeMove(int p_x, int p_y, int to_x, int to_y, int a_x, int a_y) {\n\t\treturn p_x + (p_y << 4) + (to_x << 8) + (to_y << 12) + (a_x << 16) + (a_y << 20);\n\t}", "void mo2268a(View view, PointF pointF, float f);", "public abstract boolean illuminates(Point3 point, World world);", "abstract double apply(double x, double y);", "public Point transform(Point vector) {\n double _00 = this.matrix[0][0];\n double _01 = this.matrix[0][1];\n double _02 = this.matrix[0][2];\n double _03 = this.matrix[0][3];\n double _10 = this.matrix[1][0];\n double _11 = this.matrix[1][1];\n double _12 = this.matrix[1][2];\n double _13 = this.matrix[1][3];\n double _20 = this.matrix[2][0];\n double _21 = this.matrix[2][1];\n double _22 = this.matrix[2][2];\n double _23 = this.matrix[2][3];\n double _30 = this.matrix[3][0];\n double _31 = this.matrix[3][1];\n double _32 = this.matrix[3][2];\n double _33 = this.matrix[3][3];\n\n double x = vector.x * _00 + vector.y * _10 + vector.z * _20 + vector.w * _30;\n double y = vector.x * _01 + vector.y * _11 + vector.z * _21 + vector.w * _31;\n double z = vector.x * _02 + vector.y * _12 + vector.z * _22 + vector.w * _32;\n double h = vector.x * _03 + vector.y * _13 + vector.z * _23 + vector.w * _33;\n\n return new Point(x, y, z, h);\n }", "@Override\t\t\t\n\tpublic final myPointf transformPoint(myPointf A, int transformIDX, float t) {\treturn trans[transformIDX].transformPoint(A, t);}", "public abstract Vec2 doorPosition();", "@Ignore\n\t@Test\n\tpublic void test2() {\n\t\tfinal LogicalExpression conj = TestServices\n\t\t\t\t.getCategoryServices()\n\t\t\t\t.readSemantics(\n\t\t\t\t\t\t\"(conj:<<e,t>,<<e,t>,t>> (lambda $0:e (next_to:<e,<e,t>> $0 colorado:e)) (lambda $1:e (next_to:<e,<e,t>> $1 nm:e)))\");\n\t\tfinal LogicalExpression func = TestServices\n\t\t\t\t.getCategoryServices()\n\t\t\t\t.readSemantics(\n\t\t\t\t\t\t\"(lambda $0:<e,t> (lambda $1:e (and:<t*,t> ($0 $1) (named:<e,<e,t>> $1 springfield:e))))\");\n\t\tfinal LogicalExpression expected = TestServices\n\t\t\t\t.getCategoryServices()\n\t\t\t\t.readSemantics(\n\t\t\t\t\t\t\"(lambda $0:e (and:<t*,t> (next_to:<e,<e,t>> $0 colorado:e) (next_to:<e,<e,t>> $0 nm:e) (named:<e,<e,t>> $0 springfield:e)))\");\n\t\tfinal LogicalExpression actual = services.applyCoordination(func, conj);\n\t\tAssert.assertEquals(expected, actual);\n\t}", "public void imageToWorldCoords(Point2D.Double p, boolean isDistance);", "public Point2D customCoordinateFormula(Point2Int in){\r\n double xn = coordinateCalculateFuntionX.apply((double)in.x);\r\n double yn = coordinateCalculateFuntionX.apply((double)in.x);\r\n return new Point2D(xn, yn);\r\n }", "void turnToPoint(float x, float y) {\n _rotVector.set(x - _x, y - _y, 0);\n _rotVector.setMag(1);\n }", "public void translate(float theX, float theY) {\n\t}", "boolean mo2269a(View view, PointF pointF);", "public void centerMapOnPoint(int targetX, int targetY) {\n\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (targetY - targetX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n int y = (targetY + targetX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n currentXOffset = -x;\n currentYOffset = -y;\n\n gameChanged = true;\n }", "public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}", "private FPoint m2831a(MapProjection mapProjection, double d, double d2, double d3) {\r\n int cos = (int) ((Math.cos(d) * this.f1773q) + d2);\r\n int i = (int) (d3 + ((-Math.sin(d)) * this.f1773q));\r\n FPoint fPoint = new FPoint();\r\n mapProjection.geo2Map(cos, i, fPoint);\r\n return fPoint;\r\n }", "public java.awt.geom.Point2D.Double transformedPoint(double x, double y)\n {\n double[] position = {x,y}; \n getGraphicsState().getCurrentTransformationMatrix().createAffineTransform().transform(position, 0, position, 0, 1);\n position[1] = fixY(position[1]);\n\n\t_pageAffineTransform.transform(position,0, position, 0, 1);\n return new Point2D.Double(position[0],position[1]);\n }", "public Point2D.Double getImageCenter();", "public Coordinate pixelToWorld(int x, int y, Envelope map) {\n if (graphics == null) {\n LOGGER.info(\"no graphics yet deffined\");\n \n return null;\n }\n \n //set up the affine transform and calculate scale values\n AffineTransform at = setUpTransform(map, screenSize);\n \n /* If we are rendering to a component which has already set up some form\n * of transformation then we can concatenate our transformation to it.\n * An example of this is the ZoomPane component of the swinggui module.*/\n if (concatTransforms) {\n graphics.getTransform().concatenate(at);\n } else {\n graphics.setTransform(at);\n }\n \n try {\n Point2D result = at.inverseTransform(new java.awt.geom.Point2D.Double(x, y),\n new java.awt.geom.Point2D.Double());\n Coordinate c = new Coordinate(result.getX(), result.getY());\n \n return c;\n } catch (Exception e) {\n LOGGER.warning(e.toString());\n }\n \n return null;\n }", "int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2);", "void position(double x, double y, double z);", "public void setLocation(Point2D p);", "private static SbVec4f \ngenerateCoord(Object userData,\n final SbVec3f point,\n final SbVec3f normal )\n//\n////////////////////////////////////////////////////////////////////////\n{\n SoTextureCoordinateBundle tcb = (SoTextureCoordinateBundle ) userData;\n\n final SbVec4f result = new SbVec4f();\n\n // The S and T coordinates of the result are the dot products of\n // the point with sVector and tVector. Since this computation is\n // done very frequently (during primitive generation for picking\n // on vertex-based shapes), we can avoid some operations that\n // result in 0 by doing the dot products explicitly.\n int sDim = tcb.coordS, tDim = tcb.coordT;\n\n\n result.setValue(point.getValueRead()[sDim] * tcb.sVector.getValueRead()[sDim] + tcb.sVector.getValueRead()[3],\n point.getValueRead()[tDim] * tcb.tVector.getValueRead()[tDim] + tcb.tVector.getValueRead()[3],\n 0.0f,\n 1.0f);\n\n return result;\n}", "public abstract Vec2 startPosition();", "private Point toInnerPoint(Point punto){\r\n \treturn punto.add(-coord.X(), -coord.Y());\r\n// return new Point(punto.getRow() - coord.getRow(), punto.getCol() - coord.getCol());\r\n }", "public Vector2D getPosition ();", "public final Shape translate(Vector fromPoint, Vector toPoint) {\n\t\treturn transform(new Translation(fromPoint, toPoint));\n\t}", "private static Vector2f transform(Rect2f srcRc, Rect2f dstRc, BaseVector2f pt) {\n\n // TODO: move this to a better place\n\n float x = (pt.getX() - srcRc.minX()) / srcRc.width();\n float y = (pt.getY() - srcRc.minY()) / srcRc.height();\n\n x = dstRc.minX() + x * dstRc.width();\n y = dstRc.minY() + y * dstRc.height();\n\n return new Vector2f(x, y);\n }", "default Point2D constrainPoint( Figure f, Point2D p) {\n return translatePoint(f, p, DIRECTION_NEAREST);\n }", "public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }", "public abstract void turnToLiving(int x, int y);", "public Function(Point x, Point y) {\n double delta = (x.y - y.y) / (x.x - y.x);\n a = -1 * delta;\n b = -(x.y - delta * x.x);\n }", "public SimpleLambda getTheLambda(int offset) {\n int scopedVar = offset;\n return (int x, int y) -> x + y + scopedVar;\n }", "private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }", "private static void transformPoint(Point3D position, Point3D srcOrigin, int angle, Point3D destOrigin)\n \t{\n \t\t\n \t\tint tx = position.getX() - srcOrigin.getX();\n \t\tint ty = position.getY() - srcOrigin.getY();\n \t\tint tz = position.getZ() - srcOrigin.getZ();\n \t\t\n \t\t//\"int angle\" specifies a rotation consistent with Minecraft's orientation system.\n \t\t//That means each increment of 1 in angle would be a 90-degree clockwise turn.\n \t\t//Given a starting direction A and a destination direction B, the rotation would be\n \t\t//calculated by (B - A).\n \n \t\t//Adjust angle into the expected range\n \t\tif (angle < 0)\n \t\t{\n \t\t\tint correction = -(angle / 4);\n \t\t\tangle = angle + 4 * (correction + 1);\n \t\t}\n \t\tangle = angle % 4;\n \t\t\n \t\tint rx;\n \t\tint rz;\n \t\tswitch (angle)\n \t\t{\n \t\t\tcase 0: //No rotation\n \t\t\t\trx = tx;\n \t\t\t\trz = tz;\n \t\t\t\tbreak;\n \t\t\tcase 1: //90 degrees clockwise\n \t\t\t\trx = -tz;\n \t\t\t\trz = tx;\n \t\t\t\tbreak;\n \t\t\tcase 2: //180 degrees\n \t\t\t\trx = -tx;\n \t\t\t\trz = -tz;\n \t\t\t\tbreak;\n \t\t\tcase 3: //270 degrees clockwise\n \t\t\t\trx = tz;\n \t\t\t\trz = -tx;\n \t\t\t\t\n \t\t\t\tbreak;\n \t\t\tdefault: //This should never happen\n \t\t\t\tthrow new IllegalStateException(\"Invalid angle value. This should never happen!\");\n \t\t}\n \t\t\n \t\tposition.setX( rx + destOrigin.getX() );\n \t\tposition.setY( ty + destOrigin.getY() );\n \t\tposition.setZ( rz + destOrigin.getZ() );\n \t}", "@Test\n public void testIdentity() throws TransformException {\n create(3, 0, 1, 2);\n assertIsIdentity(transform);\n assertParameterEquals(Affine.provider(3, 3, true).getParameters(), null);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = source.clone();\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }", "public Affine.Point viewportToWorld(Affine.Point dst, Point src) {\n if (dst == null) {\n dst = new Affine.Point();\n }\n dst.x = viewportToWorldX(src.x);\n dst.y = viewportToWorldY(src.y);\n return dst;\n }", "public void move(Point p);", "public void transform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"transform\");\r\n\t}", "public abstract Point_3 evaluate(double u, double v);", "private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }", "public boolean apply(World world, BlockPos rootPos);", "public abstract void alphaConversion(Variable x, Variable y);", "private Vector coordinateSummer(Vector first, Vector second) {\n Vector tmp = new Vector();\n tmp.setX(first.getX() + second.getX());\n tmp.setY(first.getY() + second.getY());\n tmp.setZ(first.getZ() + second.getZ());\n return tmp;\n }", "Point getPosition();", "Point getPosition();", "void onIdentityMove(int fromPosition, int toPosition);", "public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }", "public boolean apply(BlockPos pos, ServerLevel world);", "static Posn translate ( Posn p, double dx, double dy ) {\n\t// return .... ;\n\t// Take stock\n\t// return ... p ... dx ... dy ; // <- We know this from Posn p\n\t// return new Posn ( ... p.x ... p.y ... dx ... dy ); // <- We know this from Posn translate\n\t// return new Posn ( ... p.x ... p.y ... dx ... dy, ... p.x ... p.y ... dx ... dy );\t\n\treturn new Posn ( p.x + dx, p.y + dy );\t\n }", "Point getCenter();", "Point getCenter();", "Lab apply();", "private int convert(int x, int y) {\n\treturn (150 * y) + x;\n }", "@Override\n \t\t\t\tpublic void doWorldPerspective() {\n \n \t\t\t\t}", "private Point[] transformCoordinateSystem(Point[] objectPosition, Point newCenter) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\t// Move location to coordinate system with center in origo \n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x - newCenter.x,\n\t\t\t\tobjectPosition[i].y - newCenter.y\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}", "public void relocateToPoint(boolean isUserClick){\n// System.out.println(\"Scene x: \"+point.getX()+\", y: \"+point.getY());\n// System.out.println(\"Local x: \"+getParent().sceneToLocal(point).getX()+\", y: \"+getParent().sceneToLocal(point).getY());\n// System.out.println(\"Relocate x: \"+(getParent().sceneToLocal(point).getX() - (getWidth() / 2))+\", y: \"+(getParent().sceneToLocal(point).getY() - (getHeight() / 2)));\n// System.out.println(getBoundsInLocal().getWidth());\n// System.out.println(widthProperty());\n\n if (isUserClick) {\n double new_x=getParent().sceneToLocal(x,y).getX();\n double new_y=getParent().sceneToLocal(x,y).getY();\n setX(new_x);\n setY(new_y);\n relocate(\n// (getParent().sceneToLocal(x,y).getX() - (widthCountry / 2)),\n// (getParent().sceneToLocal(x,y).getY() - (heightCountry / 2))\n new_x,new_y\n );\n } else {\n relocate(x,y);\n }\n\n\n }", "public Point2D addPoint(double x, double y);", "void copyOffsetPosition (DVector3 pos);", "@Override \n public Vector getLocation() {\n return this.getR();\n }", "private Point extractVectorFromAngle(int arg) {\n double theta = Math.toRadians( 2* (double)arg );\n double dx = Cell.move_dist * Math.cos(theta);\n double dy = Cell.move_dist * Math.sin(theta);\n return new Point(dx, dy);\n }", "void getPosRelPoint(double px, double py, double pz, DVector3 result);", "public abstract APoint3<DataType> newOffset(DataType x, DataType y, DataType z);", "public Vector getLocation();", "N getOrigin();", "@Override\r\n public void act() \r\n {\n int posx = this.getX();\r\n int posy = this.getY();\r\n //calculamos las nuevas coordenadas\r\n int nuevox = posx + incx;\r\n int nuevoy = posy + incy;\r\n \r\n //accedemos al mundo para conocer su tamaño\r\n World mundo = this.getWorld();\r\n if(nuevox > mundo.getWidth())//rebota lado derecho\r\n {\r\n incx = -incx;\r\n }\r\n if(nuevoy > mundo.getHeight())//rebota en la parte de abajo\r\n {\r\n incy = -incy;\r\n }\r\n \r\n if(nuevoy < 0)//rebota arriba\r\n {\r\n incy = -incy;\r\n }\r\n if(nuevox < 0)//rebota izquierda\r\n {\r\n incx = -incx;\r\n }\r\n //cambiamos de posicion a la pelota\r\n this.setLocation(nuevox,nuevoy);\r\n }", "public abstract Vector4fc mulProject(IMatrix4f mat);", "public abstract Point move(Point position);", "public abstract Vector getAnchorPoint(Rectangle selectionBox);" ]
[ "0.6675117", "0.63655883", "0.62077236", "0.59934294", "0.59528476", "0.5895141", "0.58521163", "0.58069664", "0.5724362", "0.5716514", "0.5654389", "0.56370926", "0.5630497", "0.5619618", "0.5616817", "0.5601036", "0.5581008", "0.5531946", "0.5507602", "0.5500463", "0.54982764", "0.547453", "0.54470825", "0.54215777", "0.54195267", "0.5398975", "0.5378872", "0.5370696", "0.53701526", "0.5354681", "0.5334678", "0.53317106", "0.5329273", "0.5300284", "0.52719355", "0.5253442", "0.5246062", "0.52416044", "0.5240186", "0.5236126", "0.52349365", "0.52296287", "0.5229185", "0.522261", "0.5221634", "0.5215614", "0.52151656", "0.5203798", "0.51918113", "0.5177553", "0.5167197", "0.5158706", "0.5151217", "0.5146825", "0.5144463", "0.5138934", "0.51360863", "0.5128689", "0.51279765", "0.5126071", "0.51094383", "0.51091236", "0.5093521", "0.5080939", "0.5078182", "0.5075067", "0.50643253", "0.5062186", "0.5052532", "0.5044783", "0.5039484", "0.5034537", "0.50327075", "0.5027156", "0.5021571", "0.5018822", "0.5014918", "0.5014918", "0.50143415", "0.50110143", "0.5005775", "0.50008917", "0.49959874", "0.49959874", "0.4994827", "0.4993226", "0.49917737", "0.49843052", "0.4983736", "0.49835986", "0.49818027", "0.49774712", "0.49718803", "0.49646878", "0.49598873", "0.49569917", "0.49551484", "0.49538863", "0.49347812", "0.49329337", "0.49308807" ]
0.0
-1
/ calc barycentric coordinates bary for point x in anElement el, not necessarily 0 <= b[i] <= 1
public static boolean convertToBary( double[] bary, double[] x0, double[] x1, double[] x2, double[] x) { //TODO: use exception handling for degenerate situations //TODO: the return type should be void or double which should give // distance from plane int i0 = 0, i1 = 1, i2 = 2; double det; /* find two linear independent rows */ for (;;) { det = x1[i0] * x2[i1] - x1[i1] * x2[i0] - (x0[i0] * x2[i1] - x0[i1] * x2[i0]) + x0[i0] * x1[i1] - x0[i1] * x1[i0]; if (Math.abs(det) > EPS) break; if (i1 == 1) { i1 = 2; i2 = 1; } else if (i0 == 0) { i0 = 1; i2 = 0; } else { LoggingSystem.getLogger(Hit.class).fine("mBaryInElementConvertFromVec3: triangle degenerated?"); // // fprintf(stderr, "gmBaryInElementConvertFromVec3: triangle // degenerated?\n"); // fprintf(stderr, "\tcan't compute barycentric // coordinates.\n"); // fprintf(stderr, "vertex0: (%f, %f, %f)\n", x0[0], x0[1], // x0[2]); // fprintf(stderr, "vertex1: (%f, %f, %f)\n", x1[0], x1[1], // x1[2]); // fprintf(stderr, "vertex2: (%f, %f, %f)\n", x2[0], x2[1], // x2[2]); // fprintf(stderr, "point : (%f, %f, %f)\n", x[0], x[1], x[2]); // fflush(stderr); return false; } } /* calculate barycentric coordinates */ bary[0] = (x1[i0] * x2[i1]- x1[i1] * x2[i0] - (x[i0] * x2[i1] - x[i1] * x2[i0]) + x[i0] * x1[i1]- x[i1] * x1[i0]) / det; bary[1] = (x[i0] * x2[i1] - x[i1] * x2[i0] - (x0[i0] * x2[i1] - x0[i1] * x2[i0]) + x0[i0] * x[i1] - x0[i1] * x[i0]) / det; bary[2] = 1.0 - bary[0] - bary[1]; /* test third row */ if (Math .abs(x0[i2] * bary[0] + x1[i2] * bary[1] + x2[i2] * bary[2] - x[i2]) > 1.e-3) { // this is not an error and should not in my opinion be set to info level -gunn 18.5.6 LoggingSystem.getLogger(Hit.class).fine("gmBaryInElementConvertFromVec3: test for third row failed." +Math.abs(x0[i2] * bary[0] + x1[i2] * bary[1] + x2[i2] * bary[2] - x[i2]) ); return false; } correct(bary); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Vector3D convexCellBarycenter(final Vertex start) {\n\n int n = 0;\n Vector3D sumB = Vector3D.ZERO;\n\n // loop around the cell\n for (Edge e = start.getOutgoing(); n == 0 || e.getStart() != start; e = e.getEnd().getOutgoing()) {\n sumB = new Vector3D(1, sumB, e.getLength(), e.getCircle().getPole());\n n++;\n }\n\n return sumB.normalize();\n\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}", "private int getBinJ(Location l)\r\n {\r\n return (int)((l.getY()-bl.getY())/dj);\r\n }", "public Point3D getB() {\r\n return b;\r\n }", "public void difXY() {\n for(int ix=1;ix<cols-1;ix++) {\n for(int iy=1;iy<rows-1;iy++) {\n int ig=iy*cols+ix;\n // compute x difference\n dxr[ig] = par[ig+1]-par[ig-1]; // red\n //dxg[ig] = pag[ig+1]-pag[ig-1]; // green\n //dxb[ig] = pab[ig+1]-pab[ig-1]; // blue\n // compute y difference\n dyr[ig] = par[ig+cols]-par[ig-cols]; // red\n //dyg[ig] = pag[ig+cols]-pag[ig-cols]; // green\n //dyb[ig] = pab[ig+cols]-pab[ig-cols]; // blue\n }\n }\n }", "public void findBoundaryGivenPhi() {\n \r\n boundary.removeAllElements();\r\n \r\n \tfor(int i=0; i<pixelsWide-1; i++)\r\n \t\tfor(int j=0; j<pixelsHigh-1; j++) {\r\n Int2d pi = new Int2d(i,j);\r\n \r\n double sgnIJ = Math.signum( phi[i][j] );\r\n if( sgnIJ != Math.signum( phi[i+1][j] ) ) {\r\n if(!boundary.contains(pi)) boundary.add(pi);\r\n Int2d p2 = new Int2d(i+1,j);\r\n if(!boundary.contains(p2)) boundary.add(p2);\r\n }\r\n if( sgnIJ != Math.signum( phi[i][j+1] ) ) {\r\n if(!boundary.contains(pi)) boundary.add(pi);\r\n Int2d p2 = new Int2d(i,j+1);\r\n if(!boundary.contains(p2)) boundary.add(p2); \r\n }\r\n \r\n }\r\n \r\n \r\n }", "private double calcB0() {\n double[] dataX = dsX.getDataX();\n double[] dataY = dsY.getDataY();\n double sumX = 0;\n double sumY = 0;\n for (int i = 0; i < dataX.length; i++) {\n sumX += dataX[i];\n sumY += dataY[i];\n }\n return (sumY - (this.B1 * sumX)) / dataX.length;\n }", "private double angleBP(int cx, int cy, int ex, int ey){\n\t return Math.atan2(((float)ey-cy),((float)ex-cx));\r\n\t }", "private int getBinI(Location l)\r\n {\r\n return (int)((l.getX()-bl.getX())/di);\r\n }", "public Jacobian (Element element, UniversalElement universalElement) {\n\n this.jacobianMatrix = new double[universalElement.getNumberOfAllIntegrationPoints()][2][2];\n this.dXByDXi = new double[universalElement.getNumberOfAllIntegrationPoints()];\n this.dXByDEta = new double[universalElement.getNumberOfAllIntegrationPoints()];\n this.dYByDXi = new double[universalElement.getNumberOfAllIntegrationPoints()];\n this.dYByDEta = new double[universalElement.getNumberOfAllIntegrationPoints()];\n\n for (int i = 0; i < universalElement.getNumberOfAllIntegrationPoints(); i++) {\n dXByDXi[i] = 0;\n dXByDEta[i] = 0;\n dYByDXi[i] = 0;\n dYByDEta[i] = 0;\n\n for (int j = 0; j < 4; j++) { //because we have 4 apexes (and because of that we have 4 shape functions)\n dXByDXi[i] += universalElement.getdNByDXi()[i][j] * element.getID()[j].getX();\n dXByDEta[i] += universalElement.getdNByDEta()[i][j] * element.getID()[j].getX();\n dYByDXi[i] += universalElement.getdNByDXi()[i][j] * element.getID()[j].getY();\n dYByDEta[i] += universalElement.getdNByDEta()[i][j] * element.getID()[j].getY();\n }\n\n jacobianMatrix[i][0][0] = dXByDXi[i];\n jacobianMatrix[i][0][1] = dYByDXi[i];\n jacobianMatrix[i][1][0] = dXByDEta[i];\n jacobianMatrix[i][1][1] = dYByDEta[i];\n\n }\n\n calculateDeterminants(universalElement.getNumberOfAllIntegrationPoints());\n invertJacobians();\n }", "public PVector cohesion (ArrayList<Boid> boids) {\n float neighbordist = 50;\n PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all positions\n int count = 0;\n for (Boid other : boids) {\n float d = PVector.dist(position, other.position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(other.position); // Add position\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return seek(sum); // Steer towards the position\n } else {\n return new PVector(0, 0);\n }\n }", "DAABBC getAABB ();", "public E3DVector2F getTextureCoordB(){\r\n return vertices[1].getTextureCoord();\r\n }", "private double calcB1() {\n double[] dataX = dsX.getDataX();\n double[] dataY = dsY.getDataY();\n double sumX = 0;\n double sumY = 0;\n double sumXY = 0;\n double sumXsq = 0;\n\n for (int i = 0; i < dataX.length; i++) {\n sumX += dataX[i];\n sumY += dataY[i];\n sumXY += dataX[i] * dataY[i];\n sumXsq += Math.pow(dataX[i], 2);\n }\n return (((dataX.length * sumXY) - (sumX * sumY)) / ((dataX.length * sumXsq) - (Math.pow(sumX, 2))));\n }", "private int xyToOneD(int row, int col) {\n return ((row - 1) * grid.length) + (col - 1);\n }", "public void Bezier2D(double[] b, int cpts, double[] p) {\n int numberOfpoints = (b.length) / 2;\n int icounter, jcounter;\n double step, t;\n\n // We calculate the points of the curve\n icounter = 0;\n t = 0;\n step = (double) 1.0 / (cpts - 1);\n\n for (int i1 = 0; i1 != cpts; i1++) {\n if ((1.0 - t) < 5e-6) {\n t = 1.0;\n }\n\n jcounter = 0;\n p[icounter] = 0.0;\n p[icounter + 1] = 0.0;\n for (int i = 0; i != numberOfpoints; i++) {\n double basis = bernstein(numberOfpoints - 1, i, t);\n p[icounter] += basis * b[jcounter];\n p[icounter + 1] += basis * b[jcounter + 1];\n jcounter = jcounter + 2;\n }\n\n icounter += 2;\n t += step;\n }\n }", "public E3DVector3F getVertexPosB(){\r\n return vertices[1].getVertexPos();\r\n }", "private int getBox(int r, int c) \n {\n int bR = (r - 1) / bDim + 1;\n int bC = (c - 1) / bDim + 1;\n return (bR - 1) * bDim + bC;\n }", "public Vector projection(Vector b){\n Vector result = new Vector();\n result.norm= (this.x*b.x+this.y*b.y) / b.getNorm();\n result.x = b.x/b.getNorm();\n result.y = b.y/b.getNorm();\n return result;\n }", "public AABB a(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 106: */ {\r\n/* 107:133 */ bdv localbdv = e(paramaqu, paramdt);\r\n/* 108:134 */ if (localbdv == null) {\r\n/* 109:135 */ return null;\r\n/* 110: */ }\r\n/* 111:139 */ float f = localbdv.a(0.0F);\r\n/* 112:140 */ if (localbdv.d()) {\r\n/* 113:141 */ f = 1.0F - f;\r\n/* 114: */ }\r\n/* 115:143 */ return a(paramaqu, paramdt, localbdv.b(), f, localbdv.e());\r\n/* 116: */ }", "protected double[] calculateDataBoundingBox() {\n \t\tdouble min_x = Double.MAX_VALUE;\n \t\tdouble min_y = Double.MAX_VALUE;\n \t\tdouble max_x = 0.0D;\n \t\tdouble max_y = 0.0D;\n \t\t// check the points\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (p[0][i] < min_x) min_x = p[0][i];\n \t\t\tif (p[1][i] < min_y) min_y = p[1][i];\n \t\t\tif (p[0][i] > max_x) max_x = p[0][i];\n \t\t\tif (p[1][i] > max_y) max_y = p[1][i];\n \t\t}\n \t\treturn new double[]{min_x, min_y, max_x, max_y};\n \t}", "public abstract void zzb(B b, int i, long j);", "public cew a(blc ☃, axk axk1, el el1) {\r\n/* 96 */ byw byw = axk1.b(el1.a());\r\n/* 97 */ if (byw.c().a(this.b)) {\r\n/* 98 */ return cet.b();\r\n/* */ }\r\n/* */ \r\n/* 101 */ return this.o.computeIfAbsent(☃, ☃ -> {\r\n/* */ byw byw = ☃.s();\r\n/* */ return cet.a(0.0D, 0.0D, 0.0D, 1.0D, byw.f(), 1.0D);\r\n/* */ }", "static boolean pointInCircumcircle2(PointDouble a, PointDouble b, PointDouble c, PointDouble p) {\n return ((a.x - p.x) * (b.y - p.y) * ((c.x - p.x) * (c.x - p.x) + (c.y - p.y) * (c.y - p.y)) +\n (a.y - p.y) * ((b.x - p.x) * (b.x - p.x) + (b.y - p.y) * (b.y - p.y)) * (c.x - p.x) +\n ((a.x - p.x) * (a.x - p.x) + (a.y - p.y) * (a.y - p.y)) * (b.x - p.x) * (c.y - p.y) -\n ((a.x - p.x) * (a.x - p.x) + (a.y - p.y) * (a.y - p.y)) * (b.y - p.y) * (c.x - p.x) -\n (a.y - p.y) * (b.x - p.x) * ((c.x - p.x) * (c.x - p.x) + (c.y - p.y) * (c.y - p.y)) -\n (a.x - p.x) * ((b.x - p.x) * (b.x - p.x) + (b.y - p.y) * (b.y - p.y)) * (c.y - p.y)) > 0.0;\n }", "public PVector cohesion (ArrayList<Boid> boids) {\n float neighbordist = 90.0f;\n PVector steer = new PVector(0,0); // Start with empty vector to accumulate all locations\n int count = 0;\n for (Boid other : boids) {\n float d = PVector.dist(location,other.location);\n if ((d > 0) && (d < neighbordist)) {\n steer.add(other.location); // Add location\n count++;\n }\n }\n if (count > 0) {\n steer.div((float)count);\n return seek(steer); // Steer towards the location\n }\n return steer;\n }", "public void computeBoundingBox() {\n\taveragePosition = new Point3(center);\n tMat.rightMultiply(averagePosition);\n \n minBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n maxBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n // Initialize\n Point3[] v = new Point3[8];\n for (int i = 0; i < 8; i++)\n \tv[i] = new Point3(center);\n // Vertices of the box\n v[0].add(new Vector3(-radius, -radius, -height/2.0));\n v[1].add(new Vector3(-radius, radius, -height/2.0));\n v[2].add(new Vector3(radius, -radius, -height/2.0));\n v[3].add(new Vector3(radius, radius, -height/2.0));\n v[4].add(new Vector3(-radius, -radius, height/2.0));\n v[5].add(new Vector3(-radius, radius, height/2.0));\n v[6].add(new Vector3(radius, -radius, height/2.0));\n v[7].add(new Vector3(radius, radius, height/2.0));\n // Update minBound and maxBound\n for (int i = 0; i < 8; i++)\n {\n \ttMat.rightMultiply(v[i]);\n \tif (v[i].x < minBound.x)\n \t\tminBound.x = v[i].x;\n \tif (v[i].x > maxBound.x)\n \t\tmaxBound.x = v[i].x;\n \tif (v[i].y < minBound.y)\n \t\tminBound.y = v[i].y;\n \tif (v[i].y > maxBound.y)\n \t\tmaxBound.y = v[i].y;\n \tif (v[i].z < minBound.z)\n \t\tminBound.z = v[i].z;\n \tif (v[i].z > maxBound.z)\n \t\tmaxBound.z = v[i].z;\n }\n \n }", "public double base(){\r\n\t\treturn Math.abs(this.vad.getX()-this.vbs.getX());\r\n\t}", "public ArrayList<Block> getAdj (Block b) { // gets the adjacent blocks\n\t\tArrayList<Block> neighbors = new ArrayList<Block> ();\n\t\tif (b.x+1 < size) neighbors.add(get(b.x+1, b.y, b.z));\n\t\tif (b.x-1 > -1) neighbors.add(get(b.x-1, b.y, b.z));\n\t\tif (b.y+1 < size) neighbors.add(get(b.x, b.y+1, b.z));\n\t\tif (b.y-1 > -1) neighbors.add(get(b.x, b.y-1, b.z));\n\t\tif (b.z+1 < size) neighbors.add(get(b.x, b.y, b.z+1));\n\t\tif (b.z-1 > -1) neighbors.add(get(b.x, b.y, b.z-1));\n\t\treturn neighbors;\n\t}", "private int xyTo1D(int r, int c) {\n\t\treturn r * N + c;\n\t}", "public BruteCollinearPoints(Point[] points) {\n this.points = points;\n }", "public AxisAlignedBB contract(double x, double y, double z) {\n\t\treturn getAABBPool().getAABB(minX + x, minY + y, minZ + z, maxX - x, maxY - y, maxZ - z);\n\t}", "public float[] is_In_Ranges(int r, int g, int b){\n float cur_smallest_center_diff = -1;\n float cur_center_diff;\n float[] cur_centers = {-1.0f,-1.0f,-1.0f}; // 0 = red, 1 = green, 2 = blue\n for(Range cur_range: this.range_vector){\n if(cur_range.is_in_range(r, g, b)){\n cur_center_diff = ((r - cur_range.r_center)*(r - cur_range.r_center) + (g - cur_range.g_center)*(g - cur_range.g_center) + (b - cur_range.b_center)*(b - cur_range.b_center));\n if(cur_smallest_center_diff == -1) {\n cur_smallest_center_diff = cur_center_diff;\n cur_centers[0] = cur_range.r_center;\n cur_centers[1] = cur_range.g_center;\n cur_centers[2] = cur_range.b_center;\n }\n else if (cur_center_diff <= cur_smallest_center_diff) {\n cur_smallest_center_diff = cur_center_diff;\n cur_centers[0] = cur_range.r_center;\n cur_centers[1] = cur_range.g_center;\n cur_centers[2] = cur_range.b_center;\n }\n }\n }\n return cur_centers;\n }", "private int findCoordElementRegular(double coordValue, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n if (n == 1 && bounded)\n return 0;\n\n double distance = coordValue - orgGridAxis.getCoordEdge1(0);\n double exactNumSteps = distance / orgGridAxis.getResolution();\n // int index = (int) Math.round(exactNumSteps); // ties round to +Inf\n int index = (int) exactNumSteps; // truncate down\n\n if (bounded && index < 0)\n return 0;\n if (bounded && index >= n)\n return n - 1;\n\n // check that found point is within interval\n if (index >= 0 && index < n) {\n double lower = orgGridAxis.getCoordEdge1(index);\n double upper = orgGridAxis.getCoordEdge2(index);\n if (orgGridAxis.isAscending()) {\n assert lower <= coordValue : lower + \" should be le \" + coordValue;\n assert upper >= coordValue : upper + \" should be ge \" + coordValue;\n } else {\n assert lower >= coordValue : lower + \" should be ge \" + coordValue;\n assert upper <= coordValue : upper + \" should be le \" + coordValue;\n }\n }\n\n return index;\n }", "public static java.awt.Rectangle getInteriorRectangle(java.awt.Component c, com.amazon.kindle.kindlet.ui.border.KBorder b, int x, int y, int width, int height) {\n // TODO codavaj!!\n return null;\n }", "public void calculateDualPoint() {\n\n\t\tPoint dualPoint = new Point();\n\n\t\t// Go through all edges of the cell\n\t\tfor (int i = 0; i < face.edges().size(); i++) {\n\n\t\t\tDCEL_Edge e = (DCEL_Edge) face.edges().get(i);\n\n\t\t\t//\n\t\t\tif (e.reference instanceof Arc2_Sweep) {\n\n\t\t\t\t// In order to get the dual point we do the following:\n\t\t\t\t// 1. Calculate a segment which is fully contained in the cell\n\t\t\t\t// 1.1 First get a vertical segment whose x coordinate are\n\t\t\t\t// within cell x- coordinates\n\t\t\t\t// 1.2 Calculate the intersections of this segment with the\n\t\t\t\t// cell's arcs\n\t\t\t\t// 1.3 Sort the intersections with respect to their y\n\t\t\t\t// coordinates\n\t\t\t\t// 1.4 Take the first two coordingates.\n\t\t\t\t// 1.5 Those two coordinates will be the starting and the ending\n\t\t\t\t// point of the vertical line. This vertical line is fully\n\t\t\t\t// contained in the cell\n\t\t\t\t// 2. Now take the center of the segment\n\n\t\t\t\t// Step 1.1\n\t\t\t\tSegment2 segment = getVerticalSegmentOfCell();\n\t\t\t\t// Step 1.2\n\t\t\t\tPointList intersections = getIntersectionsWithArcs(segment);\n\t\t\t\t// Step 1.3\n\t\t\t\tCollections.sort(intersections.points, Point.COMPARE_BY_YCoord);\n\t\t\t\t// Step 1.4\n\t\t\t\tPoint2 startingPoint = new Point2(intersections.getPoints()\n\t\t\t\t\t\t.get(0).posX, intersections.getPoints().get(0).posY);\n\t\t\t\tPoint2 endingPoint = new Point2(intersections.getPoints()\n\t\t\t\t\t\t.get(1).posX, intersections.getPoints().get(1).posY);\n\t\t\t\t// Step 1.5\n\t\t\t\tSegment2 segmentInCell = new Segment2(startingPoint,\n\t\t\t\t\t\tendingPoint);\n\t\t\t\tsegment = segmentInCell;\n\t\t\t\t// Step 2\n\t\t\t\tdualPoint = new Point((int) segmentInCell.center().x,\n\t\t\t\t\t\t(int) segmentInCell.center().y, Color.GREEN);\n\n\t\t\t} else if (e.reference instanceof Circle2) {\n\n\t\t\t\tCircle2 circle = (Circle2) e.reference;\n\t\t\t\tdualPoint = new Point(circle.centre.x, circle.centre.y,\n\t\t\t\t\t\tColor.GREEN);\n\t\t\t}\n\t\t}\n\n\t\tthis.dualPoint = dualPoint;\n\t}", "public ArrayList<int[]> surroundingCoordinates(int row, int col){\n\t\t\t\n\t\tArrayList<int[]> coordinates = new ArrayList<int[]>();\n\t\tfor(int x = -1; x <= 1; x++) {\n\t\t\tfor(int y = -1; y <= 1; y++) {\n\t\t\t\tif(\t\t\n\t\t\t\t\t\t(row+x >= 0) && \n\t\t\t\t\t\t(col+y >= 0) &&\n\t\t\t\t\t\t(row+x < bm.getBoardSize()) &&\n\t\t\t\t\t\t(col+y < bm.getBoardSize()) &&\n\t\t\t\t\t\t(x != 0 || y != 0)\n\t\t\t\t){\n\t\t\t\t\tcoordinates.add(new int[]{row+x, col+y});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coordinates;\n\t}", "public int x (int index) { return coords[index][0]; }", "int getBlue(int x, int y);", "public Coordinates closestPointB() {\n return closestPointB;\n }", "public float getX2() {\r\n return (c + 2*b + 3*a)/3;\r\n }", "private void BC_duct(Grid gr){\r\n int i, j;\t\t\r\n NSmax=(int)(20/dt); repL=0.1;\r\n\t\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions of upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions of left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\r\n // initial conditions\r\n //for(j = 1; j <mym; j++){ \r\n // u[0][j]=Umean; //2.0*Umean*(1.0-4.0*(gr.y[0][j]-0.5)*(gr.y[0][j]-0.5));\r\n //}\r\n for(i = 0; i < mx; i++){ \r\n for(j = 1; j<mym; j++) u[i][j]=Umean;\r\n }\r\n // xmin=1.6; ymin=-3; xmax=8.6; ymax=3;\r\n }", "public abstract Element getElement(Point2D point) throws PositionEX;", "public Function(double b, double c) {\r\n\t //y = b*x + c;\r\n co[0]= c;\r\n co[1]= b;\r\n degree[0] = 0;\r\n degree[1] = 1;\r\n cindex = 2; \r\n\t}", "public Point2D getCellCoordinates(JmtCell cell) {\r\n \t\tRectangle2D bounds = GraphConstants.getBounds(cell.getAttributes());\r\n \t\treturn new Point2D.Double(bounds.getMinX(), bounds.getMinY());\r\n \t}", "public double[] getPositionCollisionBoundary(){\n\t\tif (!Helper.isValidDouble(this.getTimeCollisionBoundary()) || this.superWorld == null) return null;\n\t\tdouble[] pos = new double[2];\n\t\tpos[0] = this.getPosition()[0] + (this.getVelocity()[0] * this.getTimeCollisionBoundary());\n\t\tpos[1] = this.getPosition()[1] + (this.getVelocity()[1] * this.getTimeCollisionBoundary());\n\t\t\n\t\tif (pos[0] + this.getRadius() >= this.superWorld.getWorldHeight()) pos[0]+= this.getRadius();\n\t\telse if (pos[0] - this.getRadius() >= this.superWorld.getWorldHeight()) pos[0]-= this.getRadius();\n\t\telse if (pos[1] + this.getRadius() >= this.superWorld.getWorldHeight()) pos[1]+= this.getRadius();\n\t\telse\tpos[1] -= this.getRadius();\n\t\t\t\n\t\t\n\t\treturn pos;\n\t}", "public void solve(int b, DoubleGrid output, DoubleGrid input, double a, double c) {\n\n GaussSeidelFieldGenerator fieldGenerator = new GaussSeidelFieldGenerator(input, a, c);\n\n for (int count = 0; count < repeats; count++) {\n\n output.eachInnerRowCol(fieldGenerator::generate);\n\n boundary.apply(output);\n\n// setBoundry(b, x);\n }\n }", "public int[] computeXY() \n\t\t//POST: FCTVAL == coordinates of the node in form [x, y]\n\t\t{\n\t\t\tint myPosition = getPositionInList(this);\t//get the position of the node\n\n\t\t\t//calculate angle in the circle based on position\n\t\t\tdouble angle = (((double) myPosition) * ((2*Math.PI) / (double) length)); \n\n\t\t\t//convert from polar to cartesian coordinates with radius 0.7; x = rcos(theta)\n\t\t\tdouble x = Math.cos(angle) * 0.7;\t\t//x = rcos(theta)\n\t\t\tdouble y = Math.sin(angle) * 0.7;\t\t//y = rsin(theta)\n\t\t\t\n\t\t\treturn ScaledPoint.getRealCoordinance(x, y);\n\t\t}", "private void BC_cylinder(Grid gr){\r\n int i, j, j1, j2;\r\n NSmax = (int)(500.0/dt); repL=0.1;\r\n // Boundary conditions of lower side of computational domain\r\n for(i = 0; i<gr.mxL1; i++) BClow[i]=\"periodic\"; \r\n for(i =gr.mxL1; i<gr.mxL2; i++) BClow[i]=\"wall\";\r\n for(i =gr.mxL2; i<mx; i++) BClow[i]=\"periodic\";\r\n // Boundary conditions on upper side \r\n for(i = 0; i<gr.mxU1; i++) BCupp[i]=\"slip\";\r\n for(i =gr.mxU1; i<gr.mxU2; i++) BCupp[i]=\"in\";\r\n for(i =gr.mxU2; i<mx; i++) BCupp[i]=\"slip\";\r\n // Boundary conditions on left side\r\n for(j = 0; j<my; j++) BClef[j]=\"out\";\r\n // Boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\t\t\r\n\r\n // Initial conditions; \r\n for(i=0; i<mx; i++){ \r\n if(BClow[i]==\"wall\") j1=1; else j1=0;\r\n for(j=j1; j<my; j++) u[i][j]=Umean; \r\n }\r\n u[gr.mxL2][0]=0.0;\r\n xrange[0]=1.0f; yrange[0]=-4.5f; xrange[1]=10.0f; yrange[1]=4.5f; \r\n\r\n }", "protodef.b_math.coord getCoordInfo();", "public float getX1() {\r\n return (b + 3*a)/3;\r\n }", "void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }", "public T elementDiv( T b ) {\n convertType.specify(this, b);\n T A = convertType.convert(this);\n b = convertType.convert(b);\n\n T c = A.createLike();\n A.ops.elementDiv(A.mat, b.mat, c.mat);\n return c;\n }", "private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }", "public static double bisector(double b, double c, double alpha) {\n \tdouble p = 2 * b * c * Math.cos(alpha / 2);\n \tdouble bis = p / (b + c);\n \treturn bis;\n }", "static BigDecimal compound(final BigDecimal a, final BigDecimal r, final int n, final int y)\n {\n return a.multiply(ONE.add(divide(r, n)).pow(y * n));\n }", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public abstract int[] getCoords();", "private static int[] intersection(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4){\n\n\t\tdouble b1 = (y2 - y1)/(x2 - x1);\n\t\tdouble a1 = y1 - (b1*x1);\n\t\tdouble b2 = (y4 - y3)/(x4 - x3);\n\t\tdouble a2 = y3 - (b2*x3);\n\t\tif(x2-x1 == 0) //vertical\n\t\t\treturn new int[]{(int)x1,(int)(a2+(b2*x1))};\n\t\tif(x3-x4 == 0) //vertical\n\t\t\treturn new int[]{(int)x3,(int)(a1+(b1*x3))};\n\t/*\tif(Math.abs(b1-b2) < 0.001)\n\t\t\treturn null;\n\t\tdouble intX = -(a1-a2)/(b1-b2);\n\t\tdouble intY = a1+(b1*intX);*/\n\t\tdouble d = ((y4-y3)*(x2-x1) - (x4-x3)*(y2-y1));\n\t\tif(d == 0)\n\t\t\treturn null; //parallel roads\n\t\tdouble a = ((x4-x3)*(y1-y3) - (y4-y3)*(x1-x3))*1.0/d;\n\t\tint intX = (int)x1+(int)(a*(x2-x1));\n\t\tint intY = (int)y1+(int)(a*(y2-y1));\n\t\treturn new int[]{(int)intX,(int)intY};\n\t}", "private double[] b2() {\n double[] r = b;\n for (int j = 0; j < nBinVars2; j++) {\n r = Maths.append(r, 1d);\n }\n return r;\n }", "public abstract double[] getLowerBound();", "abstract Double getWeight(int i, int j);", "public double minAreaFreeRect(int[][] points) {\n if (points.length < 4) {\n return 0;\n }\n\n //key: info of distance, x,y center positions\n double minVal = Double.MAX_VALUE;\n Map<String, List<int[]>> map = new HashMap<>();\n for (int i = 0; i < points.length - 1; i++) {\n for (int j = i + 1; j < points.length; j++) {\n long dis = (points[i][0] - points[j][0]) * (points[i][0] - points[j][0]) +\n (points[i][1] - points[j][1]) * (points[i][1] - points[j][1]);\n double centerX = (double)(points[i][0] + points[j][0]) / 2;\n double centerY = (double)(points[i][1] + points[j][1]) / 2;\n String key = dis + \" \" + centerX + \" \" + centerY;\n if (!map.containsKey(key)) {\n map.put(key, new ArrayList<int[]>());\n }\n map.get(key).add(new int[]{i,j});\n }\n }\n\n //therefore all vals stored in same key can form rectangles\n //just try all of them to find the one with smallest area\n for (String key: map.keySet()) {\n if (map.get(key).size() < 2) {\n continue;\n }\n List<int[]> values = map.get(key);\n for (int i = 0; i < values.size() - 1; i++) {\n for (int j = i + 1; j < values.size(); j++) {\n int p1 = values.get(i)[0];\n int p2 = values.get(i)[1];\n int p3 = values.get(j)[0];\n\n double len1 = Math.sqrt((points[p1][0] - points[p3][0]) * (points[p1][0] - points[p3][0]) + (points[p1][1] - points[p3][1]) * (points[p1][1] - points[p3][1]));\n double len2 = Math.sqrt((points[p2][0] - points[p3][0]) * (points[p2][0] - points[p3][0]) + (points[p2][1] - points[p3][1]) * (points[p2][1] - points[p3][1]));\n\n minVal = Math.min(minVal, len1 * len2);\n }\n }\n }\n return minVal == Double.MAX_VALUE? 0: minVal;\n\n }", "public ColorRgb getColorRgbBiLinear(double x, double y)\n {\n //-----------------------------------------------------------------\n double u = x - Math.floor(x);\n double v = y - Math.floor(y);\n double U = u * ((double)(getXSize()-2));\n double V = v * ((double)(getYSize()-2));\n int i = (int)Math.floor(U);\n int j = (int)Math.floor(V);\n double du = U - (double)i;\n double dv = V - (double)j;\n RGBPixel p;\n\n //-----------------------------------------------------------------\n p = getPixelRgb(i, j);\n ColorRgb F00 = new ColorRgb();\n F00.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F00.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F00.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j);\n ColorRgb F10 = new ColorRgb();\n F10.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F10.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F10.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i, j+1);\n ColorRgb F01 = new ColorRgb();\n F01.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F01.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F01.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j+1);\n ColorRgb F11 = new ColorRgb();\n F11.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F11.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F11.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n //-----------------------------------------------------------------\n ColorRgb FU0 = new ColorRgb();\n FU0.r = F00.r + du * (F10.r-F00.r);\n FU0.g = F00.g + du * (F10.g-F00.g);\n FU0.b = F00.b + du * (F10.b-F00.b);\n\n ColorRgb FU1 = new ColorRgb();\n FU1.r = F01.r + du * (F11.r-F01.r);\n FU1.g = F01.g + du * (F11.g-F01.g);\n FU1.b = F01.b + du * (F11.b-F01.b);\n\n ColorRgb FVAL = new ColorRgb();\n FVAL.r = FU0.r + dv * (FU1.r-FU0.r);\n FVAL.g = FU0.g + dv * (FU1.g-FU0.g);\n FVAL.b = FU0.b + dv * (FU1.b-FU0.b);\n\n return FVAL;\n }", "public Point getBPosition()\n\t{\n\t\treturn bPoint;\n\t}", "public Coords bound(final Coords point)\r\n {\r\n int xx = point.getX();\r\n int yy = point.getY();\r\n if(xx < x)\r\n {\r\n xx = x;\r\n }\r\n if(xx > x + width)\r\n {\r\n xx = x + width;\r\n }\r\n if(yy < y)\r\n {\r\n yy = y;\r\n }\r\n if(yy > y + height)\r\n {\r\n yy = y + height;\r\n }\r\n return new Coords(xx, yy);\r\n }", "public int getCribOffset(int a, int b) {\r\n return this.matrix[a][b];\r\n }", "private int xyTo1D(int i, int j) {\n return (mGridSize * (i - 1) + j);\n }", "private int xyTo1D(final int row, final int col) {\n return (row - 1) * size + (col - 1);\n }", "public int findCoordElement(double target, boolean bounded) {\n switch (orgGridAxis.getSpacing()) {\n case regularInterval:\n case regularPoint:\n return findCoordElementRegular(target, bounded);\n case irregularPoint:\n case contiguousInterval:\n return findCoordElementContiguous(target, bounded);\n case discontiguousInterval:\n return findCoordElementDiscontiguousInterval(target, bounded);\n }\n throw new IllegalStateException(\"unknown spacing\" + orgGridAxis.getSpacing());\n }", "@Override\n\tpublic double[] getDx() {\n\t double object[] = new double[2];\n\t for(int i = 0; i < x.length; i++){\n\t object[0] += theta[0] + theta[1] * x[i] - y[i];\n\t object[1] += (theta[0] + theta[1] * x[i] - y[i])*x[i];\n\t }\n\t theta[0] -= eta * object[0];\n\t theta[1] -= eta * object[1];\n\n\t return theta;\n }", "public static BoundingBox calculateBoundingBox(Vector3D[] paramArrayOfVector3D)\r\n/* 13: */ {\r\n/* 14: 9 */ Vector3D localVector3D1 = new Vector3D();\r\n/* 15: 10 */ for (int i = 0; i < paramArrayOfVector3D.length; i++)\r\n/* 16: */ {\r\n/* 17: 12 */ localVector3D1.x += paramArrayOfVector3D[i].x;\r\n/* 18: 13 */ localVector3D1.y += paramArrayOfVector3D[i].y;\r\n/* 19: 14 */ localVector3D1.z += paramArrayOfVector3D[i].z;\r\n/* 20: */ }\r\n/* 21: 16 */ localVector3D1.x /= paramArrayOfVector3D.length;\r\n/* 22: 17 */ localVector3D1.y /= paramArrayOfVector3D.length;\r\n/* 23: 18 */ localVector3D1.z /= paramArrayOfVector3D.length;\r\n/* 24: 19 */ float[][] arrayOfFloat = new float[3][3];\r\n/* 25: 20 */ for (int j = 0; j < paramArrayOfVector3D.length; j++)\r\n/* 26: */ {\r\n/* 27: 22 */ float f1 = paramArrayOfVector3D[j].x - localVector3D1.x;\r\n/* 28: 23 */ float f2 = paramArrayOfVector3D[j].y - localVector3D1.y;\r\n/* 29: 24 */ float f3 = paramArrayOfVector3D[j].z - localVector3D1.z;\r\n/* 30: 25 */ arrayOfFloat[0][0] += f1 * f1;\r\n/* 31: 26 */ arrayOfFloat[1][1] += f2 * f2;\r\n/* 32: 27 */ arrayOfFloat[2][2] += f3 * f3;\r\n/* 33: 28 */ arrayOfFloat[0][1] += f1 * f2;\r\n/* 34: 29 */ arrayOfFloat[0][2] += f1 * f3;\r\n/* 35: 30 */ arrayOfFloat[1][2] += f2 * f3;\r\n/* 36: */ }\r\n/* 37: 32 */ arrayOfFloat[1][2] /= paramArrayOfVector3D.length;\r\n/* 38: 33 */ arrayOfFloat[2][1] = arrayOfFloat[1][2];\r\n/* 39: 34 */ arrayOfFloat[0][2] /= paramArrayOfVector3D.length;\r\n/* 40: 35 */ arrayOfFloat[2][0] = arrayOfFloat[0][2];\r\n/* 41: 36 */ arrayOfFloat[0][1] /= paramArrayOfVector3D.length;\r\n/* 42: 37 */ arrayOfFloat[1][0] = arrayOfFloat[0][1];\r\n/* 43: 38 */ arrayOfFloat[1][1] /= paramArrayOfVector3D.length;\r\n/* 44: 39 */ arrayOfFloat[2][2] /= paramArrayOfVector3D.length;\r\n/* 45: 40 */ arrayOfFloat[0][0] /= paramArrayOfVector3D.length;\r\n/* 46: 41 */ System.out.println(arrayOfFloat[0][0] + \"\\t\" + arrayOfFloat[0][1] + \"\\t\" + arrayOfFloat[0][2] + \"\\t\");\r\n/* 47: 42 */ System.out.println(arrayOfFloat[1][0] + \"\\t\" + arrayOfFloat[1][1] + \"\\t\" + arrayOfFloat[1][2] + \"\\t\");\r\n/* 48: 43 */ System.out.println(arrayOfFloat[2][0] + \"\\t\" + arrayOfFloat[2][1] + \"\\t\" + arrayOfFloat[2][2] + \"\\t\");\r\n/* 49: 44 */ double[][] arrayOfDouble1 = new double[3][3];\r\n/* 50: 45 */ for (int k = 0; k < 3; k++) {\r\n/* 51: 47 */ for (int m = 0; m < 3; m++) {\r\n/* 52: 49 */ arrayOfDouble1[k][m] = arrayOfFloat[k][m];\r\n/* 53: */ }\r\n/* 54: */ }\r\n/* 55: 52 */ Matrix localMatrix1 = new Matrix(arrayOfDouble1);\r\n/* 56: 53 */ EigenvalueDecomposition localEigenvalueDecomposition = localMatrix1.eig();\r\n/* 57: 54 */ Matrix localMatrix2 = localEigenvalueDecomposition.getV();\r\n/* 58: 55 */ double[][] arrayOfDouble2 = localMatrix2.getArray();\r\n/* 59: 56 */ Vector3D localVector3D2 = new Vector3D((float)arrayOfDouble2[0][0], (float)arrayOfDouble2[1][0], (float)arrayOfDouble2[2][0]);\r\n/* 60: 57 */ Vector3D localVector3D3 = new Vector3D(-(float)arrayOfDouble2[0][1], -(float)arrayOfDouble2[1][1], -(float)arrayOfDouble2[2][1]);\r\n/* 61: 58 */ Vector3D localVector3D4 = new Vector3D(-(float)arrayOfDouble2[0][2], -(float)arrayOfDouble2[1][2], -(float)arrayOfDouble2[2][2]);\r\n/* 62: 59 */ System.out.println(\"r=\" + localVector3D4);\r\n/* 63: 60 */ System.out.println(\"s=\" + localVector3D3);\r\n/* 64: 61 */ System.out.println(\"t=\" + localVector3D2);\r\n/* 65: 62 */ float f4 = 0.0F;\r\n/* 66: 63 */ float f5 = 0.0F;\r\n/* 67: 64 */ float f6 = 0.0F;\r\n/* 68: 65 */ float f7 = 0.0F;\r\n/* 69: 66 */ float f8 = 0.0F;\r\n/* 70: 67 */ float f9 = 0.0F;\r\n/* 71: 68 */ for (int n = 0; n < paramArrayOfVector3D.length; n++)\r\n/* 72: */ {\r\n/* 73: 70 */ float f10 = paramArrayOfVector3D[n].dotProduct(localVector3D4);\r\n/* 74: 71 */ float f11 = paramArrayOfVector3D[n].dotProduct(localVector3D4);\r\n/* 75: 72 */ float f12 = paramArrayOfVector3D[n].dotProduct(localVector3D4);\r\n/* 76: 73 */ f4 = Math.min(f4, f10);\r\n/* 77: 74 */ f5 = Math.min(f5, f11);\r\n/* 78: 75 */ f6 = Math.min(f6, f12);\r\n/* 79: 76 */ f7 = Math.max(f7, f10);\r\n/* 80: 77 */ f8 = Math.max(f8, f11);\r\n/* 81: 78 */ f9 = Math.max(f9, f12);\r\n/* 82: */ }\r\n/* 83: 80 */ float[] arrayOfFloat1 = { localVector3D4.x, localVector3D4.y, localVector3D4.z, -f4 };\r\n/* 84: 81 */ float[] arrayOfFloat2 = { -localVector3D4.x, -localVector3D4.y, -localVector3D4.z, f7 };\r\n/* 85: 82 */ float[] arrayOfFloat3 = { localVector3D2.x, localVector3D2.y, localVector3D2.z, -f6 };\r\n/* 86: 83 */ float[] arrayOfFloat4 = { -localVector3D2.x, -localVector3D2.y, -localVector3D2.z, f9 };\r\n/* 87: 84 */ float[] arrayOfFloat5 = { localVector3D3.x, localVector3D3.y, localVector3D3.z, -f5 };\r\n/* 88: 85 */ float[] arrayOfFloat6 = { -localVector3D3.x, -localVector3D3.y, -localVector3D3.z, f8 };\r\n/* 89: 86 */ return new BoundingBox(arrayOfFloat1, arrayOfFloat2, arrayOfFloat3, arrayOfFloat4, arrayOfFloat5, arrayOfFloat6);\r\n/* 90: */ }", "public double[] getHitGeoCoord();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public double getValue(double x, double y){\n\n\tint i,j;\n\tdouble fracX,fracY;\n\tdouble Wxm, Wx0, Wxp, Wym, Wy0, Wyp;\n\tdouble Vm, V0, Vp;\n\n\n\tif(x < x_min || y < y_min || x > x_max || y > y_max){\n\t return z_min;\n\t}\n\n i = (int) ((x-x_min)/x_step + 0.5);\n j = (int) ((y-y_min)/y_step + 0.5);\n\n if( i < 1) i = 1;\n if( i > (nX-2)) i = nX-2;\n if( j < 1) j = 1;\n if( j > (nY-2)) j = nY-2;\t \n\n fracX = (x - x_min - i*x_step)/x_step;\n fracY = (y - y_min - j*y_step)/y_step;\n\n\tWxm = 0.5*(0.5 - fracX)*(0.5 - fracX);\n\tWxp = 0.5*(0.5 + fracX)*(0.5 + fracX);\n\tWx0 = 0.75 - fracX*fracX;\n\n\tWym = 0.5*(0.5 - fracY)*(0.5 - fracY);\n\tWyp = 0.5*(0.5 + fracY)*(0.5 + fracY);\n\tWy0 = 0.75 - fracY*fracY;\n\n\tVm = Wxm*gridData[i-1][j-1]+Wx0*gridData[i][j-1]+Wxp*gridData[i+1][j-1];\n\tV0 = Wxm*gridData[i-1][j] +Wx0*gridData[i][j] +Wxp*gridData[i+1][j];\n\tVp = Wxm*gridData[i-1][j+1]+Wx0*gridData[i][j+1]+Wxp*gridData[i+1][j+1];\n\n return Wym*Vm + Wy0*V0 + Wyp*Vp;\n }", "private Point2D.Double calcVec(Point2D.Double a, Point2D.Double b)\n\t{\n\t\treturn new Point2D.Double((b.getX() - a.getX()), (b.getY() - a.getY()));\n\t}", "public int a(bzl ☃, bzg bzg1, int i, int j) {\r\n/* 13 */ if (i == -bzg1.a() && j == -bzg1.b() && bzg1.a() > -bzg1.c() && bzg1.a() <= 0 && bzg1.b() > -bzg1.d() && bzg1.b() <= 0) {\r\n/* 14 */ return 1;\r\n/* */ }\r\n/* */ \r\n/* 17 */ return (☃.a(10) == 0) ? 1 : bzy.c;\r\n/* */ }", "private double d(Point a, Point b){\n\t\treturn Math.sqrt(Math.pow(b.getX()-a.getX(),2) + Math.pow(a.getY() - b.getY(), 2));\r\n\t}", "int getBlockNumber(int x, int y);", "public float[] getCenterCo(float x, float y)\n\t{\n\t\tfloat[] co = new float[2];\n\t\tint xco = getXVal(x);\n\t\tco[0] = (xco*PIXEL_WIDTH) - (PIXEL_WIDTH/2);\n\t\t\n\t\tint yco = getYVal(y);\n\t\tco[1] = (yco*PIXEL_HEIGHT) - (PIXEL_HEIGHT/2);\n\t\t\n\t\treturn co;\n\t}", "public double r() { return Math.sqrt(x*x + y*y); }", "public Coordinates inBetweenPoint(Coordinates a, Coordinates b, double ratio);", "private int findCoordElementContiguous(double target, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n\n // Check that the point is within range\n MinMax minmax = orgGridAxis.getCoordEdgeMinMax();\n if (target < minmax.min()) {\n return bounded ? 0 : -1;\n } else if (target > minmax.max()) {\n return bounded ? n - 1 : n;\n }\n\n int low = 0;\n int high = n - 1;\n if (orgGridAxis.isAscending()) {\n // do a binary search to find the nearest index\n int mid;\n while (high > low + 1) {\n mid = (low + high) / 2; // binary search\n if (intervalContains(target, mid, true, false))\n return mid;\n else if (orgGridAxis.getCoordEdge2(mid) < target)\n low = mid;\n else\n high = mid;\n }\n return intervalContains(target, low, true, false) ? low : high;\n\n } else { // descending\n // do a binary search to find the nearest index\n int mid;\n while (high > low + 1) {\n mid = (low + high) / 2; // binary search\n if (intervalContains(target, mid, false, false))\n return mid;\n else if (orgGridAxis.getCoordEdge2(mid) < target)\n high = mid;\n else\n low = mid;\n }\n return intervalContains(target, low, false, false) ? low : high;\n }\n }", "public void collision(Ball b){\n float cir_center_X = b.getCenterX();\r\n float cir_center_Y = b.getCenterY();\r\n \r\n // aabb half extent\r\n float extent_X = (this.p4[0]-this.p1[0])/2; //half width\r\n float extent_Y = (this.p3[1]-this.p4[1])/2; // half height\r\n // rec center \r\n float rec_center_X = this.p1[0]+extent_X;\r\n float rec_center_Y = this.p1[1]+extent_Y;\r\n \r\n // difference between center : vector D = Vector Cir_center-Rec-center\r\n float d_X =cir_center_X-rec_center_X;\r\n float d_Y = cir_center_Y-rec_center_Y;\r\n \r\n //\r\n float p_X =Support_Lib.clamp(d_X,-extent_X,extent_X);\r\n float p_Y =Support_Lib.clamp(d_Y,-extent_Y,extent_Y);\r\n \r\n\r\n \r\n float closest_point_X = rec_center_X +p_X;\r\n float closest_point_Y = rec_center_Y +p_Y; \r\n \r\n \r\n d_X = closest_point_X -cir_center_X;\r\n d_Y = closest_point_Y -cir_center_Y;\r\n \r\n \r\n \r\n float length = (float)Math.sqrt((d_X*d_X)+(d_Y*d_Y));\r\n \r\n if(length+0.001 <=b.getRadius()){\r\n\r\n \r\n float ratio =(closest_point_X-rec_center_X)/(extent_X*2);\r\n b.accelartion(ratio);\r\n b.updateVelocity(Support_Lib.direction(d_X,d_Y));\r\n \r\n }\r\n \r\n \r\n }", "public PVector align (ArrayList<Boid> boids) {\n float neighbordist = 50;\n PVector sum = new PVector(0, 0);\n int count = 0;\n for (Boid other : boids) {\n float d = PVector.dist(position, other.position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(other.velocity);\n count++;\n }\n }\n if (count > 0) {\n sum.div((float)count);\n sum.normalize();\n sum.mult(maxspeed);\n PVector steer = PVector.sub(sum, velocity);\n steer.limit(maxforce);\n return steer;\n } else {\n return new PVector(0, 0);\n }\n }", "public void generateB(){\n\t\t\tfor(int i = 0;i < w.length;i++){\n\t\t\t\tb[i] = w[i].multiply(r).mod(q);\n\t\t\t}\n\t}", "public abstract Node getBoundingNode();", "public GJPoint2D center();", "private static double g(double x, double y) {\n double eps = 1e-6;\n if (Math.abs(x + 1) < eps)\n return -y;\n if (Math.abs(x - 1) < eps)\n return y;\n if (Math.abs(y + 1) < eps)\n return -x;\n if (Math.abs(y - 1) < eps)\n return x;\n return 0;\n }", "private int xyTo1D(int i, int j) {\n int result = j + number * (i - 1) - 1;\n return result;\n }", "@Override\n public IComplexNDArray geru(IComplexNumber alpha, IComplexNDArray x, IComplexNDArray y, IComplexNDArray a) {\n NativeBlas.cgeru(a.rows(), a.columns(),\n new ComplexFloat(alpha.realComponent().floatValue(), alpha.imaginaryComponent().floatValue()),\n x.data(), x.offset(), 1, y.data(), y.offset(), 1, a.data(),\n a.offset(), a.rows());\n return a;\n }", "public int[][] RdB() {\t\t\t\t\t\t\t\t// cherche les 4 points noirs\n\t\tint[][] pixNoirs = new int[img.getWidth()*img.getHeight()][2];\n\n\t\tint i=0;\n\t\tint radius=8;\t\t\t\t\t\t\t\t\t// 19= limite de detection de checkCircle\n\t\tfor (int ty=0; ty<img.getHeight();ty++) {\n\t\t\tfor (int tx=0;tx<img.getWidth();tx++) {\n\n\t\t\t\tColor tmp=new Color(img.getRGB(tx, ty));\n\t\t\t\tif (tmp.getGreen()<20) { \t\t\t\t//si le pixel est noir\n\t\t\t\t\tif (checkCircle(tx,ty,radius) ) {\t//verifie si un cercle de radius entoure le pixel\n\t\t\t\t\t\tpixNoirs[i][0]=tx;\n\t\t\t\t\t\tpixNoirs[i][1]=ty;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"fin\");\n\t\tint tmp=1;\n\t\tint centreX[][]=new int [img.getWidth()*img.getHeight()][2];\n\t\tcentreX[0]=pixNoirs[0];\n\t\tfor (int l=0;l<img.getHeight()*img.getWidth() && (pixNoirs[l][1]!=0 || pixNoirs[l][0]!=0);l++) {\n\t\t\tif((pixNoirs[l][0]-centreX[tmp-1][0])<5 || pixNoirs[l][1]-centreX[tmp-1][1]<5 ){\t\t//x-(x-1)>5 ou y-(y-1)>5\n\t\t\t\tcentreX[tmp][0]=pixNoirs[l][0];\t\t\t//efface le precedent roar2 si il était a 1 pixel de diff\n\t\t\t\tcentreX[tmp][1]=pixNoirs[l][1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttmp++;\n\t\t\t\tcentreX[tmp]=pixNoirs[l];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//boucle de determination des points noirs\n\t\t//System.out.println(\"roar2debut\");\n\t\tint points[][]=new int [4][2];\n\t\tint centres[][]=new int [centreX.length][2]; int boucl=0; int lasti=0;\n\t\tint t=0;\n\t\tfor (int l=1;l<=img.getHeight()*img.getWidth() && (centreX[l-1][1]!=0 || centreX[l-1][0]!=0);l++) {\n\n\n\t\t\t\n\t\t\tint diffx=centreX[l][0]-centreX[l-1][0];\n\t\t\tint diffy=centreX[l][1]-centreX[l-1][1];\n\t\t\tint diff=Math.abs(diffx)+Math.abs(diffy);\n\t\t\tif (diff>img.getWidth()*0.85)\n\t\t\t{\n\t\t\t\tpoints[t]=centreX[l];\n\t\t\t\tt++;\n\t\t\t}\n\t\t\t\n\t\t\tif (diffx<10 && diffy<10) {\n\t\t\t\tboucl++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcentres[lasti][0]=centreX[l-boucl/2][0];\n\t\t\t\tcentres[lasti][1]=centreX[l-boucl/2][1];\n\t\t\t\tlasti++;boucl=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tfor (int l=0;l<=centres.length && (centres[l][1]!=0 || centres[l][0]!=0);l++) {\t\n\t\t\tboolean test=true;\n\t\t\tint maxPoint=0;\n\t\t\tfor (int li=0;li<=points.length && (points[li][1]!=0 || points[li][0]!=0);li++) {\n\t\t\t\tint diffx=\tMath.abs(centres[l][0]-points[li][0]);\n\t\t\t\tint diffy=\tMath.abs(centres[l][1]-points[li][1]);\n\t\t\t\tboolean testx=\t\tdiffx>img.getWidth()*0.85 \t|| diffx<img.getWidth()*0.2;\t//diff <0.1 ou >0.8 x la largeur de feuille\n\t\t\t\tboolean testy=\t\tdiffy>img.getHeight()*0.8 \t|| diffy<img.getWidth()*0.2;\n\t\t\t\tboolean Repeat=\tdiffx+diffy>img.getWidth()*0.2;\t //si point deja présent\n\n\t\t\t\tif (!Repeat || (!testx || !testy) )\t// si 0.2>diffx>0.8 ou \"diffy\" et \n\t\t\t\t{\n\t\t\t\t\ttest=false;\n\t\t\t\t}\n\t\t\t\tmaxPoint=li;\n\t\t\t}\n\t\t\t\n\t\t\tif(test && maxPoint<2) {\n\t\t\t\t//System.out.println(lastRoar[l][0]+\" \"+lastRoar[l][1]);\n\t\t\t\tpoints[maxPoint+1][0]=centres[l][0];\n\t\t\t\tpoints[maxPoint+1][1]=centres[l][1];\n\t\t\t}\n\t\t}\n\t\treturn points;\n\n\t}", "public Location getCornerB() {\n return cornerB;\n }", "public Coordonnees getCoordonnees(int x, int y) {\r\n\t\tif(y >= 0 && y < hauteur && x >= 0 && x < largeur)\r\n\t\t\treturn this.plateau[y][x].getCoordonnees();\r\n\t\treturn null;\r\n\t}", "List<Coord> getDependents(int col, int row);", "public int[][] getBlock(int b){\n\t\tint[][] block = new int[size][size];\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\tblock[i][j] = numbers[i+size*(b/size)]\n\t\t\t\t\t\t [j+size*(b%size)];\n\t\t\t}\n\t\t}\n\t\treturn block;\n\t}", "public abstract Vector computeCenter();", "public double[] element() {\n\t\treturn _coordinates;\n\t}", "private int findCoordElementDiscontiguousInterval(double target, boolean bounded) {\n int idx = findSingleHit(target);\n if (idx >= 0)\n return idx;\n if (idx == -1)\n return -1; // no hits\n\n // multiple hits = choose closest (definition of closest will be based on axis type)\n return findClosestDiscontiguousInterval(target);\n }", "private static double FindR2(double[] _y, double[] _x)\n {\n double avg = FindMeanY(_y);\n double sum = 0;\n double yQuad = 0;\n\n // a = SolutionMatrix.get(1, 0);\n // b = SolutionMatrix.get(2, 0);\n // find average\n for(int i = 0; i < _y.length; i ++)\n {\n yQuad += Math.pow((_y[i] - avg), 2);\n }\n\n double Usefulnum1 = 0;\n double Usefulnum2 = 0;\n double Usefulnum3 = 0;\n\n double[] Equation = new double[d+1];\n\n // find equation\n for(int i = 0; i < SolutionMatrix.getColumnDimension(); i++)\n {\n //Usefulnum1 = SolutionMatrix.get((SolutionMatrix.getColumnDimension() - 1 - i), 0) * _x[i]; // a...z value\n for (int jj = d; jj > 0; jj--)\n {\n Usefulnum2 = SolutionMatrix.get(SolutionMatrix.getColumnDimension() - jj, 0) * _x[i];\n Usefulnum3 += Math.pow(_y[i] - Usefulnum2, 2);\n }\n }\n System.out.print(Usefulnum3);\n for(int i = 0; i < _y.length; i ++)\n {\n\n }\n\n return sum;\n }", "public Point[] getBodyCoordinates() {\n Point[] temp = new Point[segments.length - 1];\n for (int i = 1; i < segments.length; i++) {\n temp[i - 1] = segments[i].getCoordinates();\n }\n return temp;\n }" ]
[ "0.56154954", "0.5396701", "0.532483", "0.52513105", "0.5160451", "0.5130184", "0.5126725", "0.51222444", "0.508614", "0.5055969", "0.49959713", "0.4942878", "0.4927618", "0.49258378", "0.49005273", "0.48754507", "0.4857296", "0.4853208", "0.4832719", "0.481046", "0.47946295", "0.4784921", "0.4754121", "0.47162464", "0.47150645", "0.47118932", "0.4704864", "0.46956772", "0.4692788", "0.46870178", "0.46801102", "0.46768963", "0.46747604", "0.46699455", "0.466573", "0.46647215", "0.46616524", "0.46571615", "0.46555644", "0.4649586", "0.46467087", "0.46426842", "0.46334183", "0.46325004", "0.4632355", "0.46258956", "0.46200794", "0.46057978", "0.460471", "0.45994753", "0.45839912", "0.4579777", "0.45772326", "0.45759243", "0.45703492", "0.4568405", "0.4567388", "0.45590818", "0.45507708", "0.45503438", "0.45484725", "0.45474848", "0.45406437", "0.45385683", "0.45366845", "0.45299292", "0.4523582", "0.45217928", "0.45205566", "0.45197153", "0.4506377", "0.45051825", "0.45020685", "0.449463", "0.44804278", "0.44788745", "0.44647717", "0.44622543", "0.4461557", "0.44557124", "0.44536003", "0.4445012", "0.44443175", "0.44409555", "0.4439189", "0.4427187", "0.44234875", "0.4421825", "0.44189242", "0.44172427", "0.44141272", "0.4412312", "0.44121036", "0.4395694", "0.43893433", "0.43882746", "0.43881306", "0.43877715", "0.43851757", "0.43851224" ]
0.63776416
0
metodos metodo para crear persona
public void crearPersona(){ persona = new Persona(); persona.setNombre("Jose"); persona.setCedula(12345678); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void crearNuevaPersona(Persona persona);", "public void create(Person p) {\n\t\t\n\t}", "@Override\r\n\tpublic void create(Person p) \r\n\t{\n\t\t\r\n\t}", "public void CreatePerson(Person p){\n\t\tWeddingConnectionPoolManager con = new WeddingConnectionPoolManager(); \n\t\t Person p1 = new Person(p.getId(), p.getFirstName(), p.getLastName(), p.getRelationship(),\n\t\t\t\t p.getAddress(), p.getPhone(), p.getEmail(), p.getComment(), user.getId());\n\t\t System.out.println(\"p1 : \" + p1);\n\t\t System.out.println(\"p : \" + p);\n\t\t// TODO - should to iterate on the results that returns when calling to \"getpersons\" method.\n\t\tPersonDBManager.getInstance().CreateNewPerson(con.getConnectionFromPool(), p1);\t\n\t}", "@Override\r\n\tpublic void create(Person person) {\n\r\n\t}", "public Person createPerson(Person p);", "Person createPerson();", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Persona() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "public abstract Anuncio creaAnuncioIndividualizado();", "public Persona() {\n \t\n }", "public Persona() {\n\t}", "public Persona() {\n }", "public Persona(){\n /*super(nombresPosibles\n [r.nextInt(nombresPosibles.length)],(byte)r.nextInt(101));\n */\n super(\"Anónimo\",(byte)5);\n String[] nombresPosibles={\"Patracio\",\"Eusequio\",\"Bartolo\",\"Mortadelo\",\"Piorroncho\",\"Tiburcio\"};\n String[] apellidosPosibles={\"Sánchez\",\"López\",\"Martínez\",\"González\",\"Páramos\",\"Jiménez\",\"Parra\"};\n String[] nacionalidadesPosibles={\"Española\",\"Francesa\",\"Alemana\",\"Irlandesa\",\"Japonesa\",\"Congoleña\",\"Bielorrusa\",\"Mauritana\"};\n Random r=new Random();\n this.apellido=apellidosPosibles\n [r.nextInt(apellidosPosibles.length)];\n this.nacionalidad=nacionalidadesPosibles\n [r.nextInt(nacionalidadesPosibles.length)];\n mascota=new Mascota[5];\n this.saldo=r.nextInt(101);\n }", "public Persona(String nombre, String apellido, String email, String telefono){\n this.nombre = nombre;\n this.apellido = apellido;\n this.email = email;\n this.telefono = telefono;\n }", "public void crearPersona(PersonaDTO personaDTO);", "public PersonaFisica() {}", "public Persona(String nombre) {\n this.nombre = nombre;\n }", "ProjetoRN createProjetoRN();", "public Persona(int idPersona, String nombre, String apellido, String email, String telefono){\n this.idPersona = idPersona;\n this.nombre = nombre;\n this.apellido = apellido;\n this.email = email;\n this.telefono = telefono;\n \n }", "public List<Person> createPerson() throws ParseException {\n\t\tList<Person> lespersons = new ArrayList<Person>();\n\t\tint numOfPersons = manager.createQuery(\"Select p From Person p\", Person.class).getResultList().size();\n\n if (numOfPersons == 0) {\n \tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n \tPerson p1 = new Person(\"dupont\", \"paul\", \"[email protected]\", \"M\", \"http://\", simpleDateFormat.parse(\"06/12/1965\"));\n \tPerson p2 = new Person(\"durand\", \"gerard\", \"[email protected]\", \"F\", \"http://\", simpleDateFormat.parse(\"06/04/1965\"));\n \tPerson p3 = new Person(\"Pierre\", \"martin\", \"[email protected]\", \"M\", \"http://\", simpleDateFormat.parse(\"06/08/1965\"));\n \tp1.getListAmis().add(p2);\n \tp2.getListAmis().add(p1);\n \tp2.getListAmis().add(p3);\n manager.persist(p1);\n manager.persist(p2);\n manager.persist(p3);\n lespersons.add(p1);\n lespersons.add(p2);\n lespersons.add(p3);\n }\n return lespersons;\n\t}", "public void registrarPersona() {\n\t\ttry {\n\t\t\tif (validaNumDocumento(getNumDocumentPersona())) {\n\t\t\t\t\tif (validaDireccion()) {\n\t\t\t\t\t\tif (validaApellidosNombres()) {\n\t\t\t\t\t\t\tPaPersona persona = new PaPersona();\n\t\t\t\t\t\t\tif (getActualizaPersona() != null && getActualizaPersona().equals(\"N\")) {\n\t\t\t\t\t\t\t\tpersona.setPersonaId(Constante.RESULT_PENDING);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpersona.setPersonaId(getPersonaId() == null ? Constante.RESULT_PENDING: getPersonaId());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpersona.setTipoDocumentoId(Integer.valueOf(mapTipoDocumento.get(getTipoDocumento())));\n\t\t\t\t\t\t\tpersona.setNroDocIdentidad(getNumDocumentPersona());\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif (persona.getTipoDocumentoId() == Constante.TIPO_DOCUMENTO_RUC_ID) {\n\t\t\t\t\t\t\t\tpersona.setRazonSocial(getRazonSocial());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpersona.setPrimerNombre(getPrimerNombre());\n\t\t\t\t\t\t\t\tpersona.setSegundoNombre(getSegundoNombre());\n\t\t\t\t\t\t\t\tpersona.setApePaterno(getApellidoPaterno());\n\t\t\t\t\t\t\t\tpersona.setApeMaterno(getApellidoMaterno());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tPaDireccion direccion = new PaDireccion();\n\t\t\t\t\t\t\tdireccion.setDireccionId(getDireccionId() == null ? Constante.RESULT_PENDING: getDireccionId());\n\t\t\t\t\t\t\tif (getSelectedOptBusc().intValue() == 1) {\n\t\t\t\t\t\t\t\tdireccion.setTipoViaId(mapGnTipoVia.get(getCmbtipovia().getValue()));\n\t\t\t\t\t\t\t\tdireccion.setViaId(mapGnVia.get(getCmbvia().getValue()));\n\t\t\t\t\t\t\t\tdireccion.setLugarId(null);\n\t\t\t\t\t\t\t\tdireccion.setSectorId(null);\n\t\t\t\t\t\t\t\tdireccion.setNumero(numero);\n\t\t\t\t\t\t\t\tdireccion.setPersonaId(persona.getPersonaId());\n\n\t\t\t\t\t\t\t\tString direccionCompleta = papeletaBo.getDireccionCompleta(direccion,mapIGnTipoVia, mapIGnVia);\n\t\t\t\t\t\t\t\tif (direccionCompleta != null && direccionCompleta.trim().length() > 0) {\n\t\t\t\t\t\t\t\t\tdireccion.setDireccionCompleta(direccionCompleta);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdireccion.setDireccionCompleta(getDireccionCompleta());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tBuscarPersonaDTO personaDto = getPersonaDto(persona, direccion);\n\t\t\t\t\t\t\tString personaPapeleta = (String) getSessionMap().get(\"personaPapeleta\");\n\t\t\t\t\t\t\tif (personaPapeleta != null\n\t\t\t\t\t\t\t\t\t&& personaPapeleta.equals(\"I\")) {\n\t\t\t\t\t\t\t\tRegistroPapeletasManaged registro = (RegistroPapeletasManaged) getManaged(\"registroPapeletasManaged\");\n\t\t\t\t\t\t\t\tregistro.setDatosInfractor(personaDto);\n\t\t\t\t\t\t\t} else if (personaPapeleta != null\n\t\t\t\t\t\t\t\t\t&& personaPapeleta.equals(\"P\")) {\n\t\t\t\t\t\t\t\tRegistroPapeletasManaged registro = (RegistroPapeletasManaged) getManaged(\"registroPapeletasManaged\");\n\t\t\t\t\t\t\t\tregistro.setDatosPropietario(personaDto);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlimpiar();\n\t\t\t\t\t\t\tesContribuyente = (Boolean) getSessionMap().get(\"esContribuyente\");\n\t\t\t\t\t\t\tif (esContribuyente == true) {\t\n\t\t\t\t\t\t\t\tWebMessages.messageError(\"Es un Contribeyente s�lo se Actualiz� la Direcci�n para Papeletas, los otros datos es por DJ\");\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWebMessages\n\t\t\t\t\t\t\t\t\t.messageError(\"Apellidos y nombres no valido\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWebMessages\n\t\t\t\t\t\t\t\t.messageError(\"Especifique la direccion de la persona\");\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWebMessages\n\t\t\t\t\t\t.messageError(\"Número de documento de identidad no valido\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n public boolean create(Person person) {\n return false;\r\n }", "public Persona() { // constructor sin parámetros\r\n\t\t\r\n\t\tthis.nif = \"44882229Y\";\r\n\t\tthis.nombre=\"Anonimo\";\r\n\t\tthis.sexo = 'F';\r\n\t\tthis.fecha = LocalDate.now();\r\n\t\tthis.altura = 180;\r\n\t\tthis.madre = null;\r\n\t\tthis.padre = null;\r\n\t\tcontador++;\r\n\t}", "public static Person addAPerson()\n\t{\n\t\tSystem.out.println(\"Enter FirstName \");\n\t\tString firstName=sc1.next(); // firstName\n\t\tSystem.out.println(\"Enter LastName\");\n\t\tString lastName=sc1.next(); // lastName\n\t\tSystem.out.println(\"Enter Address \");\n\t\tString address=sc1.next(); // address\n\t\tSystem.out.println(\"Enter State \");\n\t\tString state=sc1.next(); // state\n\t\tSystem.out.println(\"Enter City \");\n\t\tString city=sc1.next(); // city\n\t\tSystem.out.println(\"Enter Zip \");\n\t\tString zip=sc1.next(); // zip\n\t\tSystem.out.println(\"Enter Phone Number \");\n\t\tString phoneNumber=sc1.next(); // phoneNumber\n\t\tPerson person = new Person(firstName, lastName, address, state, city, zip, phoneNumber);\n\t\tsc1.close();\n\t\treturn person;// returns person object created\n\n\t}", "Builder addCreator(Person value);", "Individual createIndividual();", "public Person createPerson(String fullName, int age, String phone, String email, String favMovie, String city, String street, Profession profession, HashMap<String, Double> weightTable, ArrayList<String> hobbies) {\n startMetrics();\n String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();\n\n Person p = new Person(fullName,age,phone,email,favMovie,city,street,profession,weightTable,hobbies);\n p.setFullName(fullName);\n p.setAge(age);\n p.setPhone(phone);\n p.setEmail(email);\n p.setFavouriteMovie(favMovie);\n p.setCityName(city);\n p.setStreetName(street);\n p.setProfession(profession);\n p.setWeightTable(weightTable);\n p.setHobbies(hobbies);\n\n System.out.println(p.toString());\n\n printMethodName(methodName);\n stopMetrics();\n gatherPerformance(methodName);\n return p;\n }", "public Persona()\n\t{\n\t\tnombre = \"--\"; //DEFINES POR DEFAULT LAS VARIABLES;\n\t\tapellido = \"--\"; //DEFINES POR DEFAULT LAS VARIABLES;\n\t\tedad = 0; //DEFINES POR DEFAULT LAS VARIABLES;\n\t\talias = \"--\"; //DEFINES POR DEFAULT LAS VARIABLES;\t\t\n\t}", "Compuesta createCompuesta();", "public static void main(String[] args) {\n\t\t\r\n\tString nombre = leerTexto(\"Ingrese un nombre:\");\r\n\tint edad = leerNumero(\"Ingrese su edad:\");\r\n\tString rut = leerTexto(\"Ingresa el RUT:\");\r\n\tchar genero = leerTexto(\"Ingresa el genero: (M/F/O)\").charAt(0);\r\n\tfloat peso = leerNumero(\"Ingrese peso:\");\r\n\tfloat altura = leerNumero(\"Ingrese la altura:\");\r\n\tPersona claudia = new Persona(nombre, rut, edad, genero, peso, altura);\r\n\t\r\n\tnombre = leerTexto(\"Ingrese un nombre:\");\r\n\tedad = leerNumero(\"Ingrese su edad:\");\r\n\trut = leerTexto(\"Ingresa el RUT:\");\r\n\tgenero = leerTexto(\"Ingresa el genero: (M/F/O)\").charAt(0);\r\n\tPersona juliano = new Persona(nombre, rut, edad, genero);\r\n\t\r\n\tPersona noelia = new Persona();\r\n\tnoelia.setNombre(leerTexto(\"Ingresa un nombre\"));\r\n\tnoelia.setEdad(leerNumero(\"Ingresa la edad\"));\r\n\tnoelia.setRut(leerTexto(\"Ingresa el RUT\"));\r\n\tnoelia.setGenero(leerTexto(\"Ingresa el genero\").charAt(0));\r\n\tnoelia.setAltura(leerNumero(\"Ingresa la altura\"));\r\n\tnoelia.setPeso(leerNumero(\"Ingresa el peso\"));\r\n\t\r\n\tPersona[] perso = new Persona[3];\r\n\tperso[0] = claudia;\r\n\tperso[1] = juliano;\r\n\tperso[2] = noelia;\r\n\t\r\n\tfor (Persona persona : perso) {\r\n\t\tif (persona.calcularIMC()==Persona.PESO_BAJO) {\r\n\t\t\tescribir(\"Pongale sus buenas cazuelas\");\r\n\t\t}else {\r\n\t\t\tif (persona.calcularIMC()==Persona.PESO_IDEAL) {\r\n\t\t\t\tescribir(\"Estamos tiki taka\");\r\n\t\t\t}else {\r\n\t\t\t\tescribir(\"Menos coffe break!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Mayor de edad\r\n\t\tescribir(\"La persona \" + persona.getNombre() + \" es mayor de edad? \" + persona.esMayorDeEdad());\r\n\t\t//Mostrar el toString()\r\n\t\tescribir(persona.toString());\r\n\t }\r\n\t}", "public Persona(int idPersona){\n this.idPersona = idPersona;\n }", "protected Persona (String nombre,String apellido, String fechaNac){\r\n this.nombre = nombre;\r\n this.apellido = apellido;\r\n this.fechaNac = fechaNac;\r\n }", "@Test(enabled = true)\n public void createPerson() {\n List <Account> accounts = new ArrayList<>();\n List<Subscription> sub = new ArrayList<>();\n \n Contact contact = new Contact.Builder().emailaddress(\"[email protected]\").phoneNumber(\"021345685\").build();\n Address address = new Address.Builder().location(\"Daveyton\").streetName(\"Phaswane Street\").houseNumber(45).build();\n \n repo = ctx.getBean(PersonsRepository.class);\n Person p = new Person.Builder()\n .firstname(\"Nobu\")\n .lastname(\"Tyokz\")\n .age(25)\n .account(accounts)\n .sub(sub)\n .contact(contact)\n .address(address)\n .build();\n repo.save(p);\n id = p.getId();\n Assert.assertNotNull(p);\n\n }", "public void create(){}", "static public Person create(String name, String urlpt) {\n Person p;\n p = searchPerson(name);\n if (p == null)\n p = new Person(name, urlpt);\n return p;\n }", "public Perfil create(Perfil perfil);", "public Persona(String nombre) {\n\t\tthis.nombre = nombre;\n\t}", "Para createPara();", "public void crearPersonaje(ActionEvent event) {\r\n\r\n\t\tthis.personaje.setAspecto(url);\r\n\r\n\t\tDatabaseOperaciones.guardarPersonaje(stats, personaje);\r\n\r\n\t\tvisualizaPersonajes();\r\n\t}", "private TypicalPersons() {}", "private TypicalPersons() {}", "Obligacion createObligacion();", "public abstract Anuncio creaAnuncioTematico();", "public Persona(String n,String a, byte e,String d){\n this.nombre=n;\n this.apellido=a;\n this.edad=e;\n this.dni=d;\n }", "private void createPersonFromUser(String fullname){\n String useruid=\"\";\n String useremail=\"\";\n\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n if (user != null) {\n // Name, email address, and profile photo Url\n String username = user.getDisplayName();\n useremail = user.getEmail();\n Uri photoUrl = user.getPhotoUrl();\n\n // The user's ID, unique to the Firebase project. Do NOT use this value to\n // authenticate with your backend server, if you have one. Use\n // FirebaseUser.getToken() instead.\n useruid = user.getUid();\n }\n\n Person person =new Person();\n person.setName(fullname);\n person.setEmail(useremail);\n person.setUid(useruid);\n person.setTime_to_stop(\"0\");\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference myRef= database.getReference(\"Person\");\n myRef.child(useruid).setValue(person);\n\n }", "public Person(String firstName, String lastName) {\r\n name = new Name(firstName, lastName); \r\n id = (int )(Math.random() * 200 + 100);; \r\n }", "Documento createDocumento();", "public Person create() {\n\t\treturn personRepository.create();\n\t}", "private void saveNewPerson() {\r\n\r\n\t\tSystem.out.println(\"Start Save new Patient...\");\r\n\r\n\t\ttry {\r\n\t\t\tIPerson p1 = new Person(\"admin\", new Role(Roles.ADMINISTRATOR,\r\n\t\t\t\t\t\"Hauptadministrator\"), \"Passwort\", \"[email protected]\", \"Vorname\",\r\n\t\t\t\t\t\"Nachname\", \"Organisation\", \"Abteilung\", \"Fachrichtung\",\r\n\t\t\t\t\t\"Strasse\", \"3e\", \"54321\", \"Ort\");\r\n\r\n\t\t\tp1.save();\r\n\t\t} catch (BusinesslogicException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} catch (DatabaseException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"New Patient saved!!\");\r\n\t}", "public void create() {\n\t\t\n\t}", "public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }", "private static Person createPerson(String type, Scanner input) {\n System.out.println(\"\\nPlease enter the details of the \" + type + \": \");\n System.out.println(\"\\nName: \");\n String name = input.nextLine();\n\n System.out.println(\"\\nContact number: \");\n String contactNo = input.nextLine();\n\n System.out.println(\"\\nEmail address : \");\n String email = input.nextLine();\n\n System.out.println(\"\\nAddress: \");\n String address = input.nextLine();\n\n return new Person(type, name, contactNo, email, address);\n\n }", "void lookupAndSaveNewPerson();", "public abstract Anuncio creaAnuncioGeneral();", "For createFor();", "@Override\n\tpublic void create(Empleado e) {\n\t\tSystem.out.println(\"Graba el empleado \" + e + \" en la BBDD.\");\n\t}", "public Person createAdminUser(Register entity) {\t\t\n\t\tPerson person = new Person();\n\t\tif(!searchPersonNew(entity)) {\t\t\t\n\t\t\tperson = factory.createPerson(entity);\t\t\t\t\t\t\n\t\t\tcreate(person);\t\t\t\n\t\t}\t\t\n\t\treturn person;\n\t}", "void create(Team team);", "@Override\n\tpublic Person createPerson(String id, String slug, String firstName,\n\t\t\tString lastName, String photoId, Gender gender) {\n\t\tfinal Person person = createPerson();\n\t\tperson.setId(id);\n\t\tperson.setSlug(slug);\n\t\tperson.setFirstName(firstName);\n\t\tperson.setLastName(lastName);\n\t\tperson.setName(firstName + \" \" + lastName);\n\t\tperson.setPhotoId(photoId);\n\t\tperson.setGender(gender);\n\t\treturn person;\n\t}", "public Persona(String dni, String nombre, String apellido1) {\n\t\tthis.dni = dni;\n\t\tthis.nombre = nombre;\n\t\tthis.apellido1 = apellido1;\n\t}", "OperacionColeccion createOperacionColeccion();", "public static User createPerson() throws ParserConfigurationException, SAXException, IOException {\n User[] users = XMLReader.parsePersonXML();\n User user = users[0];\n calories = user.getCalories();\n diet = user.getDiet();\n quantity = user.getQuantityOfPeople();\n transport = user.getTransport();\n return user;\n }", "public Person(String vorname, String nachname) {\n\n\t}", "public static void main(String[] args) {\n \n PersonaIMC persona1 = new PersonaIMC();\n \n \n /* PersonaIMC persona2 = new PersonaIMC(nombre, edad, sexo);\n PersonaIMC persona3 = new PersonaIMC(nombre, edad, sexo, peso, altura);\n \n persona1.setNombre(\"Luisa\");\n persona1.setEdad(28);\n persona1.setSexo('F');\n persona1.setPeso(60);\n persona1.setAltura(1.8);\n \n persona2.setPeso(80.5);\n persona2.setAltura(1.75);\n \n System.out.println(\"Persona 1\");\n muestraMensajePeso(persona1);\n muestraMayorDeEdad(persona1);\n System.out.println(persona1.toString());\n \n System.out.println(\"Persona 2\");\n muestraMensajePeso(persona2);\n muestraMayorDeEdad(persona2);\n System.out.println(persona2.toString());\n \n System.out.println(\"Persona 3\");\n muestraMensajePeso(persona3);\n muestraMayorDeEdad(persona3);\n System.out.println(persona3.toString());*/\n }", "public static void main(String[] args) {\n /**\n * Construction par defaut\n */\n Personne p = new Personne();\n System.out.println(p.toString());\n /**\n * Construction avec comme parametre nom et prenom\n */\n Personne p1 = new Personne(\"Thiaw\",\"Serigne Cheikh Mbacke\");\n System.out.println(p1.toString());\n /**\n * Construction avec comme parametre nom, prenom et age\n */\n Personne p2 = new Personne(\"Thiaw\",\"Serigne Cheikh Mbacke\",22);\n System.out.println(p2.toString());\n /**\n * Construction tous les parametres\n */\n Personne p3= new Personne(\"Thiaw\",\"Serigne Cheikh Mbacke\",22,Sexe.Masculin);\n System.out.println(p3.toString());\n }", "@Override\n public void buildPersonalidad() {\n this.personaje.setPersonalidad(\"Pacientes y estrategas.\");\n }", "public void create(Personne pers) {\n\t\ttry{\n\t\t\tString req = \"INSERT INTO PERSONNE_1 (ID, Nom ,Prenom)\" + \"VALUES(?,?,?)\";\n\t\t\tPreparedStatement ps= connect.prepareStatement(req);\n\t\t\tps.setInt(1,ID);\n\t\t\tps.setString(2,pers.getNom());\n\t\t\tps.setString(3,pers.getPrenom());\n\t\t\tps.executeUpdate();\n\t\t\tID++;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "Girl(String n,String p,String i,String a,String b,String t,String pr) {\n \n name = n;\n pairedto = p;\n intelligence = Integer.parseInt(i);\n attractiveness = Integer.parseInt(a);\n mBudget = Integer.parseInt(b); \n type = t;\n pref = pr;\n \n }", "public boolean createPalvelupiste(Palvelupiste palvelupiste);", "public void addPerson(Person p);", "void create(Member member);", "Compleja createCompleja();", "public Person(String userId, String firstName, String lastName, Gender gender, String spouseId, String fatherId, String motherId) {\n Id = UUID.randomUUID().toString();\n AssociatedUserName = userId;\n FirstName = firstName;\n LastName = lastName;\n Gender = gender;\n SpouseId = spouseId;\n FatherId = fatherId;\n MotherId = motherId;\n }", "@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}", "private String addPerson()\n {\n String phone = getPhone();\n System.out.println(\"Person tilføjet.\");\n System.out.println(\"\");\n return phone;\n }", "@PostMapping(\"/persona\")\n public Persona createPersona(@Valid @RequestBody Persona persona) {\n return personaRepository.save(persona);\n }", "public Person(String name, String surname) {\n this.name = name;\n this.surname = surname;\n }", "protected ProcessAddPerson() {\n }", "public static void main (String[] args){\n \n \n Persona p1 = new Persona (\"Gener\",23);\n p1.mostrar();\n p1.correr();\n \n Persona p2 = new Persona(\"12345123\");\n p2.correr(100);\n }", "private void init(){\r\n\t\tString fullName = this.person_.getFirstName()+\" \"+this.person_.getLastName();\r\n\t\tboolean alreadyExists = PersonModel.exists(fullName);\r\n\t\t\r\n\t\tif(alreadyExists == true){\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//need to create person\r\n\t\t\tPersonModel pm = new PersonModel(fullName);\r\n\t\t\tpm.save();\r\n\t\t}\r\n\r\n\t}", "Foco createFoco();", "Team createTeam();", "public Friend createFriend();", "Klassenstufe createKlassenstufe();", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void creatUser(String name, String phone, String email, String password);", "public static void main(String args[]) {\n Person prsn=new Person.PersonBuilder(\"chenni\", \"chennai\", \"hyderabad\").lastName(\"achary\").createPerson();\n System.out.println(prsn);\n }", "private void createCharacters()\n {\n Person player = new Person(PLAYER,getRoom(STARTROOM));\n characters.add(player);\n }", "public Persona(String nombre, Date fechaNac, char sexo, double peso, double altura){\r\n\t\tthis.nombre=nombre;\r\n\t\tthis.fechaNac=fechaNac;\r\n\t\tthis.peso=peso;\r\n\t\tthis.altura=altura;\r\n\t\tthis.dni=generarDni();\r\n\t\tsetSexo(sexo); //Asigna el sexo realizando comprobacion\r\n\t}", "public Persona(String nombre, int edad) {\n this.nombre = nombre;\n this.edad = edad;\n // Se recomienda que en el constructor se inicialicen estos valores es decir, darle un tamaño al arreglo\n // Como sabemos que la persona puede tener 5 carros unicamente, entonces lo vamos a guardar asi\n this.carros = new Carro[5];\n \n // Y el contador empieza en 0, pues es el momento donde se esta creando el objeto\n this.contador = 0;\n }", "public abstract void creationGrille();", "Information createInformation();", "public Persona(String nombre, Date fechaNac, char sexo){\r\n\t\tthis(nombre, fechaNac, sexo, 0, 0);\r\n\t}", "public Person (String _name, int _ID) {\n name = _name;\n ID = _ID;\n }", "public Person() {\n\t\t\n\t}", "Persoana createPersoana(String nume, int varsta) {\n return new Persoana(nume, varsta);\n }", "public void crearNodos()\n\t{\n\t\tfor(List<String> renglon: listaDeDatos)\n\t\t{\n\t\t\tPersona persona = new Persona(Integer.parseInt(renglon.get(1)), Integer.parseInt(renglon.get(2))); //crea la persona\n\t\t\t\n\t\t\tNodo nodo = new Nodo(Integer.parseInt(renglon.get(0)), 0, 0, false); //crea el nodo con id en posicion 1\n\t\t\t\n\t\t\tnodo.agregarPersona(persona);\n\t\t\tlistaNodos.add(nodo);\n\t\t}\n\t\t\n\t}", "Secuencia createSecuencia();" ]
[ "0.846484", "0.80131274", "0.7738949", "0.7567291", "0.74563205", "0.74136966", "0.73838246", "0.7132897", "0.7132897", "0.71080065", "0.70631105", "0.70286447", "0.6969133", "0.69430655", "0.6909666", "0.69018984", "0.6895878", "0.6892319", "0.6888734", "0.6885759", "0.6864338", "0.684767", "0.67981553", "0.67766684", "0.6741536", "0.6735232", "0.6718097", "0.66964555", "0.66822577", "0.66716254", "0.661686", "0.6614901", "0.6601032", "0.65986556", "0.65928006", "0.65892255", "0.65863276", "0.6585762", "0.6572808", "0.6547725", "0.6542359", "0.65180224", "0.65180224", "0.6500406", "0.64972705", "0.64793605", "0.64610976", "0.64600164", "0.644305", "0.6434767", "0.6409633", "0.64019966", "0.63890094", "0.6383041", "0.63825643", "0.63783604", "0.6357248", "0.63555026", "0.63431734", "0.6336375", "0.63334054", "0.63311124", "0.6330066", "0.6328615", "0.6297421", "0.6290669", "0.6287157", "0.62827057", "0.6278933", "0.6278474", "0.6268051", "0.6262443", "0.6260637", "0.62570727", "0.6239706", "0.6237235", "0.6233872", "0.622704", "0.61962825", "0.6193879", "0.6193774", "0.61830986", "0.6171032", "0.6170596", "0.61608034", "0.61590403", "0.61555076", "0.615252", "0.61447465", "0.6134511", "0.6130793", "0.61305374", "0.61270976", "0.611061", "0.61082846", "0.61070657", "0.61062545", "0.61034256", "0.61018443", "0.60981745" ]
0.8181106
1
metodo para mostrar datos de la persona
public void mostrarPersona(){ System.out.println("Nombre: " + persona.getNombre()); System.out.println("Cedula: " + persona.getCedula()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mostrarDatos() {\r\n System.out.println(\"El nombre del cliente es: \" + this.getNombre());\r\n System.out.println(\"El primer apellido es: \" + this.getPrimerApellido());\r\n System.out.println(\"El segundo apellido es: \" + this.getSegundoApellido());\r\n System.out.println(\"La edad es: \" + this.getEdad());\r\n }", "public void MostrarDatos(){\n // En este caso, estamos mostrando la informacion necesaria del objeto\n // podemos acceder a la informacion de la persona y de su arreglo de Carros por medio de un recorrido\n System.out.println(\"Hola, me llamo \" + nombre);\n System.out.println(\"Tengo \" + contador + \" carros.\");\n for (int i = 0; i < contador; i++) {\n System.out.println(\"Tengo un carro marca: \" + carros[i].getMarca());\n System.out.println(\"El numero de placa es: \" + carros[i].getPlaca()); \n System.out.println(\"----------------------------------------------\");\n }\n }", "private void mostrarInformacionP(){\n System.out.println(\"Nombre: \"+this.nombre);\n System.out.println(\"Sexo: \"+ this.sexo);\n System.out.println(\"Edad: \" + edad);\n\n }", "public void dataView(String nom, String apell1, String apell2, String dni,\n String num, String inttype){\n\n System.out.println(\"Datos personales\");\n System.out.println(\"\");\n System.out.println(\"Nombre: \"+nom);\n System.out.println(\"Primer Apellido: \"+apell1);\n System.out.println(\"Segundo Apellido: \"+apell2);\n System.out.println(\"Dni: \"+dni);\n System.out.println(\"Numero de cuenta: \"+num);\n System.out.println(\"Tipo de interes: \"+inttype);\n System.out.println(\"\");\n}", "public void mostrarDatos() {\n\t\tSystem.out.println(\"DNI: \" + dni);\n\t\tSystem.out.println(\"Nombre: \" + nombre);\n\t\tdireccion.mostrarDatos();\n\t\tSystem.out.println(\"Telefono 1: \" + telefonos[0]);\n\t\tSystem.out.println(\"Telefono 2: \" + telefonos[1]);\n\t\tSystem.out.println(\"Fecha de Nacimiento: \" + fecha_nac.getDayOfMonth() + \"-\" + fecha_nac.getMonth() + \"-\"\n\t\t\t\t+ fecha_nac.getYear());\n\t\tcurso.mostrarDatos();\n\t\tSystem.out.println(\"Motrando todas las notas registradas:\");\n\t\tnotas.stream().forEach(notas -> notas.mostrarDatos());\n\t}", "private void muestraPersona(JSONArray genero) {\n\tJSONArray a = (JSONArray) genero.get(0);\n\t// txtId.setText(Long.toString( (Long) a.get(0)) );\n\t//txtBuscar.setText((String) a.get(1));\n\t// textFecha.setText((String) a.get(2));\n\t// textUsu.setText((String) a.get(4));\n\tcodTemporal = a.get(0).toString();\n\n\thabilita(true, false, false, false, false, true, false, true, true);\n }", "public String toString() {\r\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\"); //Mostraremos la fecha en formato DD/MM/AAAA\r\n\t\tString nacEdad=sdf.format(fechaNac)+ \"(\"+obtenerAnios()+\" años)\";\r\n\t\treturn \"Persona [nombre=\" + nombre + \", fechaNac=\" + nacEdad + \", DNI=\" + dni\r\n\t\t\t\t+ \", sexo=\" + sexo + \", peso=\" + peso + \", altura=\" + altura\r\n\t\t\t\t+ \"]\";\r\n\t}", "@Override\r\n public String toString() {\r\n return \"Datos de Jugador: \"\r\n + \"\\n\" + \"Alias : \" + this.getAlias()\r\n + \"\\n\" + \"Nombre: \" + this.getNombre()\r\n + \"\\n\" + \"Edad : \" + this.getEdad()\r\n + \"\\n\" + \"Partidas Ganadas: \" + this.getPartidasGanadasToString()\r\n + \"\\n\" + \"Partidas Perdidas: \" + this.getPartidasPerdidasToString()\r\n + \"\\n\" + \"Partidas Empatadas: \" + this.getPartidasEmpatadasToString();\r\n }", "@Override\n public String toString() {\n return \"Person{\" + getId() + \" : \" + getUsername() + \" : \" + getJmeno() + \" \" + getPrijmeni() + '}';\n }", "public static void main(String[] args) {\n \n PersonaIMC persona1 = new PersonaIMC();\n \n \n /* PersonaIMC persona2 = new PersonaIMC(nombre, edad, sexo);\n PersonaIMC persona3 = new PersonaIMC(nombre, edad, sexo, peso, altura);\n \n persona1.setNombre(\"Luisa\");\n persona1.setEdad(28);\n persona1.setSexo('F');\n persona1.setPeso(60);\n persona1.setAltura(1.8);\n \n persona2.setPeso(80.5);\n persona2.setAltura(1.75);\n \n System.out.println(\"Persona 1\");\n muestraMensajePeso(persona1);\n muestraMayorDeEdad(persona1);\n System.out.println(persona1.toString());\n \n System.out.println(\"Persona 2\");\n muestraMensajePeso(persona2);\n muestraMayorDeEdad(persona2);\n System.out.println(persona2.toString());\n \n System.out.println(\"Persona 3\");\n muestraMensajePeso(persona3);\n muestraMayorDeEdad(persona3);\n System.out.println(persona3.toString());*/\n }", "public String showPerson(){\n return _person.toString();\n }", "public void obtenerLista(){\n listaInformacion = new ArrayList<>();\n for (int i = 0; i < listaPersonales.size(); i++){\n listaInformacion.add(listaPersonales.get(i).getId() + \" - \" + listaPersonales.get(i).getNombre());\n }\n }", "public void SolicitarDatos() {\n\t\t\r\n\t\tSystem.out.println(\"nombre:\");\r\n\t\tSystem.out.println(\"apellido\");\r\n\t\tSystem.out.println(\"numCedula\");\r\n\t\t\r\n\t}", "public static void showResultPerson( Result<Record> result){\n \t for (Record r : result) {\n// Integer id = r.getValue(PERSON.PERSO_ID);\n String firstName = r.getValue(PERSON.PERSO_FIRSTNAME);\n String lastName = r.getValue(PERSON.PERSO_LASTNAME);\n\n System.out.println(\"Name : \" + firstName + \" \" + lastName);\n }\n }", "void populateFrom(Person r) {\n // nombre.setText(r.mail1);\n // apellido.setText(r.apellido1);\n usu.setText(r.nom_usuario1);\n // mail.setText(r.mail1);\n }", "@Override\npublic String toString() {// PARA MOSTRAR LOS DATOS DE ESTA CLASE\n// TODO Auto-generated method stub\nreturn MuestraCualquiera();\n}", "private void cargarDatosDefault() {\n\t\tPersonasJSON personas = new PersonasJSON();\n\t\tpersonas = personas.leerJSON(\"src/datosJSON/Personas.JSON\");\n\t\t\n\t\tfor(int i=0 ; i<personas.getCantidadPersonas(); i++) {\n\t\t\t\n\t\t\tString nombre = personas.getPersona(i).getNombre();\n\t\t\tint deporte = personas.getPersona(i).getDeporte();\n\t\t\tint musica = personas.getPersona(i).getMusica();\n\t\t\tint espectaculo = personas.getPersona(i).getEspectaculo();\n\t\t\tint ciencia = personas.getPersona(i).getCiencia();\n\t\t\t\n\t\t\tmodel.addRow(new String[]{ nombre, String.valueOf(deporte), String.valueOf(musica),\n\t\t\t\t\tString.valueOf(espectaculo), String.valueOf(ciencia) });\n\t\t}\n\t\t\n\t\tdatos.addAll(personas.getTodasLasPersonas());\n\t\t\n\t}", "@Override\n public String toString() {\n return nome + placa;\n }", "private void carregaInformacoes() {\n Pessoa pessoa = (Pessoa) getIntent().getExtras().getSerializable(\"pessoa\");\n edtNome.setText(pessoa.getNome());\n edtEmail.setText(pessoa.getEmail());\n edtTelefone.setText(pessoa.getTelefone());\n edtIdade.setText(pessoa.getIdade());\n edtCPF.setText(pessoa.getCpf());\n }", "public void mostrarDados() {\n txtId.setText(\"\" + lista.get(indice).getId());\n txtNome.setText(lista.get(indice).getNome());\n txtEmail.setText(lista.get(indice).getEmail());\n txtSenha.setText(lista.get(indice).getSenha());\n preencheTabela();\n }", "private void seePerso() {\n\t\tfor (int i = 0; i < persoList.size(); i++) {\n\t\t\tPersonnage perso = persoList.get(i);\n\t\t\tSystem.out.println(\"id : \" + i);\n\t\t\tSystem.out.println(perso);\n\t\t}\n\n\t\tSystem.out.println(\"souhaitez vous modifier un personnage ? o/n\");\n\t\tif (sc.nextLine().toLowerCase().contentEquals(\"o\")) {\n\t\t\tSystem.out.println(\"Lequel ? id\");\n\t\t\tint id = sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tchangePerso(id);\n\t\t}\n\t}", "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "public String getLasagna(){\n return \"ID: \"+this.ID+\"\\nNombre: \"+this.nombre+\"\\nTipo: \"+this.tipo+\"\\nPrecio: \"+this.precio; //Devuelve todos los datos de la lasagna\n }", "public void mostraDoctorsPerEspecialitat() throws SQLException, IOException {\n\n\t\tmostraEspecialitats();\n\t\t\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tSystem.out.println(\"Introduce el ID de la especialidad:\");\n\t\tint id=Integer.parseInt(br.readLine());\n\t\tStatement st=conn.createStatement();\n\t\tResultSet rs=st.executeQuery(\"SELECT doc_number, d.name, address,city,phone FROM doctor d, speciality s WHERE d.speciality=s.id AND s.id=\"+id);\n\t\t\n\t\tSystem.out.println(\"################################\");\n\t\tSystem.out.println(\"#### DOCTORES ###\");\n\t\tSystem.out.println(\"################################\\n\");\n\t\t\n\t\twhile(rs.next()){\n\t\t\tSystem.out.println(\"\\tIdentificador: \"+rs.getString(\"doc_number\")+\"\\n\\tNombre: \"+rs.getString(\"name\")+\"\\n\\tDireccion: \"+rs.getString(\"address\")+\"\\n\\tCiudad: \"+rs.getString(\"city\")+\"\\n\\tTeléfono: \"+rs.getString(\"phone\"));\n\t\t\tSystem.out.println(\"\\t----------\");\n\t\t}\n\t\trs.close();\n\t\tst.close();\n\t}", "@Override\n public String toString() {\n return \"\\tMunicipio: \" + municipio + \"\\t\" + \"Habitantes: \" + habitantes + \".\";\n }", "@Override\n\tpublic void mostrarDados() {\n\t\t\n\t}", "@Override\n\t\t\tpublic String toString() {\n\t\t\t\treturn nome;\n\t\t\t}", "public List<persona> listar() {\n\t\tList<persona>lista= new ArrayList<>();\n\t\t\n\t\tString sql=\"SELECT * FROM TABLA.TABLA;\";\n\t\ttry {\n\t\t\n\t\tcon = c.conectar();\n\t\tps= con.prepareStatement(sql);\n\t\trs=ps.executeQuery();\n\t\t\n\t\twhile(rs.next()) {\n\t\t\tPersona p= new persona();\n\t\t\tp.setId(rs.getString(1));\n\t\t\tp.setNom(rs.getString(2));\n\t\t\tlista.add(p);\n\t\t}\n\t}catch (Exception e) {\n\t\t\n\t}return lista;\n\t\n\t}", "public String toString(){ \r\n return \"Nome: \" + this.nome + \"\\nEmail: \" + this.email +\r\n \"\\nEndereço: \" + this.endereco + \"\\nId: \" + this.id + \"\\n\"; \r\n }", "public static void main(String[] args) {\n Alumnos a = new Alumnos(\"3457794\",\"IDS\",\"A\",3,\"Juan\",\"Masculino\",158);\n //recibe: String folio,String nombre, String sexo, int edad\n Profesores p = new Profesores(\"SDW7984\",\"Dr. Pimentel\",\"Masculino\",25);\n \n //recibe: String puesto,String nombre, String sexo, int edad\n Administrativos ad = new Administrativos(\"Rectoria\",\"Jesica\",\"Femenino\",25);\n \n //datos de alumnos//\n System.out.println(\"\\nEl alumno tiene los siguientes datos:\");\n System.out.println(a.GetName());\n System.out.println(a.GetEdad());\n System.out.println(a.getCarrera());\n \n //datos de maestro//\n System.out.println(\"\\nLos datos de x maestro es:\");\n System.out.println(p.GetName());\n System.out.println(p.getFolio());\n System.out.println(p.GetEdad());\n \n //daros de Administrativo//\n System.out.println(\"\\nLos datos de x Administrativo\");\n System.out.println(ad.GetName());\n System.out.println(ad.getPuesto());\n System.out.println(ad.GetEdad());\n \n \n System.out.println(\"\\n\\nIntegranres de Equipo\");\n System.out.println(\"Kevin Serrano - 133369\");\n System.out.println(\"Luis Angel Farelo Toledo - 143404\");\n System.out.println(\"Ericel Nucamendi Jose - 133407\");\n System.out.println(\"Javier de Jesus Flores Herrera - 143372\");\n System.out.println(\"Carlos Alejandro Zenteno Robles - 143382\");\n }", "public List<PersonaDTO> consultarPersonas() ;", "@Override\r\n public void mostrarAlumnos(){\n for(Persona i: listaPersona){\r\n if(i instanceof Alumno){\r\n i.mostrar();\r\n }\r\n }\r\n }", "public void presenta_Estudiante(){\r\n System.out.println(\"Universidad Técnica Particular de Loja\\nInforme Semestral\\nEstudiante: \"+nombre+\r\n \"\\nAsignatura: \"+nAsignatura+\"\\nNota 1 Bimestre: \"+nota1B+\"\\nNota 2 Bimestre: \"+nota2B+\r\n \"\\nPromedio: \"+promedio()+\"\\nEstado de la Materia: \"+estado());\r\n }", "@Override\n public void buildPersonalidad() {\n this.personaje.setPersonalidad(\"Pacientes y estrategas.\");\n }", "public void desplegarInformacion() { //\n\n System.out.println(nombre);\n System.out.println(apellido);\n\n }", "public static void main(String[] args) {\n\t\t\r\n\tString nombre = leerTexto(\"Ingrese un nombre:\");\r\n\tint edad = leerNumero(\"Ingrese su edad:\");\r\n\tString rut = leerTexto(\"Ingresa el RUT:\");\r\n\tchar genero = leerTexto(\"Ingresa el genero: (M/F/O)\").charAt(0);\r\n\tfloat peso = leerNumero(\"Ingrese peso:\");\r\n\tfloat altura = leerNumero(\"Ingrese la altura:\");\r\n\tPersona claudia = new Persona(nombre, rut, edad, genero, peso, altura);\r\n\t\r\n\tnombre = leerTexto(\"Ingrese un nombre:\");\r\n\tedad = leerNumero(\"Ingrese su edad:\");\r\n\trut = leerTexto(\"Ingresa el RUT:\");\r\n\tgenero = leerTexto(\"Ingresa el genero: (M/F/O)\").charAt(0);\r\n\tPersona juliano = new Persona(nombre, rut, edad, genero);\r\n\t\r\n\tPersona noelia = new Persona();\r\n\tnoelia.setNombre(leerTexto(\"Ingresa un nombre\"));\r\n\tnoelia.setEdad(leerNumero(\"Ingresa la edad\"));\r\n\tnoelia.setRut(leerTexto(\"Ingresa el RUT\"));\r\n\tnoelia.setGenero(leerTexto(\"Ingresa el genero\").charAt(0));\r\n\tnoelia.setAltura(leerNumero(\"Ingresa la altura\"));\r\n\tnoelia.setPeso(leerNumero(\"Ingresa el peso\"));\r\n\t\r\n\tPersona[] perso = new Persona[3];\r\n\tperso[0] = claudia;\r\n\tperso[1] = juliano;\r\n\tperso[2] = noelia;\r\n\t\r\n\tfor (Persona persona : perso) {\r\n\t\tif (persona.calcularIMC()==Persona.PESO_BAJO) {\r\n\t\t\tescribir(\"Pongale sus buenas cazuelas\");\r\n\t\t}else {\r\n\t\t\tif (persona.calcularIMC()==Persona.PESO_IDEAL) {\r\n\t\t\t\tescribir(\"Estamos tiki taka\");\r\n\t\t\t}else {\r\n\t\t\t\tescribir(\"Menos coffe break!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Mayor de edad\r\n\t\tescribir(\"La persona \" + persona.getNombre() + \" es mayor de edad? \" + persona.esMayorDeEdad());\r\n\t\t//Mostrar el toString()\r\n\t\tescribir(persona.toString());\r\n\t }\r\n\t}", "public void mostrarContactos() {\n\t\tfor (int i = 0; i < this.listaContactos.size(); i++) {\n\t\t\tSystem.out.println(this.listaContactos.get(i).mostrarDatos());\n\t\t}\n\t}", "public void mostrarSocios()\n\t{\n\t\t//titulo libro, autor\n\t\tIterator<Socio> it=socios.iterator();\n\t\t\n\t\tSystem.out.println(\"***********SOCIOS***********\");\n\t\tSystem.out.printf(\"\\n%-40s%-40s\", \"NOMBRE\" , \"APELLIDO\");\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tSocio socio=(Socio)it.next();\n\t\t\tSystem.out.printf(\"\\n%-40s%-40s\\n\",socio.getNombre(),socio.getApellidos());\n\t\t}\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"CODIGO: \" +codigo+ \" NOME: \"+nome+\" DIA: \"+dataInicio+\" HORA:\"+horaInicio+\" LOCAL:\"+local;\n\t}", "public void damePersonaje(String personaje){\n this.personaje=personaje;\n\n\n\n }", "List<Persona> obtenerTodasLasPersona();", "public String obtenerDetalles(){\r\n return \"Nombre: \" + this.nombre + \", sueldo = \" + this.sueldo;\r\n }", "public Persona getPersona(String nombre)\n {\n Persona p = new Persona();\n //Considerar almacenar todos los registros en un arrayList o\n //en un JsonArray y JsonObject\n try \n { \n PreparedStatement pstm = null; \n ResultSet rs = null;\n String query = \"SELECT * FROM Persona WHERE ID_User IN (SELECT ID_User FROM Usuario WHERE username = ?)\";\n pstm = con.prepareStatement(query);\n pstm.setString(1, nombre);\n rs = pstm.executeQuery();\n while(rs.next())\n {\n p.setIdPersona(rs.getInt(\"ID_Persona\"));\n p.setIdUser(rs.getInt(\"ID_User\"));\n p.setNombre(rs.getString(\"Nombre\"));\n p.setApellidoP(rs.getString(\"apellidoPaterno\"));\n p.setApellidoM(rs.getString(\"apellidoMaterno\")); \n }\n }catch(SQLException ex){\n ex.printStackTrace(); \n }\n return p;\n }", "@Override\r\n\tpublic String getTipoPersona() {\n\t\treturn \"alumno del curso \" + curso + \" de \" + grupo + \" de \" + tipoEstudios ;\r\n\t\t\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"nombre:%s, direccion: %s, telefono: %s\", nombre_banco, direccion, telefono);\n\t}", "public static void listarRegistros() {\n System.out.println(\"\\nLISTA DE TODOS LOS REGISTROS\\n\");\n for (persona ps: pd.listaPersonas()){\n System.out.println(ps.getId()+ \" \"+\n ps.getNombre()+ \" \"+\n ps.getAp_paterno()+ \" \"+ \n ps.getAp_materno()+ \" DIRECCION: \"+ \n ps.getDireccion()+ \" SEXO: \"+ ps.getSexo());\n }\n }", "public void mostrarDatos(Object obj) throws Exception {\r\n\t\tHis_parto his_parto = (His_parto) obj;\r\n\t\ttry {\r\n\t\t\ttbxCodigo_historia.setValue(his_parto.getCodigo_historia());\r\n\t\t\tdtbxFecha_inicial.setValue(his_parto.getFecha_inicial());\r\n\r\n\t\t\tPaciente paciente = new Paciente();\r\n\t\t\tpaciente.setCodigo_empresa(his_parto.getCodigo_empresa());\r\n\t\t\tpaciente.setCodigo_sucursal(his_parto.getCodigo_sucursal());\r\n\t\t\tpaciente.setNro_identificacion(his_parto.getIdentificacion());\r\n\t\t\tpaciente = getServiceLocator().getPacienteService().consultar(\r\n\t\t\t\t\tpaciente);\r\n\r\n\t\t\tElemento elemento = new Elemento();\r\n\t\t\telemento.setCodigo(paciente.getSexo());\r\n\t\t\telemento.setTipo(\"sexo\");\r\n\t\t\telemento = getServiceLocator().getElementoService().consultar(\r\n\t\t\t\t\telemento);\r\n\r\n\t\t\ttbxIdentificacion.setValue(his_parto.getIdentificacion());\r\n\t\t\ttbxNomPaciente.setValue((paciente != null ? paciente.getNombre1()\r\n\t\t\t\t\t+ \" \" + paciente.getApellido1() : \"\"));\r\n\t\t\ttbxTipoIdentificacion.setValue((paciente != null ? paciente\r\n\t\t\t\t\t.getTipo_identificacion() : \"\"));\r\n\t\t\ttbxEdad.setValue(Util.getEdad(new java.text.SimpleDateFormat(\r\n\t\t\t\t\t\"dd/MM/yyyy\").format(paciente.getFecha_nacimiento()),\r\n\t\t\t\t\tpaciente.getUnidad_medidad(), false));\r\n\t\t\ttbxSexo.setValue((elemento != null ? elemento.getDescripcion() : \"\"));\r\n\t\t\tdbxNacimiento.setValue(paciente.getFecha_nacimiento());\r\n\t\t\ttbxDireccion.setValue(paciente.getDireccion());\r\n\r\n\t\t\tAdministradora administradora = new Administradora();\r\n\t\t\tadministradora.setCodigo(paciente.getCodigo_administradora());\r\n\t\t\tadministradora = getServiceLocator().getAdministradoraService()\r\n\t\t\t\t\t.consultar(administradora);\r\n\r\n\t\t\ttbxCodigo_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getCodigo() : \"\");\r\n\t\t\ttbxNombre_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getNombre() : \"\");\r\n\r\n\t\t\tContratos contratos = new Contratos();\r\n\t\t\tcontratos.setCodigo_empresa(his_parto.getCodigo_empresa());\r\n\t\t\tcontratos.setCodigo_sucursal(his_parto.getCodigo_sucursal());\r\n\t\t\tcontratos.setCodigo_administradora(paciente.getCodigo_administradora());\r\n//\t\t\tcontratos.setId_plan(paciente.getId_plan());\r\n\t\t\tcontratos = getServiceLocator().getContratosService().consultar(contratos);\r\n\r\n\t\t\ttbxCodigo_contrato.setValue(contratos != null ? contratos.getId_plan()\r\n\t\t\t\t\t: \"\");\r\n\t\t\ttbxContrato.setValue(contratos != null ? contratos.getNombre() : \"\");\r\n\r\n\t\t\tfor (int i = 0; i < lbxCodigo_dpto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCodigo_dpto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(paciente.getCodigo_dpto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCodigo_dpto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlistarMunicipios(lbxCodigo_municipio, lbxCodigo_dpto);\r\n\r\n\t\t\ttbxConyugue.setValue(his_parto.getConyugue());\r\n\t\t\ttbxId_conyugue.setValue(his_parto.getId_conyugue());\r\n\t\t\ttbxEdad_conyugue.setValue(his_parto.getEdad_conyugue());\r\n\r\n\t\t\tNivel_educativo nivel_educativo = new Nivel_educativo();\r\n\t\t\tnivel_educativo.setId(his_parto.getEscolaridad_conyugue());\r\n\t\t\tnivel_educativo = getServiceLocator().getNivel_educativoService()\r\n\t\t\t\t\t.consultar(nivel_educativo);\r\n\t\t\ttbxEscolaridad_nombre\r\n\t\t\t\t\t.setValue(nivel_educativo != null ? nivel_educativo\r\n\t\t\t\t\t\t\t.getNombre() : \"\");\r\n\t\t\ttbxEscolaridad_conyugue\r\n\t\t\t\t\t.setValue(nivel_educativo != null ? nivel_educativo.getId()\r\n\t\t\t\t\t\t\t: \"\");\r\n\r\n\t\t\ttbxMotivo.setValue(his_parto.getMotivo());\r\n\t\t\ttbxEnfermedad_actual.setValue(his_parto.getEnfermedad_actual());\r\n\t\t\ttbxAntecedentes_familiares.setValue(his_parto\r\n\t\t\t\t\t.getAntecedentes_familiares());\r\n\t\t\tRadio radio = (Radio) rdbPreeclampsia.getFellow(\"Preeclampsia\"\r\n\t\t\t\t\t+ his_parto.getPreeclampsia());\r\n\t\t\tradio.setChecked(true);\r\n\t\t\tRadio radio1 = (Radio) rdbHipertension.getFellow(\"Hipertension\"\r\n\t\t\t\t\t+ his_parto.getHipertension());\r\n\t\t\tradio1.setChecked(true);\r\n\t\t\tRadio radio2 = (Radio) rdbEclampsia.getFellow(\"Eclampsia\"\r\n\t\t\t\t\t+ his_parto.getEclampsia());\r\n\t\t\tradio2.setChecked(true);\r\n\t\t\tRadio radio3 = (Radio) rdbH1.getFellow(\"H1\" + his_parto.getH1());\r\n\t\t\tradio3.setChecked(true);\r\n\t\t\tRadio radio4 = (Radio) rdbH2.getFellow(\"H2\" + his_parto.getH2());\r\n\t\t\tradio4.setChecked(true);\r\n\t\t\tRadio radio5 = (Radio) rdbPostimadurez.getFellow(\"Postimadurez\"\r\n\t\t\t\t\t+ his_parto.getPostimadurez());\r\n\t\t\tradio5.setChecked(true);\r\n\t\t\tRadio radio6 = (Radio) rdbRot_pre.getFellow(\"Rot_pre\"\r\n\t\t\t\t\t+ his_parto.getRot_pre());\r\n\t\t\tradio6.setChecked(true);\r\n\t\t\tRadio radio7 = (Radio) rdbPolihidramnios.getFellow(\"Polihidramnios\"\r\n\t\t\t\t\t+ his_parto.getPolihidramnios());\r\n\t\t\tradio7.setChecked(true);\r\n\t\t\tRadio radio8 = (Radio) rdbRcui.getFellow(\"Rcui\"\r\n\t\t\t\t\t+ his_parto.getRcui());\r\n\t\t\tradio8.setChecked(true);\r\n\t\t\tRadio radio9 = (Radio) rdbPelvis.getFellow(\"Pelvis\"\r\n\t\t\t\t\t+ his_parto.getPelvis());\r\n\t\t\tradio9.setChecked(true);\r\n\t\t\tRadio radio10 = (Radio) rdbFeto_macrosonico\r\n\t\t\t\t\t.getFellow(\"Feto_macrosonico\"\r\n\t\t\t\t\t\t\t+ his_parto.getFeto_macrosonico());\r\n\t\t\tradio10.setChecked(true);\r\n\t\t\tRadio radio11 = (Radio) rdbIsoinmunizacion\r\n\t\t\t\t\t.getFellow(\"Isoinmunizacion\"\r\n\t\t\t\t\t\t\t+ his_parto.getIsoinmunizacion());\r\n\t\t\tradio11.setChecked(true);\r\n\t\t\tRadio radio12 = (Radio) rdbAo.getFellow(\"Ao\" + his_parto.getAo());\r\n\t\t\tradio12.setChecked(true);\r\n\t\t\tRadio radio13 = (Radio) rdbCirc_cordon.getFellow(\"Circ_cordon\"\r\n\t\t\t\t\t+ his_parto.getCirc_cordon());\r\n\t\t\tradio13.setChecked(true);\r\n\t\t\tRadio radio14 = (Radio) rdbPostparto.getFellow(\"Postparto\"\r\n\t\t\t\t\t+ his_parto.getPostparto());\r\n\t\t\tradio14.setChecked(true);\r\n\t\t\tRadio radio15 = (Radio) rdbDiabetes.getFellow(\"Diabetes\"\r\n\t\t\t\t\t+ his_parto.getDiabetes());\r\n\t\t\tradio15.setChecked(true);\r\n\t\t\tRadio radio16 = (Radio) rdbCardiopatia.getFellow(\"Cardiopatia\"\r\n\t\t\t\t\t+ his_parto.getCardiopatia());\r\n\t\t\tradio16.setChecked(true);\r\n\t\t\tRadio radio17 = (Radio) rdbAnemias.getFellow(\"Anemias\"\r\n\t\t\t\t\t+ his_parto.getAnemias());\r\n\t\t\tradio17.setChecked(true);\r\n\t\t\tRadio radio18 = (Radio) rdbEnf_autoinmunes\r\n\t\t\t\t\t.getFellow(\"Enf_autoinmunes\"\r\n\t\t\t\t\t\t\t+ his_parto.getEnf_autoinmunes());\r\n\t\t\tradio18.setChecked(true);\r\n\t\t\tRadio radio19 = (Radio) rdbEnf_renales.getFellow(\"Enf_renales\"\r\n\t\t\t\t\t+ his_parto.getEnf_renales());\r\n\t\t\tradio19.setChecked(true);\r\n\t\t\tRadio radio20 = (Radio) rdbInf_urinaria.getFellow(\"Inf_urinaria\"\r\n\t\t\t\t\t+ his_parto.getInf_urinaria());\r\n\t\t\tradio20.setChecked(true);\r\n\t\t\tRadio radio21 = (Radio) rdbEpilepsia.getFellow(\"Epilepsia\"\r\n\t\t\t\t\t+ his_parto.getEpilepsia());\r\n\t\t\tradio21.setChecked(true);\r\n\t\t\tRadio radio22 = (Radio) rdbTbc\r\n\t\t\t\t\t.getFellow(\"Tbc\" + his_parto.getTbc());\r\n\t\t\tradio22.setChecked(true);\r\n\t\t\tRadio radio23 = (Radio) rdbMiomas.getFellow(\"Miomas\"\r\n\t\t\t\t\t+ his_parto.getMiomas());\r\n\t\t\tradio23.setChecked(true);\r\n\t\t\tRadio radio24 = (Radio) rdbHb.getFellow(\"Hb\" + his_parto.getHb());\r\n\t\t\tradio24.setChecked(true);\r\n\t\t\tRadio radio25 = (Radio) rdbFumadora.getFellow(\"Fumadora\"\r\n\t\t\t\t\t+ his_parto.getFumadora());\r\n\t\t\tradio25.setChecked(true);\r\n\t\t\tRadio radio26 = (Radio) rdbInf_puerperal.getFellow(\"Inf_puerperal\"\r\n\t\t\t\t\t+ his_parto.getInf_puerperal());\r\n\t\t\tradio26.setChecked(true);\r\n\t\t\tRadio radio27 = (Radio) rdbInfertilidad.getFellow(\"Infertilidad\"\r\n\t\t\t\t\t+ his_parto.getInfertilidad());\r\n\t\t\tradio27.setChecked(true);\r\n\t\t\ttbxMenarquia.setValue(his_parto.getMenarquia());\r\n\t\t\ttbxCiclos.setValue(his_parto.getCiclos());\r\n\t\t\ttbxVida_marital.setValue(his_parto.getVida_marital());\r\n\t\t\ttbxVida_obstetrica.setValue(his_parto.getVida_obstetrica());\r\n\t\t\tfor (int i = 0; i < lbxNo_gestaciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNo_gestaciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNo_gestaciones())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNo_gestaciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxParto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxParto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString().equals(his_parto.getParto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxParto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxAborto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAborto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getAborto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAborto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxCesarias.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCesarias.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getCesarias())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCesarias.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdtbxFecha_um.setValue(his_parto.getFecha_um());\r\n\t\t\ttbxUm.setValue(his_parto.getUm());\r\n\t\t\ttbxFep.setValue(his_parto.getFep());\r\n\t\t\tfor (int i = 0; i < lbxGemerales.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxGemerales.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getGemerales())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxGemerales.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxMalformados.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxMalformados.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getMalformados())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxMalformados.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNacidos_vivos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNacidos_vivos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNacidos_vivos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNacidos_vivos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNacidos_muertos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNacidos_muertos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNacidos_muertos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNacidos_muertos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxPreterminos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxPreterminos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getPreterminos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxPreterminos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchbMedico.setChecked(his_parto.getMedico());\r\n\t\t\tchbEnfermera.setChecked(his_parto.getEnfermera());\r\n\t\t\tchbAuxiliar.setChecked(his_parto.getAuxiliar());\r\n\t\t\tchbPartera.setChecked(his_parto.getPartera());\r\n\t\t\tchbOtros.setChecked(his_parto.getOtros());\r\n\t\t\tRadio radio28 = (Radio) rdbControlado.getFellow(\"Controlado\"\r\n\t\t\t\t\t+ his_parto.getControlado());\r\n\t\t\tradio28.setChecked(true);\r\n\t\t\tRadio radio29 = (Radio) rdbLugar_consulta\r\n\t\t\t\t\t.getFellow(\"Lugar_consulta\" + his_parto.getLugar_consulta());\r\n\t\t\tradio29.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxNo_consultas.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNo_consultas.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNo_consultas())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNo_consultas.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchbEspecialistas.setChecked(his_parto.getEspecialistas());\r\n\t\t\tchbGeneral.setChecked(his_parto.getGeneral());\r\n\t\t\tchbPartera_consulta.setChecked(his_parto.getPartera_consulta());\r\n\t\t\tRadio radio30 = (Radio) rdbSangrado_vaginal\r\n\t\t\t\t\t.getFellow(\"Sangrado_vaginal\"\r\n\t\t\t\t\t\t\t+ his_parto.getSangrado_vaginal());\r\n\t\t\tradio30.setChecked(true);\r\n\t\t\tRadio radio31 = (Radio) rdbCefalias.getFellow(\"Cefalias\"\r\n\t\t\t\t\t+ his_parto.getCefalias());\r\n\t\t\tradio31.setChecked(true);\r\n\t\t\tRadio radio32 = (Radio) rdbEdema.getFellow(\"Edema\"\r\n\t\t\t\t\t+ his_parto.getEdema());\r\n\t\t\tradio32.setChecked(true);\r\n\t\t\tRadio radio33 = (Radio) rdbEpigastralgia.getFellow(\"Epigastralgia\"\r\n\t\t\t\t\t+ his_parto.getEpigastralgia());\r\n\t\t\tradio33.setChecked(true);\r\n\t\t\tRadio radio34 = (Radio) rdbVomitos.getFellow(\"Vomitos\"\r\n\t\t\t\t\t+ his_parto.getVomitos());\r\n\t\t\tradio34.setChecked(true);\r\n\t\t\tRadio radio35 = (Radio) rdbTinutus.getFellow(\"Tinutus\"\r\n\t\t\t\t\t+ his_parto.getTinutus());\r\n\t\t\tradio35.setChecked(true);\r\n\t\t\tRadio radio36 = (Radio) rdbEscotomas.getFellow(\"Escotomas\"\r\n\t\t\t\t\t+ his_parto.getEscotomas());\r\n\t\t\tradio36.setChecked(true);\r\n\t\t\tRadio radio37 = (Radio) rdbInfeccion_urinaria\r\n\t\t\t\t\t.getFellow(\"Infeccion_urinaria\"\r\n\t\t\t\t\t\t\t+ his_parto.getInfeccion_urinaria());\r\n\t\t\tradio37.setChecked(true);\r\n\t\t\tRadio radio38 = (Radio) rdbInfeccion_vaginal\r\n\t\t\t\t\t.getFellow(\"Infeccion_vaginal\"\r\n\t\t\t\t\t\t\t+ his_parto.getInfeccion_vaginal());\r\n\t\t\tradio38.setChecked(true);\r\n\t\t\ttbxOtros_embarazo.setValue(his_parto.getOtros_embarazo());\r\n\t\t\ttbxCardiaca.setValue(his_parto.getCardiaca());\r\n\t\t\ttbxRespiratoria.setValue(his_parto.getRespiratoria());\r\n\t\t\ttbxPeso.setValue(his_parto.getPeso());\r\n\t\t\ttbxTalla.setValue(his_parto.getTalla());\r\n\t\t\ttbxTempo.setValue(his_parto.getTempo());\r\n\t\t\ttbxPresion.setValue(his_parto.getPresion());\r\n\t\t\ttbxPresion2.setValue(his_parto.getPresion2());\r\n\t\t\ttbxInd_masa.setValue(his_parto.getInd_masa());\r\n\t\t\ttbxSus_masa.setValue(his_parto.getSus_masa());\r\n\t\t\ttbxCabeza_cuello.setValue(his_parto.getCabeza_cuello());\r\n\t\t\ttbxCardiovascular.setValue(his_parto.getCardiovascular());\r\n\t\t\ttbxMamas.setValue(his_parto.getMamas());\r\n\t\t\ttbxPulmones.setValue(his_parto.getPulmones());\r\n\t\t\ttbxAbdomen.setValue(his_parto.getAbdomen());\r\n\t\t\ttbxUterina.setValue(his_parto.getUterina());\r\n\t\t\ttbxSituacion.setValue(his_parto.getSituacion());\r\n\t\t\ttbxPresentacion.setValue(his_parto.getPresentacion());\r\n\t\t\ttbxV_presentacion.setValue(his_parto.getV_presentacion());\r\n\t\t\ttbxPosicion.setValue(his_parto.getPosicion());\r\n\t\t\ttbxV_posicion.setValue(his_parto.getV_posicion());\r\n\t\t\ttbxC_uterina.setValue(his_parto.getC_uterina());\r\n\t\t\ttbxTono.setValue(his_parto.getTono());\r\n\t\t\ttbxFcf.setValue(his_parto.getFcf());\r\n\t\t\ttbxGenitales.setValue(his_parto.getGenitales());\r\n\t\t\ttbxDilatacion.setValue(his_parto.getDilatacion());\r\n\t\t\ttbxBorramiento.setValue(his_parto.getBorramiento());\r\n\t\t\ttbxEstacion.setValue(his_parto.getEstacion());\r\n\t\t\ttbxMembranas.setValue(his_parto.getMembranas());\r\n\t\t\ttbxExtremidades.setValue(his_parto.getExtremidades());\r\n\t\t\ttbxSnc.setValue(his_parto.getSnc());\r\n\t\t\ttbxObservacion.setValue(his_parto.getObservacion());\r\n\t\t\tfor (int i = 0; i < lbxFinalidad_cons.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFinalidad_cons.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getFinalidad_cons())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFinalidad_cons.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tseleccionarProgramaPyp();\r\n\r\n\t\t\tfor (int i = 0; i < lbxCausas_externas.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCausas_externas.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getCausas_externas())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCausas_externas.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxCodigo_consulta_pyp.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCodigo_consulta_pyp.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getCodigo_consulta_pyp())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCodigo_consulta_pyp.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxTipo_disnostico.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxTipo_disnostico.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getTipo_disnostico())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxTipo_disnostico.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tCie cie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_principal());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\t\t\ttbxTipo_principal.setValue(his_parto.getTipo_principal());\r\n\t\t\ttbxNomDx.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\t/* relacionado 1 */\r\n\t\t\tcie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_relacionado_1());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\r\n\t\t\ttbxTipo_relacionado_1.setValue(his_parto.getTipo_relacionado_1());\r\n\t\t\ttbxNomDxRelacionado_1\r\n\t\t\t\t\t.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\t/* relacionado 2 */\r\n\t\t\tcie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_relacionado_2());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\r\n\t\t\ttbxTipo_relacionado_2.setValue(his_parto.getTipo_relacionado_2());\r\n\t\t\ttbxNomDxRelacionado_2\r\n\t\t\t\t\t.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\t/* relacionado 3 */\r\n\t\t\tcie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_relacionado_3());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\r\n\t\t\ttbxTipo_relacionado_3.setValue(his_parto.getTipo_relacionado_3());\r\n\t\t\ttbxNomDxRelacionado_3\r\n\t\t\t\t\t.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\ttbxTratamiento.setValue(his_parto.getTratamiento());\r\n\r\n\t\t\t// Mostramos la vista //\r\n\t\t\ttbxAccion.setText(\"modificar\");\r\n\t\t\taccionForm(true, tbxAccion.getText());\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(\"Este dato no se puede editar\", \"Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn this.nombre + \" \" + this.apellidos + \" (ID empleado - \" + this.id + \")\";\n\t}", "@Override\r\n\tpublic String falar() {\r\n\t\treturn \"[ \"+getNome()+\" ] Sou Um Professor\";\r\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \" id=\" + id + \", nome=\" + nome + \", dat_nasc=\"\r\n\t\t\t\t+ dat_nasc + \", salario=\" + salario + \" \\n \";\r\n\t}", "public void displayPatients() {\n DefaultTableModel dm = new DefaultTableModel(0, 0);\n String header[] = new String[]{\"\", \"Nom:\", \"Prénom:\", \"Dg:\", \"Séance:\", \"Date visit\"};\n dm.setColumnIdentifiers(header);\n jTable1.setModel(dm);\n\n \n \n //set the data in the table =>rows\n\n for (int i = 0; i < patients.size(); i++) {\n Patient patient = patients.get(i);\n\n Vector<Object> data = new Vector<Object>();\n data.add(patient.getId());\n data.add(patient.getNom());\n data.add(patient.getPrenom());\n data.add(patient.getDg());\n data.add(patient.getNombre_seance());\n data.add(patient.getDate_visit());\n dm.addRow(data);\n \n }\n }", "private void visualizaPersonajes() {\r\n\r\n\t\t// Recogemos nuestro personaje y comprobamos su personaje para mostrar una\r\n\t\t// imagen u\r\n\t\t// otra.\r\n\t\tthis.personaje = DatabaseOperaciones.getPersonaje();\r\n\r\n\t\tString clase = (personaje == null) ? null : personaje.getClass().toString().substring(24);\r\n\r\n\t\tif (clase != null) {\r\n\r\n\t\t\tthis.character1.setStyle(\"visibility: visible;\" + \"-fx-background-image: url('\"\r\n\t\t\t\t\t+ this.personaje.getAspecto() + \"'); \" + \"-fx-background-size: cover;\");\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\r\n\t\t\tthis.character1.setStyle(\"visibility: hidden;\");\r\n\t\t}\r\n\r\n\t\tcompruebaPersonajes();\r\n\t}", "private void mostrarUsuario(Usuario usuario) {\n\t\tSystem.out.println(usuario.getId()+\" - \"+usuario.getNombre()+\" \"+usuario.getApellido()+\" / \"+usuario.getEdad()+\" / \"+usuario.getDni()+\" / \"+usuario.getFecha_nac());\r\n\t}", "public Persona()\n\t{\n\t\tnombre = \"--\"; //DEFINES POR DEFAULT LAS VARIABLES;\n\t\tapellido = \"--\"; //DEFINES POR DEFAULT LAS VARIABLES;\n\t\tedad = 0; //DEFINES POR DEFAULT LAS VARIABLES;\n\t\talias = \"--\"; //DEFINES POR DEFAULT LAS VARIABLES;\t\t\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn this.nome + \" (\" + this.funcao + \") - \" + this.biografia + \" - \" + this.email + \" - \" + this.foto + \" - \"\n\t\t\t\t+ this.formacao + \" - \" + this.unidade + \" - \" + this.data;\n\t}", "public static void main(String[] args) {\n Persona alumno = new Persona(\"Omar\", 1252522);\n System.out.println(\"Nombre: \" + alumno.getNombre());\n System.out.println(\"Matricula: \" + alumno.getMatricula());\n }", "public static void main(String[] args) {\n Alumno aaDatos []; // El identificador es nulo\n \n aaDatos = new Alumno[tam];//Creamos un arreglo de 10 \n //alumnos - AQUI HABRA PREGUNTA\n for (int i = 0; i < aaDatos.length; i++) {\n aaDatos[i]= new Alumno(\"Dany\",\"16550518\", 0);//Para cada lugar de arreglo se crea un objeto de la clase alumno\n \n }\n for (Alumno aaDatos1: aaDatos) {\n System.out.println(\"Nombre: \"+ aaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaDatos1.getiCar());\n \n }\n \n \n //CREAMOS UNA COPIA DEL ARREGLO\n Alumno aaCopiaDatos [];\n aaCopiaDatos = new Alumno [tam];\n \n for (int i = 0; i < aaCopiaDatos.length; i++) {\n aaCopiaDatos[i]= new Alumno(aaDatos[i].getsNom(), // <<<Se llenan todos los datos que pide el constructor por argumentos\n aaDatos[i].getsMatri(), \n aaDatos[i].getiCar());\n \n }\n for (Alumno aaCopiaDatos1 : aaCopiaDatos) {\n System.out.println(\"Nombre: \"+ aaCopiaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaCopiaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaCopiaDatos1.getiCar());\n }\n System.out.println(aaDatos);\n System.out.println(aaCopiaDatos);\n }", "public Persona(String nombre) {\n this.nombre = nombre;\n }", "@Override\n public String toString(){\n return Nombre + \", \" + Clave + \", de \" + horario + \", \" + Maestro;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Nombre: \"+this.nombre+\" Cantidad: \"+this.cantidad+\" \"+this.unidadMedida;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn id + \" \" + name + \" \" + surname;\n\t}", "public String showAllPersons() {\n String string = \"\";\n for(Person person: getPersons().values()){\n string += person.toString();\n }\n return string;\n }", "public void consultaDinero(){\r\n System.out.println(this.getMonto());\r\n }", "public TabellaModel() {\r\n lista = new Lista();\r\n elenco = new Vector<Persona>();\r\n elenco =lista.getElenco();\r\n values = new String[elenco.size()][3];\r\n Iterator<Persona> iterator = elenco.iterator();\r\n while (iterator.hasNext()) {\r\n\t\t\tfor (int i = 0; i < elenco.size(); i++) {\r\n\t\t\t\tpersona = new Persona();\r\n\t\t\t\tpersona = (Persona) iterator.next();\r\n\t\t\t\tvalues[i][0] = persona.getNome();\r\n\t\t\t\tvalues[i][1] = persona.getCognome();\r\n\t\t\t\tvalues[i][2] = persona.getTelefono();\t\r\n\t\t\t}\r\n\t\t}\r\n setDataVector(values, columnNames);\t\r\n }", "public List<PersonEntity> obtenerDatosPersonas() {\n\n\t\ttry {\n\n\t\t\tlog.info(\"Procediendo a obtener el detalle de los clientes\");\n\t\t\tStoredProcedureQuery storedProcedureQuery = entityManager\n\t\t\t\t\t\n\t\t\t\t\t// Definicion\n\t\t\t\t\t.createStoredProcedureQuery(prop.getPROCEDURE_OBTENER_PERSONAS(), PersonEntity.class);\n\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<PersonEntity> res = storedProcedureQuery.getResultList();\n\n\t\t\tlog.info(\"Lista consultada exitosamente\");\n\t\t\tlog.info(\"Recorriendo lista de salida...\");\n\t\t\tfor (PersonEntity p : res) {\n\t\t\t\tlog.info(\"Persona : \" + p);\n\t\t\t}\n\n\t\t\treturn res;\n\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Error al consultar procedure [\" + prop.getPROCEDURE_OBTENER_PERSONAS() + \"] , Detalle > \" + e.getMessage());\n\t\t}\n\n\t\treturn null;\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Dipendente [nome=\" + nome + \", cognome=\" + cognome + \", nMat=\" + nMat + \"]\";\r\n\t}", "private void mostrarEstadoObjetosUsados() {\n Beneficiario beneficiario = null;\n FichaSocial fichaSocial = null;\n SolicitudBeneficio solicitudBeneficio = null;\n AspectoHabitacional aspectoHabitacional = null;\n AspectoEconomico aspectoEconomico = null;\n\n // CAMBIAR: Obtener datos del Request y asignarlos a los textField\n if (this.getRequestBean1().getObjetoABM() != null) {\n fichaSocial = (FichaSocial) this.getRequestBean1().getObjetoABM();\n aspectoHabitacional = (AspectoHabitacional) fichaSocial.getAspectoHabitacional();\n aspectoEconomico = (AspectoEconomico) fichaSocial.getAspectoEconomico();\n this.getElementoPila().getObjetos().set(0, fichaSocial);\n this.getElementoPila().getObjetos().set(1, aspectoHabitacional);\n this.getElementoPila().getObjetos().set(2, aspectoEconomico);\n }\n\n int ind = 0;\n fichaSocial = (FichaSocial) this.obtenerObjetoDelElementoPila(ind++, FichaSocial.class);\n aspectoHabitacional = (AspectoHabitacional) this.obtenerObjetoDelElementoPila(ind++, AspectoHabitacional.class);\n aspectoEconomico = (AspectoEconomico) this.obtenerObjetoDelElementoPila(ind++, AspectoEconomico.class);\n\n\n this.getTfCodigo().setText(fichaSocial.getNumero());\n this.getTfFecha().setText(Conversor.getStringDeFechaCorta(fichaSocial.getFecha()));\n ////\n //Beneficiarios:\n if (fichaSocial.getTitular() != null) {\n this.getTfTitular().setText(fichaSocial.toString());\n }\n\n this.setListaDelCommunication(new ArrayList(fichaSocial.getGrupoFamiliar()));\n this.getObjectListDataProvider().setList(new ArrayList(fichaSocial.getGrupoFamiliar()));\n\n //Aspecto habitacional:\n if (aspectoHabitacional.getNumeroPersonas() != null) {\n this.getTfNroPersonas().setText(aspectoHabitacional.getNumeroPersonas().toString());\n }\n this.getTfVivienda().setText(aspectoHabitacional.getVivienda());\n this.getTfTenencia().setText(aspectoHabitacional.getTenencia());\n this.getTfNroCamas().setText(aspectoHabitacional.getNumeroCamas());\n this.getTfNroAmbientes().setText(aspectoHabitacional.getNumeroAmbientes());\n this.getCbBanioCompleto().setValue(new Boolean(aspectoHabitacional.isBanioCompleto()));\n this.getCbBanioInterno().setValue(new Boolean(aspectoHabitacional.isBanioInterno()));\n this.getCbAgua().setValue(new Boolean(aspectoHabitacional.isAgua()));\n this.getCbLuz().setValue(new Boolean(aspectoHabitacional.isLuz()));\n this.getCbCloaca().setValue(new Boolean(aspectoHabitacional.isCloaca()));\n this.getCbGasNatural().setValue(new Boolean(aspectoHabitacional.isGasNatural()));\n\n //Aspecto Economico:\n this.getTfNroCasas().setText(aspectoEconomico.getNumeroCasas());\n this.getTfNroTerrenos().setText(aspectoEconomico.getNumeroTerrenos());\n this.getTfNroCampos().setText(aspectoEconomico.getNumeroCampos());\n this.getTfVehiculo().setText(aspectoEconomico.getVehiculo());\n this.getTfIndustria().setText(aspectoEconomico.getIndustria());\n this.getTfActividadLaboral().setText(aspectoEconomico.getActividadLaboral());\n this.getTfComercio().setText(aspectoEconomico.getComercio());\n\n //Solicitud Beneficio\n this.setListaDelCommunication2(new ArrayList(fichaSocial.getListaSolicitudBeneficio()));\n this.getObjectListDataProvider2().setList(new ArrayList(fichaSocial.getListaSolicitudBeneficio()));\n }", "@Override\r\n public void mostrarProfesores(){\n for(Persona i: listaPersona){\r\n if(i instanceof Profesor){\r\n i.mostrar();\r\n }\r\n }\r\n }", "public void mostrarAutomovil(){\r\n System.out.println(\"Marca: \" + automovil.getMarca());\r\n System.out.println(\"Modelo: \" + automovil.getModelo());\r\n System.out.println(\"Placa: \" + automovil.getPlaca());\r\n }", "private void agregarDatoATable() {\n\t\tString nombre = textNombre.getText();\n\t\tint deporte = (int)spinnerDeporte.getValue();\n\t\tint musica = (int)spinnerMusica.getValue();\n\t\tint espectaculo = (int)spinnerEspectaculo.getValue();\n\t\tint ciencia = (int)spinnerCiencia.getValue();\n\t\t\n\t\t//Reseteo los inputs para los proximos datos\n\t\ttextNombre.setText(\"\");\n\t\tspinnerDeporte.setValue(1);\n\t\tspinnerMusica.setValue(1);\n\t\tspinnerEspectaculo.setValue(1);\n\t\tspinnerCiencia.setValue(1);\n\t\t\n\t\t//Agrego todos los datos al array\n\t\tdatos.add(new Persona(nombre,deporte,musica,espectaculo,ciencia));\n\t\t\n\t\t//Agrego los datos a la JTable\n\t\tmodel.addRow(new String[]{ nombre, String.valueOf(deporte), String.valueOf(musica),\n\t\t\t\tString.valueOf(espectaculo), String.valueOf(ciencia) });\n\t\ttable.setModel(model);\n\t}", "public Persona(int idPersona, String nombre, String apellido, String email, String telefono){\n this.idPersona = idPersona;\n this.nombre = nombre;\n this.apellido = apellido;\n this.email = email;\n this.telefono = telefono;\n \n }", "public String datosAlumno() {\n\t\treturn \"alumno: \" + this.getNombre() + \" \" + this.getApellido() + \" genero: \" + this.getGenero()\n\t\t+ \" condicion: \" + this.getCondicion() + \" notaFinal: \" + this.getNotaFinal();\n\t}", "void crearNuevaPersona(Persona persona);", "private PersonaEnvio buscaPersonaPorNombre(PersonaEnvio personaRequest) throws NotariaException{\n\t\tPersonaEnvio respuesta = new PersonaEnvio();\n\t\tString nombrePersona = personaRequest.getNombrePersona().replaceAll(\"\\\\s+\", \" \").trim();\n\t\tList<DatoBusquedaPersona> lista = personaBo.findPersonaByName(nombrePersona);\n\t\tif (lista != null) {\n\t\t\trespuesta.setResultados(new ArrayList<DatoBusquedaPersona>(\n\t\t\t\t\tlista));\n\t\t\trespuesta.setNumeroResultados(lista.size());\n\t\t\trespuesta.setEstatus(\"Búsqueda correcta.\");\n\t\t\trespuesta.setExito(true);\n\t\t\treturn respuesta;\n\t\t} else {\n\t\t\trespuesta.setResultados(null);\n\t\t\trespuesta.setNumeroResultados(0);\n\t\t\trespuesta.setEstatus(\"No se encontraron resultados.\");\n\t\t\trespuesta.setExito(false);\n\t\t\treturn respuesta;\n\t\t}\n\t}", "@GetMapping(\"/personas\")\n\tpublic List<Persona> allPersonas(){\n\t\treturn personaRepository.findAll();\n\t\t\n\t}", "public void consultaDatosFiliatorios(Paciente p_paciente){\n\t\tSystem.out.println(\"Hospital: \" + this.getHospital() + \"\\tDirector: \" + this.getDirector());\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------------\");\n\t\tp_paciente.mostrarDatosPantalla();\n\t}", "@GetMapping(path=\"/showData\")\n public List<Person> showData() {\n Iterable<Person> myPerson = personRepository.findAll();\n List<Person> listOfPersons = new ArrayList<>();\n myPerson.forEach((Person person) -> {\n listOfPersons.add(person);\n });\n return listOfPersons;\n }", "@Override\r\n public String toString() {\r\n return \"Nodo: \" + this.dato.toString();\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn this.nombre;\n\t}", "@Override\r\n public String toString() {\r\n \r\n DateFormat data = DateFormat.getDateInstance();\r\n return \"Nome: \" + getNome()+ \" \\nCPF: \" + getCpf() + \" \\nTelefone: \"\r\n + getTelefone() + \" \\nData de Nascimento : \" + data.format(getDataNasc())\r\n + \" \\nSexo: \" + getSexo();\r\n }", "public String getMostrarResultados() {\n StringBuilder strb = new StringBuilder();\r\n if(auditoriaanalizada==null){\r\n return \"No existe ningún informe para dicho informe\";\r\n }\r\n for(int i=1; i <= MAX_PREGUNTAS; i++){\r\n try{\r\n PropertyDescriptor p = new PropertyDescriptor(\"p\" + i, Auditorias.class);\r\n Integer c = (Integer) p.getReadMethod().invoke(auditoriaanalizada);\r\n if(c!=null && c==0){\r\n //hay que buscar dicha pregunta y poner lo que pone en el campo reglamento\r\n Reglamento r = ejbFacadeReglamento.find(i);\r\n if(r!=null && r.getIncumplimiento()!=null && !r.getIncumplimiento().isEmpty()){\r\n strb.append(\"<li>\");\r\n strb.append(r.getIncumplimiento());\r\n strb.append(\"</li>\");\r\n }\r\n }\r\n \r\n }\r\n catch(Exception e){\r\n System.out.println(\"Error:\" + e.getMessage());\r\n }\r\n }\r\n return strb.toString();\r\n }", "@Override\n public String toString() {\n return \"Empleado{\" + \"nombre=\" + nombre + \", edad=\" + edad + \", salario=\" + salario + '}';\n }", "public Persona(){\n /*super(nombresPosibles\n [r.nextInt(nombresPosibles.length)],(byte)r.nextInt(101));\n */\n super(\"Anónimo\",(byte)5);\n String[] nombresPosibles={\"Patracio\",\"Eusequio\",\"Bartolo\",\"Mortadelo\",\"Piorroncho\",\"Tiburcio\"};\n String[] apellidosPosibles={\"Sánchez\",\"López\",\"Martínez\",\"González\",\"Páramos\",\"Jiménez\",\"Parra\"};\n String[] nacionalidadesPosibles={\"Española\",\"Francesa\",\"Alemana\",\"Irlandesa\",\"Japonesa\",\"Congoleña\",\"Bielorrusa\",\"Mauritana\"};\n Random r=new Random();\n this.apellido=apellidosPosibles\n [r.nextInt(apellidosPosibles.length)];\n this.nacionalidad=nacionalidadesPosibles\n [r.nextInt(nacionalidadesPosibles.length)];\n mascota=new Mascota[5];\n this.saldo=r.nextInt(101);\n }", "public static void main(String[] args) {\n\r\n clsAlumno alumno1 = new clsAlumno();\r\n\r\n alumno1.setNombre(\"Eneko\");\r\n\r\n alumno1.setApellido(\"Galdos\");\r\n\r\n alumno1.setDNI(\"72826873H\");\r\n\r\n alumno1.setCreditos(60);\r\n\r\n alumno1.mostrarPersona();\r\n\r\n alumno1.mostrarCreditos();\r\n\r\n System.out.println();\r\n\r\n clsProfesor profesor1 = new clsProfesor();\r\n\r\n profesor1.setNombre(\"Javier\");\r\n\r\n profesor1.setApellido(\"Cerro\");\r\n\r\n profesor1.setDNI(\"11111111A\");\r\n\r\n profesor1.setDepartamento(\"Informática\");\r\n\r\n profesor1.mostrarPersona();\r\n\r\n profesor1.mostrarDepartamento();\r\n\r\n }", "public String verDatos(){\n return \"Ataque: \"+ataque+\"\\nDefensa: \"+defensa+\"\\nPunteria: \"+punteria;\n }", "@Override\n\tpublic String toString () {\n\t\treturn tituloCD + \" - Autor/Artista: \" + autorCD;\n\t}", "public static void main(String[] args) {\n\t\tProfesor profesor = new Alumno();\r\n\t\tSystem.out.println(\"Profesor: \"+profesor.devolverNombre());\r\n\t\tSystem.out.println(\"Edad: \"+profesor.devolverEdad());\r\n\t\tSystem.out.println();\r\n\t\tPersona persona = new Alumno();\r\n\t\tSystem.out.println(\"Edad: \"+persona.devolverEdad());\r\n\t\tSystem.out.println(\"Nombre: \"+persona.devolverNombre());\r\n\t\t\r\n\t\tPersona persona2 = new Profesor();\r\n\t\tSystem.out.println(\"Edad: \"+persona2.devolverEdad());\r\n\t\tSystem.out.println(\"Nombre: \"+persona2.devolverNombre());\r\n\t\t\r\n\t\tArrayList<Persona> personas = new ArrayList<Persona>();\r\n\t\tpersonas.add(persona);\r\n\t\tpersonas.add(persona2);\r\n\t\t\r\n\t\tfor (Persona persona3 : personas) {\r\n\t\t\tSystem.out.println(\"ENTRO AL FOR\");\r\n\t\t\tSystem.out.println(\"Edad: \"+persona3.devolverEdad());\r\n\t\t\tSystem.out.println(\"Nombre: \"+persona3.devolverNombre());\r\n\t\t}\r\n\t}", "@RequestMapping(value = \"/AgregarPersona\", method = RequestMethod.GET)\n\tpublic ModelAndView AgregarPersona() {\n\t\t//prepara para generar nuevo registro de persona\n\t\tmav.addObject(new Persona());\n\t\tmav.setViewName(\"agregarPersona\");\n\t\treturn mav;\n\t}", "@Override\n\tpublic List<Persona> getPersona() throws SQLException {\n\t\tList<Persona> listaPersona1 = new ArrayList<Persona>();\n\t\t\n Single<List<DbRow>> rows = dbClient.execute(exec -> exec\n \t\t.createQuery(\"select * from persona;\").execute()).collectList();\n \n try {\n List<DbRow> listasPersonas = rows.get();\n \n if(!listasPersonas.isEmpty()) {\n \t\n \tfor(int i=0; i< listasPersonas.size(); i++) {\n \t\tPersona p = new Persona();\n \t\tp.setId((int)listasPersonas.get(i).column(\"id\").value());\n \t\tp.setNombre((String)listasPersonas.get(i).column(\"nombre\").value());\n \t\tp.setDireccion((String)listasPersonas.get(i).column(\"direccion\").value());\n \t\tp.setCorreo((String)listasPersonas.get(i).column(\"correo\").value()); \t\t\n \t\tlistaPersona1.add(p);\n \t}\n \t\n }\n // listasPersonas.forEach(System.out::println);\n \n } catch (InterruptedException e) {\n e.printStackTrace();\n return null;\n } catch (ExecutionException e) {\n e.printStackTrace();\n return null;\n }\n return listaPersona1;\n\t\t\n\t}", "public String visualizzaCampo(){\n\t\tString info= new String(\"Nome: \"+ nome +\"\\n\" +\"Descrizione: \" + descrizione+ \"\\n\"+ \"Obbligatoria: \" + obbligatorio +\"\\n\");\n\t\treturn info;\n\t}", "void printData()\n {\n System.out.println(\"Studentname=\" +name);\n System.out.println(\"Student city =\"+city);\n System.out.println(\"Student age = \"+age);\n }", "public void solicitarDatos() {\r\n System.out.println(\"Dime el nombre del cliente: \");\r\n this.setNombre(lector.nextLine());\r\n System.out.println(\"Dime el primer apellido: \");\r\n this.setPrimerApellido(lector.nextLine());\r\n System.out.println(\"Dime el segundo apellido: \");\r\n this.setSegundoApellido(lector.nextLine());\r\n System.out.println(\"Dime la edad: \");\r\n this.setEdad(lector.nextInt());\r\n }", "public void llenarDatos() {\n String nombre = \"\";\n String descripcion = \"\";\n try {\n ResultSet resultado = buscador.getResultSet(\"select nombre, descripcion from NODO where ID = \" + IDNodoPadre + \";\");\n if (resultado.next()) {\n nombre = resultado.getObject(\"nombre\").toString();\n descripcion = resultado.getObject(\"descripcion\").toString();\n }\n } catch (SQLException e) {\n System.out.println(\"*SQL Exception: *\" + e.toString());\n }\n campoNombre.setText(nombre);\n campoDescripcion.setText(descripcion);\n //Si esta asociada a categorias\n if(conCategorias)\n llenarComboCategoria();\n else{\n comboCategoria.setVisible(false);\n labelCategoria.setVisible(false);\n }\n }", "public void GuardarPersonas()\r\n {\r\n System.out.print(\"Inserte su numero de cedula: \");\r\n setNumeroId(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Nombre: \");\r\n setNombre(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Apellido: \");\r\n setPrimerApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su Segundo Apellido: \");\r\n setSegundoApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su edad: \");\r\n setEdad(Integer.parseInt(entrada.nextLine()));\r\n System.out.print(\"Inserte su peso: \");\r\n setPeso(Float.valueOf(entrada.nextLine()));\r\n \r\n }", "public Afiliado(String nombrePersona, String apellidoPersona, String duiPersona) {\n //Inicializar Miembros de clase.\n Afiliados = new ArrayList<>();\n NumeroDui = new ArrayList<>();\n FechaAfiliacion = new ArrayList<>();\n //Agregar valores a los arraylist.\n Afiliados.add(nombrePersona + \" \" + apellidoPersona);\n NumeroDui.add(duiPersona);\n FechaAfiliacion.add(ObtenerFechaActual());\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn this.nome;\r\n\t}", "@Override\n\tpublic String getPerson() throws RemoteException {\n\t\treturn \"[Person name=\" + name + \",sex=\" + sex + \",age=\" + age + \"]\";\n\t}", "public Persona(){\n \n }", "public Persona(){\n \n }", "@Test\n\t@Transactional(value = TransactionMode.ROLLBACK)\n\t@UsingDataSet({ \"persona.json\", \"registro.json\", \"administrador.json\", \"cuenta.json\", \"empleado.json\",\n\t\t\t\"familia.json\", \"genero.json\", \"recolector.json\", \"planta.json\" })\n\tpublic void obtenerPersonaSinRegistro() {\n\t\tTypedQuery<Persona> query = entityManager.createNamedQuery(Persona.PERSONA_SIN_REGISTRO, Persona.class);\n\t\tList<Persona> listaPersonas = query.getResultList();\n\n\t\tIterator<Persona> iterator = listaPersonas.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tSystem.out.println(iterator.next());\n\t\t}\n\t}" ]
[ "0.71626145", "0.70909446", "0.7070012", "0.7046698", "0.69264066", "0.6896772", "0.68578243", "0.6791878", "0.6654108", "0.65558094", "0.65314245", "0.6465523", "0.6444806", "0.6439064", "0.64377224", "0.6426238", "0.63977075", "0.63788766", "0.635563", "0.63499695", "0.6330354", "0.63233566", "0.6318861", "0.6315837", "0.6310985", "0.6310733", "0.6278534", "0.6275607", "0.6264531", "0.6245647", "0.623376", "0.6227864", "0.6224446", "0.62210965", "0.62161916", "0.619009", "0.61881226", "0.6183883", "0.6179777", "0.61769545", "0.61760396", "0.61750394", "0.6174243", "0.6165321", "0.61602956", "0.6153145", "0.6142044", "0.6140217", "0.6128157", "0.6123373", "0.61214846", "0.6120863", "0.6120262", "0.6117734", "0.611647", "0.6108828", "0.61035156", "0.61006343", "0.6097096", "0.6090766", "0.6072351", "0.6065632", "0.6050524", "0.60486454", "0.6042103", "0.603772", "0.60224473", "0.601964", "0.598926", "0.5979556", "0.5974656", "0.5960599", "0.5955333", "0.595158", "0.5950401", "0.5949734", "0.59471065", "0.5943311", "0.5939283", "0.59369516", "0.59327865", "0.59299064", "0.59194744", "0.5916307", "0.5916174", "0.5911758", "0.5911587", "0.5903054", "0.59016895", "0.59016836", "0.5895811", "0.58947647", "0.58936274", "0.5891637", "0.5891001", "0.58896035", "0.58894366", "0.5888723", "0.5888723", "0.588663" ]
0.8234247
0
metodo para crear automovil
public void crearAutomovil(){ automovil = new Vehiculo(); automovil.setMarca("BMW"); automovil.setModelo(2010); automovil.setPlaca("TWS435"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Anuncio creaAnuncioTematico();", "public abstract Anuncio creaAnuncioGeneral();", "public void create() {\n\t\t\n\t}", "Oracion createOracion();", "Compleja createCompleja();", "@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}", "public abstract Anuncio creaAnuncioIndividualizado();", "Obligacion createObligacion();", "Compuesta createCompuesta();", "Negacion createNegacion();", "For createFor();", "Operacion createOperacion();", "@Override\n\tpublic void create() {\n\t\t\n\t}", "public void create(){}", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "public void automovil(){\r\n System.out.println(\"Ingrese placa: \");\r\n placa = leer.next();\r\n System.out.println(\"Ingrese marca: \");\r\n marca = leer.next();\r\n \r\n Automovil auto = new Automovil(placa, marca, 10000);\r\n controlador.llenarVehiculo(auto);\r\n {\r\n }\r\n }", "public static void creaHidatoAutomaticament()\n {\n ControladorVista.mostraCreacioHidatoAutomatica();\n }", "CreationData creationData();", "Secuencia createSecuencia();", "@Override\r\n\tpublic void create() {\n\r\n\t}", "OperacionColeccion createOperacionColeccion();", "private Attr newAttr(String tipo, String valor) {\n/* 341 */ Attr atrib = this.pagHTML.createAttribute(tipo);\n/* 342 */ atrib.setValue(valor);\n/* 343 */ return atrib;\n/* */ }", "@Override\n public boolean create(Revue objet) {\n return false;\n }", "private TipoAtaque generateTipoAtaque() {\n\t\treturn null;\r\n\t}", "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "AliciaLab createAliciaLab();", "public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}", "Motivo create(Motivo motivo);", "private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "Klassenstufe createKlassenstufe();", "public void creoVehiculo() {\n\t\t\n\t\tAuto a= new Auto(false, 0);\n\t\ta.encender();\n\t\ta.setPatente(\"saraza\");\n\t\ta.setCantPuertas(123);\n\t\ta.setBaul(true);\n\t\t\n\t\tSystem.out.println(a);\n\t\t\n\t\tMoto m= new Moto();\n\t\tm.encender();\n\t\tm.frenar();\n\t\tm.setManubrio(true);\n\t\tm.setVelMax(543);\n\t\tm.setPatente(\"zas 241\");\n\t\tVehiculo a1= new Auto(true, 0);\n\t\ta1.setPatente(\"asd 423\");\n\t\t((Auto)a1).setBaul(true);\n\t\t((Auto)a1).setCantPuertas(15);\n\t\tif (a1 instanceof Auto) {\n\t\t\tAuto autito= (Auto) a1;\n\t\t\tautito.setBaul(true);\n\t\t\tautito.setCantPuertas(531);\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Moto) {\n\t\t\tMoto motito=(Moto) a1;\n\t\t\tmotito.setManubrio(false);\n\t\t\tmotito.setVelMax(15313);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Camion) {\n\t\t\tCamion camioncito=(Camion) a1;\n\t\t\tcamioncito.setAcoplado(false);\n\t\t\tcamioncito.setPatente(\"ge\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\tVehiculo a2= new Moto();\n\t\tSystem.out.println(a2);\n\t\ta1.frenar();\n\t\t\n\t\tArrayList<Vehiculo>listaVehiculo= new ArrayList<Vehiculo>();\n\t\tlistaVehiculo.add(new Auto(true, 53));\n\t\tlistaVehiculo.add(new Moto());\n\t\tlistaVehiculo.add(new Camion());\n\t\tfor (Vehiculo vehiculo : listaVehiculo) {\n\t\t\tSystem.out.println(\"clase:\" +vehiculo.getClass().getSimpleName());\n\t\t\tvehiculo.encender();\n\t\t\tvehiculo.frenar();\n\t\t\tSystem.out.println(\"=======================================\");\n\t\t\t\n\t\t}\n\t}", "NFRSoftgoal createNFRSoftgoal();", "@Override\n\tpublic boolean create(Langues obj) {\n\t\treturn false;\n\t}", "public Generateur() {\n }", "Vaisseau_longueur createVaisseau_longueur();", "ModularizationElement createModularizationElement();", "Atributo createAtributo();", "@Override\n public void create() {\n theMap = new ObjectSet<>(2048, 0.5f);\n generate();\n }", "@Override\n\tpublic Nota buildObject() {\n\t\treturn new Nota(emitente, destinatario, chave, numero, serie, emissao, total, isIncomplete);\n\t}", "@Override\r\n\tpublic boolean create(Jeu obj) {\n\t\treturn false;\r\n\t}", "public void asignarAutomovilPersona(){\r\n persona.setAutomovil(automovil);\r\n }", "Lehrkraft createLehrkraft();", "protected abstract void generate();", "public void crear() {\n con = new Conexion();\n con.setInsertar(\"insert into lenguajes_programacion (nombre, fecha_creacion, estado) values ('\"+this.getNombre()+\"', '\"+this.getFecha_creacion()+\"', 'activo')\");\n }", "Builder addCreator(String value);", "@Override\n\tpublic void create(Owner owner) {\n\n\t}", "public abstract void create();", "private static void createFileContribuicaoUmidade() throws IOException{\r\n\t\tInteger contribuicaoDefault = 0;\r\n\t\tarqContribuicaoUmidade = new File(pathContribuicaoUmidade);\r\n\t\tif(!arqContribuicaoUmidade.exists()) {\r\n\t\t\tarqContribuicaoUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqContribuicaoUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {//Se arquivo existir\r\n\t\t\tFileReader fr = new FileReader(getArqContribuicaoUmidade());\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(modificado)*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqContribuicaoUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma contribuicao 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}", "ProjetoRN createProjetoRN();", "public void generate() {\n\t}", "Foco createFoco();", "private ElementoDettaglioVariazioneCodificaCapitoloFactory() {\n\t}", "Not createNot();", "Not createNot();", "PiviDiagram createPiviDiagram();", "private DittaAutonoleggio(){\n \n }", "void crearNuevaPersona(Persona persona);", "OperationalizingSoftgoal createOperationalizingSoftgoal();", "Vaisseau createVaisseau();", "SpacesInvaders_aUnVaisseau createSpacesInvaders_aUnVaisseau();", "public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}", "Attribute createAttribute();", "Attribute createAttribute();", "public void addCreator(String value) {\n/* 106 */ addStringToSeq(\"creator\", value);\n/* */ }", "public static void instanciarCreencias() {\n\t\tfor(int i =0; i < GestorPartida.getContJugadores(); i++) {\n\t\t\t\n\t\t\tGestorPartida.jugadores[i].setCreencias(new Creencias(GestorPartida.jugadores, GestorPartida.objetoJugador, GestorPartida.objetoSala, i)); \n\t\t}\n\t}", "@Override\n public void crearReloj() {\n Manecilla seg;\n seg = new Manecilla(40,60,0,1,null);\n cronometro = new Reloj(seg);\n }", "private void criaInterface() {\n\t\tColor azul = new Color(212, 212, 240);\n\n\t\tpainelMetadado.setLayout(null);\n\t\tpainelMetadado.setBackground(azul);\n\n\t\tmetadadoLabel = FactoryInterface.createJLabel(10, 3, 157, 30);\n\t\tpainelMetadado.add(metadadoLabel);\n\n\t\tbotaoAdicionar = FactoryInterface.createJButton(520, 3, 30, 30);\n\t\tbotaoAdicionar.setIcon(FactoryInterface.criarImageIcon(Imagem.ADICIONAR));\n\t\tbotaoAdicionar.setToolTipText(Sap.ADICIONAR.get(Sap.TERMO.get()));\n\t\tpainelMetadado.add(botaoAdicionar);\n\n\t\tbotaoEscolha = FactoryInterface.createJButton(560, 3, 30, 30);\n\t\tbotaoEscolha.setIcon(FactoryInterface.criarImageIcon(Imagem.VOLTAR_PRETO));\n\t\tbotaoEscolha.setToolTipText(Sap.ESCOLHER.get(Sap.TERMO.get()));\n\t\tbotaoEscolha.setEnabled(false);\n\t\tpainelMetadado.add(botaoEscolha);\n\n\t\talterarModo(false);\n\t\tatribuirAcoes();\n\t}", "interface Create {}", "private void creaPannelli() {\n /* variabili e costanti locali di lavoro */\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* pannello date */\n pan = this.creaPanDate();\n this.addPannello(pan);\n\n /* pannello coperti */\n PanCoperti panCoperti = new PanCoperti();\n this.setPanCoperti(panCoperti);\n this.addPannello(panCoperti);\n\n\n /* pannello placeholder per il Navigatore risultati */\n /* il navigatore vi viene inserito in fase di inizializzazione */\n pan = new PannelloFlusso(Layout.ORIENTAMENTO_ORIZZONTALE);\n this.setPanNavigatore(pan);\n this.addPannello(pan);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "GoalModel createGoalModel();", "@Override\n\tpublic boolean create(NPC_tmpl obj) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void makerear() {\n\t\t\r\n\t}", "protected void creaPagine() {\n Pagina pag;\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* crea la pagina e aggiunge campi e pannelli */\n pag = this.addPagina(\"generale\");\n\n pan = PannelloFactory.orizzontale(this);\n pan.add(Cam.data);\n pan.add(Cam.importo.get());\n pan.add(Cam.note.get());\n pag.add(pan);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "void create(Order order);", "private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }", "protected abstract M createNewElement();", "public abstract void generate();", "DomainElement createDomainElement();", "Petunia() {\r\n\t\t}", "protected abstract void createAttributes();", "Make createMake();", "private static void generModeloDePrueba() {\n\t\tCSharpArchIdPackageImpl.init();\n // Retrieve the default factory singleton\n\t\tCSharpArchIdFactory factory = CSharpArchIdFactory.eINSTANCE;\n // create an instance of myWeb\n\t\tModel modelo = factory.createModel();\n\t\tmodelo.setName(\"Prueba\"); \n // create a page\n\t\tCompileUnit cu = factory.createCompileUnit();\n\t\tcu.setName(\"archivo.cs\");\n\t\tClassDeclaration clase = factory.createClassDeclaration();\n\t\t//clase.setName(\"Sumar\");\n\t\t//cu.getTypeDeclaration().add(clase);\n modelo.getCompileUnits().add(cu);\n \n Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;\n Map<String, Object> m = reg.getExtensionToFactoryMap();\n m.put(\"model\", new XMIResourceFactoryImpl());\n\n // Obtain a new resource set\n ResourceSet resSet = new ResourceSetImpl();\n\n // create a resource\n Resource resource = resSet.createResource(URI\n .createURI(\"CSharpArchId.model\"));\n // Get the first model element and cast it to the right type, in my\n // example everything is hierarchical included in this first node\n resource.getContents().add(modelo);\n\n // now save the content.\n try {\n resource.save(Collections.EMPTY_MAP);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\t\t\n // and so on, and so on\n // as you can see the EMF model can be (more or less) used as standard Java\n\t}", "Object build();", "Para createPara();", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "public interface NewLine extends ClouBausteinElement {\n\n static NewLine create(CodePosition codePosition){\n return new NewLineImpl(codePosition);\n }\n\n}", "Documento createDocumento();", "private IOferta buildOfertaEjemplo4() {\n\t\tPredicate<Compra> condicion = Predicates.alwaysTrue();\n\t\tFunction<Compra, Float> descuento = new DescuentoLlevaXPagaY(\"11-111-1111\", 3, 2);\n\t\treturn new OfertaDinero(\"Lleva 3 paga 2 en Coca-Cola\", condicion,\n\t\t\t\tdescuento);\n\t}", "Information createInformation();", "public void inicializar();", "private void makeObject() {\n\t\t\n\t\tItem I1= new Item(1,\"Cap\",10.0f,\"to protect from sun\");\n\t\tItemMap.put(1, I1);\n\t\t\n\t\tItem I2= new Item(2,\"phone\",100.0f,\"Conversation\");\n\t\tItemMap.put(2, I2);\n\t\t\n\t\tSystem.out.println(\"Objects Inserted\");\n\t}", "Position_ordonnee createPosition_ordonnee();", "public void make();", "Vaisseau_ordonneeLaPlusBasse createVaisseau_ordonneeLaPlusBasse();", "public boolean createPalvelupiste(Palvelupiste palvelupiste);", "private final void createAndAddNode(String name) {\n\t}", "@Generated\n public Anotacion() {\n }", "public Contribuinte()\n {\n this.nif = \"\";\n this.nome = \"\";\n this.morada = \"\"; \n }" ]
[ "0.6495235", "0.6465843", "0.6300872", "0.62493575", "0.6218243", "0.6177469", "0.6171597", "0.6149347", "0.61437875", "0.6106166", "0.6100428", "0.6085236", "0.60710365", "0.6054169", "0.605316", "0.60436237", "0.6006945", "0.5987459", "0.5944883", "0.5912858", "0.5906271", "0.59007585", "0.58913", "0.5882321", "0.5871432", "0.586243", "0.5835337", "0.58267677", "0.5821842", "0.5811289", "0.58018917", "0.5778258", "0.5766866", "0.5735183", "0.57302177", "0.57271916", "0.572343", "0.5676176", "0.566753", "0.5630929", "0.5617291", "0.56080234", "0.5597566", "0.55931807", "0.5592036", "0.5587316", "0.55863225", "0.55763835", "0.555898", "0.555088", "0.5542689", "0.5533217", "0.5525995", "0.5525101", "0.55182886", "0.55182886", "0.5508624", "0.5506119", "0.55032575", "0.549488", "0.5491804", "0.5485895", "0.5477121", "0.5473531", "0.5473531", "0.5468657", "0.5465338", "0.546243", "0.5459306", "0.5452809", "0.5446837", "0.5443076", "0.54412705", "0.54398316", "0.54272187", "0.5427055", "0.5423858", "0.5423715", "0.54235864", "0.5421492", "0.5421207", "0.5413202", "0.5411718", "0.5408404", "0.5404787", "0.5402076", "0.54008985", "0.5398132", "0.5388141", "0.53877854", "0.5382352", "0.53810143", "0.5366679", "0.5364585", "0.5364161", "0.53592837", "0.53514546", "0.5346691", "0.5345713", "0.5339883" ]
0.7457805
0
metodo para mostrar datos del automovil
public void mostrarAutomovil(){ System.out.println("Marca: " + automovil.getMarca()); System.out.println("Modelo: " + automovil.getModelo()); System.out.println("Placa: " + automovil.getPlaca()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void mostrarDados() {\n\t\t\n\t}", "public void mostrarDatos() {\r\n System.out.println(\"El nombre del cliente es: \" + this.getNombre());\r\n System.out.println(\"El primer apellido es: \" + this.getPrimerApellido());\r\n System.out.println(\"El segundo apellido es: \" + this.getSegundoApellido());\r\n System.out.println(\"La edad es: \" + this.getEdad());\r\n }", "@Override\npublic String toString() {// PARA MOSTRAR LOS DATOS DE ESTA CLASE\n// TODO Auto-generated method stub\nreturn MuestraCualquiera();\n}", "public void MostrarDatos(){\n // En este caso, estamos mostrando la informacion necesaria del objeto\n // podemos acceder a la informacion de la persona y de su arreglo de Carros por medio de un recorrido\n System.out.println(\"Hola, me llamo \" + nombre);\n System.out.println(\"Tengo \" + contador + \" carros.\");\n for (int i = 0; i < contador; i++) {\n System.out.println(\"Tengo un carro marca: \" + carros[i].getMarca());\n System.out.println(\"El numero de placa es: \" + carros[i].getPlaca()); \n System.out.println(\"----------------------------------------------\");\n }\n }", "public void mostrarDatos() {\n\t\tSystem.out.println(\"DNI: \" + dni);\n\t\tSystem.out.println(\"Nombre: \" + nombre);\n\t\tdireccion.mostrarDatos();\n\t\tSystem.out.println(\"Telefono 1: \" + telefonos[0]);\n\t\tSystem.out.println(\"Telefono 2: \" + telefonos[1]);\n\t\tSystem.out.println(\"Fecha de Nacimiento: \" + fecha_nac.getDayOfMonth() + \"-\" + fecha_nac.getMonth() + \"-\"\n\t\t\t\t+ fecha_nac.getYear());\n\t\tcurso.mostrarDatos();\n\t\tSystem.out.println(\"Motrando todas las notas registradas:\");\n\t\tnotas.stream().forEach(notas -> notas.mostrarDatos());\n\t}", "public void mostrarPersona(){\r\n System.out.println(\"Nombre: \" + persona.getNombre());\r\n System.out.println(\"Cedula: \" + persona.getCedula());\r\n }", "private void mostrarEstadoObjetosUsados() {\n Beneficiario beneficiario = null;\n FichaSocial fichaSocial = null;\n SolicitudBeneficio solicitudBeneficio = null;\n AspectoHabitacional aspectoHabitacional = null;\n AspectoEconomico aspectoEconomico = null;\n\n // CAMBIAR: Obtener datos del Request y asignarlos a los textField\n if (this.getRequestBean1().getObjetoABM() != null) {\n fichaSocial = (FichaSocial) this.getRequestBean1().getObjetoABM();\n aspectoHabitacional = (AspectoHabitacional) fichaSocial.getAspectoHabitacional();\n aspectoEconomico = (AspectoEconomico) fichaSocial.getAspectoEconomico();\n this.getElementoPila().getObjetos().set(0, fichaSocial);\n this.getElementoPila().getObjetos().set(1, aspectoHabitacional);\n this.getElementoPila().getObjetos().set(2, aspectoEconomico);\n }\n\n int ind = 0;\n fichaSocial = (FichaSocial) this.obtenerObjetoDelElementoPila(ind++, FichaSocial.class);\n aspectoHabitacional = (AspectoHabitacional) this.obtenerObjetoDelElementoPila(ind++, AspectoHabitacional.class);\n aspectoEconomico = (AspectoEconomico) this.obtenerObjetoDelElementoPila(ind++, AspectoEconomico.class);\n\n\n this.getTfCodigo().setText(fichaSocial.getNumero());\n this.getTfFecha().setText(Conversor.getStringDeFechaCorta(fichaSocial.getFecha()));\n ////\n //Beneficiarios:\n if (fichaSocial.getTitular() != null) {\n this.getTfTitular().setText(fichaSocial.toString());\n }\n\n this.setListaDelCommunication(new ArrayList(fichaSocial.getGrupoFamiliar()));\n this.getObjectListDataProvider().setList(new ArrayList(fichaSocial.getGrupoFamiliar()));\n\n //Aspecto habitacional:\n if (aspectoHabitacional.getNumeroPersonas() != null) {\n this.getTfNroPersonas().setText(aspectoHabitacional.getNumeroPersonas().toString());\n }\n this.getTfVivienda().setText(aspectoHabitacional.getVivienda());\n this.getTfTenencia().setText(aspectoHabitacional.getTenencia());\n this.getTfNroCamas().setText(aspectoHabitacional.getNumeroCamas());\n this.getTfNroAmbientes().setText(aspectoHabitacional.getNumeroAmbientes());\n this.getCbBanioCompleto().setValue(new Boolean(aspectoHabitacional.isBanioCompleto()));\n this.getCbBanioInterno().setValue(new Boolean(aspectoHabitacional.isBanioInterno()));\n this.getCbAgua().setValue(new Boolean(aspectoHabitacional.isAgua()));\n this.getCbLuz().setValue(new Boolean(aspectoHabitacional.isLuz()));\n this.getCbCloaca().setValue(new Boolean(aspectoHabitacional.isCloaca()));\n this.getCbGasNatural().setValue(new Boolean(aspectoHabitacional.isGasNatural()));\n\n //Aspecto Economico:\n this.getTfNroCasas().setText(aspectoEconomico.getNumeroCasas());\n this.getTfNroTerrenos().setText(aspectoEconomico.getNumeroTerrenos());\n this.getTfNroCampos().setText(aspectoEconomico.getNumeroCampos());\n this.getTfVehiculo().setText(aspectoEconomico.getVehiculo());\n this.getTfIndustria().setText(aspectoEconomico.getIndustria());\n this.getTfActividadLaboral().setText(aspectoEconomico.getActividadLaboral());\n this.getTfComercio().setText(aspectoEconomico.getComercio());\n\n //Solicitud Beneficio\n this.setListaDelCommunication2(new ArrayList(fichaSocial.getListaSolicitudBeneficio()));\n this.getObjectListDataProvider2().setList(new ArrayList(fichaSocial.getListaSolicitudBeneficio()));\n }", "public void mostrarDados() {\n txtId.setText(\"\" + lista.get(indice).getId());\n txtNome.setText(lista.get(indice).getNome());\n txtEmail.setText(lista.get(indice).getEmail());\n txtSenha.setText(lista.get(indice).getSenha());\n preencheTabela();\n }", "public void mostrarAyuda() {\r\n\t\t\r\n\t\tEnum_Instrucciones[] arrayEnumerado;\r\n\t\t\r\n\t\tarrayEnumerado = Enum_Instrucciones.getArrayEnumerados();\r\n\t\t\r\n\t\t// El tamano del array de enumerados es 8.\r\n\t\tfor(int i = 0; i < Enum_Instrucciones.tamanoArrayEnumerados(); i++) {\r\n\t\t\tSystem.out.println(arrayEnumerado[i].getDescripcionOrden());\r\n\t\t}\r\n\t}", "@Override\n public String toString() {\n return \"Id del Libro: \"+id+\" Nombre del Libro: \"+nombre+\" Disponibilidad: \"+disponibilidad;\n }", "public void MostrarValores() {\r\n Nodo recorrido = UltimoValorIngresado;\r\n\r\n while (recorrido != null) {\r\n Lista += recorrido.informacion + \"\\n\";\r\n recorrido = recorrido.siguiente;\r\n }\r\n\r\n JOptionPane.showMessageDialog(null, Lista);\r\n Lista = \"\";\r\n }", "public void mostrarDatos(Object obj) throws Exception {\n\t\tHisc_urgencia_odontologico hisc_urgencia_odontologico = (Hisc_urgencia_odontologico) obj;\n\t\ttry {\n\t\t\tcargarInformacion_paciente();\n\t\t\tinfoPacientes.setCodigo_historia(hisc_urgencia_odontologico\n\t\t\t\t\t.getCodigo_historia());\n\n\t\t\tinitMostrar_datos(hisc_urgencia_odontologico);\n\n\t\t\t// tbxCodigo_historia.setValue(hisc_urgencia_odontologico.getCodigo_historia());\n\t\t\t// tbxIdentificacion.setValue(hisc_urgencia_odontologico.getIdentificacion());\n\t\t\t// dtbxFecha_inicial.setValue(hisc_urgencia_odontologico.getFecha_inicial());\n\t\t\t// tbxNro_ingreso.setValue(hisc_urgencia_odontologico.getNro_ingreso());\n\t\t\t// tbxCodigo_prestador.setValue(hisc_urgencia_odontologico\n\t\t\t// .getCodigo_prestador());\n\t\t\t// dtbxFecha_ingreso.setValue(hisc_urgencia_odontologico.getFecha_ingreso());\n\t\t\ttbxAcompaniante.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAcompaniante());\n\t\t\tfor (int i = 0; i < lbxRelacion.getItemCount(); i++) {\n\t\t\t\tListitem listitem = lbxRelacion.getItemAtIndex(i);\n\t\t\t\tif (listitem.getValue().toString()\n\t\t\t\t\t\t.equals(hisc_urgencia_odontologico.getRelacion())) {\n\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\ti = lbxRelacion.getItemCount();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttbxTel_acompaniante.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getTel_acompaniante());\n\t\t\ttbxMotivo_consulta.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getMotivo_consulta());\n\t\t\ttbxEnfermedad_actual.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getEnfermedad_actual());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_tratamiento,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_tratamiento());\n\t\t\ttbxAnam_cual_tratamiento.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_tratamiento());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_toma_medicamentos,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_toma_medicamentos());\n\t\t\ttbxAnam_cual_toma_medicamentos.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_toma_medicamentos());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_alergias,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_alergias());\n\t\t\ttbxAnam_cual_alergias.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_alergias());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_cardiopatias,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_cardiopatias());\n\t\t\ttbxAnam_cual_cardiopatias.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_cardiopatias());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_alteracion_presion,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_alteracion_presion());\n\t\t\ttbxAnam_cual_alteracion_presion.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_alteracion_presion());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_embarazo,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_embarazo());\n\t\t\ttbxAnam_cual_embarazo.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_embarazo());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_diabetes,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_diabetes());\n\t\t\tfor (int i = 0; i < lbxAnam_cual_diabetes.getItemCount(); i++) {\n\t\t\t\tListitem listitem = lbxAnam_cual_diabetes.getItemAtIndex(i);\n\t\t\t\tif (listitem\n\t\t\t\t\t\t.getValue()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.equals(hisc_urgencia_odontologico\n\t\t\t\t\t\t\t\t.getAnam_cual_diabetes())) {\n\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\ti = lbxAnam_cual_diabetes.getItemCount();\n\t\t\t\t}\n\t\t\t}\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_hepatitis,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_hepatitis());\n\t\t\tfor (int i = 0; i < lbxAnam_cual_hepatitis.getItemCount(); i++) {\n\t\t\t\tListitem listitem = lbxAnam_cual_hepatitis.getItemAtIndex(i);\n\t\t\t\tif (listitem\n\t\t\t\t\t\t.getValue()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.equals(hisc_urgencia_odontologico\n\t\t\t\t\t\t\t\t.getAnam_cual_hepatitis())) {\n\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\ti = lbxAnam_cual_hepatitis.getItemCount();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_irradiaciones,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_irradiaciones());\n\t\t\ttbxAnam_cual_irradiaciones.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_irradiaciones());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_discracias,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_discracias());\n\t\t\ttbxAnam_cual_discracias.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_discracias());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_fiebre_reumatica,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_fiebre_reumatica());\n\t\t\ttbxAnam_cual_fiebre_reumatica.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_fiebre_reumatica());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_enfermedad_renal,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_enfermedad_renal());\n\t\t\ttbxAnam_cual_enfermedad_renal.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_enfermedad_renal());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_inmunosupresion,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_inmunosupresion());\n\t\t\ttbxAnam_cual_inmunosupresion.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_inmunosupresion());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_trastornos,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_trastornos());\n\t\t\ttbxAnam_cual_trastornos.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_trastornos());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_patologia,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_patologia());\n\t\t\ttbxAnam_cual_patologia.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_patologia());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_trastornos_gastricos,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_trastornos_gastricos());\n\t\t\ttbxAnam_cual_trastornos_gastricos\n\t\t\t\t\t.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t\t\t.getAnam_cual_trastornos_gastricos());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_epilepsia,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_epilepsia());\n\t\t\ttbxAnam_cual_epilepsia.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_epilepsia());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_cirugias,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_cirugias());\n\t\t\ttbxAnam_cual_cirugias.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_cirugias());\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_protasis,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_protasis());\n\t\t\tfor (int i = 0; i < lbxAnam_cual_protasis.getItemCount(); i++) {\n\t\t\t\tListitem listitem = lbxAnam_cual_protasis.getItemAtIndex(i);\n\t\t\t\tif (listitem\n\t\t\t\t\t\t.getValue()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.equals(hisc_urgencia_odontologico\n\t\t\t\t\t\t\t\t.getAnam_cual_protasis())) {\n\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\ti = lbxAnam_cual_protasis.getItemCount();\n\t\t\t\t}\n\t\t\t}\n\t\t\tUtilidades.seleccionarRadio(rdbAnam_otro,\n\t\t\t\t\thisc_urgencia_odontologico.getAnam_otro());\n\t\t\ttbxAnam_cual_otros.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getAnam_cual_otros());\n\t\t\tUtilidades.seleccionarRadio(rdbSintoma_respiratorio,\n\t\t\t\t\thisc_urgencia_odontologico.getSintoma_respiratorio());\n\t\t\tUtilidades.seleccionarRadio(rdbSintoma_piel,\n\t\t\t\t\thisc_urgencia_odontologico.getSintoma_piel());\n\n\t\t\tcargarImpresionDiagnostica(hisc_urgencia_odontologico);\n\n\t\t\t// dbxPulso.setValue(hisc_urgencia_odontologico.getPulso());\n\t\t\t// dbxTemperatura\n\t\t\t// .setValue(hisc_urgencia_odontologico.getTemperatura());\n\t\t\t// dbxTension_arterial.setValue(hisc_urgencia_odontologico\n\t\t\t// .getTension_arterial());\n\t\t\t// dbxPeso.setValue(hisc_urgencia_odontologico.getPeso());\n\t\t\t// dbxTalla.setValue(hisc_urgencia_odontologico.getTalla());\n\t\t\t// dbxRespiracion\n\t\t\t// .setValue(hisc_urgencia_odontologico.getRespiracion());\n\t\t\t// for (int i = 0; i < lbxGrupo_s.getItemCount(); i++) {\n\t\t\t// Listitem listitem = lbxGrupo_s.getItemAtIndex(i);\n\t\t\t// if (listitem.getValue().toString()\n\t\t\t// .equals(hisc_urgencia_odontologico.getGrupo_s())) {\n\t\t\t// listitem.setSelected(true);\n\t\t\t// i = lbxGrupo_s.getItemCount();\n\t\t\t// }\n\t\t\t// }\n\t\t\t// for (int i = 0; i < lbxRh.getItemCount(); i++) {\n\t\t\t// Listitem listitem = lbxRh.getItemAtIndex(i);\n\t\t\t// if (listitem.getValue().toString()\n\t\t\t// .equals(hisc_urgencia_odontologico.getRh())) {\n\t\t\t// listitem.setSelected(true);\n\t\t\t// i = lbxRh.getItemCount();\n\t\t\t// }\n\t\t\t// }\n\t\t\t// dbxDiastolica.setValue(hisc_urgencia_odontologico.getDiastolica());\n\t\t\t// tbxObservaciones_temp.setValue(hisc_urgencia_odontologico\n\t\t\t// .getObservaciones_temp());\n\t\t\tfor (int i = 0; i < lbxCausas_externas.getItemCount(); i++) {\n\t\t\t\tListitem listitem = lbxCausas_externas.getItemAtIndex(i);\n\t\t\t\tif (listitem\n\t\t\t\t\t\t.getValue()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.equals(hisc_urgencia_odontologico.getCausas_externas())) {\n\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\ti = lbxCausas_externas.getItemCount();\n\t\t\t\t}\n\t\t\t\t// Muestra el texbox de otos cuando seleccionan la opcion en\n\t\t\t\t// causas externas\n\t\t\t\tif (lbxCausas_externas.getSelectedItem().getValue().toString()\n\t\t\t\t\t\t.equals(\"15\")) {\n\t\t\t\t\ttbxOtro_causas_externas.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttbxOtro_causas_externas.setValue(hisc_urgencia_odontologico\n\t\t\t\t\t.getOtro_causas_externas());\n\t\t\tfor (int i = 0; i < lbxTipo_disnostico.getItemCount(); i++) {\n\t\t\t\tListitem listitem = lbxTipo_disnostico.getItemAtIndex(i);\n\t\t\t\tif (listitem\n\t\t\t\t\t\t.getValue()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.equals(hisc_urgencia_odontologico.getTipo_disnostico())) {\n\t\t\t\t\tlistitem.setSelected(true);\n\t\t\t\t\ti = lbxTipo_disnostico.getItemCount();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttbxTratamiento\n\t\t\t\t\t.setValue(hisc_urgencia_odontologico.getTratamiento());\n\t\t\tUtilidades.seleccionarRadio(rdbHa_sufrido_violencia,\n\t\t\t\t\thisc_urgencia_odontologico.getHa_sufrido_violencia());\n\t\t\tUtilidades.seleccionarRadio(rdbFisico,\n\t\t\t\t\thisc_urgencia_odontologico.getFisico());\n\t\t\tUtilidades.seleccionarRadio(rdbSexual,\n\t\t\t\t\thisc_urgencia_odontologico.getSexual());\n\t\t\tUtilidades.seleccionarRadio(rdbEmocional,\n\t\t\t\t\thisc_urgencia_odontologico.getEmocional());\n\t\t\tUtilidades.seleccionarRadio(rdbSiente_riesgo,\n\t\t\t\t\thisc_urgencia_odontologico.getSiente_riesgo());\n\t\t\tUtilidades.seleccionarRadio(rdbQuiere_hablar_del_tema,\n\t\t\t\t\thisc_urgencia_odontologico.getQuiere_hablar_del_tema());\n\n\t\t\t// cargarSignosVitales(hisc_urgencia_odontologico);\n\t\t\t// Mostramos la vista //\n\t\t\ttbxAccion.setText(\"modificar\");\n\t\t\taccionForm(true, tbxAccion.getText());\n\t\t} catch (Exception e) {\n\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t}\n\t}", "private void mostrarInformacionP(){\n System.out.println(\"Nombre: \"+this.nombre);\n System.out.println(\"Sexo: \"+ this.sexo);\n System.out.println(\"Edad: \" + edad);\n\n }", "public void mostrarNotificaciones(){\n System.out.println(notificaciones.toString());\n }", "public void SolicitarDatos() {\n\t\t\r\n\t\tSystem.out.println(\"nombre:\");\r\n\t\tSystem.out.println(\"apellido\");\r\n\t\tSystem.out.println(\"numCedula\");\r\n\t\t\r\n\t}", "public String getLasagna(){\n return \"ID: \"+this.ID+\"\\nNombre: \"+this.nombre+\"\\nTipo: \"+this.tipo+\"\\nPrecio: \"+this.precio; //Devuelve todos los datos de la lasagna\n }", "public String getMostrarResultados() {\n StringBuilder strb = new StringBuilder();\r\n if(auditoriaanalizada==null){\r\n return \"No existe ningún informe para dicho informe\";\r\n }\r\n for(int i=1; i <= MAX_PREGUNTAS; i++){\r\n try{\r\n PropertyDescriptor p = new PropertyDescriptor(\"p\" + i, Auditorias.class);\r\n Integer c = (Integer) p.getReadMethod().invoke(auditoriaanalizada);\r\n if(c!=null && c==0){\r\n //hay que buscar dicha pregunta y poner lo que pone en el campo reglamento\r\n Reglamento r = ejbFacadeReglamento.find(i);\r\n if(r!=null && r.getIncumplimiento()!=null && !r.getIncumplimiento().isEmpty()){\r\n strb.append(\"<li>\");\r\n strb.append(r.getIncumplimiento());\r\n strb.append(\"</li>\");\r\n }\r\n }\r\n \r\n }\r\n catch(Exception e){\r\n System.out.println(\"Error:\" + e.getMessage());\r\n }\r\n }\r\n return strb.toString();\r\n }", "public void mostraDados() {\n System.out.println(\"O canal atual é: \" + tv.getCanal());\n System.out.println(\"O volume atual é: \" + tv.getVolume());\n System.out.println(\"--------------------------------------\");\n }", "public String verDatos(){\n return \"Ataque: \"+ataque+\"\\nDefensa: \"+defensa+\"\\nPunteria: \"+punteria;\n }", "public String visualizzaCampo(){\n\t\tString info= new String(\"Nome: \"+ nome +\"\\n\" +\"Descrizione: \" + descrizione+ \"\\n\"+ \"Obbligatoria: \" + obbligatorio +\"\\n\");\n\t\treturn info;\n\t}", "public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }", "public void mostrarDatos(Object obj) throws Exception {\r\n\t\tHis_parto his_parto = (His_parto) obj;\r\n\t\ttry {\r\n\t\t\ttbxCodigo_historia.setValue(his_parto.getCodigo_historia());\r\n\t\t\tdtbxFecha_inicial.setValue(his_parto.getFecha_inicial());\r\n\r\n\t\t\tPaciente paciente = new Paciente();\r\n\t\t\tpaciente.setCodigo_empresa(his_parto.getCodigo_empresa());\r\n\t\t\tpaciente.setCodigo_sucursal(his_parto.getCodigo_sucursal());\r\n\t\t\tpaciente.setNro_identificacion(his_parto.getIdentificacion());\r\n\t\t\tpaciente = getServiceLocator().getPacienteService().consultar(\r\n\t\t\t\t\tpaciente);\r\n\r\n\t\t\tElemento elemento = new Elemento();\r\n\t\t\telemento.setCodigo(paciente.getSexo());\r\n\t\t\telemento.setTipo(\"sexo\");\r\n\t\t\telemento = getServiceLocator().getElementoService().consultar(\r\n\t\t\t\t\telemento);\r\n\r\n\t\t\ttbxIdentificacion.setValue(his_parto.getIdentificacion());\r\n\t\t\ttbxNomPaciente.setValue((paciente != null ? paciente.getNombre1()\r\n\t\t\t\t\t+ \" \" + paciente.getApellido1() : \"\"));\r\n\t\t\ttbxTipoIdentificacion.setValue((paciente != null ? paciente\r\n\t\t\t\t\t.getTipo_identificacion() : \"\"));\r\n\t\t\ttbxEdad.setValue(Util.getEdad(new java.text.SimpleDateFormat(\r\n\t\t\t\t\t\"dd/MM/yyyy\").format(paciente.getFecha_nacimiento()),\r\n\t\t\t\t\tpaciente.getUnidad_medidad(), false));\r\n\t\t\ttbxSexo.setValue((elemento != null ? elemento.getDescripcion() : \"\"));\r\n\t\t\tdbxNacimiento.setValue(paciente.getFecha_nacimiento());\r\n\t\t\ttbxDireccion.setValue(paciente.getDireccion());\r\n\r\n\t\t\tAdministradora administradora = new Administradora();\r\n\t\t\tadministradora.setCodigo(paciente.getCodigo_administradora());\r\n\t\t\tadministradora = getServiceLocator().getAdministradoraService()\r\n\t\t\t\t\t.consultar(administradora);\r\n\r\n\t\t\ttbxCodigo_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getCodigo() : \"\");\r\n\t\t\ttbxNombre_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getNombre() : \"\");\r\n\r\n\t\t\tContratos contratos = new Contratos();\r\n\t\t\tcontratos.setCodigo_empresa(his_parto.getCodigo_empresa());\r\n\t\t\tcontratos.setCodigo_sucursal(his_parto.getCodigo_sucursal());\r\n\t\t\tcontratos.setCodigo_administradora(paciente.getCodigo_administradora());\r\n//\t\t\tcontratos.setId_plan(paciente.getId_plan());\r\n\t\t\tcontratos = getServiceLocator().getContratosService().consultar(contratos);\r\n\r\n\t\t\ttbxCodigo_contrato.setValue(contratos != null ? contratos.getId_plan()\r\n\t\t\t\t\t: \"\");\r\n\t\t\ttbxContrato.setValue(contratos != null ? contratos.getNombre() : \"\");\r\n\r\n\t\t\tfor (int i = 0; i < lbxCodigo_dpto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCodigo_dpto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(paciente.getCodigo_dpto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCodigo_dpto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlistarMunicipios(lbxCodigo_municipio, lbxCodigo_dpto);\r\n\r\n\t\t\ttbxConyugue.setValue(his_parto.getConyugue());\r\n\t\t\ttbxId_conyugue.setValue(his_parto.getId_conyugue());\r\n\t\t\ttbxEdad_conyugue.setValue(his_parto.getEdad_conyugue());\r\n\r\n\t\t\tNivel_educativo nivel_educativo = new Nivel_educativo();\r\n\t\t\tnivel_educativo.setId(his_parto.getEscolaridad_conyugue());\r\n\t\t\tnivel_educativo = getServiceLocator().getNivel_educativoService()\r\n\t\t\t\t\t.consultar(nivel_educativo);\r\n\t\t\ttbxEscolaridad_nombre\r\n\t\t\t\t\t.setValue(nivel_educativo != null ? nivel_educativo\r\n\t\t\t\t\t\t\t.getNombre() : \"\");\r\n\t\t\ttbxEscolaridad_conyugue\r\n\t\t\t\t\t.setValue(nivel_educativo != null ? nivel_educativo.getId()\r\n\t\t\t\t\t\t\t: \"\");\r\n\r\n\t\t\ttbxMotivo.setValue(his_parto.getMotivo());\r\n\t\t\ttbxEnfermedad_actual.setValue(his_parto.getEnfermedad_actual());\r\n\t\t\ttbxAntecedentes_familiares.setValue(his_parto\r\n\t\t\t\t\t.getAntecedentes_familiares());\r\n\t\t\tRadio radio = (Radio) rdbPreeclampsia.getFellow(\"Preeclampsia\"\r\n\t\t\t\t\t+ his_parto.getPreeclampsia());\r\n\t\t\tradio.setChecked(true);\r\n\t\t\tRadio radio1 = (Radio) rdbHipertension.getFellow(\"Hipertension\"\r\n\t\t\t\t\t+ his_parto.getHipertension());\r\n\t\t\tradio1.setChecked(true);\r\n\t\t\tRadio radio2 = (Radio) rdbEclampsia.getFellow(\"Eclampsia\"\r\n\t\t\t\t\t+ his_parto.getEclampsia());\r\n\t\t\tradio2.setChecked(true);\r\n\t\t\tRadio radio3 = (Radio) rdbH1.getFellow(\"H1\" + his_parto.getH1());\r\n\t\t\tradio3.setChecked(true);\r\n\t\t\tRadio radio4 = (Radio) rdbH2.getFellow(\"H2\" + his_parto.getH2());\r\n\t\t\tradio4.setChecked(true);\r\n\t\t\tRadio radio5 = (Radio) rdbPostimadurez.getFellow(\"Postimadurez\"\r\n\t\t\t\t\t+ his_parto.getPostimadurez());\r\n\t\t\tradio5.setChecked(true);\r\n\t\t\tRadio radio6 = (Radio) rdbRot_pre.getFellow(\"Rot_pre\"\r\n\t\t\t\t\t+ his_parto.getRot_pre());\r\n\t\t\tradio6.setChecked(true);\r\n\t\t\tRadio radio7 = (Radio) rdbPolihidramnios.getFellow(\"Polihidramnios\"\r\n\t\t\t\t\t+ his_parto.getPolihidramnios());\r\n\t\t\tradio7.setChecked(true);\r\n\t\t\tRadio radio8 = (Radio) rdbRcui.getFellow(\"Rcui\"\r\n\t\t\t\t\t+ his_parto.getRcui());\r\n\t\t\tradio8.setChecked(true);\r\n\t\t\tRadio radio9 = (Radio) rdbPelvis.getFellow(\"Pelvis\"\r\n\t\t\t\t\t+ his_parto.getPelvis());\r\n\t\t\tradio9.setChecked(true);\r\n\t\t\tRadio radio10 = (Radio) rdbFeto_macrosonico\r\n\t\t\t\t\t.getFellow(\"Feto_macrosonico\"\r\n\t\t\t\t\t\t\t+ his_parto.getFeto_macrosonico());\r\n\t\t\tradio10.setChecked(true);\r\n\t\t\tRadio radio11 = (Radio) rdbIsoinmunizacion\r\n\t\t\t\t\t.getFellow(\"Isoinmunizacion\"\r\n\t\t\t\t\t\t\t+ his_parto.getIsoinmunizacion());\r\n\t\t\tradio11.setChecked(true);\r\n\t\t\tRadio radio12 = (Radio) rdbAo.getFellow(\"Ao\" + his_parto.getAo());\r\n\t\t\tradio12.setChecked(true);\r\n\t\t\tRadio radio13 = (Radio) rdbCirc_cordon.getFellow(\"Circ_cordon\"\r\n\t\t\t\t\t+ his_parto.getCirc_cordon());\r\n\t\t\tradio13.setChecked(true);\r\n\t\t\tRadio radio14 = (Radio) rdbPostparto.getFellow(\"Postparto\"\r\n\t\t\t\t\t+ his_parto.getPostparto());\r\n\t\t\tradio14.setChecked(true);\r\n\t\t\tRadio radio15 = (Radio) rdbDiabetes.getFellow(\"Diabetes\"\r\n\t\t\t\t\t+ his_parto.getDiabetes());\r\n\t\t\tradio15.setChecked(true);\r\n\t\t\tRadio radio16 = (Radio) rdbCardiopatia.getFellow(\"Cardiopatia\"\r\n\t\t\t\t\t+ his_parto.getCardiopatia());\r\n\t\t\tradio16.setChecked(true);\r\n\t\t\tRadio radio17 = (Radio) rdbAnemias.getFellow(\"Anemias\"\r\n\t\t\t\t\t+ his_parto.getAnemias());\r\n\t\t\tradio17.setChecked(true);\r\n\t\t\tRadio radio18 = (Radio) rdbEnf_autoinmunes\r\n\t\t\t\t\t.getFellow(\"Enf_autoinmunes\"\r\n\t\t\t\t\t\t\t+ his_parto.getEnf_autoinmunes());\r\n\t\t\tradio18.setChecked(true);\r\n\t\t\tRadio radio19 = (Radio) rdbEnf_renales.getFellow(\"Enf_renales\"\r\n\t\t\t\t\t+ his_parto.getEnf_renales());\r\n\t\t\tradio19.setChecked(true);\r\n\t\t\tRadio radio20 = (Radio) rdbInf_urinaria.getFellow(\"Inf_urinaria\"\r\n\t\t\t\t\t+ his_parto.getInf_urinaria());\r\n\t\t\tradio20.setChecked(true);\r\n\t\t\tRadio radio21 = (Radio) rdbEpilepsia.getFellow(\"Epilepsia\"\r\n\t\t\t\t\t+ his_parto.getEpilepsia());\r\n\t\t\tradio21.setChecked(true);\r\n\t\t\tRadio radio22 = (Radio) rdbTbc\r\n\t\t\t\t\t.getFellow(\"Tbc\" + his_parto.getTbc());\r\n\t\t\tradio22.setChecked(true);\r\n\t\t\tRadio radio23 = (Radio) rdbMiomas.getFellow(\"Miomas\"\r\n\t\t\t\t\t+ his_parto.getMiomas());\r\n\t\t\tradio23.setChecked(true);\r\n\t\t\tRadio radio24 = (Radio) rdbHb.getFellow(\"Hb\" + his_parto.getHb());\r\n\t\t\tradio24.setChecked(true);\r\n\t\t\tRadio radio25 = (Radio) rdbFumadora.getFellow(\"Fumadora\"\r\n\t\t\t\t\t+ his_parto.getFumadora());\r\n\t\t\tradio25.setChecked(true);\r\n\t\t\tRadio radio26 = (Radio) rdbInf_puerperal.getFellow(\"Inf_puerperal\"\r\n\t\t\t\t\t+ his_parto.getInf_puerperal());\r\n\t\t\tradio26.setChecked(true);\r\n\t\t\tRadio radio27 = (Radio) rdbInfertilidad.getFellow(\"Infertilidad\"\r\n\t\t\t\t\t+ his_parto.getInfertilidad());\r\n\t\t\tradio27.setChecked(true);\r\n\t\t\ttbxMenarquia.setValue(his_parto.getMenarquia());\r\n\t\t\ttbxCiclos.setValue(his_parto.getCiclos());\r\n\t\t\ttbxVida_marital.setValue(his_parto.getVida_marital());\r\n\t\t\ttbxVida_obstetrica.setValue(his_parto.getVida_obstetrica());\r\n\t\t\tfor (int i = 0; i < lbxNo_gestaciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNo_gestaciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNo_gestaciones())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNo_gestaciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxParto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxParto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString().equals(his_parto.getParto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxParto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxAborto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAborto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getAborto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAborto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxCesarias.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCesarias.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getCesarias())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCesarias.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdtbxFecha_um.setValue(his_parto.getFecha_um());\r\n\t\t\ttbxUm.setValue(his_parto.getUm());\r\n\t\t\ttbxFep.setValue(his_parto.getFep());\r\n\t\t\tfor (int i = 0; i < lbxGemerales.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxGemerales.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getGemerales())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxGemerales.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxMalformados.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxMalformados.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getMalformados())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxMalformados.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNacidos_vivos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNacidos_vivos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNacidos_vivos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNacidos_vivos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNacidos_muertos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNacidos_muertos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNacidos_muertos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNacidos_muertos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxPreterminos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxPreterminos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getPreterminos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxPreterminos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchbMedico.setChecked(his_parto.getMedico());\r\n\t\t\tchbEnfermera.setChecked(his_parto.getEnfermera());\r\n\t\t\tchbAuxiliar.setChecked(his_parto.getAuxiliar());\r\n\t\t\tchbPartera.setChecked(his_parto.getPartera());\r\n\t\t\tchbOtros.setChecked(his_parto.getOtros());\r\n\t\t\tRadio radio28 = (Radio) rdbControlado.getFellow(\"Controlado\"\r\n\t\t\t\t\t+ his_parto.getControlado());\r\n\t\t\tradio28.setChecked(true);\r\n\t\t\tRadio radio29 = (Radio) rdbLugar_consulta\r\n\t\t\t\t\t.getFellow(\"Lugar_consulta\" + his_parto.getLugar_consulta());\r\n\t\t\tradio29.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxNo_consultas.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNo_consultas.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getNo_consultas())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNo_consultas.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchbEspecialistas.setChecked(his_parto.getEspecialistas());\r\n\t\t\tchbGeneral.setChecked(his_parto.getGeneral());\r\n\t\t\tchbPartera_consulta.setChecked(his_parto.getPartera_consulta());\r\n\t\t\tRadio radio30 = (Radio) rdbSangrado_vaginal\r\n\t\t\t\t\t.getFellow(\"Sangrado_vaginal\"\r\n\t\t\t\t\t\t\t+ his_parto.getSangrado_vaginal());\r\n\t\t\tradio30.setChecked(true);\r\n\t\t\tRadio radio31 = (Radio) rdbCefalias.getFellow(\"Cefalias\"\r\n\t\t\t\t\t+ his_parto.getCefalias());\r\n\t\t\tradio31.setChecked(true);\r\n\t\t\tRadio radio32 = (Radio) rdbEdema.getFellow(\"Edema\"\r\n\t\t\t\t\t+ his_parto.getEdema());\r\n\t\t\tradio32.setChecked(true);\r\n\t\t\tRadio radio33 = (Radio) rdbEpigastralgia.getFellow(\"Epigastralgia\"\r\n\t\t\t\t\t+ his_parto.getEpigastralgia());\r\n\t\t\tradio33.setChecked(true);\r\n\t\t\tRadio radio34 = (Radio) rdbVomitos.getFellow(\"Vomitos\"\r\n\t\t\t\t\t+ his_parto.getVomitos());\r\n\t\t\tradio34.setChecked(true);\r\n\t\t\tRadio radio35 = (Radio) rdbTinutus.getFellow(\"Tinutus\"\r\n\t\t\t\t\t+ his_parto.getTinutus());\r\n\t\t\tradio35.setChecked(true);\r\n\t\t\tRadio radio36 = (Radio) rdbEscotomas.getFellow(\"Escotomas\"\r\n\t\t\t\t\t+ his_parto.getEscotomas());\r\n\t\t\tradio36.setChecked(true);\r\n\t\t\tRadio radio37 = (Radio) rdbInfeccion_urinaria\r\n\t\t\t\t\t.getFellow(\"Infeccion_urinaria\"\r\n\t\t\t\t\t\t\t+ his_parto.getInfeccion_urinaria());\r\n\t\t\tradio37.setChecked(true);\r\n\t\t\tRadio radio38 = (Radio) rdbInfeccion_vaginal\r\n\t\t\t\t\t.getFellow(\"Infeccion_vaginal\"\r\n\t\t\t\t\t\t\t+ his_parto.getInfeccion_vaginal());\r\n\t\t\tradio38.setChecked(true);\r\n\t\t\ttbxOtros_embarazo.setValue(his_parto.getOtros_embarazo());\r\n\t\t\ttbxCardiaca.setValue(his_parto.getCardiaca());\r\n\t\t\ttbxRespiratoria.setValue(his_parto.getRespiratoria());\r\n\t\t\ttbxPeso.setValue(his_parto.getPeso());\r\n\t\t\ttbxTalla.setValue(his_parto.getTalla());\r\n\t\t\ttbxTempo.setValue(his_parto.getTempo());\r\n\t\t\ttbxPresion.setValue(his_parto.getPresion());\r\n\t\t\ttbxPresion2.setValue(his_parto.getPresion2());\r\n\t\t\ttbxInd_masa.setValue(his_parto.getInd_masa());\r\n\t\t\ttbxSus_masa.setValue(his_parto.getSus_masa());\r\n\t\t\ttbxCabeza_cuello.setValue(his_parto.getCabeza_cuello());\r\n\t\t\ttbxCardiovascular.setValue(his_parto.getCardiovascular());\r\n\t\t\ttbxMamas.setValue(his_parto.getMamas());\r\n\t\t\ttbxPulmones.setValue(his_parto.getPulmones());\r\n\t\t\ttbxAbdomen.setValue(his_parto.getAbdomen());\r\n\t\t\ttbxUterina.setValue(his_parto.getUterina());\r\n\t\t\ttbxSituacion.setValue(his_parto.getSituacion());\r\n\t\t\ttbxPresentacion.setValue(his_parto.getPresentacion());\r\n\t\t\ttbxV_presentacion.setValue(his_parto.getV_presentacion());\r\n\t\t\ttbxPosicion.setValue(his_parto.getPosicion());\r\n\t\t\ttbxV_posicion.setValue(his_parto.getV_posicion());\r\n\t\t\ttbxC_uterina.setValue(his_parto.getC_uterina());\r\n\t\t\ttbxTono.setValue(his_parto.getTono());\r\n\t\t\ttbxFcf.setValue(his_parto.getFcf());\r\n\t\t\ttbxGenitales.setValue(his_parto.getGenitales());\r\n\t\t\ttbxDilatacion.setValue(his_parto.getDilatacion());\r\n\t\t\ttbxBorramiento.setValue(his_parto.getBorramiento());\r\n\t\t\ttbxEstacion.setValue(his_parto.getEstacion());\r\n\t\t\ttbxMembranas.setValue(his_parto.getMembranas());\r\n\t\t\ttbxExtremidades.setValue(his_parto.getExtremidades());\r\n\t\t\ttbxSnc.setValue(his_parto.getSnc());\r\n\t\t\ttbxObservacion.setValue(his_parto.getObservacion());\r\n\t\t\tfor (int i = 0; i < lbxFinalidad_cons.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFinalidad_cons.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getFinalidad_cons())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFinalidad_cons.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tseleccionarProgramaPyp();\r\n\r\n\t\t\tfor (int i = 0; i < lbxCausas_externas.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCausas_externas.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getCausas_externas())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCausas_externas.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxCodigo_consulta_pyp.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCodigo_consulta_pyp.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getCodigo_consulta_pyp())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCodigo_consulta_pyp.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxTipo_disnostico.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxTipo_disnostico.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_parto.getTipo_disnostico())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxTipo_disnostico.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tCie cie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_principal());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\t\t\ttbxTipo_principal.setValue(his_parto.getTipo_principal());\r\n\t\t\ttbxNomDx.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\t/* relacionado 1 */\r\n\t\t\tcie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_relacionado_1());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\r\n\t\t\ttbxTipo_relacionado_1.setValue(his_parto.getTipo_relacionado_1());\r\n\t\t\ttbxNomDxRelacionado_1\r\n\t\t\t\t\t.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\t/* relacionado 2 */\r\n\t\t\tcie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_relacionado_2());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\r\n\t\t\ttbxTipo_relacionado_2.setValue(his_parto.getTipo_relacionado_2());\r\n\t\t\ttbxNomDxRelacionado_2\r\n\t\t\t\t\t.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\t/* relacionado 3 */\r\n\t\t\tcie = new Cie();\r\n\t\t\tcie.setCodigo(his_parto.getTipo_relacionado_3());\r\n\t\t\t//log.info(\"antes: \" + cie);\r\n\t\t\tcie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n\t\t\t//log.info(\"despues: \" + cie);\r\n\r\n\t\t\ttbxTipo_relacionado_3.setValue(his_parto.getTipo_relacionado_3());\r\n\t\t\ttbxNomDxRelacionado_3\r\n\t\t\t\t\t.setValue((cie != null ? cie.getNombre() : \"\"));\r\n\r\n\t\t\ttbxTratamiento.setValue(his_parto.getTratamiento());\r\n\r\n\t\t\t// Mostramos la vista //\r\n\t\t\ttbxAccion.setText(\"modificar\");\r\n\t\t\taccionForm(true, tbxAccion.getText());\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(\"Este dato no se puede editar\", \"Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "public void mostrarDatos(Object obj) throws Exception {\r\n\t\tHis_atencion_embarazada his_atencion_embarazada = (His_atencion_embarazada) obj;\r\n\t\ttry {\r\n\t\t\ttbxCodigo_historia.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_historia());\r\n\t\t\tdtbxFecha_inicial.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_inicial());\r\n\r\n\t\t\tAdministradora administradora = new Administradora();\r\n\t\t\tadministradora.setCodigo(his_atencion_embarazada.getCodigo_eps());\r\n\t\t\tadministradora = getServiceLocator().getAdministradoraService()\r\n\t\t\t\t\t.consultar(administradora);\r\n\r\n\t\t\ttbxCodigo_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getCodigo() : \"\");\r\n\t\t\ttbxNombre_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getNombre() : \"\");\r\n\r\n\t\t\tfor (int i = 0; i < lbxCodigo_dpto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCodigo_dpto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCodigo_dpto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCodigo_dpto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlistarMunicipios(lbxCodigo_municipio, lbxCodigo_dpto);\r\n\r\n\t\t\tPaciente paciente = new Paciente();\r\n\t\t\tpaciente.setCodigo_empresa(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_empresa());\r\n\t\t\tpaciente.setCodigo_sucursal(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_sucursal());\r\n\t\t\tpaciente.setNro_identificacion(his_atencion_embarazada\r\n\t\t\t\t\t.getIdentificacion());\r\n\t\t\tpaciente = getServiceLocator().getPacienteService().consultar(\r\n\t\t\t\t\tpaciente);\r\n\r\n\t\t\tElemento elemento = new Elemento();\r\n\t\t\telemento.setCodigo(paciente.getSexo());\r\n\t\t\telemento.setTipo(\"sexo\");\r\n\t\t\telemento = getServiceLocator().getElementoService().consultar(\r\n\t\t\t\t\telemento);\r\n\r\n\t\t\ttbxIdentificacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getIdentificacion());\r\n\t\t\ttbxNomPaciente.setValue((paciente != null ? paciente.getNombre1()\r\n\t\t\t\t\t+ \" \" + paciente.getApellido1() : \"\"));\r\n\t\t\ttbxTipoIdentificacion.setValue((paciente != null ? paciente\r\n\t\t\t\t\t.getTipo_identificacion() : \"\"));\r\n\t\t\ttbxEdad_madre.setValue(Util.getEdad(new java.text.SimpleDateFormat(\r\n\t\t\t\t\t\"dd/MM/yyyy\").format(paciente.getFecha_nacimiento()),\r\n\t\t\t\t\tpaciente.getUnidad_medidad(), false));\r\n\t\t\ttbxSexo_madre.setValue((elemento != null ? elemento\r\n\t\t\t\t\t.getDescripcion() : \"\"));\r\n\t\t\tdbxNacimiento.setValue(paciente.getFecha_nacimiento());\r\n\r\n\t\t\ttbxMotivo.setValue(his_atencion_embarazada.getDireccion());\r\n\t\t\ttbxTelefono.setValue(his_atencion_embarazada.getTelefono());\r\n\t\t\tRadio radio = (Radio) rdbSeleccion.getFellow(\"Seleccion\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getSeleccion());\r\n\t\t\tradio.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxGestaciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxGestaciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getGestaciones())) {\r\n\t\t\t\t\ti = lbxGestaciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxPartos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxPartos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getPartos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxPartos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxCesarias.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCesarias.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCesarias())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCesarias.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxAbortos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAbortos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getAbortos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAbortos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxEspontaneo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxEspontaneo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getEspontaneo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxEspontaneo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxProvocado.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxProvocado.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getProvocado())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxProvocado.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNacido_muerto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNacido_muerto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getNacido_muerto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNacido_muerto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxPrematuro.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxPrematuro.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getPrematuro())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxPrematuro.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHijos_menos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHijos_menos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHijos_menos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHijos_menos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHijos_mayor.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHijos_mayor.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHijos_mayor())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHijos_mayor.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxMalformado.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxMalformado.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getMalformado())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxMalformado.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHipertension.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHipertension.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHipertension())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHipertension.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdtbxFecha_ultimo_parto.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_ultimo_parto());\r\n\t\t\tfor (int i = 0; i < lbxCirugia.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCirugia.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCirugia())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCirugia.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxOtro_antecedente.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getOtro_antecedente());\r\n\t\t\tfor (int i = 0; i < lbxHemoclasificacion.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHemoclasificacion.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHemoclasificacion())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHemoclasificacion.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxRh.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxRh.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getRh())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxRh.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxPeso.setValue(his_atencion_embarazada.getPeso());\r\n\t\t\ttbxTalla.setValue(his_atencion_embarazada.getTalla());\r\n\t\t\ttbxImc.setValue(his_atencion_embarazada.getImc());\r\n\t\t\ttbxTa.setValue(his_atencion_embarazada.getTa());\r\n\t\t\ttbxFc.setValue(his_atencion_embarazada.getFc());\r\n\t\t\ttbxFr.setValue(his_atencion_embarazada.getFr());\r\n\t\t\ttbxTemperatura.setValue(his_atencion_embarazada.getTemperatura());\r\n\t\t\ttbxCroomb.setValue(his_atencion_embarazada.getCroomb());\r\n\t\t\tdtbxFecha_ultima_mestruacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_ultima_mestruacion());\r\n\t\t\tdtbxFecha_probable_parto.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_probable_parto());\r\n\t\t\ttbxEdad_gestacional.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getEdad_gestacional());\r\n\t\t\tfor (int i = 0; i < lbxControl.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxControl.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getControl())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxControl.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxNum_control.setValue(his_atencion_embarazada.getNum_control());\r\n\t\t\tfor (int i = 0; i < lbxFetales.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFetales.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFetales())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFetales.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxFiebre.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFiebre.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFiebre())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFiebre.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxLiquido.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxLiquido.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getLiquido())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxLiquido.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxFlujo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFlujo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFlujo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFlujo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxEnfermedad.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxEnfermedad.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getEnfermedad())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxEnfermedad.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_enfermedad.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCual_enfermedad());\r\n\t\t\tfor (int i = 0; i < lbxCigarrillo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCigarrillo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCigarrillo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCigarrillo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxAlcohol.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAlcohol.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getAlcohol())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAlcohol.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_alcohol.setValue(his_atencion_embarazada.getCual_alcohol());\r\n\t\t\tfor (int i = 0; i < lbxDroga.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxDroga.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDroga())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxDroga.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_droga.setValue(his_atencion_embarazada.getCual_droga());\r\n\t\t\tfor (int i = 0; i < lbxViolencia.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxViolencia.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getViolencia())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxViolencia.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_violencia.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCual_violencia());\r\n\t\t\tfor (int i = 0; i < lbxToxoide.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxToxoide.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getToxoide())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxToxoide.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxDosis.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxDosis.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDosis())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxDosis.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxObservaciones_gestion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getObservaciones_gestion());\r\n\t\t\ttbxAltura_uterina.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getAltura_uterina());\r\n\t\t\tchbCorelacion.setChecked(his_atencion_embarazada.getCorelacion());\r\n\t\t\tchbEmbarazo_multiple.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getEmbarazo_multiple());\r\n\t\t\tchbTrasmision_sexual.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getTrasmision_sexual());\r\n\t\t\tRadio radio1 = (Radio) rdbAnomalia.getFellow(\"Anomalia\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getAnomalia());\r\n\t\t\tradio1.setChecked(true);\r\n\t\t\tRadio radio2 = (Radio) rdbEdema_gestion.getFellow(\"Edema_gestion\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getEdema_gestion());\r\n\t\t\tradio2.setChecked(true);\r\n\t\t\tRadio radio3 = (Radio) rdbPalidez.getFellow(\"Palidez\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getPalidez());\r\n\t\t\tradio3.setChecked(true);\r\n\t\t\tRadio radio4 = (Radio) rdbConvulciones.getFellow(\"Convulciones\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getConvulciones());\r\n\t\t\tradio4.setChecked(true);\r\n\t\t\tRadio radio5 = (Radio) rdbConciencia.getFellow(\"Conciencia\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getConciencia());\r\n\t\t\tradio5.setChecked(true);\r\n\t\t\tRadio radio6 = (Radio) rdbCavidad_bucal.getFellow(\"Cavidad_bucal\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getCavidad_bucal());\r\n\t\t\tradio6.setChecked(true);\r\n\t\t\ttbxHto.setValue(his_atencion_embarazada.getHto());\r\n\t\t\ttbxHb.setValue(his_atencion_embarazada.getHb());\r\n\t\t\ttbxToxoplasma.setValue(his_atencion_embarazada.getToxoplasma());\r\n\t\t\ttbxVdrl1.setValue(his_atencion_embarazada.getVdrl1());\r\n\t\t\ttbxVdrl2.setValue(his_atencion_embarazada.getVdrl2());\r\n\t\t\ttbxVih1.setValue(his_atencion_embarazada.getVih1());\r\n\t\t\ttbxVih2.setValue(his_atencion_embarazada.getVih2());\r\n\t\t\ttbxHepb.setValue(his_atencion_embarazada.getHepb());\r\n\t\t\ttbxOtro.setValue(his_atencion_embarazada.getOtro());\r\n\t\t\ttbxEcografia.setValue(his_atencion_embarazada.getEcografia());\r\n\t\t\tRadio radio7 = (Radio) rdbClasificacion_gestion\r\n\t\t\t\t\t.getFellow(\"Clasificacion_gestion\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada\r\n\t\t\t\t\t\t\t\t\t.getClasificacion_gestion());\r\n\t\t\tradio7.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxContracciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxContracciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getContracciones())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxContracciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNum_contracciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNum_contracciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getNum_contracciones())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNum_contracciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHemorragia.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHemorragia.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHemorragia())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHemorragia.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxLiquido_vaginal.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxLiquido_vaginal.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getLiquido_vaginal())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxLiquido_vaginal.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxColor_liquido.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getColor_liquido());\r\n\t\t\tfor (int i = 0; i < lbxDolor_cabeza.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxDolor_cabeza.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDolor_cabeza())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxDolor_cabeza.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxVision.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxVision.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDolor_cabeza())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxVision.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxConvulcion.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxConvulcion.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getConvulcion())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxConvulcion.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxObservaciones_parto.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getObservaciones_parto());\r\n\t\t\ttbxContracciones_min.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getContracciones_min());\r\n\t\t\ttbxFc_fera.setValue(his_atencion_embarazada.getFc_fera());\r\n\t\t\ttbxDilatacion_cervical.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getDilatacion_cervical());\r\n\t\t\tRadio radio8 = (Radio) rdbPreentacion.getFellow(\"Preentacion\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getPreentacion());\r\n\t\t\tradio8.setChecked(true);\r\n\t\t\ttbxOtra_presentacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getOtra_presentacion());\r\n\t\t\tRadio radio9 = (Radio) rdbEdema.getFellow(\"Edema\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getEdema());\r\n\t\t\tradio9.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxHemorragia_vaginal.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHemorragia_vaginal.getItemAtIndex(i);\r\n\t\t\t\tif (listitem\r\n\t\t\t\t\t\t.getValue()\r\n\t\t\t\t\t\t.toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHemorragia_vaginal())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHemorragia_vaginal.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxHto_parto.setValue(his_atencion_embarazada.getHto_parto());\r\n\t\t\ttbxHb_parto.setValue(his_atencion_embarazada.getHb_parto());\r\n\t\t\ttbxHepb_parto.setValue(his_atencion_embarazada.getHepb_parto());\r\n\t\t\ttbxVdrl_parto.setValue(his_atencion_embarazada.getVdrl_parto());\r\n\t\t\ttbxVih_parto.setValue(his_atencion_embarazada.getVih_parto());\r\n\t\t\tRadio radio10 = (Radio) rdbClasificacion_parto\r\n\t\t\t\t\t.getFellow(\"Clasificacion_parto\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_parto());\r\n\t\t\tradio10.setChecked(true);\r\n\t\t\tdtbxFecha_nac.setValue(his_atencion_embarazada.getFecha_nac());\r\n\t\t\ttbxIdentificacion_nac.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getIdentificacion_nac());\r\n\t\t\tfor (int i = 0; i < lbxSexo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxSexo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getSexo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxSexo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxPeso_nac.setValue(his_atencion_embarazada.getPeso_nac());\r\n\t\t\ttbxTalla_nac.setValue(his_atencion_embarazada.getTalla_nac());\r\n\t\t\ttbxPc_nac.setValue(his_atencion_embarazada.getPc_nac());\r\n\t\t\ttbxFc_nac.setValue(his_atencion_embarazada.getFc_nac());\r\n\t\t\ttbxTemper_nac.setValue(his_atencion_embarazada.getTemper_nac());\r\n\t\t\ttbxEdad.setValue(his_atencion_embarazada.getEdad());\r\n\t\t\ttbxAdgar1.setValue(his_atencion_embarazada.getAdgar1());\r\n\t\t\ttbxAdgar5.setValue(his_atencion_embarazada.getAdgar5());\r\n\t\t\ttbxAdgar10.setValue(his_atencion_embarazada.getAdgar10());\r\n\t\t\ttbxAdgar20.setValue(his_atencion_embarazada.getAdgar20());\r\n\t\t\ttbxObservaciones_nac.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getObservaciones_nac());\r\n\t\t\tRadio radio11 = (Radio) rdbClasificacion_nac\r\n\t\t\t\t\t.getFellow(\"Clasificacion_nac\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_nac());\r\n\t\t\tradio11.setChecked(true);\r\n\t\t\tchbReani_prematuro.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_prematuro());\r\n\t\t\tchbReani_meconio.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_meconio());\r\n\t\t\tchbReani_respiracion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_respiracion());\r\n\t\t\tchbReani_hipotonico.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_hipotonico());\r\n\t\t\tchbReani_apnea.setChecked(his_atencion_embarazada.getReani_apnea());\r\n\t\t\tchbReani_jadeo.setChecked(his_atencion_embarazada.getReani_jadeo());\r\n\t\t\tchbReani_deficultosa.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_deficultosa());\r\n\t\t\tchbReani_gianosis.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_gianosis());\r\n\t\t\tchbReani_bradicardia.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_bradicardia());\r\n\t\t\tchbReani_hipoxemia.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_hipoxemia());\r\n\t\t\tchbReani_estimulacion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_estimulacion());\r\n\t\t\tchbReani_ventilacion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_ventilacion());\r\n\t\t\tchbReani_comprensiones.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_comprensiones());\r\n\t\t\tchbReani_intubacion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_intubacion());\r\n\t\t\ttbxMedicina.setValue(his_atencion_embarazada.getMedicina());\r\n\t\t\tRadio radio12 = (Radio) rdbClasificacion_reani\r\n\t\t\t\t\t.getFellow(\"Clasificacion_reani\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_reani());\r\n\t\t\tradio12.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxRuptura.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxRuptura.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getRuptura())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxRuptura.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxTiempo_ruptura.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxTiempo_ruptura.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getTiempo_ruptura())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxTiempo_ruptura.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxLiquido_neo.setValue(his_atencion_embarazada.getLiquido_neo());\r\n\t\t\tfor (int i = 0; i < lbxFiebre_neo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFiebre_neo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFiebre_neo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFiebre_neo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxTiempo_neo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxTiempo_neo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getTiempo_neo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxTiempo_neo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCoricamniotis.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCoricamniotis());\r\n\t\t\tRadio radio17 = (Radio) rdbIntrauterina.getFellow(\"Intrauterina\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getIntrauterina());\r\n\t\t\tradio17.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxMadre20.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxMadre20.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getMadre20())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxMadre20.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchbAlcohol_neo.setChecked(his_atencion_embarazada.getAlcohol_neo());\r\n\t\t\tchbDrogas_neo.setChecked(his_atencion_embarazada.getDrogas_neo());\r\n\t\t\tchbCigarrillo_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getCigarrillo_neo());\r\n\t\t\tRadio radio13 = (Radio) rdbRespiracion_neo\r\n\t\t\t\t\t.getFellow(\"Respiracion_neo\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getRespiracion_neo());\r\n\t\t\tradio13.setChecked(true);\r\n\t\t\tRadio radio14 = (Radio) rdbLlanto_neo.getFellow(\"Llanto_neo\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getLlanto_neo());\r\n\t\t\tradio14.setChecked(true);\r\n\t\t\tRadio radio15 = (Radio) rdbVetalidad_neo.getFellow(\"Vetalidad_neo\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getVetalidad_neo());\r\n\t\t\tradio15.setChecked(true);\r\n\t\t\tchbTaquicardia_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getTaquicardia_neo());\r\n\t\t\tchbBradicardia_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getBradicardia_neo());\r\n\t\t\tchbPalidez_neo.setChecked(his_atencion_embarazada.getPalidez_neo());\r\n\t\t\tchbCianosis_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getCianosis_neo());\r\n\t\t\tfor (int i = 0; i < lbxAnomalias_congenitas.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAnomalias_congenitas.getItemAtIndex(i);\r\n\t\t\t\tif (listitem\r\n\t\t\t\t\t\t.getValue()\r\n\t\t\t\t\t\t.toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada\r\n\t\t\t\t\t\t\t\t.getAnomalias_congenitas())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAnomalias_congenitas.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_anomalias.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCual_anomalias());\r\n\t\t\ttbxLesiones.setValue(his_atencion_embarazada.getLesiones());\r\n\t\t\ttbxOtras_alter.setValue(his_atencion_embarazada.getOtras_alter());\r\n\t\t\tRadio radio16 = (Radio) rdbClasificacion_neo\r\n\t\t\t\t\t.getFellow(\"Clasificacion_neo\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_neo());\r\n\t\t\tradio16.setChecked(true);\r\n\t\t\ttbxAlarma.setValue(his_atencion_embarazada.getAlarma());\r\n\t\t\ttbxConsulta_control.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getConsulta_control());\r\n\t\t\ttbxMedidas_preventiva.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getMedidas_preventiva());\r\n\t\t\ttbxRecomendaciones.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getRecomendaciones());\r\n\t\t\ttbxDiagnostico.setValue(his_atencion_embarazada.getDiagnostico());\r\n\t\t\ttbxCodigo_diagnostico.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_diagnostico());\r\n\t\t\ttbxTratamiento.setValue(his_atencion_embarazada.getTratamiento());\r\n\t\t\ttbxRecomendacion_alimentacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getRecomendacion_alimentacion());\r\n\t\t\ttbxEvolucion_servicio.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getEvolucion_servicio());\r\n\r\n\t\t\t// Mostramos la vista //\r\n\t\t\ttbxAccion.setText(\"modificar\");\r\n\t\t\taccionForm(true, tbxAccion.getText());\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(\"Este dato no se puede editar\", \"Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "public void dataView(String nom, String apell1, String apell2, String dni,\n String num, String inttype){\n\n System.out.println(\"Datos personales\");\n System.out.println(\"\");\n System.out.println(\"Nombre: \"+nom);\n System.out.println(\"Primer Apellido: \"+apell1);\n System.out.println(\"Segundo Apellido: \"+apell2);\n System.out.println(\"Dni: \"+dni);\n System.out.println(\"Numero de cuenta: \"+num);\n System.out.println(\"Tipo de interes: \"+inttype);\n System.out.println(\"\");\n}", "public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }", "public void mostrarSocios()\n\t{\n\t\t//titulo libro, autor\n\t\tIterator<Socio> it=socios.iterator();\n\t\t\n\t\tSystem.out.println(\"***********SOCIOS***********\");\n\t\tSystem.out.printf(\"\\n%-40s%-40s\", \"NOMBRE\" , \"APELLIDO\");\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tSocio socio=(Socio)it.next();\n\t\t\tSystem.out.printf(\"\\n%-40s%-40s\\n\",socio.getNombre(),socio.getApellidos());\n\t\t}\n\t}", "public void mostrarlistainciofin(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=inicio;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.siguiente;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de incio a fin\",JOptionPane.INFORMATION_MESSAGE);\n } }", "public void mostrarlistafininicio(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = fin;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")->\";\n auxiliar = auxiliar.ant;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de fin a inicio\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "public void automovil(){\r\n System.out.println(\"Ingrese placa: \");\r\n placa = leer.next();\r\n System.out.println(\"Ingrese marca: \");\r\n marca = leer.next();\r\n \r\n Automovil auto = new Automovil(placa, marca, 10000);\r\n controlador.llenarVehiculo(auto);\r\n {\r\n }\r\n }", "private void limpiarDatos() {\n\t\t\n\t}", "@Override\n\tpublic String exibirDados() {\n\t\ttoString();\n\t\tString message = toString() + \"\\nimc: \" + calculaImc();\n\t\treturn message;\n\t}", "public void mostrarLista() {\n\n Nodo recorrer = temp;\n while (recorrer != null) {\n\n System.out.println(\"[ \" + recorrer.getDato() + \"]\");\n recorrer = recorrer.getSiguiente();\n\n }\n\n }", "public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }", "public void visualizzaCampo(){\r\n\t\tInputOutput.stampaCampo(nome, descrizione, obbligatorio);\r\n\t}", "public void mostrarAutomataAction(ActionEvent event){\r\n mostrarAutomata.setDisable(true);\r\n reconocerHilera.setDisable(false);\r\n arbol= new ArbolSintactico();\r\n automata=new AutomataFD();\r\n arbol.crearArbol(cadena);\r\n automata.enumerar(arbol.getRaiz());\r\n automata.anulable(arbol.getRaiz());\r\n automata.calcularPosiciones(arbol.getRaiz());\r\n automata.follows(arbol.getRaiz());\r\n System.out.println(arbol.getRaiz().getPrimeraPos());\r\n automata.construirAutomata(arbol.getRaiz());\r\n Object[][] tablaAutomata=automata.getTabla();\r\n \r\n for(int i=0;i<tablaAutomata.length;i++){\r\n for(int k=0;k<tablaAutomata[0].length;k++){\r\n tabla.appendText(tablaAutomata[i][k].toString()+\" \"); \r\n }\r\n tabla.appendText(\"\\n\");\r\n \r\n }\r\n tabla.setEditable(false);\r\n \r\n \r\n }", "public void consultaDinero(){\r\n System.out.println(this.getMonto());\r\n }", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "@Override//sobrescribir metodo\n public String getDescripcion(){\n return hamburguesa.getDescripcion()+\" + lechuga\";//retorna descripcion del oobj hamburguesa y le agrega +lechuga\n }", "public void mostrarlistafininicio(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=fin;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.anterior;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de fin a inicio\",JOptionPane.INFORMATION_MESSAGE);\n }}", "public String toString(){\r\n\treturn \"KORISNIK:\"+korisnik+\" PORUKA:\"+poruka;\r\n\t}", "protected void exibirMedicos(){\n System.out.println(\"--- MEDICOS CADASTRADOS ----\");\r\n String comando = \"select * from medico order by id\";\r\n ResultSet rs = cb.buscaDados(comando);\r\n try{\r\n while(rs.next()){\r\n int id = rs.getInt(\"id\");\r\n String nome = rs.getString(\"nome\");\r\n System.out.println(\"[\"+id+\"] \"+nome);\r\n }\r\n }\r\n catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "public void PoblarINFO(String llamado) {//C.P.M Aqui llega como argumento llamado\r\n try {\r\n rs = modelo.Obteninfo();//C.P.M Mandamos a poblar la informacion de negocio\r\n if (llamado.equals(\"\")) {//C.P.M si el llamado llega vacio es que viene de la interface\r\n while (rs.next()) {//C.P.M recorremos el resultado para obtener los datos\r\n vista.jTNombreempresa.setText(rs.getString(1));//C.P.M los datos los enviamos a la vista de la interface\r\n vista.jTDireccion.setText(rs.getString(2));\r\n vista.jTTelefono.setText(rs.getString(3));\r\n vista.jTRFC.setText(rs.getString(4));\r\n }\r\n }\r\n if (llamado.equals(\"factura\")) {//C.P.M de lo contrario es llamado de factura y los valores se van a la vista de vactura \r\n while (rs.next()) {//C.P.M recorremos el resultado \r\n vistafactura.jTNombreempresa.setText(rs.getString(1));//C.P.M enviamos los datos a la vista de factura\r\n vistafactura.jTDireccion.setText(rs.getString(2));\r\n vistafactura.jTTelefono.setText(rs.getString(3));\r\n vistafactura.jTRFC.setText(rs.getString(4));\r\n }\r\n }\r\n } catch (SQLException ex) {//C.P.M Notificamos a el usuario si ocurre algun error\r\n JOptionPane.showMessageDialog(null,\"Ocurio un error al intentar consultar la informacion del negocio\");\r\n }\r\n }", "@Override\n public String toString() {\n return \"\\tMunicipio: \" + municipio + \"\\t\" + \"Habitantes: \" + habitantes + \".\";\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \" id=\" + id + \", nome=\" + nome + \", dat_nasc=\"\r\n\t\t\t\t+ dat_nasc + \", salario=\" + salario + \" \\n \";\r\n\t}", "public void recuperarFactura(){\n int id = datosFactura.recuperarFacturaID();\n Factura factura = almacen.getFactura(id);\n System.out.println(\"\\n\");\n if(factura != null)\n System.out.print(factura.toString());\n System.out.println(\"\\n\");\n }", "@Override\n public String toString() {\n return getDescricao();\n }", "@Override\r\n public String toString() {\r\n \treturn \"{ id : \" + getId() + \", costo : \\\"\" + getCosto() + \", fecha : \\\"\" + getFecha() + \"\\\" }\" ; \r\n }", "public void acutualizarInfo(){\n String pibId = String.valueOf(comentario.getId());\n labelId.setText(\"#\" + pibId);\n\n String autor = comentario.getAutor().toString();\n labelAutor.setText(autor);\n\n String fecha = comentario.getFechaCreacion().toString();\n labelFecha.setText(fecha);\n \n String contenido = comentario.getContenido();\n textAreaContenido.setText(contenido);\n \n String likes = ((Integer)comentario.totalLikes()).toString();\n labelLikes.setText(likes);\n \n Collection<Comentario> comments = socialNetwork.searchSubComentarios(comentario);\n panelSubComentarios.loadItems(comments, 15);\n \n if(comentario.isSubcomentario()){\n jButton4.setEnabled(true);\n }\n else{\n jButton4.setEnabled(false);\n }\n }", "public String toString(){\r\n\t\treturn \"KORISNIK:\"+korisnik+\" PORUKA:\"+poruka;\r\n\t}", "public String Dime_datos_generales() {\n\t\t\n\t\treturn \"la plataforma del veiculo tiene \"+ rueda+\" ruedas\"+\n\t\t\"\\nmide \"+ largo/1000+\" metros con un ancho de \"+ancho+\n\t\t\"cm\"+\"\\nun peso de platafrorma de \"+peso;\n\t}", "public void llenarDatos() {\n String nombre = \"\";\n String descripcion = \"\";\n try {\n ResultSet resultado = buscador.getResultSet(\"select nombre, descripcion from NODO where ID = \" + IDNodoPadre + \";\");\n if (resultado.next()) {\n nombre = resultado.getObject(\"nombre\").toString();\n descripcion = resultado.getObject(\"descripcion\").toString();\n }\n } catch (SQLException e) {\n System.out.println(\"*SQL Exception: *\" + e.toString());\n }\n campoNombre.setText(nombre);\n campoDescripcion.setText(descripcion);\n //Si esta asociada a categorias\n if(conCategorias)\n llenarComboCategoria();\n else{\n comboCategoria.setVisible(false);\n labelCategoria.setVisible(false);\n }\n }", "public void popular(){\n DAO dao = new DAO();\n modelo.setNumRows(0);\n\n for(Manuais m: dao.selecTudoManuaisVenda()){\n modelo.addRow(new Object[]{m.getId(),m.getNome(),m.getClasse(),m.getEditora(),m.getPreco()+\".00 MZN\"});\n \n }\n }", "@Override\r\n\tpublic void mostrar() {\n\t\t\r\n\t}", "@Override\r\n public String toString() {\r\n return \"Datos de Jugador: \"\r\n + \"\\n\" + \"Alias : \" + this.getAlias()\r\n + \"\\n\" + \"Nombre: \" + this.getNombre()\r\n + \"\\n\" + \"Edad : \" + this.getEdad()\r\n + \"\\n\" + \"Partidas Ganadas: \" + this.getPartidasGanadasToString()\r\n + \"\\n\" + \"Partidas Perdidas: \" + this.getPartidasPerdidasToString()\r\n + \"\\n\" + \"Partidas Empatadas: \" + this.getPartidasEmpatadasToString();\r\n }", "private void TampilData(){\n try{ //\n String sql = \"SELECT * FROM buku\"; // memanggil dari php dengan tabel buku\n stt = con.createStatement(); // membuat statement baru dengan mengkonekan ke database\n rss = stt.executeQuery(sql); \n while (rss.next()){ \n Object[] o = new Object [3]; // membuat array 3 dimensi dengan nama object\n \n o[0] = rss.getString(\"judul\"); // yang pertama dengan ketentuan judul\n o[1] = rss.getString(\"penulis\"); // yang kedua dengan ketentuan penulis\n o[2] = rss.getInt(\"harga\"); // yang ketiga dengan ketentuan harga\n model.addRow(o); // memasukkan baris dengan mengkonekan di tabel model\n } \n }catch(SQLException e){ // memanipulasi kesalahan\n System.out.println(\"ini error\"); // menampilkan pesan ini error\n }\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"CODIGO: \" +codigo+ \" NOME: \"+nome+\" DIA: \"+dataInicio+\" HORA:\"+horaInicio+\" LOCAL:\"+local;\n\t}", "private void mostrarDatosInterfaz() {\n\t\tif (this.opcion == CREAR) {\n\t\t\tthis.campoTextoNombreUsuario.setUserData(\"\");\n\t\t\tthis.campoTextoNombreUsuario.setDisable(false);\n\t\t\tthis.campoContrasena.setUserData(\"\");\n\t\t\tthis.campoContrasena.setDisable(false);\n\t\t\tthis.campoCorreo.setUserData(\"\");\n\t\t\tthis.campoCorreo.setDisable(false);\n\t\t\tthis.comboGrupoUsuario.getSelectionModel().select(\"\");\n\t\t\tthis.comboGrupoUsuario.setDisable(false);\n\t\t\tthis.comboStatus.getSelectionModel().select(\"\");\n\t\t\tthis.comboStatus.setDisable(false);\n\t\t\tthis.comboEmpleados.setDisable(false);\n\t\t} else if (this.opcion == EDITAR) {\n\t\t\tthis.campoTextoNombreUsuario.setText(this.usuario.getUsuario());\n\t\t\tthis.campoTextoNombreUsuario.setDisable(true);\n\t\t\tthis.campoContrasena.setText(this.usuario.getContrasena());\n\t\t\tthis.campoContrasena.setDisable(false);\n\t\t\tthis.campoCorreo.setText(this.usuario.getCorreoElectronico());\n\t\t\tthis.campoCorreo.setDisable(false);\n\t\t\tthis.comboGrupoUsuario.setValue(this.usuario.getNombreGrupoUsuario());\n\t\t\tthis.comboGrupoUsuario.setDisable(false);\n\t\t\tthis.comboStatus.setValue(this.usuario.getDescripcionStatus());\n\t\t\tthis.comboStatus.setDisable(false);\n\t\t\tthis.comboEmpleados.setValue(this.usuario.getNombreEmpleado());\n\t\t\tthis.comboEmpleados.setDisable(false);\n\t\t} else if (this.opcion == VER) {\n\t\t\tthis.campoTextoNombreUsuario.setText(this.usuario.getUsuario());\n\t\t\tthis.campoTextoNombreUsuario.setDisable(true);\n\t\t\tthis.campoContrasena.setText(this.usuario.getContrasena());\n\t\t\tthis.campoContrasena.setDisable(true);\n\t\t\tthis.campoCorreo.setText(this.usuario.getCorreoElectronico());\n\t\t\tthis.campoCorreo.setDisable(true);\n\t\t\tthis.comboGrupoUsuario.setValue(this.usuario.getNombreGrupoUsuario());\n\t\t\tthis.comboGrupoUsuario.setDisable(true);\n\t\t\tthis.comboStatus.setValue(this.usuario.getDescripcionStatus());\n\t\t\tthis.comboStatus.setDisable(true);\n\t\t\tthis.comboEmpleados.setValue(this.usuario.getNombreEmpleado());\n\t\t\tthis.comboEmpleados.setDisable(true);\n\t\t}//FIN IF ELSE\n\t}", "private void mostrarReservas() {\n\t\tJFReservasAdmin jfres =new JFReservasAdmin();\n\t\tjfres.setVisible(true);\n\t\t\n\t\tMap<Integer,Reserva> reservas = modelo.obtenerReservasPeriodo(per.getIdPeriodo());\n\t\tDefaultTableModel dtm = new DefaultTableModel(new Object[][] {},\n\t\t\t\tnew String[] { \"Dia\", \"Hora\", \"Email\" });\n\n\t\tfor (Integer key : reservas.keySet()) {\n\n\t\t\tdtm.addRow(new Object[] { reservas.get(key).getReserva_dia(), reservas.get(key).getReserva_hora(),reservas.get(key).getEmail() });\n\t\t}\n\t\tjfres.tReservas.setModel(dtm);\n\t}", "@Override\n public String toString() {\n return \"Nimi: \" + nimi +\"\\n\"+\n \"Vanus: \"+ vanus +\"\\n\"+\n \"Pikkus: \"+ pikkus +\"\\n\"+\n \"Kehakaal: \"+ kehakaal+\"\\n\"+\n \"Aktiivus: \"+aktiivsus+\"\\n\";\n }", "public String obtenerDetalles(){\r\n return \"Nombre: \" + this.nombre + \", sueldo = \" + this.sueldo;\r\n }", "void LlenarModelo(){\n datos.addColumn(\"ID\");\n datos.addColumn(\"Descripcion\");\n datos.addColumn(\"Cantidad\");\n String []ingresar=new String[4];\n try {\n Connection con = Conexion.getConection();\n Statement estado = con.createStatement();\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo>=\" + SIGEPSA.IDOtrosPagosMin + \";\");\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago ;\");\n ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo<9 or codigo>10 and activo = 1;\");\n while(resultado.next()){\n ingresar[0]=String.valueOf((String)resultado.getObject(\"CODIGO\").toString());\n ingresar[1]=String.valueOf((String)resultado.getObject(\"DESCRIPCION\").toString());\n ingresar[2]=String.valueOf((String)resultado.getObject(\"CANTIDAD\").toString());\n datos.addRow(ingresar);\n }\n }catch (Exception ex) {\n \n }\n }", "public List<Mobibus> darMobibus();", "public String toString(){\n\t\treturn \"ID : \"+id+\"\\nNom : \"+nom+\"\\nMdp : \"+mdp;\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"Pasos dados por \" + a.nombre + \" \" + a.distancia + \" m = \" + pasosActividad + \" / Pasos en total = \" + pasosTotal);\n\t}", "public void mostrarlistainicifin(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = inicio;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")<=>\";\n auxiliar = auxiliar.sig;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de inicio a fin\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Nombre: \"+this.nombre+\" Cantidad: \"+this.cantidad+\" \"+this.unidadMedida;\n\t}", "@Override\n public String toString() {\n String s = \"\"; //Comienza con un string vacio, y se le va a agregando cada cliente por medio de un ciclo.\n NodoCliente aux = cabeza;\n while (aux != null) {\n s += aux + \"\\n\";\n aux = aux.getNext();\n }\n return s;\n }", "public void obtener() {\r\n \t\r\n \tif (raiz!=null)\r\n {\r\n int informacion = raiz.dato;\r\n raiz = raiz.sig;\r\n end = raiz;\r\n System.out.println(\"Obtenemos el dato de la cima: \"+informacion);\r\n }\r\n else\r\n {\r\n System.out.println(\"No hay datos en la pila\");\r\n }\r\n }", "public void imprimeDados() {\n\t\tString resp = this.nome + \"(\" + this.ID + \")\\n\";\n\t\tint i = 0;\n\n\t\tif (this.alunos != null) {\n\t\t\tfor (Aluno aluno : this.alunos) {\n\t\t\t\tString cpf = aluno.getCpf();\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tresp += \"[\" + cpf;\n\t\t\t\t} else {\n\t\t\t\t\tresp += \", \" + cpf;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tresp += \"]\";\n\n\t\tSystem.out.println(resp);\n\t}", "public String toString() {\r\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\"); //Mostraremos la fecha en formato DD/MM/AAAA\r\n\t\tString nacEdad=sdf.format(fechaNac)+ \"(\"+obtenerAnios()+\" años)\";\r\n\t\treturn \"Persona [nombre=\" + nombre + \", fechaNac=\" + nacEdad + \", DNI=\" + dni\r\n\t\t\t\t+ \", sexo=\" + sexo + \", peso=\" + peso + \", altura=\" + altura\r\n\t\t\t\t+ \"]\";\r\n\t}", "public void affiche() {\n System.out.println(\"le tapis porte \"+this.tapis.size()+\" caisse(s)\");\n for (Iterator it = this.tapis.iterator(); it.hasNext(); ) {\n System.out.println(it.next().toString());\n } \n }", "public void mostrarDatos(Object obj) throws Exception {\r\n Hospitalizacion hospitalizacion = (Hospitalizacion) obj;\r\n try {\r\n deshabilitarCampos(false);\r\n tbxNro_factura.setValue(hospitalizacion.getNro_factura());\r\n listarIngresos(lbxNro_ingreso,\r\n listarAdmisiones(hospitalizacion, true), false);\r\n Utilidades.seleccionarListitem(lbxNro_ingreso,\r\n hospitalizacion.getNro_ingreso());\r\n\r\n Paciente paciente = new Paciente();\r\n paciente.setCodigo_empresa(hospitalizacion.getCodigo_empresa());\r\n paciente.setCodigo_sucursal(hospitalizacion.getCodigo_sucursal());\r\n paciente.setNro_identificacion(hospitalizacion\r\n .getNro_identificacion());\r\n paciente = getServiceLocator().getPacienteService().consultar(\r\n paciente);\r\n tbxNro_identificacion.seleccionarRegistro(paciente, hospitalizacion\r\n .getNro_identificacion(),\r\n (paciente != null ? paciente.getNombreCompleto() : \"\"));\r\n datos_seleccion\r\n .put(\"tipo_identificacion\",\r\n (paciente != null ? paciente\r\n .getTipo_identificacion() : \"\"));\r\n datos_seleccion.put(\"sexo\", (paciente != null ? paciente.getSexo()\r\n : \"\"));\r\n datos_seleccion.put(\r\n \"fecha_nac\",\r\n (paciente != null ? new SimpleDateFormat(\"dd/MM/yyyy\")\r\n .format(paciente.getFecha_nacimiento()) : \"\"));\r\n tbxNacimiento.setValue(new java.text.SimpleDateFormat(\"dd/MM/yyyy\")\r\n .format(paciente.getFecha_nacimiento()));\r\n tbxSexo.setValue(Utilidades.getNombreElemento(paciente.getSexo(),\r\n \"sexo\", HospitalizacionAction.this));\r\n tbxEstrato.setValue(paciente.getEstrato());\r\n tbxEdad.setValue(Util.getEdad(new java.text.SimpleDateFormat(\r\n \"dd/MM/yyyy\").format(paciente.getFecha_nacimiento()), \"1\",\r\n true));\r\n tbxTipo_afiliado.setValue(Utilidades.getNombreElemento(\r\n paciente.getTipo_afiliado(), \"tipo_afiliado\",\r\n HospitalizacionAction.this));\r\n\r\n Prestadores prestadores = new Prestadores();\r\n prestadores.setCodigo_empresa(hospitalizacion.getCodigo_empresa());\r\n prestadores\r\n .setCodigo_sucursal(hospitalizacion.getCodigo_sucursal());\r\n prestadores.setNro_identificacion(hospitalizacion\r\n .getCodigo_prestador());\r\n prestadores = getServiceLocator().getPrestadoresService()\r\n .consultar(prestadores);\r\n\r\n tbxCodigo_prestador.seleccionarRegistro(prestadores,\r\n hospitalizacion.getCodigo_prestador(),\r\n (prestadores != null ? prestadores.getNombres() + \" \"\r\n + prestadores.getApellidos() : \"\"));\r\n\r\n datos_seleccion.put(\"codigo_administradora\",\r\n hospitalizacion.getCodigo_administradora());\r\n datos_seleccion.put(\"id_plan\", hospitalizacion.getId_plan());\r\n\r\n Administradora administradora = new Administradora();\r\n administradora.setCodigo_empresa(hospitalizacion\r\n .getCodigo_empresa());\r\n administradora.setCodigo_sucursal(hospitalizacion\r\n .getCodigo_sucursal());\r\n administradora\r\n .setCodigo(hospitalizacion.getCodigo_administradora());\r\n administradora = getServiceLocator().getAdministradoraService()\r\n .consultar(administradora);\r\n\r\n Contratos contratos = new Contratos();\r\n contratos.setCodigo_empresa(hospitalizacion.getCodigo_empresa());\r\n contratos.setCodigo_sucursal(hospitalizacion.getCodigo_sucursal());\r\n contratos.setCodigo_administradora(hospitalizacion\r\n .getCodigo_administradora());\r\n contratos.setId_plan(hospitalizacion.getId_plan());\r\n contratos = getServiceLocator().getContratosService().consultar(\r\n contratos);\r\n tbxAseguradora.setValue((administradora != null ? administradora\r\n .getNombre() : \"\")\r\n + \" - \"\r\n + (contratos != null ? contratos.getNombre() : \"\"));\r\n\r\n Utilidades.seleccionarListitem(lbxVia_ingreso,\r\n hospitalizacion.getVia_ingreso());\r\n dtbxFecha_ingreso.setValue(hospitalizacion.getFecha_ingreso());\r\n tbxNumero_autorizacion.setValue(hospitalizacion\r\n .getNumero_autorizacion());\r\n Utilidades.seleccionarListitem(lbxCausa_externa,\r\n hospitalizacion.getCausa_externa());\r\n Utilidades.seleccionarListitem(lbxEstado_salida,\r\n hospitalizacion.getEstado_salida());\r\n dtbxFecha_egreso.setValue(hospitalizacion.getFecha_egreso());\r\n\r\n Cie cie = new Cie();\r\n cie.setCodigo(hospitalizacion.getCodigo_diagnostico_principal());\r\n cie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n tbxCodigo_diagnostico_principal.seleccionarRegistro(cie,\r\n hospitalizacion.getCodigo_diagnostico_principal(),\r\n (cie != null ? cie.getNombre() : \"\"));\r\n datos_seleccion.put(\"cie_diagnostico_principal\", cie);\r\n\r\n cie = new Cie();\r\n cie.setCodigo(hospitalizacion.getCodigo_diagnostico1());\r\n cie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n tbxCodigo_diagnostico1.seleccionarRegistro(cie, hospitalizacion\r\n .getCodigo_diagnostico1(), (cie != null ? cie.getNombre()\r\n : \"\"));\r\n datos_seleccion.put(\"cie_diagnostico_1\", cie);\r\n\r\n cie = new Cie();\r\n cie.setCodigo(hospitalizacion.getCodigo_diagnostico2());\r\n cie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n tbxCodigo_diagnostico2.seleccionarRegistro(cie, hospitalizacion\r\n .getCodigo_diagnostico2(), (cie != null ? cie.getNombre()\r\n : \"\"));\r\n datos_seleccion.put(\"cie_diagnostico_2\", cie);\r\n\r\n cie = new Cie();\r\n cie.setCodigo(hospitalizacion.getCodigo_diagnostico3());\r\n cie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n tbxCodigo_diagnostico3.seleccionarRegistro(cie, hospitalizacion\r\n .getCodigo_diagnostico3(), (cie != null ? cie.getNombre()\r\n : \"\"));\r\n datos_seleccion.put(\"cie_diagnostico_3\", cie);\r\n\r\n cie = new Cie();\r\n cie.setCodigo(hospitalizacion.getComplicacion());\r\n cie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n tbxComplicacion.seleccionarRegistro(cie,\r\n hospitalizacion.getComplicacion(),\r\n (cie != null ? cie.getNombre() : \"\"));\r\n datos_seleccion.put(\"cie_complicacion\", cie);\r\n\r\n cie = new Cie();\r\n cie.setCodigo(hospitalizacion.getCausa_muerte());\r\n cie = getServiceLocator().getServicio(GeneralExtraService.class).consultar(cie);\r\n tbxCausa_muerte.seleccionarRegistro(cie,\r\n hospitalizacion.getCausa_muerte(),\r\n (cie != null ? cie.getNombre() : \"\"));\r\n\r\n datos_seleccion.put(\"cie_causa_muerte\", cie);\r\n\r\n validarRegistroEditar(hospitalizacion);\r\n\r\n // Mostramos la vista //\r\n tbxAccion.setText(\"modificar\");\r\n accionForm(true, tbxAccion.getText());\r\n } catch (Exception e) {\r\n MensajesUtil.mensajeError(e, \"\", this);\r\n }\r\n }", "public static void inicializaMedicosText() {\n \n try (BufferedWriter bw = new BufferedWriter(new FileWriter(\"medicos.txt\"))) {\n for (Medico m : medicos) {\n if(m.getPuesto()==null)\n bw.write(m.getCedula() + \",\" + m.getNombres() + \",\" + m.getApellidos() + \",\" + m.getEdad() + \",0\");\n else\n bw.write(m.getCedula() + \",\" + m.getNombres() + \",\" + m.getApellidos() + \",\" + m.getEdad() + \",\" + m.getPuesto().getId());\n bw.newLine();\n }\n }\n catch (IOException ex) {\n Logger.getLogger(StageAdmin.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void mostrarReservas() {\n\t\tint numReserva=1;\r\n\t\tfor(Reserva reserva:reservas) {\r\n\t\t\tSystem.out.println(numReserva+\" \"+reserva.toString());\r\n\t\t\tnumReserva++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void MostrarListafINInicio() {\n if(!estVacia()){\n String datos=\"<=>\";\n NodoDoble current=fin;\n while(current!=null){\n datos += \"[\"+current.dato+\"]<=>\";\n current = current.anterior;\n }\n JOptionPane.showMessageDialog(null, datos, \"Mostrando Lista de inicio a Fin\",JOptionPane.INFORMATION_MESSAGE);\n }\n }", "public void mostraDevolucao(List<Devolucao> lista) {\n System.out.println(\"--------------------------------------\\n\");\n System.out.println(String.format(\"%-10s\", \"ID\") + \"\\t\"\n + String.format(\"%-40s\", \"|LIVRO\") + \"\\t\"\n + String.format(\"%-20s\", \"|DISP\") + \"\\t\"\n + String.format(\"%-20s\", \"|CLIENTE\") + \"\\t\"\n + String.format(\"%-20s\", \"|RETIRADA\") + \"\\t\"\n + String.format(\"%-20s\", \"|ENTREGA\") + \"\\t\"\n + String.format(\"%-20s\", \"|DEVOLVIDO\")\n );\n for (Devolucao dev : lista) {\n String disponivel = dev.getRetirada().getLivroDevolvido() ? \"Sim\" : \"Não\";\n System.out.println(String.format(\"%-10s\", dev.getId()) + \"\\t\"\n + String.format(\"%-40s\", \"|\" + dev.getRetirada().getLivro().getNome()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + disponivel) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getCliente().getNome()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getRetiradaFormatada()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getEntregaFormatada()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getDevolvidoFormatada())\n );\n }\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Cuota [id=\" + id + \", fechaPago=\" + fechaPago + \", periodo=\" + periodo + \", monto=\" + monto\r\n\t\t\t\t+ \", estado=\" + estado + \", usuario=\" + usuario + \"]\";\r\n\t}", "public void mostrarInstitucionAcceso(int institucion){\r\n periodoS=null;\r\n \r\n institucionAcceso=new institucionAccesoDAO().mostrarInstitucionAcceso(institucion);\r\n //LISTADO PERIODO INSTITUCION\r\n \r\n periodoL=new periodoDAO().mostrarPeriodoInstitucion(institucion);\r\n \r\n if (periodoL.size() >0){\r\n periodoS=periodoL.get(0).getPeriodo();\r\n }\r\n cargarMenu();\r\n }", "public void obtenerLista(){\n listaInformacion = new ArrayList<>();\n for (int i = 0; i < listaPersonales.size(); i++){\n listaInformacion.add(listaPersonales.get(i).getId() + \" - \" + listaPersonales.get(i).getNombre());\n }\n }", "private void muestraPersona(JSONArray genero) {\n\tJSONArray a = (JSONArray) genero.get(0);\n\t// txtId.setText(Long.toString( (Long) a.get(0)) );\n\t//txtBuscar.setText((String) a.get(1));\n\t// textFecha.setText((String) a.get(2));\n\t// textUsu.setText((String) a.get(4));\n\tcodTemporal = a.get(0).toString();\n\n\thabilita(true, false, false, false, false, true, false, true, true);\n }", "@Override\n public String toString(){\n StringBuilder retorno = new StringBuilder(\" ( *\");\n for(INodo descendiente : getDescendientes()){\n retorno.append(descendiente);\n }\n retorno.append(\" )\");\n\n return String.valueOf(retorno);\n }", "public String verDados() {\n\t\treturn super.verDados() + \"\\nSobremesa: \" + this.adicionais;\n\n\t}", "@Override\n\tpublic void mostrarDeposito() {\n\t\tSystem.out.println(\"Depósito: \"+depositoActual+\"litros\");\n\t}", "public void MostrarListaInicioFin() {\n if(!estVacia()){\n String datos=\"<=>\";\n NodoDoble current=inicio;\n while(current!=null){\n datos += \"[\"+current.dato+\"]<=>\";\n current = current.siguiente;\n }\n JOptionPane.showMessageDialog(null, datos, \"Mostrando Lista de inicio a Fin\",JOptionPane.INFORMATION_MESSAGE);\n }\n }", "@Override\r\n public String toString() {\n return this.descripcion;\r\n }", "private void mostrarEmenta (){\n }", "public void reporteHabitacionMasPopular(TablaModelo modelo){\n ArrayList<ControlVeces> control = new ArrayList<>();\n ControlVeces controlador;\n try {// pago de alojamiento en rango fchas\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT ALOJAMIENTO.Id,ALOJAMIENTO.Id_Reservacion,RESERVACION.Fecha_Entrada, RESERVACION.Fecha_Salida,RESERVACION.Precio, RESERVACION.Id_Habitacion FROM RESERVACION JOIN ALOJAMIENTO WHERE RESERVACION.Id=ALOJAMIENTO.Id_Reservacion AND RESERVACION.Check_In=1;\");\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {// pago de alojamiento en rango fchas\n String nombre = Integer.toString(resultado.getInt(6));\n int casilla = numeroObjeto(control,nombre);\n if(casilla>=0){// maneja el resultado// pago de alojamiento en rango fchas\n control.get(casilla).setVeces(control.get(casilla).getVeces()+1);\n }else{// maneja el resultado\n controlador = new ControlVeces(nombre);// pago de alojamiento en rango fchas\n control.add(controlador);\n }\n } // maneja el resultado \n ordenamiento(control);\n int numero = control.size()-1;// el de hasta arriba es el que mas elementos tiene \n String idHabitacionMasPopular = control.get(numero).getNombre();\n this.habitacionPopular= idHabitacionMasPopular;\n introducirDatosHabitacionMasPopular(modelo, idHabitacionMasPopular);\n } catch (SQLException ex) {\n ex.printStackTrace();\n } catch(Exception e){\n \n }\n }", "public static void main(String[] args) {\n Alumno aaDatos []; // El identificador es nulo\n \n aaDatos = new Alumno[tam];//Creamos un arreglo de 10 \n //alumnos - AQUI HABRA PREGUNTA\n for (int i = 0; i < aaDatos.length; i++) {\n aaDatos[i]= new Alumno(\"Dany\",\"16550518\", 0);//Para cada lugar de arreglo se crea un objeto de la clase alumno\n \n }\n for (Alumno aaDatos1: aaDatos) {\n System.out.println(\"Nombre: \"+ aaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaDatos1.getiCar());\n \n }\n \n \n //CREAMOS UNA COPIA DEL ARREGLO\n Alumno aaCopiaDatos [];\n aaCopiaDatos = new Alumno [tam];\n \n for (int i = 0; i < aaCopiaDatos.length; i++) {\n aaCopiaDatos[i]= new Alumno(aaDatos[i].getsNom(), // <<<Se llenan todos los datos que pide el constructor por argumentos\n aaDatos[i].getsMatri(), \n aaDatos[i].getiCar());\n \n }\n for (Alumno aaCopiaDatos1 : aaCopiaDatos) {\n System.out.println(\"Nombre: \"+ aaCopiaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaCopiaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaCopiaDatos1.getiCar());\n }\n System.out.println(aaDatos);\n System.out.println(aaCopiaDatos);\n }", "@Override\r\n public String toString() {\n return tipodocumento;\r\n }", "public void mostrarOrdenadores() {\n\t\ttry {\n\t\t\tXPathQueryService consulta = \n\t\t\t\t\t(XPathQueryService) \n\t\t\t\t\tcol.getService(\"XPathQueryService\", \"1.0\");\n\t\t\tResourceSet r = consulta.query(\"//ordenador\");\n\t\t\tResourceIterator i = r.getIterator();\n\t\t\twhile(i.hasMoreResources()) {\n\t\t\t\tSystem.out.println(i.nextResource().getContent());\n\t\t\t}\n\t\t} catch (XMLDBException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getDataCandidatura(){\n return dataCandidatura;\n }", "@Override\r\n\tpublic Equipo mostrar() {\n\t\tLOG.info(\"Mostrar los datos del equipo\");\r\n\t\treturn equipo;\r\n\t}", "public void generTirarDados() {\n\r\n\t}", "public static void showAllVilla(){\n ArrayList<Villa> villaList = getListFromCSV(FuncGeneric.EntityType.VILLA);\n displayList(villaList);\n showServices();\n }", "public void recuperarFacturasCliente(){\n String NIF = datosFactura.recuperarFacturaClienteNIF();\n ArrayList<Factura> facturas = almacen.getFacturas(NIF);\n if(facturas != null){\n for(Factura factura : facturas) {\n System.out.println(\"\\n\");\n System.out.print(factura.toString());\n }\n }\n System.out.println(\"\\n\");\n }", "public void cargarDatos() {\n \n if(drogasIncautadoList==null){\n return;\n }\n \n \n \n List<Droga> datos = drogasIncautadoList;\n\n Object[][] matriz = new Object[datos.size()][4];\n \n for (int i = 0; i < datos.size(); i++) {\n \n \n //System.out.println(s[0]);\n \n matriz[i][0] = datos.get(i).getTipoDroga();\n matriz[i][1] = datos.get(i).getKgDroga();\n matriz[i][2] = datos.get(i).getQuetesDroga();\n matriz[i][3] = datos.get(i).getDescripcion();\n \n }\n Object[][] data = matriz;\n String[] cabecera = {\"Tipo Droga\",\"KG\", \"Quetes\", \"Descripción\"};\n dtm = new DefaultTableModel(data, cabecera);\n tableDatos.setModel(dtm);\n }", "@Override\r\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder ();\r\n\t\tsb.append(\"Ci sono \"+voti.size()+\" voti\\n\");\r\n\t\tfor (Voto v : this.voti)\r\n\t\t{\r\n\t\t\tsb.append(v); // chiama il toString() di voto\r\n\t\t\tsb.append(\"\\n\");\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public List<Listas_de_las_Solicitudes> Mostrar_las_peticiones_que_han_llegado_al_Usuario_Administrador(int cedula) {\n\t\t//paso3: Obtener el listado de peticiones realizadas por el usuario\n\t\tEntityManagerFactory entitymanagerfactory = Persistence.createEntityManagerFactory(\"LeyTransparencia\");\n\t\tEntityManager entitymanager = entitymanagerfactory.createEntityManager();\n\t\tentitymanager.getEntityManagerFactory().getCache().evictAll();\n\t\tQuery consulta4=entitymanager.createQuery(\"SELECT g FROM Gestionador g WHERE g.cedulaGestionador =\"+cedula);\n\t\tGestionador Gestionador=(Gestionador) consulta4.getSingleResult();\n\t\t//paso4: Obtener por peticion la id, fecha y el estado\n\t\tList<Peticion> peticion=Gestionador.getEmpresa().getPeticions();\n\t\tList<Listas_de_las_Solicitudes> peticion2 = new ArrayList();\n\t\t//paso5: buscar el area de cada peticion\n\t\tfor(int i=0;i<peticion.size();i++){\n\t\t\tString almcena=\"\";\n\t\t\tString sarea=\"no posee\";\n\t\t\tBufferedReader in;\n\t\t\ttry{\n\t\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(\"C:/area/area\"+String.valueOf(peticion.get(i).getIdPeticion())+\".txt\"), \"utf-8\"));\n\t\t\t\ttry {\n\t\t\t\t\twhile((sarea=in.readLine())!=null){\n\t\t\t\t\t\tint s=0;\n\t\t\t\t\t\talmcena=sarea;\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\tSystem.out.println(almcena);\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\t\t\n\t\t\t\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (FileNotFoundException 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\t//paso6: Mostrar un listado de peticiones observando el id, la fecha de realizacion de la peticion, hora de realizacion de la peticion, y el estado actual de la peticion\n\t\t\tListas_de_las_Solicitudes agregar=new Listas_de_las_Solicitudes();\n\t\t\tagregar.setId(String.valueOf(peticion.get(i).getIdPeticion()));\n\t\t\tagregar.setFechaPeticion(peticion.get(i).getFechaPeticion());\n\t\t\tagregar.setNombreestado(peticion.get(i).getEstado().getTipoEstado());\n\t\t\tagregar.setArea(almcena);\n\t\t\tpeticion2.add(agregar);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"el usuario existe\");\n\t\treturn peticion2;\n\t\t//aun no se\n\t}", "public String mostrarPedido()\r\n\t{\r\n\t\tString cad=\"\";\r\n\t\tfor (Articulo articulo : articulosPedido) {\r\n\t\t\tcad+=articulo.toString()+\"\\n\";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}", "public void tampilBuku() {\n System.out.println(\"ID : \" + this.id);\n System.out.println(\"Judul : \" + this.judul);\n System.out.println(\"Tahun Terbit: \" + this.tahun);\n }" ]
[ "0.66572124", "0.6620795", "0.6592598", "0.65058166", "0.6485971", "0.6419216", "0.6412213", "0.63943726", "0.6351781", "0.63425666", "0.63200814", "0.6319772", "0.63195103", "0.6269425", "0.62653375", "0.6250371", "0.6222847", "0.6190443", "0.6183661", "0.61735153", "0.6164353", "0.6153708", "0.61373067", "0.6129579", "0.6124237", "0.6069138", "0.60623425", "0.60606664", "0.60555834", "0.6022651", "0.6011917", "0.60028404", "0.59983176", "0.59980166", "0.59964645", "0.5992223", "0.5977153", "0.5972489", "0.59692514", "0.5956409", "0.5952542", "0.59476554", "0.5944622", "0.59372926", "0.59370905", "0.59332544", "0.59195954", "0.59157693", "0.5911206", "0.59061396", "0.5889778", "0.58835894", "0.58784044", "0.585633", "0.58493614", "0.58369243", "0.5835206", "0.58314174", "0.58293694", "0.5821307", "0.58213025", "0.58195937", "0.5817469", "0.5801093", "0.5798029", "0.57920337", "0.57909465", "0.57871896", "0.57856864", "0.5785043", "0.57838243", "0.5773483", "0.57680935", "0.5762633", "0.5758746", "0.5756684", "0.5753048", "0.5752372", "0.5751734", "0.57468915", "0.57440853", "0.5743673", "0.5738237", "0.5737153", "0.5735086", "0.57348007", "0.57339716", "0.5727642", "0.57264656", "0.57170665", "0.5712516", "0.57047415", "0.5704328", "0.57038504", "0.5702605", "0.5699301", "0.56932944", "0.56844723", "0.56784695", "0.5677522" ]
0.79724735
0
asignar la clase persona a la clase automovil
public void asignarAutomovilPersona(){ persona.setAutomovil(automovil); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void asignarClase(int clase);", "public void construirCargo() {\n persona.setCargo(Cargos.SUPERVISOR);\n }", "public void nascitaAgnello() {\n\t\tpecore.add(new Agnello());\n\t\tnumeroAgelli++;\n\t}", "public void automovil(){\r\n System.out.println(\"Ingrese placa: \");\r\n placa = leer.next();\r\n System.out.println(\"Ingrese marca: \");\r\n marca = leer.next();\r\n \r\n Automovil auto = new Automovil(placa, marca, 10000);\r\n controlador.llenarVehiculo(auto);\r\n {\r\n }\r\n }", "public void ativa()\n\t{\n\t\tativado = true;\n\t}", "public void ativa() {\n this.ativada = true;\n }", "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }", "@Override\n\tpublic void atirou() {\n\n\t\t\tatirou=true;\n\t\t\t\n\t\t\n\t}", "@Override public void realizarCobro(Persona persona){\n\tpersona.cuenta.retiro(120);\n }", "private void actualizarNombre(Persona persona){\n \n String nombre=IO_ES.leerCadena(\"Inserte el nombre\");\n persona.setNombre(nombre);\n }", "public void asignarPersona(Jugador j){\r\n this.jugador = j;\r\n }", "public void acionarInadimplencia(CestaGarantiasDO cesta);", "public void asignarVida();", "public abstract Anuncio creaAnuncioIndividualizado();", "public VentanaPrincipal() {\n initComponents();\n editar = false;\n }", "public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}", "public abstract void alimentarse();", "@Override\n\tpublic void imprime() {\n\t\t\n\t}", "public void attrito(){\n yCord[0]+=4;\n yCord[1]+=4;\n yCord[2]+=4;\n //e riaggiorna i propulsori (che siano attivati o no) ricalcolandoli sulla base delle coordinate dell'astronave, cambiate\n aggiornaPropulsori();\n \n }", "public void nastaviIgru() {\r\n\t\t// nastavi igru poslije pobjede\r\n\t\tigrajPoslijePobjede = true;\r\n\t}", "@Override\n\tpublic void jogavel(Participante p) {\n\t\t\n\t}", "Obligacion createObligacion();", "private void suono(int idGioc) {\n\t\tpartita.effettoCasella(idGioc);\n\t}", "public Encuesta(Persona persona, Distrito distrito){\n ID = IDautogenerado++;\n this.persona = persona;\n this.distrito = distrito;\n }", "public void acaba() \n\t\t{\n\t\t\tsigo2 = false;\n\t\t}", "public void reinitAff()\n\t{\n\t\tthis.gagne = false;\n\t\tthis.perdu = false;\n\t}", "public void crearClase() {\r\n\t\tsetClase(3);\r\n\t\tsetTipoAtaque(3);\r\n\t\tsetArmadura(15);\r\n\t\tsetModopelea(0);\r\n\t}", "void crearNuevaPersona(Persona persona);", "public void activarNuevoAlmacen() {\n\t\ttxtId.setVisible(false);\n\t\tpnAlmacen.setVisible(true);\n\t\tsetTxtUbicacion(\"\");\n\t\tgetPnTabla().setVisible(false);\n\t\tadd(pnAlmacen,BorderLayout.CENTER);\n\t \n\t}", "public void atualizar() {\n System.out.println(\"Metodo atualizar chamado!\");\n setR1(0);\n setR2(0);\n setR3(0);\n setN(0);\n\n //context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Atualizado!\", \"\"));\n }", "private void jogarIa() {\n\t\tia = new IA(this.mapa,false);\r\n\t\tia.inicio();\r\n\t\tthis.usouIa = true;\r\n\t\tatualizarBandeirasIa();//ATUALIZA AS BANDEIRAS PARA DEPOIS QUE ELA JOGOU\r\n\t\tatualizarNumeroBombas();//ATUALIZA O NUMERO DE BOMBAS PARA DPS QUE ELA JOGOU\r\n\t\tatualizarTela();\r\n\t\tif(ia.isTaTudoBem() == false)\r\n\t\t\tJOptionPane.showMessageDialog(this, \"IMPOSSIVEL PROSSEGUIR\", \"IMPOSSIVEL ENCONTRAR CASAS CONCLUSIVAS\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}", "public void moverAPacman(Direccion direccion) {\n // TODO implement here\n }", "public void aumentarAciertos() {\r\n this.aciertos += 1;\r\n this.intentos += 1; \r\n }", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "private DittaAutonoleggio(){\n \n }", "@Override\n\tpublic void effetto(Giocatore giocatoreAttuale) {\n\t\tgiocatoreAttuale.vaiInPrigione();\n\t\tSystem.out.println(MESSAGGIO_IN_PRIGIONE);\n\t\t\n\t}", "@Override\n\tpublic void naoAtirou() {\n\t\tatirou=false;\n\n\t}", "public void asetaTeksti(){\n }", "public void damePersonaje(String personaje){\n this.personaje=personaje;\n\n\n\n }", "@Override\n\tpublic void imprimir() {\n\t\t\n\t}", "void adicionaComentario(Comentario comentario);", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void atualizar(Aluno pAluno) {\r\n\t}", "public void Ordenamiento() {\n\n\t}", "private void attacco(int idGioc) {\n\t\tpartita.attacco(idGioc);\n\t\tStatiGioco prossimoStato=partita.nextPhase(StatiGioco.ATTACKSTATE,StatiGioco.DONTKNOW, idGioc);\n\t\tpartita.getPlayers().getGiocatore(idGioc).setStatoAttuale(prossimoStato);\n\t}", "@Override\n public void reset() {\n // Crea instancia y define el tipo del personaje.\n this.personaje = new Personaje();\n this.personaje.setTipo(\"Agua\");\n }", "void establecerPuntoAM(int pos){\n this.emisoraAMActual = pos;\n }", "private void procedureBasePrDessin(){\n if(courante == null){\n reset();\n courante = new Tortue(simpleLogo.getFeuille(), true);\n simpleLogo.setBarreOutilsVisible(true);\n }\n }", "@Override\n\tpublic void coba() {\n\t\t\n\t}", "@Override\n\tpublic void prijmiNaklad(Objednavka ob, int idAuta) {\n\t\tsuper.prijmiNaklad(ob, idAuta);\n\t\tthis.sklad += ob.objem;\n\t}", "private void asignaNombre() {\r\n\r\n\t\tswitch (this.getNumero()) {\r\n\r\n\t\tcase 1:\r\n\t\t\tthis.setNombre(\"As de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tthis.setNombre(\"Dos de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tthis.setNombre(\"Tres de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tthis.setNombre(\"Cuatro de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tthis.setNombre(\"Cinco de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tthis.setNombre(\"Seis de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tthis.setNombre(\"Siete de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tthis.setNombre(\"Diez de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tthis.setNombre(\"Once de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tthis.setNombre(\"Doce de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void act() \n {\n if(getY()>=30 && !cambia)\n {\n direccion = -1;\n }\n else\n {\n cambia = true;\n }\n if(getY() <= getWorld().getHeight()-30 && cambia)\n {\n direccion = 1;\n }\n else\n {\n cambia = false;\n }\n \n setLocation(getX(),getY()+(velocidad*direccion));\n reglas();\n ataque();\n \n \n \n }", "public void imprimirNivelSuperior(){\n\t\tmodCons.imprimirNivelSuperior();\n\t}", "private ControleurAcceuil(){ }", "public void setCuentaContable(CuentaContable cuentaContable)\r\n/* 83: */ {\r\n/* 84:103 */ this.cuentaContable = cuentaContable;\r\n/* 85: */ }", "public void moverIzquierda() {\n estado = EstadosPersonaje.IZQUIERDA;\n mover(new Vector2(-1, 0));\n }", "public void setAlface(boolean alternancia){\n salada.setAlface(alternancia);\n }", "private static void changePatient(){\r\n // opretter ny instans af tempPatinet som overskriver den gamle\r\n Patient p = new Patient(); // det her kan udskiftes med en nulstil funktion for at forsikre at der altid kun er en patient.\r\n Patient.setCprNumber((Long) null);\r\n }", "public void setacto()\n\t\t{\n\t\t\tacto=1;\n\t\tavance=0;\n\t\t}", "public void limpar() {\n\t\talunosMilitarPraca.setId(null);\n\t\talunosMilitarPraca.setMasculino(null);\n\t\talunosMilitarPraca.setFeminino(null);\n\t\t\n\t\talunosMilitarOficial.setId(null);\n\t\talunosMilitarOficial.setMasculino(null);\n\t\talunosMilitarOficial.setFeminino(null);\n\t}", "public void coMina(){\n espM=true;\r\n }", "private UsineJoueur() {}", "public void asignarNombre(String name);", "private void setNameAutomatic(){\n\t}", "public void aggiungiPecoraCasualmente() {\n\t\tif (((int) (Math.random() * 3)) >= 1) {\n\t\t\tPecoraAdulta nuovaPecoraAdulta = new PecoraAdulta();\n\t\t\tpecore.add(nuovaPecoraAdulta);\n\t\t\tif (nuovaPecoraAdulta.isMaschio())\n\t\t\t\tnumMontoni++;\n\t\t\telse\n\t\t\t\tnumPecoreFemmine++;\n\t\t} else {\n\t\t\tpecore.add(new Agnello());\n\t\t\tnumeroAgelli++;\n\t\t}\n\t}", "public void moverAbajo() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, -1));\n }", "private void asignarCapacidades ()\n\t{\n\t\tif(tipoVehiculo.equalsIgnoreCase(TIPO_VEHICULO_ECONOMICO))\n\t\t{\n\t\t\tcapacidadKilometrosPorGalon = CAPACIDAD_60;\n\t\t}\n\t\t\n\t\telse if(tipoVehiculo.equalsIgnoreCase(TIPO_VEHICULO_MEDIO))\n\t\t{\n\t\t\tcapacidadKilometrosPorGalon = CAPACIDAD_45;\n\t\t}\n\t\t\n\t\telse capacidadKilometrosPorGalon = CAPACIDAD_30;\n\t}", "protected Asignatura()\r\n\t{}", "public void setClaim(boolean a,AbstAnt ant){\n isClaimed= a;\n claimer= ant;\n}", "public void setAnio(int p) { this.anio = p; }", "public void VaciarPila()\n {\n this.tope = 0;\n }", "public void effacerUtilisateur() {\r\n this.modele.effacerUtilisateur(this.modele);\r\n this.modele = new Utilisateurs();\r\n }", "@Override\n public void buildPersonalidad() {\n this.personaje.setPersonalidad(\"Pacientes y estrategas.\");\n }", "protected abstract void applyPrinciple();", "public void comenzarDiaLaboral() {\n\t\tSystem.out.println(\"AEROPUERTO: Inicio del dia laboral, se abren los puestos de informe, atención y freeshops al público, el conductor del tren llega a tiempo como siempre\");\n\t\tthis.turnoPuestoDeInforme.release();\n\t\t}", "@Override\r\n\tpublic void efectoPersonaje(Jugador uno) {\r\n\t\tthis.player = uno;\r\n\t\tSystem.out.println(\"Efecto\" + activado);\r\n\t\tif (activado) {\r\n\r\n\t\t\tactivarContador = true;\r\n\t\t\tSystem.out.println(\"EMPEZO CONTADOR\");\r\n\r\n\t\t\tif (player instanceof Verde) {\r\n\t\t\t\tSystem.out.println(\"FUE JUGADOR VERDE\");\r\n\t\t\t\tplayer.setBoost(3);\r\n\t\t\t} else if (player instanceof Morado) {\r\n\t\t\t\tSystem.out.println(\"FUE JUGADOR MORADO\");\r\n\t\t\t\tplayer.setBoost(3);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void approveSelf() throws IllegalAccessException {\n\t\tif (this.secOpFlag)\n\t\t\tthrow new IllegalAccessException(\"Diagnose requires second opinion and can't be self approved.\");\n\t\tthis.approved = true;\n\t\tthis.secOpFlag = false;\n\t}", "public void setActivo(boolean activo)\r\n/* 149: */ {\r\n/* 150:255 */ this.activo = activo;\r\n/* 151: */ }", "public void modificarCapacitacion(Joven joven, CapacitacionJoven capacitacionJoven, Capacitacion capacitacion,\n\t\t\tDictado dictado, Date fInicio, Date fFin, TipoDeEstadoCapacitacionJoven estado, String observacion, Date fechaEntregaCertificado) throws ReinaException {\n\t\tboolean esta = false;\n\t\tfor (CapacitacionJoven capacJoven : joven.getCapacitaciones()) {\n\t\t\testa |= ( (capacitacionJoven.getId() != capacJoven.getId()) && capacJoven.getCapacitacion().getId().equals(capacitacion.getId()) && capacJoven.estaVigente() );\n\t\t}\n\t\tif(esta)\n\t\t\tthrow new ReinaException(\"El joven se encuentra o ha realizado la capacitación que se desea registrar\");\n\t\t\n\t\t// que no quiera comenzar antes del inicio del dictado\n\t\tif (fFin != null && fInicio.after(fFin))\n\t\t\tthrow new ReinaException(\"La fecha de sucripción del joven a la formación laboral \" + capacitacion.getNombre() + \" debe ser anterior a la fecha de finalización\");\n\t\t\t\n\t\t// que la fecha del certificado sea posterior a la de inicio\n\t\tif (fechaEntregaCertificado != null && fInicio.after(fechaEntregaCertificado))\n\t\t\tthrow new ReinaException(\"La fecha de sucripción del joven a la formación laboral \" + capacitacion.getNombre() + \" debe ser anterior a la fecha de entrega del certificado\");\t\t\n\t\t\n\t\t\n\t\t// <<procesamiento>>\n\t\tcapacitacionJoven.setCapacitacion(capacitacion);\n\t\tcapacitacionJoven.setDictado(dictado);\n\t\tcapacitacionJoven.setFechaInicio(fInicio);\n\t\tcapacitacionJoven.setFechaFin(fFin);\n\t\tcapacitacionJoven.setEstado(estado);\n\t\tcapacitacionJoven.setObservacion(observacion);\n\t\tcapacitacionJoven.setFechaEntregaCertificado(fechaEntregaCertificado);\n\t}", "public void anuncio() {\n\n\t\tapp.image(pantallaEncontrado, 197, 115, 300, 150);\n\n\t\tapp.image(botonContinuar, 253, 285);\n\n\t}", "public void setAutorizacion(String autorizacion)\r\n/* 139: */ {\r\n/* 140:236 */ this.autorizacion = autorizacion;\r\n/* 141: */ }", "public void setActivo(boolean activo)\r\n/* 178: */ {\r\n/* 179:328 */ this.activo = activo;\r\n/* 180: */ }", "public void activer() throws ActivationImpossibleException {\n throw new ActivationImpossibleException(\"Serrure non activable sans objet, faut pas jouer au plus malin avec moi.\");\n }", "protected void agregarUbicacion(){\n\n\n\n }", "@Override\n\tpublic void setAutomata(Automata automata) {\n\t\t\n\t}", "void rezervasyonYap(String name, String surname, String islem);", "public void caminar(){\n if(this.robot.getOrden() == true){\n System.out.println(\"Ya tengo la orden, caminare a la cocina para empezar a prepararla.\");\n this.robot.asignarEstadoActual(this.robot.getEstadoCaminar());\n }\n }", "@Override\n\tpublic boolean semelhante(Assemelhavel obj, int profundidade) {\n\t\treturn false;\n\t}", "public void agregarAlinicio(int el){\n if(!estVacia()){\n inicio=new NodoDoble(el, inicio, null);\n inicio.siguiente.anterior=inicio;\n }else{\n inicio=fin=new NodoDoble(el);\n }\n }", "public void setPatronAutorizacion(String patronAutorizacion)\r\n/* 219: */ {\r\n/* 220:369 */ this.patronAutorizacion = patronAutorizacion;\r\n/* 221: */ }", "public void AdicionaInicio(String nomeCampus) {\n\t\tCampusModel Campus = new CampusModel(nomeCampus);\n\t\tCampus.setProx(inicio);\n\t\tinicio = Campus;\n\t}", "public void setActivo(boolean activo)\r\n/* 115: */ {\r\n/* 116:142 */ this.activo = activo;\r\n/* 117: */ }", "private static void muta(Cromosoma c)\n\t{\n\t}", "public void GuardarPersonas()\r\n {\r\n System.out.print(\"Inserte su numero de cedula: \");\r\n setNumeroId(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Nombre: \");\r\n setNombre(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Apellido: \");\r\n setPrimerApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su Segundo Apellido: \");\r\n setSegundoApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su edad: \");\r\n setEdad(Integer.parseInt(entrada.nextLine()));\r\n System.out.print(\"Inserte su peso: \");\r\n setPeso(Float.valueOf(entrada.nextLine()));\r\n \r\n }", "public final void nonRedefinissableParEnfant(){\n\n }", "public void activarAceptar() {\n aceptar = false;\n }", "public void setCuentaContableCierre(CuentaContable cuentaContableCierre)\r\n/* 103: */ {\r\n/* 104:119 */ this.cuentaContableCierre = cuentaContableCierre;\r\n/* 105: */ }", "public void fecharConta() {\n\t\tcliente.setConta(new Conta());\r\n\t\tRepositorioCliente repositorioCliente = new FabricaRepositorio().getRepCliente();\r\n\t\trepositorioCliente.editar((ClienteIndividual)cliente);\r\n//\t\tGerenciadorContaImpl contaImpl = new GerenciadorContaImpl();\r\n//\t\ttry {\r\n//\t\t\tcontaImpl.fecharConta(cliente);\r\n//\t\t} catch (OperacaoInvalidaException e) {\r\n//\t\t\te.printStackTrace();\r\n//\t\t}\r\n\t}", "public void setAcideAmine(String codon) {\n switch (codon) {\n \n case \"GCU\" :\n case \"GCC\" :\n case \"GCA\" :\n case \"GCG\" : \n this.acideAmine = \"Alanine\";\n break;\n case \"CGU\" :\n case \"CGC\" :\n case \"CGA\" :\n case \"CGG\" :\n case \"AGA\" :\n case \"AGG\" :\n this.acideAmine = \"Arginine\";\n break;\n case \"AAU\" :\n case \"AAC\" :\n this.acideAmine = \"Asparagine\";\n break;\n case \"GAU\" :\n case \"GAC\" :\n this.acideAmine = \"Aspartate\";\n break;\n case \"UGU\" :\n case \"UGC\" :\n this.acideAmine = \"Cysteine\";\n break;\n case \"GAA\" :\n case \"GAG\" :\n this.acideAmine = \"Glutamate\";\n break;\n case \"CAA\" :\n case \"CAG\" :\n this.acideAmine = \"Glutamine\";\n break;\n case \"GGU\" :\n case \"GGC\" :\n case \"GGA\" :\n case \"GGG\" :\n this.acideAmine = \"Glycine\";\n break;\n case \"CAU\" :\n case \"CAC\" :\n this.acideAmine = \"Histidine\";\n break;\n case \"AUU\" :\n case \"AUC\" :\n case \"AUA\" :\n this.acideAmine = \"Isoleucine\";\n break;\n case \"UUA\" :\n case \"UUG\" :\n case \"CUU\" :\n case \"CUC\" :\n case \"CUA\" :\n case \"CUG\" :\n this.acideAmine = \"Leucine\";\n break;\n case \"AAA\" :\n case \"AAG\" :\n this.acideAmine = \"Lysine\";\n break;\n case \"AUG\" :\n this.acideAmine = \"Methionine\";\n break;\n case \"UUU\" :\n case \"UUC\" :\n this.acideAmine = \"Phenylalanine\";\n break;\n case \"CCU\" :\n case \"CCC\" :\n case \"CCA\" :\n case \"CCG\" :\n this.acideAmine = \"Proline\";\n break;\n case \"UAG\" :\n this.acideAmine = \"Pyrrolysine\";\n break;\n case \"UGA\" :\n this.acideAmine = \"Selenocysteine\";\n break;\n case \"UCU\" :\n case \"UCC\" :\n case \"UCA\" :\n case \"UCG\" :\n case \"AGU\" :\n case \"AGC\" :\n this.acideAmine = \"Serine\";\n break;\n case \"ACU\" :\n case \"ACC\" :\n case \"ACA\" :\n case \"ACG\" :\n this.acideAmine = \"Threonine\";\n break;\n case \"UGG\" :\n this.acideAmine = \"Tryptophane\";\n break;\n case \"UAU\" :\n case \"UAC\" :\n this.acideAmine = \"Tyrosine\";\n break;\n case \"GUU\" :\n case \"GUC\" :\n case \"GUA\" :\n case \"GUG\" :\n this.acideAmine = \"Valine\";\n break;\n case \"UAA\" :\n this.acideAmine = \"Marqueur\";\n break;\n }\n }" ]
[ "0.6787596", "0.6338639", "0.61755264", "0.60794157", "0.6039141", "0.6011293", "0.6004293", "0.5960204", "0.59417737", "0.5926485", "0.5919156", "0.588521", "0.5838728", "0.58335435", "0.5811737", "0.578345", "0.5780884", "0.5768974", "0.5767288", "0.57577556", "0.57033026", "0.5691281", "0.56785715", "0.56726784", "0.5669003", "0.565433", "0.56430346", "0.5636619", "0.56356925", "0.5612026", "0.5587591", "0.5564078", "0.5547025", "0.5537358", "0.5535038", "0.5533431", "0.55312884", "0.553031", "0.5527356", "0.5523437", "0.5521749", "0.551685", "0.5515201", "0.5508988", "0.55063343", "0.5505963", "0.5504372", "0.5492658", "0.54819506", "0.54742837", "0.5461467", "0.54509866", "0.54456174", "0.5444128", "0.54419", "0.5436733", "0.5435427", "0.54323834", "0.54304755", "0.54300886", "0.54270226", "0.5425732", "0.5421957", "0.54168296", "0.54036874", "0.5400783", "0.53960097", "0.5394653", "0.5388681", "0.538331", "0.5379268", "0.5369855", "0.53656065", "0.5364003", "0.5359537", "0.5357085", "0.53526825", "0.5352429", "0.5339258", "0.5335713", "0.5333695", "0.5328834", "0.5327913", "0.53263694", "0.5318557", "0.5305578", "0.53053147", "0.530101", "0.5297292", "0.52956676", "0.5290745", "0.52838206", "0.5280315", "0.52755046", "0.52617246", "0.52608806", "0.52604556", "0.52594185", "0.5257975", "0.5256366" ]
0.79091865
0
Creates the ActiveMQ Broker, which is listening on the URL BROKER_URL
@Bean BrokerService broker() throws Exception { BrokerService broker = new BrokerService(); // configure the broker broker.addConnector(BROKER_URL); broker.start(); return broker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static DatacenterBroker createBroker(){\n\n\t\tDatacenterBroker broker = null;\n\t\ttry {\n\t\t\tbroker = new DatacenterBroker(\"Broker\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\treturn broker;\n\t}", "private void setupBroker(String uri) {\n try {\n broker = BrokerFactory.createBroker(uri);\n\n VirtualDestinationInterceptor interceptor = new VirtualDestinationInterceptor();\n VirtualTopic virtualTopic = new VirtualTopic();\n virtualTopic.setName(\"VirtualOrders.>\");\n virtualTopic.setSelectorAware(true);\n VirtualDestination[] virtualDestinations = { virtualTopic };\n interceptor.setVirtualDestinations(virtualDestinations);\n broker.setDestinationInterceptors(new DestinationInterceptor[]{interceptor});\n\n SubQueueSelectorCacheBrokerPlugin subQueueSelectorCacheBrokerPlugin = new SubQueueSelectorCacheBrokerPlugin();\n BrokerPlugin[] updatedPlugins = {subQueueSelectorCacheBrokerPlugin};\n broker.setPlugins(updatedPlugins);\n\n broker.setUseJmx(false);\n broker.start();\n broker.waitUntilStarted();\n } catch (Exception e) {\n LOG.error(\"Failed creating broker\", e);\n }\n }", "@Bean\n ActiveMQConnectionFactory connectionFactory() {\n ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_URL);\n return connectionFactory;\n }", "public Broker() {\n\t\tbrokerSocket = null;\n\t\tclientSocket = null;\n\t\tresWriter = null;\n\t\tmqttReader = null;\n\t\tportNumber = 1883;\n\t}", "public MALBrokerBinding createBroker(String localName, Blob authenticationId,\r\n QoSLevel[] expectedQos, UInteger priorityLevelNumber, Map qosProperties)\r\n throws MALException {\n return null;\r\n }", "public void initialize() {\r\n\r\n\t\t/** URL of the ActiveMQ broker, prepended by transport protocol **/\r\n\t\tString brokerUrl = config.getConfig().getString(\"broker_url\");\r\n\r\n\t\t/** Topic to subscribe to for receiving access to all notifications **/\r\n\t\tString topicName = config.getConfig().getString(\"topic\");\r\n\r\n\t\t/** Username for authenticating with the ActiveMQ broker **/\r\n\t\tString userName = config.getConfig().getString(\"user\");\r\n\r\n\t\t/** The password corresponding to the username **/\r\n\t\tString password = config.getConfig().getString(\"password\");\r\n\r\n\t\t// Creates a connection\r\n\t\tActiveMQSslConnectionFactory connectionFactory = new ActiveMQSslConnectionFactory(\r\n\t\t\t\tbrokerUrl);\r\n\r\n\t\t// Setting the trust manager to the connection factory\r\n\t\tconnectionFactory.setKeyAndTrustManagers(null, trustedCerts,\r\n\t\t\t\tnew SecureRandom());\r\n\t\tconnectionFactory.setWatchTopicAdvisories(false);\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (logger.isDebugEnabled()){\r\n\t\t\t\tlogger.debug(\"creating connection to \" + brokerUrl);\r\n\t\t\t}\r\n\t\t\t// Connect to the broker\r\n\t\t\tConnection connection = connectionFactory.createConnection(\r\n\t\t\t\t\tuserName, password);\r\n\r\n\t\t\t// Creating session for sending messages\r\n\t\t\tsession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\r\n\t\t\tconnection.start();\r\n\r\n\t\t\t// Creating the topic (i.e. creating a link to the already existing\r\n\t\t\t// one on the broker)\r\n\t\t\tTopic topic = session.createTopic(topicName);\r\n\r\n\t\t\t// MessageConsumer is used for receiving (consuming) messages from\r\n\t\t\t// the topic (above given threshold)\r\n\t\t\tMessageConsumer consumer = session.createConsumer(topic);\r\n\t\t\tconsumer.setMessageListener(this);\r\n\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"Connection to Notification with Id \"\r\n\t\t\t\t\t\t+ connection.getClientID() + \" Listening for messages\");\r\n\t\t\t}\r\n\r\n\t\t} catch (JMSException e) {\r\n\t\t\tsession = null;\r\n\t\t\tlogger.error(\"[JMS Exception] \" + e.getMessage());\r\n\t\t}\r\n\t}", "void setBrokerName(String brokerName);", "public void setBrokerURL(String brokerURL) {\n this.brokerURL = brokerURL;\n }", "@Bean\n public ConnectionFactory connectionFactory(){\n ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();\n activeMQConnectionFactory.setBrokerURL(brokerUrl);\n activeMQConnectionFactory.setUserName(brokerUsername);\n activeMQConnectionFactory.setPassword(brokerPassword);\n return activeMQConnectionFactory;\n }", "@Override\n public void run() {\n ApplicationInfo ai = null;\n try {\n ai = MainActivity.getAppContext().getPackageManager().getApplicationInfo(MainActivity.getAppContext().getPackageName(), PackageManager.GET_META_DATA);\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n String brokerAddress = (String) ai.metaData.get(\"BROKER_ADDRESS\");\n int brokerPort = (int) ai.metaData.get(\"BROKER_PORT\");\n\n // configurazione delle proprietà del broker e avvio del server relativo\n Properties properties = new Properties();\n properties.setProperty(BrokerConstants.HOST_PROPERTY_NAME, brokerAddress);\n properties.setProperty(BrokerConstants.PORT_PROPERTY_NAME, String.valueOf(brokerPort));\n properties.setProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME, Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + BrokerConstants.DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME);\n MemoryConfig memoryConfig = new MemoryConfig(properties);\n Server mqttBroker = new Server();\n try {\n mqttBroker.startServer(memoryConfig);\n } catch (IOException e) {\n e.printStackTrace();\n }\n Log.i(TAG, \"Server Started\");\n }", "java.lang.String getBrokerAddress();", "public MALBrokerBinding createBroker(MALEndpoint endPoint,\r\n Blob authenticationId, QoSLevel[] expectedQos,\r\n UInteger priorityLevelNumber, Map qosProperties) throws MALException {\n return null;\r\n }", "private void setupAmqpEndpoits() {\n\n // NOTE : Last Will and Testament Service endpoint is opened only if MQTT client provides will information\n // The receiver on the unique client publish address will be opened only after\n // connection is established (and CONNACK sent to the MQTT client)\n\n // setup and open AMQP endpoint for receiving on unique client control/publish addresses\n ProtonReceiver receiverControl = this.connection.createReceiver(String.format(AmqpReceiverEndpoint.CLIENT_CONTROL_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n ProtonReceiver receiverPublish = this.connection.createReceiver(String.format(AmqpReceiverEndpoint.CLIENT_PUBLISH_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n this.rcvEndpoint = new AmqpReceiverEndpoint(new AmqpReceiver(receiverControl, receiverPublish));\n\n // setup and open AMQP endpoint to Subscription Service\n ProtonSender ssSender = this.connection.createSender(AmqpSubscriptionServiceEndpoint.SUBSCRIPTION_SERVICE_ENDPOINT);\n this.ssEndpoint = new AmqpSubscriptionServiceEndpoint(ssSender);\n\n // setup and open AMQP endpoint for publishing\n ProtonSender senderPubrel = this.connection.createSender(String.format(AmqpPublishEndpoint.AMQP_CLIENT_PUBREL_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n this.pubEndpoint = new AmqpPublishEndpoint(senderPubrel);\n\n this.rcvEndpoint.openControl();\n this.ssEndpoint.open();\n this.pubEndpoint.open();\n }", "private void initRabbitMQ() throws IOException {\n\t\tConnectionFactory factory = new ConnectionFactory();\n\t\tfactory.setHost(\"localhost\");\n\t\tconnection = factory.newConnection();\n\t\tchannel = connection.createChannel();\n\t\t\n\t\tchannel.exchangeDeclare(AbstractProducer.EXCHANGE_NAME, AbstractProducer.EXCHANGE_TYPE);\n\t\tString queueName = channel.queueDeclare(AbstractProducer.QUEUE_NAME, true, false, false, null).getQueue();\n\t\t\n\t\tchannel.queueBind(queueName, AbstractProducer.EXCHANGE_NAME, \"\");\n\t\t\n\t\tqueueingConsumer = new QueueingConsumer(channel);\n\t\tchannel.basicConsume(queueName, MSG_ACK, queueingConsumer);\n\t}", "@Override public String brokerAddress() { return brokerAddress; }", "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 }", "private void talker( String broker, String username, String password, String rQueue, String sQueue)\n {\n // Create a connection.\n try\n {\n javax.jms.ConnectionFactory factory;\n factory = new ActiveMQConnectionFactory(username, password, broker);\n connect = factory.createConnection (username, password);\n sendSession = connect.createSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE);\n receiveSession = connect.createSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE);\n }\n catch (javax.jms.JMSException jmse)\n {\n System.err.println(\"error: Cannot connect to Broker - \" + broker);\n jmse.printStackTrace();\n System.exit(1);\n }\n\n // Create Sender and Receiver 'Talk' queues\n try\n {\n if (sQueue != null)\n {\n javax.jms.Queue sendQueue = sendSession.createQueue (sQueue);\n sender = sendSession.createProducer(sendQueue);\n }\n if (rQueue != null)\n {\n javax.jms.Queue receiveQueue = receiveSession.createQueue (rQueue);\n javax.jms.MessageConsumer qReceiver = receiveSession.createConsumer(receiveQueue);\n qReceiver.setMessageListener(this);\n // Now that 'receive' setup is complete, start the Connection\n connect.start();\n }\n }\n catch (javax.jms.JMSException jmse)\n {\n jmse.printStackTrace();\n exit();\n }\n\n try\n {\n if (rQueue != null)\n System.out.println (\"\");\n else\n System.out.println (\"\\nNo receiving queue specified.\\n\");\n\n // Read all standard input and send it as a message.\n java.io.BufferedReader stdin =\n new java.io.BufferedReader( new java.io.InputStreamReader( System.in ) );\n if (sQueue != null)\n System.out.println (\"\\nTalk application:\\n\"\n \t\t\t\t\t+ \"=================\\n\"\n \t\t\t\t\t+ \"The application user \" + username + \" connects to the broker at \" + DEFAULT_BROKER_NAME + \".\\n\"\n\t\t\t\t\t\t\t\t+ \"The application will send messages to the \" + sQueue + \" queue.\\n\"\n + \"The application creates a receiver on the \" + rQueue + \" queue to consume any messages allocated to it.\\n\\n\"\n + \"Type some text, and then press Enter to send it as a TextMesssage from \" + username + \".\\n\");\n\n else\n System.out.println (\"\\nPress CTRL-C to exit.\\n\");\n\n while ( true )\n {\n String s = stdin.readLine();\n\n if ( s == null )\n exit();\n else if ( s.length() > 0 && sQueue != null)\n {\n javax.jms.TextMessage msg = sendSession.createTextMessage();\n msg.setText( username + \": \" + s );\n // Queues usually are used for PERSISTENT messages.\n // Hold messages for 30 minutes (1,800,000 millisecs).\n sender.send( msg,\n javax.jms.DeliveryMode.PERSISTENT,\n javax.jms.Message.DEFAULT_PRIORITY,\n MESSAGE_LIFESPAN);\n }\n }\n }\n catch ( java.io.IOException ioe )\n {\n ioe.printStackTrace();\n }\n catch ( javax.jms.JMSException jmse )\n {\n jmse.printStackTrace();\n }\n // Close the connection.\n exit();\n }", "public void open(String address, int port, Handler<AsyncResult<AmqpBridge>> openHandler) {\n\n this.client = ProtonClient.create(this.vertx);\n\n // TODO: check correlation between MQTT and AMQP keep alive\n ProtonClientOptions clientOptions = new ProtonClientOptions();\n clientOptions.setHeartbeat(this.mqttEndpoint.keepAliveTimeSeconds() * 1000);\n\n String userName = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getUsername() : null;\n String password = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getPassword() : null;\n // NOTE : if username/password are null then Vert.x Proton just provides SASL ANONYMOUS as supported mechanism\n // otherwise it provides PLAIN with username/password provided here\n this.client.connect(clientOptions, address, port, userName, password, done -> {\n\n String clientIdentifier = this.mqttEndpoint.clientIdentifier();\n if (done.succeeded()) {\n\n this.connection = done.result();\n this.connection\n .closeHandler(remoteClose -> handleRemoteConnectionClose(this.connection, remoteClose))\n .disconnectHandler(this::handleRemoteDisconnect)\n .open();\n\n // setup MQTT endpoint handlers and AMQP endpoints\n this.setupMqttEndpoint();\n this.setupAmqpEndpoits();\n\n // setup a Future for completed connection steps with all services\n // with AMQP_WILL and AMQP_LIST/AMQP_SUBSCRIPTIONS or AMQP_CLOSE handled\n Future<AmqpSubscriptionsMessage> connectionFuture = Future.future();\n connectionFuture.setHandler(ar -> {\n\n try {\n if (ar.succeeded()) {\n\n this.rcvEndpoint.publishHandler(this::publishHandler);\n this.rcvEndpoint.pubrelHandler(this::pubrelHandler);\n\n AmqpSubscriptionsMessage amqpSubscriptionsMessage = ar.result();\n\n if (amqpSubscriptionsMessage != null) {\n this.mqttEndpoint.accept(!amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n // added topic subscriptions of a previous session in the local collection\n this.grantedQoSLevels = amqpSubscriptionsMessage.topicSubscriptions()\n .stream()\n .collect(Collectors.toMap(amqpTopicSubscription -> amqpTopicSubscription.topic(),\n amqpTopicSubscription -> amqpTopicSubscription.qos()));\n\n } else {\n this.mqttEndpoint.accept(false);\n this.grantedQoSLevels = new HashMap<>();\n }\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_ACCEPTED.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n // open unique client publish address receiver\n this.rcvEndpoint.openPublish();\n\n openHandler.handle(Future.succeededFuture(AmqpBridge.this));\n\n } else {\n\n this.mqttEndpoint.reject(CONNECTION_REFUSED_SERVER_UNAVAILABLE);\n LOG.error(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_REFUSED_SERVER_UNAVAILABLE.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n openHandler.handle(Future.failedFuture(ar.cause()));\n }\n }\n finally\n {\n openedFuture.complete();\n }\n });\n\n // step 1 : send AMQP_WILL to Last Will and Testament Service\n Future<ProtonDelivery> willFuture = Future.future();\n // if remote MQTT has specified the will\n if (this.mqttEndpoint.will().isWillFlag()) {\n\n // sending AMQP_WILL\n MqttWill will = this.mqttEndpoint.will();\n\n AmqpWillMessage amqpWillMessage =\n new AmqpWillMessage(will.isWillRetain(),\n will.getWillTopic(),\n MqttQoS.valueOf(will.getWillQos()),\n Buffer.buffer(will.getWillMessageBytes()));\n\n // specified link name for the Last Will and Testament Service as MQTT clientid\n ProtonLinkOptions linkOptions = new ProtonLinkOptions();\n linkOptions.setLinkName(clientIdentifier);\n\n // setup and open AMQP endpoints to Last Will and Testament Service\n ProtonSender wsSender = this.connection.createSender(AmqpLwtServiceEndpoint.LWT_SERVICE_ENDPOINT, linkOptions);\n this.lwtEndpoint = new AmqpLwtServiceEndpoint(wsSender);\n\n this.lwtEndpoint.open();\n this.lwtEndpoint.sendWill(amqpWillMessage, willFuture);\n\n } else {\n\n // otherwise just complete the Future\n willFuture.complete();\n }\n\n willFuture.compose(v -> {\n\n // handling AMQP_SUBSCRIPTIONS reply from Subscription Service\n this.rcvEndpoint.subscriptionsHandler(amqpSubscriptionsMessage -> {\n\n LOG.info(\"Session present: {}\", !amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n LOG.info(amqpSubscriptionsMessage.toString());\n\n connectionFuture.complete(amqpSubscriptionsMessage);\n });\n\n // step 2 : send AMQP_CLOSE or AMQP_LIST (based on \"clean session\" flag) to Subscription Service\n Future<ProtonDelivery> sessionFuture = Future.future();\n\n if (this.mqttEndpoint.isCleanSession()) {\n\n // sending AMQP_CLOSE\n AmqpCloseMessage amqpCloseMessage =\n new AmqpCloseMessage(clientIdentifier);\n\n this.ssEndpoint.sendClose(amqpCloseMessage, closeAsyncResult -> {\n\n // in case of AMQP_CLOSE, the connection completes on its disposition\n // no other AMQP message will be delivered by Subscription Service (i.e. AMQP_SUBSCRIPTIONS)\n if (closeAsyncResult.succeeded()) {\n connectionFuture.complete();\n } else {\n connectionFuture.fail(closeAsyncResult.cause());\n }\n });\n\n } else {\n\n // sending AMQP_LIST\n AmqpListMessage amqpListMessage =\n new AmqpListMessage(clientIdentifier);\n\n this.ssEndpoint.sendList(amqpListMessage, sessionFuture);\n }\n\n return sessionFuture;\n\n }).compose(v -> {\n // nothing here !??\n }, connectionFuture);\n\n // timeout for the overall connection process\n vertx.setTimer(AMQP_SERVICES_CONNECTION_TIMEOUT, timer -> {\n if (!connectionFuture.isComplete()) {\n connectionFuture.fail(\"Timeout on connecting to AMQP services\");\n }\n });\n\n } else {\n\n LOG.error(\"Error connecting to AMQP services ...\", done.cause());\n final MqttConnectReturnCode code;\n if (done.cause() instanceof SecurityException) {\n // error on the SASL mechanism side\n code = CONNECTION_REFUSED_NOT_AUTHORIZED;\n } else {\n code = CONNECTION_REFUSED_SERVER_UNAVAILABLE;\n\n }\n this.mqttEndpoint.reject(code);\n\n openHandler.handle(Future.failedFuture(done.cause()));\n\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", code.ordinal(),\n clientIdentifier, this.remoteAddress);\n }\n\n });\n\n }", "protected void setup() throws SQLException {\n\t\ttry {\n\t\t\t// get connection factory\n\t\t\tQueueConnectionFactory factory = AQjmsFactory.getQueueConnectionFactory(getOracleDataSource());\n\n\t\t\t// create jms connection\n\t\t\tconn = factory.createQueueConnection();\n\n\t\t\t// set exception listener\n\t\t\tconn.setExceptionListener(this);\n\n\t\t\t// set event listener\n\t\t\t//((com.sun.messaging.jms.Connection) conn).setEventListener(this);\n\n\t\t\t// test if this is a HA connection\n\t\t\t//isHAConnection = ((com.sun.messaging.jms.Connection) conn).isConnectedToHABroker();\n\t\t\t//log(\"Is connected to HA broker cluster: \" + isHAConnection);\n\n\t\t\t// get destination name\n\t\t\tString destName = FailoverQSender.TEST_DEST_NAME;\n\n\t\t\t// create a transacted session\n\t\t\tsession = conn.createQueueSession(true, -1);\n\n\t\t\t// get destination\n\t\t\tqueue = session.createQueue(destName);\n\n\t\t\t// create queue receiver\n\t\t\tqreceiver = session.createReceiver(queue);\n\t\t\t// set isConnected flag to true\n\t\t\tisConnected = true;\n\t\t\t// start the JMS connection\n\t\t\tconn.start();\n\t\t\tlog(\"Ready to receive on destination: \" + destName);\n\t\t} catch (JMSException jmse) {\n\t\t\tisConnected = false;\n\t\t\tlog(jmse);\n\t\t\tclose();\n\t\t}\n\t}", "private static KafkaProducer<String, String> createProducer(String a_broker) {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(\"bootstrap.servers\", a_broker);\r\n\t\tprops.put(\"compression.type\", \"none\");\r\n\t\tprops.put(\"value.serializer\", StringSerializer.class.getName());\r\n\t\tprops.put(\"key.serializer\", StringSerializer.class.getName());\r\n\t\t\r\n\t\treturn new KafkaProducer<String, String>(props);\r\n\t}", "public static MessageBroker getInstance() {\n\t\t//TODO: Implement this\n\t\tif (instance == null) {\n\t\t\tinstance = new MessageBrokerImpl();\n\n\t\t}\n\t\treturn instance;\n\t}", "@Override\n protected void setUp() throws Exception {\n brokerService = new BrokerService();\n LevelDBStore adaptor = new LevelDBStore();\n brokerService.setPersistenceAdapter(adaptor);\n brokerService.deleteAllMessages();\n\n // A small max page size makes this issue occur faster.\n PolicyMap policyMap = new PolicyMap();\n PolicyEntry pe = new PolicyEntry();\n pe.setMaxPageSize(1);\n policyMap.put(new ActiveMQQueue(\">\"), pe);\n brokerService.setDestinationPolicy(policyMap);\n\n brokerService.addConnector(ACTIVEMQ_BROKER_BIND);\n brokerService.start();\n\n ACTIVEMQ_BROKER_URI = brokerService.getTransportConnectors().get(0).getPublishableConnectString();\n destination = new ActiveMQQueue(getName());\n }", "private void configureMqtt() {\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"ws://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"tcp://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTT_PORT;\n\t\t\t}\n\t\t}\n\t\t\n\t\tString mqttServer = getMQTTServer();\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tpersistence = new MemoryPersistence();\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, persistence);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t} catch (MqttException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void doPreSetup() throws Exception {\n broker = new EmbeddedActiveMQ();\n deleteDirectory(\"target/data\");\n port = AvailablePortFinder.getNextAvailable();\n brokerUri = \"tcp://localhost:\" + port;\n configureBroker(this.broker);\n startBroker();\n }", "@Test\n public void testAZMQ() {\n try {\n if (ZMQ.context(1) != null) {\n System.out.println(\"ZMQ Binding successful\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Unable to bind ZMQ\");\n }\n }", "public void setBrokerId(String value) {\n this.brokerId = value;\n }", "public void setBrokerId(String value) {\n this.brokerId = value;\n }", "public BrokerSubscriptionTestConsole(String url)\n {\n try\n {\n System.out.println(\"** Starting BrokerSubscriptionTestConsole used to test subscription behaviour **\");\n \n Connection connection = ConnectionHelper.createConnection(url, \"{reconnect: true}\");\n _console = new Console(this);\n _console.addConnection(connection);\n\n // Wait until the broker Agent has been discovered\n _broker = _console.findAgent(\"broker\");\n if (_broker == null)\n {\n System.out.println(\"broker Agent not found\");\n System.exit(1);\n }\n\n System.out.println(\"Creating Query for objects whose name property has a value that starts with 'a'\");\n\n SubscribeParams params;\n QmfQuery query = new QmfQuery(QmfQueryTarget.OBJECT, \"['re_match', 'name', ['quote', '^a']]\");\n\n // Create a subscription, response returned synchronously\n params = _console.createSubscription(_broker, query, \"consoleHandle1\", \"{publishInterval:5}\");\n System.out.println(\"duration = \" + params.getLifetime());\n System.out.println(\"interval = \" + params.getPublishInterval());\n System.out.println(\"subscriptionId = \" + params.getSubscriptionId());\n System.out.println(\"consoleHandle = \" + params.getConsoleHandle());\n\n // Sleep a while, getting query result as they become available\n try\n {\n Thread.sleep(20000);\n }\n catch (InterruptedException ie)\n {\n }\n\n // Refresh the subscription getting results asynchronously, just for variety\n System.out.println(\"Calling refreshSubscription on \" + params.getSubscriptionId());\n _console.refreshSubscription(params.getSubscriptionId(), \"{replyHandle:ignoredReplyHandle}\");\n\n\n // Create a subscription for _class_name = queue\n System.out.println(\"Creating Query for all queue objects\");\n query = new QmfQuery(QmfQueryTarget.OBJECT, \"['eq', '_class_name', ['quote', 'queue']]\");\n params = _console.createSubscription(_broker, query, \"queues\");\n\n while (_objectId == null)\n {\n System.out.println(\"Waiting for ObjectId to be set\");\n try\n {\n Thread.sleep(1000);\n }\n catch (InterruptedException ie)\n {\n }\n }\n\n // Cancel the query for all queue objects\n System.out.println(\"Cancelling Query for all queue objects\");\n _console.cancelSubscription(params.getSubscriptionId());\n\n // Create a subscription for _object_id\n System.out.println(\"Creating Query for _object_id = \" + _objectId);\n query = new QmfQuery(QmfQueryTarget.OBJECT, _objectId);\n params = _console.createSubscription(_broker, query, \"queues\");\n\n }\n catch (QmfException qmfe)\n {\n System.err.println(\"QmfException \" + qmfe.getMessage() + \": BrokerSubscriptionTestConsole failed\");\n System.exit(1);\n }\n }", "public FailoverQReceiver() throws SQLException {\n\t\t// set up JMS environment\n\t\tsetup();\n\t}", "MessageReceiver createReceiver(String topic) throws MessagingException;", "public static void init() throws Exception {\n String host = \"localhost\";\n ConnectionFactory factory = new ConnectionFactory();\n factory.setHost(host);\n\n Connection connection = factory.newConnection();\n\n controllerChannel = connection.createChannel();\n controllerChannel.queueDeclare(\n CONTROLLER_QUEUE_NAME,\n true,\n false,\n true,\n null);\n }", "public Builder setBrokerAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n brokerAddress_ = value;\n onChanged();\n return this;\n }", "private KafkaProducer<String, String> createProducer(String brokerList) {\n if (USERNAME==null) USERNAME = \"token\";\n\n Properties properties = new Properties();\n //common Kafka configs\n properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerList);\n properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SASL_SSL\");\n properties.put(SaslConfigs.SASL_MECHANISM, \"PLAIN\");\n properties.put(SaslConfigs.SASL_JAAS_CONFIG, \"org.apache.kafka.common.security.plain.PlainLoginModule required username=\\\"\" + USERNAME + \"\\\" password=\\\"\" + API_KEY + \"\\\";\");\n properties.put(SslConfigs.SSL_PROTOCOL_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"HTTPS\");\n //Kafka producer configs\n properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.CLIENT_ID_CONFIG, \"stocktrader-producer\");\n properties.put(ProducerConfig.ACKS_CONFIG, \"all\");\n properties.put(ProducerConfig.CLIENT_DNS_LOOKUP_CONFIG,\"use_all_dns_ips\");\n\n KafkaProducer<String, String> kafkaProducer = null;\n \n try {\n kafkaProducer = new KafkaProducer<>(properties);\n } catch (KafkaException kafkaError ) {\n logger.warning(\"Error while creating producer: \"+kafkaError.getMessage());\n Throwable cause = kafkaError.getCause();\n if (cause != null) logger.warning(\"Caused by: \"+cause.getMessage());\n throw kafkaError;\n }\n return kafkaProducer;\n }", "public static AmqpTransportConfig create() {\n\t\tfinal AmqpTransportConfig res = new AmqpTransportConfig();\n\t\tres.setBuilder(BUILDER);\n\t\treturn res;\n\t}", "public ActiveMqUtils(String url) {\n connectionFactory = getConnectionFactory(url);\n }", "public String getBrokerId() {\n return brokerId;\n }", "public String getBrokerId() {\n return brokerId;\n }", "@Override\n\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"topic 消息类型开始产生消息 \" + \"生产者: \" + Thread.currentThread().getName());\n\t\t\t\ttry {\n\t\t\t\t\t\t/**第一步 创建连接工厂*/\n\t\t\t\t\t\tfactory = new ActiveMQConnectionFactory(MqConfigConstants.USERNAME, MqConfigConstants.PASSWORD, MqConfigConstants.BROKEURL_ALI);\n\t\t\t\t\t\t/**第二步 创建JMS 连接*/\n\t\t\t\t\t\tConnection connection = factory.createConnection();\n\t\t\t\t\t\tconnection.start();\n\t\t\t\t\t\t/** 第三步 创建Session,开启事务 */\n\t\t\t\t\t\tSession session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);\n\t\t\t\t\t\t/** 第四步: 创建topic,Topic是 Destination接口的子接口*/\n\t\t\t\t\t\tTopic topic = session.createTopic(MqConfigConstants.TopicName);\n\t\t\t\t\t\t/** 第五步 创建生产者producer */\n\t\t\t\t\t\tMessageProducer producer = session.createProducer(topic);\n\n\t\t\t\t\t\t/** 设置消息不需要持久化 */\n\t\t\t\t\t\tproducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n\t\t\t\t\t\t//发送文本消息\n\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\t/** 第六步 发送消息 */\n\t\t\t\t\t\t\t\tMessage message = createMessage(session,\"vincent\",27,\"江西省赣州市\");\n\t\t\t\t\t\t\t\tproducer.send(message);\n\t\t\t\t\t\t\t\tsession.commit();//开启事务必须需要提交,消费者才能获取到\n\t\t\t\t\t\t\t\tSystem.out.println(\"发送消息: \" +message.toString() );\n\t\t\t\t\t\t\t\tThread.sleep(200);\n\t\t\t\t\t\t}\n\t\t\t\t} catch (JMSException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}", "@Override\r\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(codec);\r\n\t\tgetContentManager().registerOntology(ontology);\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\t\tif(args != null && args.length > 0) {\r\n\t\t\tbroker = (Broker)args[0];\r\n\t\t} else {\r\n\t\t\tbroker = new Broker(\"Broker\");\r\n\t\t}\r\n\t\t\r\n\t\tProgramGUI.getInstance().printToLog(broker.hashCode(), getLocalName(), \"created\", Color.GREEN.darker());\r\n\t\t\r\n\t\t// Register in the DF\r\n\t\tDFRegistry.register(this, BROKER_AGENT);\r\n\t\t\r\n\t\tsubscribeToRetailers();\r\n\t\tquery();\r\n\t\tpurchase();\r\n\t}", "public void testBrokerListWithOneBrokerDefaultsToSingleServerPolicy() throws Exception\n {\n _url = \"amqp://user:pass@clientid/test?brokerlist='tcp://localhost:5672'\";\n _connectionUrl = new AMQConnectionURL(_url);\n _connection = createStubConnection();\n\n _failoverPolicy = new FailoverPolicy(_connectionUrl, _connection);\n\n assertTrue(\"Unexpected failover method\", _failoverPolicy.getCurrentMethod() instanceof FailoverSingleServer);\n }", "public BrokerAlgo() {}", "public String getBrokerId() {\n return brokerId;\n }", "public String getBrokerId() {\n return brokerId;\n }", "@Override\n public void configureMessageBroker(MessageBrokerRegistry registry) {\n registry.enableSimpleBroker(\"/topic/\");\n }", "@SuppressWarnings(\"empty-statement\")\n public void runClient() {\n // setup MQTT Client\n String clientID = \"apto01\";\n String pass = \"1234\";\n connOpt = new MqttConnectOptions();\n\n connOpt.setCleanSession(true);\n connOpt.setKeepAliveInterval(30);\n connOpt.setUserName(\"isis2503\");\n connOpt.setPassword(pass.toCharArray());\n\n alertaLogic = new AlertLogic();\n\n // Connect to Broker\n try {\n myClient = new MqttClient(BROKER_URL, clientID);\n myClient.setCallback(this);\n myClient.connect(connOpt);\n } catch (MqttException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n\n System.out.println(\"Connected to \" + BROKER_URL);\n\n // setup topic\n // topics on m2m.io are in the form <domain>/<stuff>/<thing>\n // subscribe to topic if subscriber\n if (subscriber) {\n try {\n int subQoS = 0;\n myClient.subscribe(infoInoTopic, subQoS);\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }\n // disconnect\n try {\n // wait to ensure subscribed messages are delivered\n while (subscriber);\n myClient.disconnect();\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "@Bean()\n Mono<Connection> connectionMono(RabbitProperties rabbitProperties) {\n ConnectionFactory connectionFactory = new ConnectionFactory();\n connectionFactory.setHost(rabbitProperties.getHost());\n connectionFactory.setPort(rabbitProperties.getPort());\n connectionFactory.setUsername(rabbitProperties.getUsername());\n connectionFactory.setPassword(rabbitProperties.getPassword());\n return Mono.fromCallable(() -> connectionFactory.newConnection(\"reactor-rabbit\")).cache();\n }", "public void start() {\n try {\n consumer.start();\n } catch (MQClientException e) {\n e.printStackTrace();\n }\n System.out.println(\"Consumer Started.\");\n }", "public static void main(String[] args) throws Exception {\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(\"rabbitConfiguration.xml\");\n\t\tAmqpAdmin amqpAdmin = context.getBean(AmqpAdmin.class);\n\t\tQueue helloWorldQueue = new Queue(\"hello.world.queue\");\n\t\t\n\t\tamqpAdmin.declareQueue(helloWorldQueue);\n\n\t}", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "public static void main(String... args) throws JCSMPException {\n if (args.length < 1) {\n System.out.println(\"Usage: TopicSubscriber <msg_backbone_ip:port>\");\n System.exit(-1);\n }\n System.out.println(\"TopicSubscriber initializing...\");\n final JCSMPProperties properties = new JCSMPProperties();\n properties.setProperty(JCSMPProperties.HOST, args[0]); // msg-backbone ip:port\n properties.setProperty(JCSMPProperties.VPN_NAME, \"default\"); // message-vpn\n properties.setProperty(JCSMPProperties.USERNAME, \"helloWorldTutorial\"); // client-username (assumes no password)\n final Topic topic = JCSMPFactory.onlyInstance().createTopic(\"tutorial/topic\");\n final JCSMPSession session = JCSMPFactory.onlyInstance().createSession(properties);\n session.connect();\n \n final CountDownLatch latch = new CountDownLatch(1); // used for\n // synchronizing b/w threads\n /** Anonymous inner-class for MessageListener \n * This demonstrates the async threaded message callback */\n final XMLMessageConsumer cons = session.getMessageConsumer(new XMLMessageListener() {\n public void onReceive(BytesXMLMessage msg) {\n if (msg instanceof TextMessage) {\n System.out.printf(\"TextMessage received: '%s'%n\",\n ((TextMessage)msg).getText());\n } else {\n System.out.println(\"Message received.\");\n }\n System.out.printf(\"Message Dump:%n%s%n\",msg.dump());\n latch.countDown(); // unblock main thread\n }\n public void onException(JCSMPException e) {\n System.out.printf(\"Consumer received exception: %s%n\",e);\n latch.countDown(); // unblock main thread\n }\n });\n session.addSubscription(topic);\n System.out.println(\"Connected. Awaiting message...\");\n cons.start();\n // Consume-only session is now hooked up and running!\n\n try {\n latch.await(); // block here until message received, and latch will flip\n } catch (InterruptedException e) {\n System.out.println(\"I was awoken while waiting\");\n }\n // Close consumer\n cons.close();\n System.out.println(\"Exiting.\");\n session.closeSession();\n }", "private void setupMqttEndpoint() {\n\n this.mqttEndpoint\n .publishHandler(this::publishHandler)\n .publishAcknowledgeHandler(this::pubackHandler)\n .publishReleaseHandler(this::pubrelHandler)\n .publishReceivedHandler(this::pubrecHandler)\n .publishCompletionHandler(this::pubcompHandler)\n .subscribeHandler(this::subscribeHandler)\n .unsubscribeHandler(this::unsubscribeHandler)\n .disconnectHandler(this::disconnectHandler)\n .closeHandler(this::closeHandler);\n }", "private static void startProducer() throws Exception {\n\t\t\n\t\tProperties jndiProps = new Properties();\n\t\tjndiProps.put(\"java.naming.factory.initial\", \"com.sun.jndi.fscontext.RefFSContextFactory\");\n\t\tjndiProps.put(\"java.naming.provider.url\", \"file:///C:/Temp\");\n\t\t\n\t\tInitialContext ctx = null;\n\t\n\t\tctx = new InitialContext(jndiProps);\n\t\tcom.sun.messaging.ConnectionFactory tcf = (com.sun.messaging.ConnectionFactory) ctx.lookup(\"Factory\");\n\t Topic topic = (com.sun.messaging.Topic) ctx.lookup(\"uav topic\");\n\t TopicConnection conn = (TopicConnection) tcf.createTopicConnection();\n\t Session session = (Session) conn.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\t \n\t MessageProducer producer = session.createProducer(topic);\n\t conn.start();\n\t TextMessage myTextMsg = session.createTextMessage();\n\t myTextMsg.setText(\"Hello JMS Subscriber!\");\n System.out.println(\"\\n===Sending Message:===\" + myTextMsg.toString());\n producer.send(myTextMsg);\n \n //Close the session and connection resources.\n session.close();\n conn.close();\n\t\t\n\t}", "private void createAndListen() {\n\n\t\t\n\t}", "public synchronized QueueConnection createQueueConnection(String userName,\n String password) throws JMSException {\n QueueConnectionImpl qc = new QueueConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n return (qc);\n }", "public void configureMessageBroker(MessageBrokerRegistry config) {\r\n\t\tLog.info(\"WebSocketConfig : configureMessageBroker : start\");\r\n\t\tconfig.enableSimpleBroker(\"/topic\");\r\n\t\tconfig.setApplicationDestinationPrefixes(\"/app\");\r\n\t\tLog.info(\"WebSocketConfig : configureMessageBroker : end\");\r\n\t}", "@Override\r\n protected void configure() {\r\n bindRequiredName(\"LTAS_SERVICE_NAME\", \"LTAS_SERVICE_NAME\");\r\n bindRequiredName(\"RABBITMQ_HOST\", \"RABBITMQ_HOST\");\r\n bindRequiredName(\"RABBITMQ_PORT\", \"RABBITMQ_PORT\");\r\n bindRequiredName(\"RABBITMQ_USERNAME\", \"RABBITMQ_USERNAME\");\r\n bindRequiredName(\"RABBITMQ_PWD\", \"RABBITMQ_PWD\");\r\n bindRequiredName(\"RABBITMQ_VIRTUALHOST\", \"RABBITMQ_VIRTUALHOST\");\r\n\r\n bind(RabbitMQAPI.class);\r\n bind(RabbitMQService.class);\r\n\r\n }", "private void createAndConnectJabberClient() throws Exception\n {\n Properties properties = (Properties) muleContext.getRegistry().lookupObject(\"properties\");\n String host = properties.getProperty(\"host\");\n conversationPartner = properties.getProperty(\"conversationPartner\");\n String password = properties.getProperty(\"conversationPartnerPassword\");\n \n // also save the jid that is used to connect to the jabber server\n muleJabberUserId = properties.getProperty(\"user\") + \"@\" + host;\n \n jabberClient = new JabberClient(host, conversationPartner, password);\n configureJabberClient(jabberClient);\n jabberClient.connect(jabberLatch);\n \n assertTrue(jabberLatch.await(STARTUP_TIMEOUT, TimeUnit.MILLISECONDS));\n }", "@Override\n public BrokerMessageListener create(long brokerMessageListenerId) {\n BrokerMessageListener brokerMessageListener = new BrokerMessageListenerImpl();\n\n brokerMessageListener.setNew(true);\n brokerMessageListener.setPrimaryKey(brokerMessageListenerId);\n\n return brokerMessageListener;\n }", "Communicator createCommunicator();", "private static void startConsumer() throws Exception {\n\t\tProperties jndiProps = new Properties();\n\t\tjndiProps.put(\"java.naming.factory.initial\", \"com.sun.jndi.fscontext.RefFSContextFactory\");\n\t\tjndiProps.put(\"java.naming.provider.url\", \"file:///C:/Temp\");\n\t\t\n\t\tInitialContext ctx = null;\n\t\n\t\tctx = new InitialContext(jndiProps);\n\t\tcom.sun.messaging.ConnectionFactory tcf = (com.sun.messaging.ConnectionFactory) ctx.lookup(\"Factory\");\n\t Topic topic = (com.sun.messaging.Topic) ctx.lookup(\"uav topic\");\n\t TopicConnection conn = (TopicConnection) tcf.createTopicConnection();\n\t Session session = (Session) conn.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\t \n\t MessageConsumer consumer = session.createConsumer(topic);\n\t conn.start();\n\n Message msg = consumer.receive();\n\n if (msg instanceof TextMessageImpl) {\n TextMessage txtMsg = (TextMessage) msg;\n System.out.println(\"\\n===Read Message:===\" + txtMsg.toString());\n }\n \n //Close the session and connection resources.\n session.close();\n conn.close();\n\t \n\t}", "@BeforeMethod\n void setup() throws Exception {\n bkEnsemble = new LocalBookkeeperEnsemble(3, 0, () -> 0);\n bkEnsemble.start();\n // Start broker\n ServiceConfiguration config = new ServiceConfiguration();\n config.setLoadManagerClassName(ModularLoadManagerImpl.class.getName());\n config.setClusterName(\"use\");\n config.setWebServicePort(Optional.of(0));\n config.setMetadataStoreUrl(\"zk:127.0.0.1:\" + bkEnsemble.getZookeeperPort());\n\n config.setAdvertisedAddress(\"localhost\");\n config.setBrokerShutdownTimeoutMs(0L);\n config.setLoadBalancerOverrideBrokerNicSpeedGbps(Optional.of(1.0d));\n config.setBrokerServicePort(Optional.of(0));\n config.setBrokerServicePortTls(Optional.of(0));\n config.setWebServicePortTls(Optional.of(0));\n pulsar = new PulsarService(config);\n pulsar.start();\n }", "public Builder setExecBroker(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000200;\n execBroker_ = value;\n onChanged();\n return this;\n }", "public static void main(String[] args) throws Exception {\n DefaultMQProducer producer = new\n DefaultMQProducer(\"producer1\");\n //Launch the instance.\n producer.setNamesrvAddr(\"192.168.0.159:9876\");\n\n producer.start();\n for (int i = 0; i < 2000; i++) {\n //Create a message instance, specifying topic, tag and message body.\n Message msg = new Message(\"test111\" /* Topic */,\n \"TagA\" /* Tag */,\n (\"{\\\"_db_\\\":\\\"order_service\\\",\\\"_table_\\\":\\\"order_base\\\",\\\"_event_\\\":\\\"row_insert\\\",\\\"order_id\\\":\\\"1\" + i +\"\\\",\\\"order_from\\\":\\\"rocketmq\\\",\\\"order_no\\\":\\\"P12311111\\\",\" +\n \"\\\"category\\\":\\\"1\\\",\\\"serve_type\\\":\\\"2\\\",\\\"account_id\\\":\\\"\\\",\\\"account_type\\\":\\\"\\\",\\\"order_status\\\":\\\"\\\",\\\"region_id\\\":\\\"\\\",\\\"appoint_method\\\":\\\"\\\",\\\"sp_type\\\":\\\"\\\",\\\"order_type\\\":\\\"\\\",\\\"is_delete\\\":\\\"\\\",\\\"refund_status\\\":\\\"\\\",\\\"order_pay_status\\\":\\\"\\\",\\\"is_logistics\\\":\\\"\\\",\\\"repair_type\\\":\\\"\\\",\\\"is_return\\\":\\\"\\\",\\\"create_time\\\":\\\"\\\",\\\"update_time\\\":\\\"\\\"}\").getBytes(RemotingHelper.DEFAULT_CHARSET) /* Message body */\n );\n //Call send message to deliver message to one of brokers.\n SendResult sendResult = producer.send(msg);\n System.out.printf(\"%s%n\", sendResult);\n }\n //Shut down once the producer instance is not longer in use.\n producer.shutdown();\n }", "public void init(int yea)\n {\n try\n {\n InitialContext initialContext = new InitialContext(getProperties());\n //logger.info(\"initial context successful\");\n\n// ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup(\"/ConnectionFactory\");\n// System.out.println(\"lookup successful\");\n// Connection connection = connectionFactory.createConnection();\n//\n// Queue bridgeQueue = (Queue)initialContext.lookup(\"/queue/bridgeQueue\");\n// Queue himsQueue = (Queue)initialContext.lookup(\"/queue/himsQueue\");\n//\n// Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n// consumer = session.createConsumer(bridgeQueue);\n// producer = session.createProducer(himsQueue);\n\n System.out.println(\"connection successful\");\n //logger.info(\"Jms Connection factory and resources created without errors\");\n// connection.start();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n //logger.error(\"error looking up jms connection factory\", e);\n }\n }", "protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}", "public ActiveMQSink(String brokerURL, String destinationQueue) {\n Validate.notEmpty(brokerURL);\n Validate.notEmpty(destinationQueue);\n ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerURL);\n connectionFactory.setAlwaysSyncSend(true);\n ActiveMQQueue activeMQQueue = new ActiveMQQueue(destinationQueue);\n\n jmsTemplate = new JmsTemplate(connectionFactory);\n jmsTemplate.setDefaultDestination(activeMQQueue);\n }", "@Override\n public void configureMessageBroker(MessageBrokerRegistry registry) {\n registry.setApplicationDestinationPrefixes(\"/app\"); //route messages to /app to Spring app message handling methods (see ChatController)\n registry.enableSimpleBroker(\"/topic/\", \"/queue/\"); //route messages to /topic to the in-memory Message Broker\n }", "public interface AbstractBroker {\n\n public void connect() throws Exception;\n\n public void subscribe(String queue, String topic) throws Exception;\n\n public void unSubscribe(String topic, String clientId) throws Exception;\n\n public void getMessageWithOutAck(byte[] body, long deliverTag, Consumer consumer);\n}", "public void createClient() {\n client = new UdpClient(Util.semIp, Util.semPort, this);\n\n // Le paso true porque quiero que lo haga en un hilo nuevo\n client.connect(true);\n }", "@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n props.put(\"oracle.net.tns_admin\", tnsAdmin); //eg: \"/user/home\" if ojdbc.properies file is in home \n props.put(\"security.protocol\", protocol);\n props.put(\"bootstrap.servers\", broker);\n //props.put(\"group.id\", group);\n props.put(\"enable.auto.commit\", \"true\");\n props.put(\"auto.commit.interval.ms\", \"10000\");\n props.put(\"linger.ms\", 1000);\n // Set how to serialize key/value pairs\n props.setProperty(\"key.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n props.setProperty(\"value.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n\n producer = new KafkaProducer<>(props);\n }", "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 }", "public java.lang.String getBrokerAddress() {\n java.lang.Object ref = brokerAddress_;\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 brokerAddress_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "String getExecBroker();", "private static void createCouchbaseClient() {\n LOGGER.debug(\"Creating Couchbase Client\");\n String bucket = CONFIG.getString(\"couchbase.bucket\");\n String[] hosts = CONFIG.getString(\"couchbase.host\").split(\";\");\n String port = CONFIG.getString(\"couchbase.port\");\n String base = CONFIG.getString(\"couchbase.base\");\n\n List<URI> uris = new ArrayList<>();\n for (final String host : hosts) {\n uris.add(URI.create(\"http://\" + host + \":\" + port + \"/\" + base));\n }\n try {\n tapClient = new TapClient(uris, bucket, \"\");\n } catch (Exception ex) {\n LOGGER.error(\"Caught exception trying to connect to Couchbase\", ex);\n }\n }", "@Override\r\n public void configureMessageBroker(MessageBrokerRegistry config) {\n config.enableSimpleBroker(\"/client_socket\");\r\n\r\n //this is for recieving messages\r\n //config.setApplicationDestinationPrefixes(\"/server_socket_prefix\");\r\n }", "private void initializeProducers(ComponentContext context) {\n BrokerHost rfHost;\n Properties prop = MQUtil.getProp(context);\n if (prop == null) {\n log.error(\"RabbitMQ configuration file not found...\");\n return;\n }\n try {\n correlationId = prop.getProperty(SENDER_COR_ID);\n rfHost = new BrokerHost(MQUtil.getMqUrl(\n prop.getProperty(SERVER_PROTO),\n prop.getProperty(SERVER_UNAME),\n prop.getProperty(SERVER_PWD),\n prop.getProperty(SERVER_ADDR),\n prop.getProperty(SERVER_PORT),\n prop.getProperty(SERVER_VHOST)));\n\n manageSender = registerProducer(rfHost,\n MQUtil.rfProducerChannelConf(\n prop.getProperty(SENDER_EXCHG),\n prop.getProperty(ROUTE_KEY),\n prop.getProperty(SENDER_QUEUE)),\n msgOutQueue);\n } catch (Exception e) {\n throw new IllegalStateException(e);\n }\n manageSender.start();\n }", "public void deploy(MDBDescriptor descriptor) throws NamingException, JMSException {\n MessageConsumer consumer;\n Connection connection;\n \n if ( descriptor.isTopic() ){\n \n TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) createJMSObject( \n descriptor.getConnectionFactoryJndiName(), descriptor.isAlreadyBound(), \n new TopicConnectionFactoryImpl()); \n \n Topic topic = (Topic) createJMSObject(descriptor.getDestinationJndiName(), descriptor.isAlreadyBound(),\n new MockTopic(descriptor.getDestinationJndiName())); \n \n TopicConnection topicConnection = topicConnectionFactory.createTopicConnection(this.jmsUsername, this.jmsPassword);\n connection = topicConnection;\n // TODO: implement transactions and acknowledgements\n TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);\n consumer = topicSession.createSubscriber(topic);\n \n }\n else {\n\n QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) createJMSObject( \n descriptor.getConnectionFactoryJndiName(), descriptor.isAlreadyBound(), \n new QueueConnectionFactoryImpl()); \n \n Queue queue = (Queue) createJMSObject(descriptor.getDestinationJndiName(), descriptor.isAlreadyBound(),\n new MockQueue(descriptor.getDestinationJndiName())); \n \n QueueConnection queueConnection = queueConnectionFactory.createQueueConnection(this.jmsUsername, this.jmsPassword);\n connection = queueConnection;\n QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n consumer = queueSession.createReceiver( queue );\n }\n \n // Same routine as for session bean\n MDBHome home = new MDBHome( descriptor );\n MDBHomeIface mdbHome = (MDBHomeIface) home.createProxy();\n \n MessageListener messageListener = mdbHome.create();\n \n consumer.setMessageListener( messageListener );\n connection.start();\n }", "public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException {\n XAQueueConnectionImpl qc = new XAQueueConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n return (qc);\n }", "@BeforeClass\r\n public static void setupStatic() throws Exception {\n\tActiveMqBroker = new BrokerService();\r\n\tActiveMqBroker.setPersistent(false);\r\n\tActiveMqBroker.start();\r\n\r\n\t// Producer\r\n\tproducer = new JmsProducer(new RuntimeContext<Producer>(JMS_CONFIG_PRODUCER_KEY, Producer.class));\r\n\r\n\t// Consumer which will do the assertions\r\n\tconsumer = new JmsConsumer(new RuntimeContext<Consumer>(JMS_CONFIG_CONSUMER_KEY, Consumer.class));\r\n\tconsumer.addMessageHandler(new MessageHandler() {\r\n\r\n\t @Override\r\n\t public boolean onReceive(Message message) throws MessageException {\r\n\t\tRECEIVED_MESSAGES.put(uniqueMessageId(message.getProviderId()), message);\r\n\t\treturn true;\r\n\t }\r\n\r\n\t @Override\r\n\t public void onError(Message message, Throwable th) {\r\n\t\tth.printStackTrace();\r\n\t }\r\n\t});\r\n\r\n\tconsumer.start();\r\n }", "public static void main(String[] argv) throws Exception {\n ConnectionFactory factory = new ConnectionFactory();\n // Specify the address of the MOM server\n factory.setHost(\"localhost\");\n // Create a new connection to the MOM\n Connection connection = factory.newConnection();\n // Create a new channel within this connection\n // to consume and to produce messages\n Channel channel = connection.createChannel();\n // Declare the queue to be used with the parameters:\n // durable:false, exclusive: false, autodelete:false,\n // additional-arguments:null\n channel.queueDeclare(QUEUE_NAME, false, false, false, null);\n // Prepare the message\n String message = \"Hello World!\";\n // Send the message to the queue\n channel.basicPublish(\"\", QUEUE_NAME, null, message.getBytes(\"UTF-8\"));\n System.out.println(\" [x] Sent '\" + message + \"'\");\n // Close the channel and the connection and finish the execution\n channel.close();\n connection.close();\n }", "@Override\n public void configureMessageBroker(MessageBrokerRegistry config) {\n config.enableSimpleBroker(\"/topic\");\n //for posting messages back - clients write to this\n config.setApplicationDestinationPrefixes(\"/app\");\n }", "@Override\n public void configureMessageBroker(MessageBrokerRegistry brokerRegistry) {\n brokerRegistry.setApplicationDestinationPrefixes(\"/app\");\n\n /*\n * The list of destination prefixes provided in this are based on what broker is\n * getting used. In this case we will use in-memory broker which doesn't have\n * any such requirements. For the purpose of maintaining convention the \"/topic\"\n * and the \"/queue\" prefixes are chosen. The convention dictates usage of\n * \"/topic\" destination for pub-sub model targeting many subscribers and the\n * \"/queue\" destination for point to point messaging.\n */\n brokerRegistry.enableSimpleBroker(\"/topic\", \"/queue\");\n\n /*\n * For configuring dedicated broker use the below code.\n */\n // brokerRegistry.enableStompBrokerRelay(\"/topic\", \"/queue\");\n }", "public Subscriber createSubscriber(String topicName) {\n validateTopicName(topicName, false);\n String target = String.format(\"%s.%s\", endpointId, topicName);\n CAMQPEndpointPolicy endpointPolicy = new CAMQPEndpointPolicy();\n endpointPolicy.setEndpointType(EndpointType.TOPIC);\n CAMQPTargetInterface receiver = CAMQPEndpointManager.createTarget(session, topicName, target, endpointPolicy);\n return new Subscriber(target, receiver);\n }", "protected void createClient(MqttCallback callback) {\n\t\tLoggerUtility.info(CLASS_NAME, \"createClient\", \"Org ID = \" + getOrgId() +\n\t\t\t\t\"\\n Client ID = \" + clientId);\n\t\tthis.mqttAsyncClient = null;\n\t\tthis.mqttClientOptions = new MqttConnectOptions();\n\t\tthis.mqttCallback = callback;\n\t}", "void createConnection();", "public AuctionHouseProxy(String hostName, int port){\n try {\n coms = new CommunicationService(hostName, port);\n }catch (IOException e){\n e.printStackTrace();\n }\n }", "public synchronized TopicConnection createTopicConnection(String userName, String password)\n throws JMSException {\n TopicConnectionImpl qc = new TopicConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n\n return (qc);\n }", "public static void main(final String[] args) throws Exception {\n Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setJournalDirectory(\"target/data/journal\").setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(NettyAcceptorFactory.class.getName())).addConnectorConfiguration(\"connector\", new TransportConfiguration(NettyConnectorFactory.class.getName()));\n\n // Step 2. Create the JMS configuration\n JMSConfiguration jmsConfig = new JMSConfigurationImpl();\n\n // Step 3. Configure the JMS ConnectionFactory\n ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName(\"cf\").setConnectorNames(Arrays.asList(\"connector\")).setBindings(\"cf\");\n jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);\n\n // Step 4. Configure the JMS Queue\n JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl().setName(\"queue1\").setDurable(false).setBindings(\"queue/queue1\");\n jmsConfig.getQueueConfigurations().add(queueConfig);\n\n // Step 5. Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration\n EmbeddedJMS jmsServer = new EmbeddedJMS().setConfiguration(configuration).setJmsConfiguration(jmsConfig).start();\n System.out.println(\"Started Embedded JMS Server\");\n\n // Step 6. Lookup JMS resources defined in the configuration\n ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup(\"cf\");\n Queue queue = (Queue) jmsServer.lookup(\"queue/queue1\");\n\n // Step 7. Send and receive a message using JMS API\n Connection connection = null;\n try {\n connection = cf.createConnection();\n Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n MessageProducer producer = session.createProducer(queue);\n TextMessage message = session.createTextMessage(\"Hello sent at \" + new Date());\n System.out.println(\"Sending message: \" + message.getText());\n producer.send(message);\n MessageConsumer messageConsumer = session.createConsumer(queue);\n connection.start();\n TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);\n System.out.println(\"Received message:\" + messageReceived.getText());\n } finally {\n if (connection != null) {\n connection.close();\n }\n\n // Step 11. Stop the JMS server\n jmsServer.stop();\n System.out.println(\"Stopped the JMS Server\");\n }\n }", "@Bean\n public Binding serviceTopicBinding(AmqpAdmin amqpAdmin) {\n return BindingBuilder.bind(clientQueue(amqpAdmin)).to(labTopicExchange()).with(Topic.SERVICE.getRoutingKey());\n }", "public String rabbitHost();", "private void createTopic(String topicName) {\r\n\t\tArrayList<Integer> socketNumbers = new ArrayList<Integer>();\r\n\t\tsubscriberMap.put(topicName, socketNumbers);\r\n\t\ttopicNumbers.put(topicNumbers.size(), topicName);\r\n\t\tterminal.println(\"Topic \" + topicName + \" was created.\");\r\n\t}", "public void init() {\n configuration.init();\n \n //Connections connections = configuration.getBroker().getConnections(\"topic\");\n Connections connections = configuration.getBrokerPool().getBroker().getConnections(\"topic\");\n \n if (connections == null) {\n handleException(\"Couldn't find the connection factor: \" + \"topic\");\n }\n \n sensorCatalog = new SensorCatalog();\n clientCatalog = new ClientCatalog();\n \n nodeCatalog = new NodeCatalog();\n \n updateManager = new UpdateManager(configuration, sensorCatalog, this);\n updateManager.init();\n \n endpointAllocator = new EndpointAllocator(configuration, nodeCatalog);\n\n registry = new JCRRegistry(this);\n registry.init();\n\n // Initialize Public-End-Point\n if(!isPublicEndPointInit) {\n \tinitPublicEndpoint();\n }\n }", "public Builder setBrokerId(String value) {\n validate(fields()[1], value);\n this.brokerId = value;\n fieldSetFlags()[1] = true;\n return this; \n }", "public Builder setBrokerId(String value) {\n validate(fields()[1], value);\n this.brokerId = value;\n fieldSetFlags()[1] = true;\n return this; \n }", "public KafkaBacksideEnvironment() {\n\t\tConfigPullParser p = new ConfigPullParser(\"kafka-props.xml\");\n\t\tproperties = p.getProperties();\n\t\tconnectors = new HashMap<String, IPluginConnector>();\n\t\t//chatApp = new SimpleChatApp(this);\n\t\t//mainChatApp = new ChatApp(this);\n\t\t//elizaApp = new ElizaApp(this);\n\t\tbootPlugins();\n\t\t//TODO other stuff?\n\t\tSystem.out.println(\"Booted\");\n\t\t//Register a shutdown hook so ^c will properly close things\n\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t public void run() { shutDown(); }\n\t\t});\n\t}", "@Override\n public void configureMessageBroker(MessageBrokerRegistry registry) {\n registry.enableSimpleBroker(TOPIC);\n }", "public static CloudbrokerClient getInstance(String username,\n\t\t\tString password, String hostPrefix) {\n\t\treturn new CloudbrokerClient(username, password, hostPrefix + \".cloudbroker.com\", 443);\n\t}", "@java.lang.Override\n public java.lang.String getBrokerAddress() {\n java.lang.Object ref = brokerAddress_;\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 brokerAddress_ = s;\n return s;\n }\n }", "public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "Messenger(QuorumCnxManager manager) {\n\n this.ws = new WorkerSender(manager);\n\n this.wsThread = new Thread(this.ws, \"WorkerSender[myid=\" + self.getMyId() + \"]\");\n this.wsThread.setDaemon(true);\n\n this.wr = new WorkerReceiver(manager);\n\n this.wrThread = new Thread(this.wr, \"WorkerReceiver[myid=\" + self.getMyId() + \"]\");\n this.wrThread.setDaemon(true);\n }" ]
[ "0.6762005", "0.65469784", "0.6217145", "0.61282694", "0.59298044", "0.5877603", "0.58518803", "0.57685536", "0.57525164", "0.5575111", "0.5558444", "0.554343", "0.55341285", "0.5475879", "0.54596865", "0.53898007", "0.53711146", "0.5367868", "0.5359284", "0.5335837", "0.53332335", "0.5314019", "0.5308236", "0.52716124", "0.5269715", "0.52524966", "0.52524966", "0.5244586", "0.5240089", "0.5239434", "0.52248037", "0.51848406", "0.5182189", "0.51819277", "0.51390743", "0.51384985", "0.51384985", "0.51366776", "0.5100246", "0.5096271", "0.50948495", "0.5084205", "0.5084205", "0.50832933", "0.508299", "0.507724", "0.50464743", "0.5045801", "0.50399756", "0.50041926", "0.4995078", "0.49559438", "0.49548292", "0.49363065", "0.49317136", "0.49306184", "0.49244148", "0.49235183", "0.49225247", "0.49207056", "0.49163803", "0.49154058", "0.49086228", "0.49002314", "0.48938647", "0.48928845", "0.48919433", "0.48829734", "0.48796967", "0.48574805", "0.48465914", "0.48276135", "0.4822258", "0.48173708", "0.4810192", "0.48055488", "0.47999096", "0.47979012", "0.4797504", "0.4791746", "0.4784445", "0.4783365", "0.47791833", "0.47672588", "0.4766653", "0.47653392", "0.47594124", "0.47564813", "0.4740101", "0.47326508", "0.47256353", "0.4716289", "0.4711768", "0.4711768", "0.4703321", "0.4700086", "0.46975815", "0.46859553", "0.46839064", "0.4683031" ]
0.71919197
0
Creates the connection factory to connect to the broker
@Bean ActiveMQConnectionFactory connectionFactory() { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_URL); return connectionFactory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "@Bean\n public ConnectionFactory connectionFactory(){\n ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();\n activeMQConnectionFactory.setBrokerURL(brokerUrl);\n activeMQConnectionFactory.setUserName(brokerUsername);\n activeMQConnectionFactory.setPassword(brokerPassword);\n return activeMQConnectionFactory;\n }", "Connection createConnection();", "public interface ConnectionFactory {\r\n\r\n /**\r\n * Creates a connection instance based on the given parameters.\r\n * \r\n * @param context\r\n * the context\r\n * @param <T>\r\n * the type of the objects that are handled by the connection.\r\n * @return the connection instance\r\n * @throws ConnectionBuildException\r\n * if creating the connection fails\r\n */\r\n public <T> Connection<T> createConnection( ConnectionContext<T> context ) throws ConnectionBuildException;\r\n\r\n}", "public static Connection createConnection() {\n\t\treturn new FabricaDeConexoes().getConnection();\n\t}", "private RabbitMQConnectionFactory getConnectionFactory(RabbitMQOutTransportInfo transportInfo) {\n Hashtable<String, String> props = transportInfo.getProperties();\n RabbitMQConnectionFactory factory = rabbitMQConnectionFactoryManager.getConnectionFactory(props);\n return factory;\n }", "public interface ConnectionFactory {\n\n public abstract Connection createConnection();\n\n}", "void createConnection();", "@Bean\n public ConnectionFactory connectionFactory() {\n CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host); //org.springframework.amqp.rabbit.connection.connectionFactory\n connectionFactory.setUsername(username);\n connectionFactory.setPassword(password);\n connectionFactory.setPort(port);\n return connectionFactory;\n }", "protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}", "private static DatacenterBroker createBroker(){\n\n\t\tDatacenterBroker broker = null;\n\t\ttry {\n\t\t\tbroker = new DatacenterBroker(\"Broker\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\treturn broker;\n\t}", "Connection createConnection(ExecutorService pool);", "public Object createConnectionFactory(ConnectionManager cxManager)\n throws ResourceException {\n log.finest(\"createConnectionFactory()\");\n return new VertxConnectionFactoryImpl(this, cxManager);\n }", "private static DBConnectionFactory createDBConnectionFactory(ConfigurationObject config) {\r\n ConfigurationObject dbConnectionFactoryConfig = Helper.getChildConfig(config,\r\n DB_CONNECTION_FACTORY_CONFIG);\r\n\r\n // Create database connection factory using the extracted configuration\r\n try {\r\n return new DBConnectionFactoryImpl(dbConnectionFactoryConfig);\r\n } catch (UnknownConnectionException e) {\r\n throw new LateDeliverablesTrackerConfigurationException(\r\n \"Fails to create database connection factory.\", e);\r\n } catch (ConfigurationException e) {\r\n throw new LateDeliverablesTrackerConfigurationException(\r\n \"Fails to create database connection factory.\", e);\r\n }\r\n }", "public void initialize() {\r\n\r\n\t\t/** URL of the ActiveMQ broker, prepended by transport protocol **/\r\n\t\tString brokerUrl = config.getConfig().getString(\"broker_url\");\r\n\r\n\t\t/** Topic to subscribe to for receiving access to all notifications **/\r\n\t\tString topicName = config.getConfig().getString(\"topic\");\r\n\r\n\t\t/** Username for authenticating with the ActiveMQ broker **/\r\n\t\tString userName = config.getConfig().getString(\"user\");\r\n\r\n\t\t/** The password corresponding to the username **/\r\n\t\tString password = config.getConfig().getString(\"password\");\r\n\r\n\t\t// Creates a connection\r\n\t\tActiveMQSslConnectionFactory connectionFactory = new ActiveMQSslConnectionFactory(\r\n\t\t\t\tbrokerUrl);\r\n\r\n\t\t// Setting the trust manager to the connection factory\r\n\t\tconnectionFactory.setKeyAndTrustManagers(null, trustedCerts,\r\n\t\t\t\tnew SecureRandom());\r\n\t\tconnectionFactory.setWatchTopicAdvisories(false);\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (logger.isDebugEnabled()){\r\n\t\t\t\tlogger.debug(\"creating connection to \" + brokerUrl);\r\n\t\t\t}\r\n\t\t\t// Connect to the broker\r\n\t\t\tConnection connection = connectionFactory.createConnection(\r\n\t\t\t\t\tuserName, password);\r\n\r\n\t\t\t// Creating session for sending messages\r\n\t\t\tsession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\r\n\t\t\tconnection.start();\r\n\r\n\t\t\t// Creating the topic (i.e. creating a link to the already existing\r\n\t\t\t// one on the broker)\r\n\t\t\tTopic topic = session.createTopic(topicName);\r\n\r\n\t\t\t// MessageConsumer is used for receiving (consuming) messages from\r\n\t\t\t// the topic (above given threshold)\r\n\t\t\tMessageConsumer consumer = session.createConsumer(topic);\r\n\t\t\tconsumer.setMessageListener(this);\r\n\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"Connection to Notification with Id \"\r\n\t\t\t\t\t\t+ connection.getClientID() + \" Listening for messages\");\r\n\t\t\t}\r\n\r\n\t\t} catch (JMSException e) {\r\n\t\t\tsession = null;\r\n\t\t\tlogger.error(\"[JMS Exception] \" + e.getMessage());\r\n\t\t}\r\n\t}", "public interface ConnectionFactory {\r\n\r\n\tString testdir = System.getenv(\"SERVER_MODULES_DIR\");\r\n\tint timeout = 139;\r\n\tList<String> modules = Arrays.asList(\r\n/*\t\t\ttestdir + \"/mod_test.so\",\r\n\t\t\ttestdir + \"/mod_test_dict.so\",*/\r\n\t\t\t\"/usr/lib/rad/module/mod_pam.so\",\r\n/*\t\t\ttestdir + \"/mod_test_enum.so\",\r\n\t\t\ttestdir + \"/mod_test_list.so\",*/\r\n\t\t\t\"/usr/lib/rad/protocol/mod_proto_rad.so\",\r\n\t\t\t\"/usr/lib/rad/transport/mod_tls.so\",\r\n\t\t\t\"/usr/lib/rad/transport/mod_tcp.so\");\r\n\r\n\tpublic Connection createConnection() throws Exception;\r\n\tpublic String getDescription();\r\n}", "public SwimConnectionFactory() {\n\t\tsuper();\n\t}", "public Object createConnectionFactory() throws ResourceException {\n throw new ResourceException(\"Vert.x JCA adapter not supported in non-managed environment\");\n }", "private void configureMqtt() {\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"ws://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"tcp://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTT_PORT;\n\t\t\t}\n\t\t}\n\t\t\n\t\tString mqttServer = getMQTTServer();\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tpersistence = new MemoryPersistence();\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, persistence);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t} catch (MqttException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public synchronized TopicConnection createTopicConnection(String userName, String password)\n throws JMSException {\n TopicConnectionImpl qc = new TopicConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n\n return (qc);\n }", "public synchronized Connection createConnection(String userName, String password) throws JMSException {\n ConnectionImpl qc = new ConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n return (qc);\n }", "public interface ConnectionFactory\r\n{\r\n /**\r\n * Create the ManagedConnection. \r\n * <b>Only used by ConnectionManager so do not call this.</b>\r\n * @param ec ExecutionContext that the connection is bound to during its lifecycle (if any)\r\n * @param transactionOptions the Transaction options this connection will be enlisted to, null if non existent\r\n * @return The ManagedConnection.\r\n */\r\n ManagedConnection createManagedConnection(ExecutionContext ec, Map<String, Object> transactionOptions);\r\n\r\n /**\r\n * Release any resources that have been allocated.\r\n */\r\n void close();\r\n\r\n /**\r\n * Type of resource that this ConnectionFactory represents. See ConnectionResourceType.\r\n * @return Resource type (\"JTA\", \"RESOURCE_LOCAL\")\r\n */\r\n String getResourceType();\r\n\r\n /**\r\n * Accessor for the resource name (e.g \"jdbc/tx\").\r\n * @return The resource name\r\n */\r\n String getResourceName();\r\n}", "private ConnectionFactoryDefinition loadConnectionFactory(XMLStreamReader reader) throws XMLStreamException {\n\n ConnectionFactoryDefinition connectionFactory = new ConnectionFactoryDefinition();\n\n connectionFactory.setName(reader.getAttributeValue(null, \"name\"));\n\n String create = reader.getAttributeValue(null, \"create\");\n if (create != null) {\n connectionFactory.setCreate(CreateOption.valueOf(create));\n }\n loadProperties(reader, connectionFactory, \"connectionFactory\");\n\n return connectionFactory;\n\n }", "protected void setup() throws SQLException {\n\t\ttry {\n\t\t\t// get connection factory\n\t\t\tQueueConnectionFactory factory = AQjmsFactory.getQueueConnectionFactory(getOracleDataSource());\n\n\t\t\t// create jms connection\n\t\t\tconn = factory.createQueueConnection();\n\n\t\t\t// set exception listener\n\t\t\tconn.setExceptionListener(this);\n\n\t\t\t// set event listener\n\t\t\t//((com.sun.messaging.jms.Connection) conn).setEventListener(this);\n\n\t\t\t// test if this is a HA connection\n\t\t\t//isHAConnection = ((com.sun.messaging.jms.Connection) conn).isConnectedToHABroker();\n\t\t\t//log(\"Is connected to HA broker cluster: \" + isHAConnection);\n\n\t\t\t// get destination name\n\t\t\tString destName = FailoverQSender.TEST_DEST_NAME;\n\n\t\t\t// create a transacted session\n\t\t\tsession = conn.createQueueSession(true, -1);\n\n\t\t\t// get destination\n\t\t\tqueue = session.createQueue(destName);\n\n\t\t\t// create queue receiver\n\t\t\tqreceiver = session.createReceiver(queue);\n\t\t\t// set isConnected flag to true\n\t\t\tisConnected = true;\n\t\t\t// start the JMS connection\n\t\t\tconn.start();\n\t\t\tlog(\"Ready to receive on destination: \" + destName);\n\t\t} catch (JMSException jmse) {\n\t\t\tisConnected = false;\n\t\t\tlog(jmse);\n\t\t\tclose();\n\t\t}\n\t}", "public Connection getConnection(){\n try {\n return connectionFactory.getConnection(); // wird doch schon im Konstruktor von TodoListApp aufgerufen ???\n } catch (SQLException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }", "@Bean()\n Mono<Connection> connectionMono(RabbitProperties rabbitProperties) {\n ConnectionFactory connectionFactory = new ConnectionFactory();\n connectionFactory.setHost(rabbitProperties.getHost());\n connectionFactory.setPort(rabbitProperties.getPort());\n connectionFactory.setUsername(rabbitProperties.getUsername());\n connectionFactory.setPassword(rabbitProperties.getPassword());\n return Mono.fromCallable(() -> connectionFactory.newConnection(\"reactor-rabbit\")).cache();\n }", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "public ConnectionConfig createConnection()\n {\n return _connectionConfig;\n }", "public ActiveMqUtils(String url) {\n connectionFactory = getConnectionFactory(url);\n }", "public static DMSoapClientFactory newInstance(Properties properties) throws DMException {\r\n DMSoapClientFactory factory = new DMSoapClientFactory();\r\n factory.setProperties(properties);\r\n return factory;\r\n \r\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 MessageDestinationFactory() {\n this.properties = new ConfigMap();\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}", "public <T> Connection<T> createConnection( ConnectionContext<T> context ) throws ConnectionBuildException;", "private MQTTNetworkLayer createMQTTNetworkLayer(NetworkLayerParams networkParams) \r\n throws Exception {\r\n String serverURI = networkParams.serverURI;\r\n String clientId = networkParams.clientId;\r\n String remoteMAC = networkParams.remoteMAC;\r\n \r\n return new MQTTNetworkLayer(\r\n networkParams.connectionStorage,\r\n serverURI, clientId, remoteMAC\r\n );\r\n }", "@Bean\n BrokerService broker() throws Exception {\n BrokerService broker = new BrokerService();\n // configure the broker\n broker.addConnector(BROKER_URL);\n broker.start();\n return broker;\n }", "public static AmqpTransportConfig create() {\n\t\tfinal AmqpTransportConfig res = new AmqpTransportConfig();\n\t\tres.setBuilder(BUILDER);\n\t\treturn res;\n\t}", "public Factory() {\n this(getInternalClient());\n }", "public void open(String address, int port, Handler<AsyncResult<AmqpBridge>> openHandler) {\n\n this.client = ProtonClient.create(this.vertx);\n\n // TODO: check correlation between MQTT and AMQP keep alive\n ProtonClientOptions clientOptions = new ProtonClientOptions();\n clientOptions.setHeartbeat(this.mqttEndpoint.keepAliveTimeSeconds() * 1000);\n\n String userName = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getUsername() : null;\n String password = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getPassword() : null;\n // NOTE : if username/password are null then Vert.x Proton just provides SASL ANONYMOUS as supported mechanism\n // otherwise it provides PLAIN with username/password provided here\n this.client.connect(clientOptions, address, port, userName, password, done -> {\n\n String clientIdentifier = this.mqttEndpoint.clientIdentifier();\n if (done.succeeded()) {\n\n this.connection = done.result();\n this.connection\n .closeHandler(remoteClose -> handleRemoteConnectionClose(this.connection, remoteClose))\n .disconnectHandler(this::handleRemoteDisconnect)\n .open();\n\n // setup MQTT endpoint handlers and AMQP endpoints\n this.setupMqttEndpoint();\n this.setupAmqpEndpoits();\n\n // setup a Future for completed connection steps with all services\n // with AMQP_WILL and AMQP_LIST/AMQP_SUBSCRIPTIONS or AMQP_CLOSE handled\n Future<AmqpSubscriptionsMessage> connectionFuture = Future.future();\n connectionFuture.setHandler(ar -> {\n\n try {\n if (ar.succeeded()) {\n\n this.rcvEndpoint.publishHandler(this::publishHandler);\n this.rcvEndpoint.pubrelHandler(this::pubrelHandler);\n\n AmqpSubscriptionsMessage amqpSubscriptionsMessage = ar.result();\n\n if (amqpSubscriptionsMessage != null) {\n this.mqttEndpoint.accept(!amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n // added topic subscriptions of a previous session in the local collection\n this.grantedQoSLevels = amqpSubscriptionsMessage.topicSubscriptions()\n .stream()\n .collect(Collectors.toMap(amqpTopicSubscription -> amqpTopicSubscription.topic(),\n amqpTopicSubscription -> amqpTopicSubscription.qos()));\n\n } else {\n this.mqttEndpoint.accept(false);\n this.grantedQoSLevels = new HashMap<>();\n }\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_ACCEPTED.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n // open unique client publish address receiver\n this.rcvEndpoint.openPublish();\n\n openHandler.handle(Future.succeededFuture(AmqpBridge.this));\n\n } else {\n\n this.mqttEndpoint.reject(CONNECTION_REFUSED_SERVER_UNAVAILABLE);\n LOG.error(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_REFUSED_SERVER_UNAVAILABLE.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n openHandler.handle(Future.failedFuture(ar.cause()));\n }\n }\n finally\n {\n openedFuture.complete();\n }\n });\n\n // step 1 : send AMQP_WILL to Last Will and Testament Service\n Future<ProtonDelivery> willFuture = Future.future();\n // if remote MQTT has specified the will\n if (this.mqttEndpoint.will().isWillFlag()) {\n\n // sending AMQP_WILL\n MqttWill will = this.mqttEndpoint.will();\n\n AmqpWillMessage amqpWillMessage =\n new AmqpWillMessage(will.isWillRetain(),\n will.getWillTopic(),\n MqttQoS.valueOf(will.getWillQos()),\n Buffer.buffer(will.getWillMessageBytes()));\n\n // specified link name for the Last Will and Testament Service as MQTT clientid\n ProtonLinkOptions linkOptions = new ProtonLinkOptions();\n linkOptions.setLinkName(clientIdentifier);\n\n // setup and open AMQP endpoints to Last Will and Testament Service\n ProtonSender wsSender = this.connection.createSender(AmqpLwtServiceEndpoint.LWT_SERVICE_ENDPOINT, linkOptions);\n this.lwtEndpoint = new AmqpLwtServiceEndpoint(wsSender);\n\n this.lwtEndpoint.open();\n this.lwtEndpoint.sendWill(amqpWillMessage, willFuture);\n\n } else {\n\n // otherwise just complete the Future\n willFuture.complete();\n }\n\n willFuture.compose(v -> {\n\n // handling AMQP_SUBSCRIPTIONS reply from Subscription Service\n this.rcvEndpoint.subscriptionsHandler(amqpSubscriptionsMessage -> {\n\n LOG.info(\"Session present: {}\", !amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n LOG.info(amqpSubscriptionsMessage.toString());\n\n connectionFuture.complete(amqpSubscriptionsMessage);\n });\n\n // step 2 : send AMQP_CLOSE or AMQP_LIST (based on \"clean session\" flag) to Subscription Service\n Future<ProtonDelivery> sessionFuture = Future.future();\n\n if (this.mqttEndpoint.isCleanSession()) {\n\n // sending AMQP_CLOSE\n AmqpCloseMessage amqpCloseMessage =\n new AmqpCloseMessage(clientIdentifier);\n\n this.ssEndpoint.sendClose(amqpCloseMessage, closeAsyncResult -> {\n\n // in case of AMQP_CLOSE, the connection completes on its disposition\n // no other AMQP message will be delivered by Subscription Service (i.e. AMQP_SUBSCRIPTIONS)\n if (closeAsyncResult.succeeded()) {\n connectionFuture.complete();\n } else {\n connectionFuture.fail(closeAsyncResult.cause());\n }\n });\n\n } else {\n\n // sending AMQP_LIST\n AmqpListMessage amqpListMessage =\n new AmqpListMessage(clientIdentifier);\n\n this.ssEndpoint.sendList(amqpListMessage, sessionFuture);\n }\n\n return sessionFuture;\n\n }).compose(v -> {\n // nothing here !??\n }, connectionFuture);\n\n // timeout for the overall connection process\n vertx.setTimer(AMQP_SERVICES_CONNECTION_TIMEOUT, timer -> {\n if (!connectionFuture.isComplete()) {\n connectionFuture.fail(\"Timeout on connecting to AMQP services\");\n }\n });\n\n } else {\n\n LOG.error(\"Error connecting to AMQP services ...\", done.cause());\n final MqttConnectReturnCode code;\n if (done.cause() instanceof SecurityException) {\n // error on the SASL mechanism side\n code = CONNECTION_REFUSED_NOT_AUTHORIZED;\n } else {\n code = CONNECTION_REFUSED_SERVER_UNAVAILABLE;\n\n }\n this.mqttEndpoint.reject(code);\n\n openHandler.handle(Future.failedFuture(done.cause()));\n\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", code.ordinal(),\n clientIdentifier, this.remoteAddress);\n }\n\n });\n\n }", "public FailoverQReceiver() throws SQLException {\n\t\t// set up JMS environment\n\t\tsetup();\n\t}", "public static void init() throws Exception {\n String host = \"localhost\";\n ConnectionFactory factory = new ConnectionFactory();\n factory.setHost(host);\n\n Connection connection = factory.newConnection();\n\n controllerChannel = connection.createChannel();\n controllerChannel.queueDeclare(\n CONTROLLER_QUEUE_NAME,\n true,\n false,\n true,\n null);\n }", "public void init() {\n configuration.init();\n \n //Connections connections = configuration.getBroker().getConnections(\"topic\");\n Connections connections = configuration.getBrokerPool().getBroker().getConnections(\"topic\");\n \n if (connections == null) {\n handleException(\"Couldn't find the connection factor: \" + \"topic\");\n }\n \n sensorCatalog = new SensorCatalog();\n clientCatalog = new ClientCatalog();\n \n nodeCatalog = new NodeCatalog();\n \n updateManager = new UpdateManager(configuration, sensorCatalog, this);\n updateManager.init();\n \n endpointAllocator = new EndpointAllocator(configuration, nodeCatalog);\n\n registry = new JCRRegistry(this);\n registry.init();\n\n // Initialize Public-End-Point\n if(!isPublicEndPointInit) {\n \tinitPublicEndpoint();\n }\n }", "public Broker() {\n\t\tbrokerSocket = null;\n\t\tclientSocket = null;\n\t\tresWriter = null;\n\t\tmqttReader = null;\n\t\tportNumber = 1883;\n\t}", "public static final FXConnectionFactory getConnectionFactory()\n { \n if (_cFact == null) { \n init(); \n } \n return _cFact; \n }", "public synchronized QueueConnection createQueueConnection(String userName,\n String password) throws JMSException {\n QueueConnectionImpl qc = new QueueConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n return (qc);\n }", "private Connection getConnection(String signature) throws LateDeliverablesProcessingException {\r\n try {\r\n if (connectionName == null) {\r\n return this.dbConnectionFactory.createConnection();\r\n } else {\r\n return this.dbConnectionFactory.createConnection(connectionName);\r\n }\r\n } catch (DBConnectionException e) {\r\n throw Helper.logException(log, signature, new LateDeliverablesProcessingException(\r\n \"Fails to create database connection.\", e));\r\n }\r\n }", "public ClientRepositoryFactory() {\n this(new ClientAdapterFactory());\n }", "public DataSourceFactory() {}", "private static void createCouchbaseClient() {\n LOGGER.debug(\"Creating Couchbase Client\");\n String bucket = CONFIG.getString(\"couchbase.bucket\");\n String[] hosts = CONFIG.getString(\"couchbase.host\").split(\";\");\n String port = CONFIG.getString(\"couchbase.port\");\n String base = CONFIG.getString(\"couchbase.base\");\n\n List<URI> uris = new ArrayList<>();\n for (final String host : hosts) {\n uris.add(URI.create(\"http://\" + host + \":\" + port + \"/\" + base));\n }\n try {\n tapClient = new TapClient(uris, bucket, \"\");\n } catch (Exception ex) {\n LOGGER.error(\"Caught exception trying to connect to Couchbase\", ex);\n }\n }", "public ClientTSap() {\n socketFactory = SocketFactory.getDefault();\n }", "public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException {\n XATopicConnectionImpl qc = new XATopicConnectionImpl(userName == null ? \"anonymous\" : userName, password, createReconnector());\n qc.assignClientId(clientId);\n qc.setSmqpProducerReplyInterval(smqpProducerReplyInterval);\n qc.setSmqpConsumerCacheSize(smqpConsumerCacheSize);\n qc.setJmsDeliveryMode(jmsDeliveryMode);\n qc.setJmsPriority(jmsPriority);\n qc.setJmsTTL(jmsTTL);\n qc.setJmsMessageIdEnabled(jmsMessageIdEnabled);\n qc.setJmsMessageTimestampEnabled(jmsMessageTimestampEnabled);\n qc.setUseThreadContextCL(useThreadContextCL);\n qc.setDuplicateMessageDetection(duplicateMessageDetection);\n qc.setDuplicateBacklogSize(duplicateBacklogSize);\n if (keepaliveInterval > 0)\n qc.startKeepAlive(keepaliveInterval);\n\n return (qc);\n }", "public SocketChannelTarantoolConnection() {\n\t\tthis(\"localhost\", 33013);\n\t}", "public ConnectionFactory getConnectionFactory() {\n return connectionFactory;\n }", "public static Connection connect(){\n\t\ttry {\n\t\t\tadd = Configure.getADDRESS();\n\t\t\tconn = ConnectionFactory.getConnect(add, Configure.port, \"TCP\");\n\t\t} catch (Exception e) {\n\t\t\tConfigure.logger.error(e.getMessage());\n\t\t\t//System.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\t//System.exit(0);\n\t\t}\n\t\treturn conn;\n\t}", "Communicator createCommunicator();", "public MPSApplicationContextFactory() {\n this.encodingManager = new EncodingManager();\n\n protocolBuilder = new NamedProtocolBuilder();\n // Register the known protocols with the builder.\n ProtocolRegistry registry = new ProtocolRegistry();\n registry.register(protocolBuilder);\n }", "ITransport createTransport(T netconfAccessInfo) throws NetconfException;", "void connect(FmqPool pool);", "private void setupAmqpEndpoits() {\n\n // NOTE : Last Will and Testament Service endpoint is opened only if MQTT client provides will information\n // The receiver on the unique client publish address will be opened only after\n // connection is established (and CONNACK sent to the MQTT client)\n\n // setup and open AMQP endpoint for receiving on unique client control/publish addresses\n ProtonReceiver receiverControl = this.connection.createReceiver(String.format(AmqpReceiverEndpoint.CLIENT_CONTROL_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n ProtonReceiver receiverPublish = this.connection.createReceiver(String.format(AmqpReceiverEndpoint.CLIENT_PUBLISH_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n this.rcvEndpoint = new AmqpReceiverEndpoint(new AmqpReceiver(receiverControl, receiverPublish));\n\n // setup and open AMQP endpoint to Subscription Service\n ProtonSender ssSender = this.connection.createSender(AmqpSubscriptionServiceEndpoint.SUBSCRIPTION_SERVICE_ENDPOINT);\n this.ssEndpoint = new AmqpSubscriptionServiceEndpoint(ssSender);\n\n // setup and open AMQP endpoint for publishing\n ProtonSender senderPubrel = this.connection.createSender(String.format(AmqpPublishEndpoint.AMQP_CLIENT_PUBREL_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n this.pubEndpoint = new AmqpPublishEndpoint(senderPubrel);\n\n this.rcvEndpoint.openControl();\n this.ssEndpoint.open();\n this.pubEndpoint.open();\n }", "<P> ConnectionService<P> getConnectionService();", "abstract public boolean createConnection();", "@Override\n\t\tpublic DRPCClient create() throws Exception {\n\t\t\tMap<String, Object> config = Utils.readStormConfig();\n\t\t\treturn new DRPCClient(config, configuration.drpcHost,\n\t\t\t\t\tconfiguration.drpcPort, MAX_WAIT_TO_EXECUTE);\n\t\t}", "@VisibleForTesting\n public static CalciteConnection connect(CalciteSchema schema,\n @Nullable JavaTypeFactory typeFactory) {\n return DRIVER.connect(schema, typeFactory);\n }", "NodeConnection createNodeConnection();", "protected abstract ConnectionBase createNewConnection(Socket socket);", "protected Channel createChannel() throws IOException, TimeoutException, NoSuchAlgorithmException {\n LOGGER.debug(\"Creating channel\");\n Channel channel = connectionProducer.getConnection(config).createChannel();\n LOGGER.debug(\"Created channel\");\n return channel;\n }", "public BasicHttpClientConnectionManager(Lookup<ConnectionSocketFactory> socketFactoryRegistry, HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory) {\n/* 137 */ this(socketFactoryRegistry, connFactory, null, null);\n/* */ }", "private void initMqtt(){\n\n MqttConnectOptions options = new MqttConnectOptions();\n options.setUserName(\"secureIoT\");\n options.setPassword(\"admin\".toCharArray());\n\n String clientId = MqttClient.generateClientId();\n mqttClient = new MqttAndroidClient(this.getApplicationContext(), \"tcp://m21.cloudmqtt.com:18188\", clientId);\n\n try {\n IMqttToken token = mqttClient.connect(options);\n token.setActionCallback(new IMqttActionListener() {\n @Override\n public void onSuccess(IMqttToken asyncActionToken) {\n Log.d(LOG_TAG, \"onSuccess\");\n // Subscribe for messages from server & device\n subscribeMqttTopic(\"/server/\" + deviceMac);\n subscribeMqttTopic(\"/device/\" + deviceMac);\n }\n\n @Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n // Something went wrong e.g. connection timeout or firewall problems\n Log.d(LOG_TAG, \"onFailure\");\n exception.printStackTrace();\n\n }\n });\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "private void createAndConnectJabberClient() throws Exception\n {\n Properties properties = (Properties) muleContext.getRegistry().lookupObject(\"properties\");\n String host = properties.getProperty(\"host\");\n conversationPartner = properties.getProperty(\"conversationPartner\");\n String password = properties.getProperty(\"conversationPartnerPassword\");\n \n // also save the jid that is used to connect to the jabber server\n muleJabberUserId = properties.getProperty(\"user\") + \"@\" + host;\n \n jabberClient = new JabberClient(host, conversationPartner, password);\n configureJabberClient(jabberClient);\n jabberClient.connect(jabberLatch);\n \n assertTrue(jabberLatch.await(STARTUP_TIMEOUT, TimeUnit.MILLISECONDS));\n }", "protected ConnectionListenerFactory getConnectionListenerFactory()\n {\n return clf;\n }", "public static AbstractSocialConnection createConnection(Properties pProperties){\n AbstractSocialConnection socConn = null;\n String strSocDataSource = pProperties.getProperty(SOCIAL_DATA_SOURCE);\n if (pProperties != null && strSocDataSource != null && !strSocDataSource.equals(\"\")){\n /** Creating a Twitter connection*/\n if (strSocDataSource.equals(UtilsConnection.TWITTER)){\n String tmpStr = pProperties.getProperty(UtilsConnection.DEPTH_LEVEL);\n int pDepthLevel = tmpStr!=null?Integer.parseInt(tmpStr):DEFAULT_DEPTH_LEVEL;\n if (verifyProperties(pProperties)){\n socConn = new TwitterConnection(pDepthLevel,\n pProperties.getProperty(UtilsConnection.CONSUMER_KEY),\n pProperties.getProperty(UtilsConnection.CONSUMER_SECRET),\n pProperties.getProperty(UtilsConnection.ACCESS_TOKEN),\n pProperties.getProperty(UtilsConnection.ACCESS_TOKEN_SECRET));\n socConn.initialize();\n }\n else\n LOGGER.error(\"OAuth connection parameters have not been defined!\");\n }\n else\n LOGGER.error(\"Social netword data source has not been defined!\");\n }\n return socConn;\n }", "@Test(timeout = 4000)\n public void test52() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getXAConnectionFactory();\n connectionFactories0.enumerateQueueConnectionFactory();\n connectionFactories0.clearXAQueueConnectionFactory();\n TopicConnectionFactory topicConnectionFactory0 = new TopicConnectionFactory();\n connectionFactories0.addTopicConnectionFactory(topicConnectionFactory0);\n TopicConnectionFactory[] topicConnectionFactoryArray0 = new TopicConnectionFactory[1];\n topicConnectionFactoryArray0[0] = topicConnectionFactory0;\n connectionFactories0.setTopicConnectionFactory(topicConnectionFactoryArray0);\n try { \n connectionFactories0.getConnectionFactory((-1925));\n fail(\"Expecting exception: IndexOutOfBoundsException\");\n \n } catch(IndexOutOfBoundsException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.exolab.jms.config.ConnectionFactories\", e);\n }\n }", "public ProyectFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public ConnectionManager() {\n }", "public ManagedHttpClientConnectionFactory(HttpMessageWriterFactory<HttpRequest> requestWriterFactory, HttpMessageParserFactory<HttpResponse> responseParserFactory) {\n/* 96 */ this(requestWriterFactory, responseParserFactory, null, null);\n/* */ }", "@Override\n public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {\n\n FacebookConnectionFactory fcf = new FacebookConnectionFactory(\n \"1487938974801143\",\n \"b53bfee1bbc43715311e12e109d90621\"\n );\n fcf.setScope(\"email\");\n cfConfig.addConnectionFactory(fcf);\n\n GoogleConnectionFactory gcf = new GoogleConnectionFactory(\"298688116141-tomf8f4jkunlankbd4c55nu9bp83h963.apps.googleusercontent.com\", \"iGEoPkecoD4Gu1RTjNKAoxFl\");\n gcf.setScope(\"profile\");\n cfConfig.addConnectionFactory(gcf);\n\n\n }", "private void setupBroker(String uri) {\n try {\n broker = BrokerFactory.createBroker(uri);\n\n VirtualDestinationInterceptor interceptor = new VirtualDestinationInterceptor();\n VirtualTopic virtualTopic = new VirtualTopic();\n virtualTopic.setName(\"VirtualOrders.>\");\n virtualTopic.setSelectorAware(true);\n VirtualDestination[] virtualDestinations = { virtualTopic };\n interceptor.setVirtualDestinations(virtualDestinations);\n broker.setDestinationInterceptors(new DestinationInterceptor[]{interceptor});\n\n SubQueueSelectorCacheBrokerPlugin subQueueSelectorCacheBrokerPlugin = new SubQueueSelectorCacheBrokerPlugin();\n BrokerPlugin[] updatedPlugins = {subQueueSelectorCacheBrokerPlugin};\n broker.setPlugins(updatedPlugins);\n\n broker.setUseJmx(false);\n broker.start();\n broker.waitUntilStarted();\n } catch (Exception e) {\n LOG.error(\"Failed creating broker\", e);\n }\n }", "private void createClient() {\n tc = new TestClient();\n }", "public static AbstractSocialConnection createConnection(Properties pProperties, String pDataSource){\n pProperties.put(SOCIAL_DATA_SOURCE, pDataSource);\n return createConnection(pProperties);\n }", "public void init(int yea)\n {\n try\n {\n InitialContext initialContext = new InitialContext(getProperties());\n //logger.info(\"initial context successful\");\n\n// ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup(\"/ConnectionFactory\");\n// System.out.println(\"lookup successful\");\n// Connection connection = connectionFactory.createConnection();\n//\n// Queue bridgeQueue = (Queue)initialContext.lookup(\"/queue/bridgeQueue\");\n// Queue himsQueue = (Queue)initialContext.lookup(\"/queue/himsQueue\");\n//\n// Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n// consumer = session.createConsumer(bridgeQueue);\n// producer = session.createProducer(himsQueue);\n\n System.out.println(\"connection successful\");\n //logger.info(\"Jms Connection factory and resources created without errors\");\n// connection.start();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n //logger.error(\"error looking up jms connection factory\", e);\n }\n }", "private DatabaseConnectionService() {\n ds = new HikariDataSource();\n ds.setMaximumPoolSize(20);\n ConfigProperties configProperties = ConfigurationLoader.load();\n if (configProperties == null) {\n throw new RuntimeException(\"Unable to read the config.properties.\");\n }\n ds.setDriverClassName(configProperties.getDatabaseDriverClassName());\n ds.setJdbcUrl(configProperties.getDatabaseConnectionUrl());\n ds.addDataSourceProperty(\"user\", configProperties.getDatabaseUsername());\n ds.addDataSourceProperty(\"password\", configProperties.getDatabasePassword());\n ds.setAutoCommit(false);\n }", "private CuratorFramework createCurator() {\n // Create list of Servers\n final String serverStr = sharedZookeeperTestResource.getZookeeperConnectString();\n final List<String> serverList = Arrays.asList(Tools.splitAndTrim(serverStr));\n\n // Create config map\n final Map<String, Object> config = new HashMap<>();\n config.put(\"servers\", serverList);\n\n return CuratorFactory.createNewCuratorInstance(config, getClass().getSimpleName());\n }", "public void createClient() {\n client = new UdpClient(Util.semIp, Util.semPort, this);\n\n // Le paso true porque quiero que lo haga en un hilo nuevo\n client.connect(true);\n }", "public interface KafkaClientFactory {\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Uses default Kafka cluster connection information (default == single configuration\n * found in Bootique; if none or more than one exists, an exception is thrown). Returned Consumer needs to be\n * closed by the calling code when it is no longer in use.\n *\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(ConsumerConfig<K, V> config);\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Returned Consumer needs to be closed by the calling code when it is no longer\n * in use.\n *\n * @param clusterName symbolic configuration name for the Kafka cluser coming from configuration.\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(String clusterName, ConsumerConfig<K, V> config);\n\n <K, V> Producer<K, V> createProducer(ProducerConfig<K, V>config);\n\n <K, V> Producer<K, V> createProducer(String clusterName, ProducerConfig<K, V>config);\n}", "private KafkaProducer<String, String> createProducer(String brokerList) {\n if (USERNAME==null) USERNAME = \"token\";\n\n Properties properties = new Properties();\n //common Kafka configs\n properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerList);\n properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SASL_SSL\");\n properties.put(SaslConfigs.SASL_MECHANISM, \"PLAIN\");\n properties.put(SaslConfigs.SASL_JAAS_CONFIG, \"org.apache.kafka.common.security.plain.PlainLoginModule required username=\\\"\" + USERNAME + \"\\\" password=\\\"\" + API_KEY + \"\\\";\");\n properties.put(SslConfigs.SSL_PROTOCOL_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"HTTPS\");\n //Kafka producer configs\n properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.CLIENT_ID_CONFIG, \"stocktrader-producer\");\n properties.put(ProducerConfig.ACKS_CONFIG, \"all\");\n properties.put(ProducerConfig.CLIENT_DNS_LOOKUP_CONFIG,\"use_all_dns_ips\");\n\n KafkaProducer<String, String> kafkaProducer = null;\n \n try {\n kafkaProducer = new KafkaProducer<>(properties);\n } catch (KafkaException kafkaError ) {\n logger.warning(\"Error while creating producer: \"+kafkaError.getMessage());\n Throwable cause = kafkaError.getCause();\n if (cause != null) logger.warning(\"Caused by: \"+cause.getMessage());\n throw kafkaError;\n }\n return kafkaProducer;\n }", "@Override\n\tpublic void createClient() {\n\t\t\n\t}", "public SqlConnection createConnection() {\n return new SqlConnection(this, VM.getOrThrow());\n }", "@Override\n\tpublic SwimConnection createInstance() {\n\t\tSwimConnection connection = null;\n\t\t\n\t\tif (this.hasSpecification()) {\n\t\t\tif (this.getSpecification().getId().equals(Specification.CONNECTION_SWIM_SIMULATED_ID)) {\n\t\t\t\tSimulatedSwimConnectionProperties properties = (SimulatedSwimConnectionProperties) this.getSpecification().getProperties();\n\t\t\t\tconnection = new SimulatedSwimConnection(\n\t\t\t\t\t\tproperties.getResourceDirectory(),\n\t\t\t\t\t\tDuration.ofMillis(properties.getUpdatePeriod()),\n\t\t\t\t\t\tproperties.getUpdateProbability(),\n\t\t\t\t\t\tproperties.getUpdateQuantity());\n\t\t\t\tif (properties.getSubscribesAIXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.AIXM);\n\t\t\t\tif (properties.getSubscribesFIXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.FIXM);\n\t\t\t\tif (properties.getSubscribesWXXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.WXXM);\n\t\t\t\tif (properties.getSubscribesIWXXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.IWXXM);\n\t\t\t\tif (properties.getSubscribesAMXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.AMXM);\n\t\t\t} else if (this.getSpecification().getId().equals(Specification.CONNECTION_SWIM_LIVE_ID)) {\n\t\t\t\tLiveSwimConnectionProperties properties = (LiveSwimConnectionProperties) this.getSpecification().getProperties();\n\t\t\t\tconnection = new LiveSwimConnection();\n\t\t\t\t// TODO: set properties for live SWIM connection\n\t\t\t\tif (properties.getSubscribesAIXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.AIXM);\n\t\t\t\tif (properties.getSubscribesFIXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.FIXM);\n\t\t\t\tif (properties.getSubscribesWXXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.WXXM);\n\t\t\t\tif (properties.getSubscribesIWXXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.IWXXM);\n\t\t\t\tif (properties.getSubscribesAMXM())\n\t\t\t\t\tconnection.subscribe(SwimProtocol.AMXM);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn connection;\n\t}", "ManagedConnection createManagedConnection(ExecutionContext ec, Map<String, Object> transactionOptions);", "private WebSocket connect() throws Exception\n {\n return new WebSocketFactory()\n .setConnectionTimeout(TIMEOUT)\n .createSocket(SERVER)\n .addListener(new WebSocketAdapter() {\n // A text message arrived from the server.\n public void onTextMessage(WebSocket websocket, String message) {\n if(message.contains(\"ticker\")) {\n List<Object> decodeMessage = GSON.fromJson(message, new TypeToken<List<Object>>() {}.getType());\n if (decodeMessage.size() == 4) {\n val ticker = decodeMessage.get(2);\n if (ticker instanceof String && ((String) ticker).equalsIgnoreCase(\"ticker\")) {\n Map<String, List<Object>> ticks = (Map<String, List<Object>>) decodeMessage.get(1);\n val ask = Double.parseDouble((String) ticks.get(\"a\").get(0));\n val bid = Double.parseDouble((String) ticks.get(\"b\").get(0));\n val krakenCurrencyPair = (String)decodeMessage.get(3);\n val currencyPair = CurrencyPair.of(krakenCurrencyPair.substring(0,3), krakenCurrencyPair.substring(4,7));\n outBoundBus.post(PriceUpdateEvent.of(BidAsk.of(bid,ask),currencyPair, Exchange.KRAKEN));\n }\n }\n\n }\n }\n })\n .addExtension(WebSocketExtension.PERMESSAGE_DEFLATE)\n .connect();\n }", "private PaymentService makeNewConnection()\n throws Exception {\n try {\n\n //TO-DO.. load property file and create new connection\n PaymentService paymentservice = new PaymentService(url, appId, user, password, rcode, domainId, false);\n // Load database driver if not already loaded\n// Class.forName(driver);\n// // Establish network connection to database\n// PaymentService connection =\n// DriverManager.getConnection(url, username, password);\n return (paymentservice);\n } catch (Exception cnfe) {\n // Simplify try/catch blocks of people using this by\n // throwing only one exception type.\n throw new Exception(cnfe.getMessage());\n }\n }", "public DefaultConnectingIOReactor(final IOEventHandlerFactory eventHandlerFactory) {\n this(eventHandlerFactory, null, null);\n }", "public Connection createRealConnection(String propertiesStr, String userName, String password) {\n\t\tDebug.println(\"Create real connection for initialized id factory, propertiesStr: \" +propertiesStr + \" userName: \" + userName + \" pass: \" + password);\n\t\tConnection originalConn = null;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t // Setup the connection with the DB\n\t try {\n\t \t originalConn = DriverManager\n\t\t\t .getConnection(propertiesStr, userName, password);\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\tDebug.println(\"Successfully create real connection for initializing id factory\");\n\t\treturn originalConn;\n\t}", "public abstract Connection getConnection();", "private void setupMqttEndpoint() {\n\n this.mqttEndpoint\n .publishHandler(this::publishHandler)\n .publishAcknowledgeHandler(this::pubackHandler)\n .publishReleaseHandler(this::pubrelHandler)\n .publishReceivedHandler(this::pubrecHandler)\n .publishCompletionHandler(this::pubcompHandler)\n .subscribeHandler(this::subscribeHandler)\n .unsubscribeHandler(this::unsubscribeHandler)\n .disconnectHandler(this::disconnectHandler)\n .closeHandler(this::closeHandler);\n }", "abstract ManagedChannel createChannel(List<ServerInfo> servers);", "@Test(timeout = 4000)\n public void test64() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getXATopicConnectionFactory();\n ConnectionFactory[] connectionFactoryArray0 = new ConnectionFactory[2];\n ConnectionFactory connectionFactory0 = new ConnectionFactory();\n connectionFactoryArray0[0] = connectionFactory0;\n ConnectionFactory connectionFactory1 = new ConnectionFactory();\n connectionFactoryArray0[1] = connectionFactory1;\n connectionFactories0.setConnectionFactory(connectionFactoryArray0);\n assertEquals(2, connectionFactories0.getConnectionFactoryCount());\n }", "static RabbitConnectionFactoryConfig uriToConnectionConfig(String uri) {\n RabbitConnectionFactoryConfig properties = new RabbitConnectionFactoryConfig();\n if (isNotEmpty(uri)) {\n String username = StringUtils.substringBetween(uri, \"amqp://\", \":\");\n String password = StringUtils.substringBetween(uri, username + \":\", \"@\");\n String hostWithPort = StringUtils.substringBetween(uri, \"@\", \"/\");\n\n // If no virtual host is specified\n if (isEmpty(hostWithPort)) {\n hostWithPort = StringUtils.substringAfter(uri, \"@\");\n }\n\n int port = properties.getPort();\n String host = hostWithPort;\n boolean hasPort = StringUtils.contains(hostWithPort, \":\");\n if (hasPort) {\n host = StringUtils.substringBefore(hostWithPort, \":\");\n port = NumberUtils.toInt(StringUtils.substringAfter(hostWithPort, \":\"));\n }\n String virtualHost = StringUtils.substringAfter(uri, hostWithPort + \"/\");\n\n\n properties.setUsername(username);\n properties.setPassword(password);\n properties.setHost(host);\n properties.setPort(port);\n\n if (isNotEmpty(virtualHost)) {\n properties.setVirtualHost(virtualHost);\n }\n\n }\n return properties;\n }", "private void connectUsingToken() {\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(sslContext.getSocketFactory());\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ClientTSap(SocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }" ]
[ "0.69724345", "0.66450566", "0.66145205", "0.6519932", "0.6463706", "0.6403766", "0.63509065", "0.63258374", "0.61197156", "0.61143327", "0.6104527", "0.6101801", "0.6055812", "0.605495", "0.60024875", "0.5970798", "0.59413904", "0.5913599", "0.5899801", "0.58669376", "0.58362097", "0.58358413", "0.5835541", "0.58313715", "0.58309233", "0.58112496", "0.5806851", "0.58033144", "0.57576513", "0.57270557", "0.570363", "0.569693", "0.5690086", "0.56819975", "0.56600946", "0.56383353", "0.56274563", "0.5613021", "0.56080157", "0.55994785", "0.5595736", "0.55932724", "0.55846", "0.55552924", "0.55498415", "0.5548308", "0.5547071", "0.5546104", "0.5539736", "0.5536472", "0.5525301", "0.55188996", "0.5511875", "0.5504339", "0.5497989", "0.5485289", "0.54766124", "0.5474647", "0.5458377", "0.54550636", "0.5452318", "0.54403", "0.54396266", "0.5419089", "0.5396525", "0.53868777", "0.53752923", "0.53721315", "0.5371724", "0.5367694", "0.5366951", "0.535872", "0.5357043", "0.5351099", "0.534848", "0.5344852", "0.53200096", "0.5319523", "0.53121597", "0.53086996", "0.5297753", "0.5295788", "0.5288381", "0.52861506", "0.5281235", "0.527998", "0.52692765", "0.52664644", "0.5260487", "0.5259181", "0.52588946", "0.52569973", "0.5251126", "0.5248548", "0.5244663", "0.5244147", "0.5242155", "0.5239582", "0.5233598", "0.52249825" ]
0.66582954
1
Message listener adapter to listen on new messages
@Bean MessageListenerAdapter adapter(final Receiver receiver) { MessageListenerAdapter messageListener = new MessageListenerAdapter(receiver); messageListener.setDefaultListenerMethod("receiveMessage"); return messageListener; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void addMessageReceivedListener(MessageReceivedListener messageReceivedListener) {\n\n\t}", "@Override\r\n public void setListener() {\n input.setInputListener(this);\r\n\r\n //bind load more listener, it will track scroll up\r\n messagesAdapter.setLoadMoreListener(this);\r\n\r\n //bind on message long click\r\n messagesAdapter.setOnMessageLongClickListener(this);\r\n\r\n //get called when a incoming message come..\r\n socketManager.getSocket().on(\"updateChat\", new Emitter.Listener() {\r\n @Override\r\n public void call(Object... args) {\r\n String messageData = (String) args[0];\r\n Gson gson = new Gson();\r\n _Message message = gson.fromJson(messageData, _Message.class);\r\n\r\n //double check for valid room\r\n if (me.isValidRoomForUser(message.getRoomName())) {\r\n\r\n //sometime nodejs can broadcast own message so check and message should be view immediately\r\n\r\n if(!message.getUser().getId().equals(me.getId())) {\r\n //save new incoming message to realm\r\n saveOrUpdateNewMessageRealm(message);\r\n\r\n //check and save validity of room incoming user\r\n runOnUiThread(() -> {\r\n\r\n messagesAdapter.addToStart(message, true);\r\n });\r\n }\r\n\r\n }\r\n }\r\n });\r\n }", "public interface MessageListener {\n\t\n\t/**\n\t * Method used to consume message\n\t * @param message\tMessage that You want to consume\n\t */\n\tvoid consumeMessage(String message);\n\t\n\t/**\n\t * Method used when You want to get all consumed messages\n\t * @return\tList of messages consumed from a jms queue/topic\n\t */\n\tList<String> getFeeds();\n\n}", "void onNewMessage(String message);", "public void OnMessageReceived(String msg);", "void onMessageReceived(Message message);", "public interface MessageReceivedListener {\n\t\n\t/**\n\t * Called when new command/message received\n\t * @param msg Command/message as String\n\t */\n\tpublic void OnMessageReceived(String msg);\n\t\n\t/**\n\t * Called when new file is incoming.\n\t * @param length Total length of data expected to be received\n\t * @param downloaded Total length of data actually received so far\n\t */\n\tpublic void OnFileIncoming(int length);\n\t\n\t/**\n\t * Called when more data of a file has been transfered\n\t * @param data Byte array of data received\n\t * @param read The lenght of the data received as int\n\t * @param length Total length of data expected to be received\n\t * @param downloaded Total length of data actually received so far\n\t */\n\tpublic void OnFileDataReceived(byte[] data,int read, int length, int downloaded);\n\t\n\t/**\n\t * Called when file transfer is complete\n\t * @param got\n\t * @param expected\n\t */\n\tpublic void OnFileComplete();\n\t\n\t/**\n\t * Called when an error occur\n\t */\n\tpublic void OnConnectionError();\n\t\n\t/**\n\t * Called when socket has connected to the server\n\t */\n\tpublic void OnConnectSuccess();\n}", "@Override\n\t\t\tpublic void onEmsgOpenedListener() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "public void addGetMessagesListener(XMPPConnection connection){\n\t PacketFilter filter = new MessageTypeFilter(Message.Type.chat);\n connection.addPacketListener(new PacketListener() {\n @Override\n public void processPacket(Packet packet) {\n Message message = (Message) packet;\n if (message.getBody() != null) {\n String fromName = StringUtils.parseBareAddress(message.getFrom());\n Log.i(\"XMPPChatDemoActivity \", \" Text Recieved \" + message.getBody() + \" from \" + fromName);\n messages.add(fromName + \":\");\n messages.add(message.getBody());\n // Add the incoming message to the list view\n mHandler.post(new Runnable() {\n public void run() {\n setListAdapter();\n }\n });\n }\n }\n }, filter);\n }", "void subscribeReceiveListener(IDataReceiveListener listener);", "public interface MessagingQueueListener {\n\n void onMessage(MessageEvent messageEvent);\n}", "@Override\n\t\t\t\t\tpublic void listen(String mess) {\n\t\t\t\t\t\tif (TextUtils.isEmpty(mess)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//mess信息 自己说的话\n\t\t\t\t\t\tMessageBean mb = new MessageBean();\n\t\t\t\t\t\tmb.messType = MessageBean.ASKER;\n\t\t\t\t\t\tmb.content = mess;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//答\n\t\t\t\t\t\tMessageBean mb2 = SmartAnswerUtils.parse(mess);\n\t\t\t\t\t\t//添加到容器中\n\t\t\t\t\t\tmDatas.add(mb);\n\t\t\t\t\t\tmDatas.add(mb2);\n\t\t\t\t\t\tmyAdapter.notifyDataSetChanged();\n\t\t\t\t\t}", "public interface MessageListener {\n\n\t/*\n\t *\tCalled on message reception after sending message\n\t *\tif a response is received\n\t *\n\t *\t@param message The message response\n\t *\t@param replyTo The replyTo destination (null for no reply)\n\t */\n\tpublic void onMessage(Message message, URI replyTo) throws MMPMessageException;\n}", "public void onMessage(String message) {\n\t\t\n\t}", "public interface MessageListener extends Listener {\n void onMessage(String roomId, MessageObject object);\n void onAgentDisconnect(String roomId, MessageObject object);\n}", "public void onMessage(Message message) {\n lastMessage = message;\n\n }", "public interface OnChatListener {\n void onSendMessage(Bundle b);\n }", "public interface SubscriptionListener {\n public void onReceivedMessage(String message);\n}", "public interface OnMessageReceived {\n public void messageReceived(String message);\n }", "public void onMessage(int extensionInstanceID, String message) {\n }", "public interface OnEventAvailableListener {\n\tpublic void OnEventAvailable(Message msg);\n}", "public interface OnMessageReceived {\n void messageReceived(String message);\n }", "private void onMessage(JsonRpcMessage msg) {\n List<JsonRpcMessage> extraMessages = super.handleMessage(msg, true);\n notifyMessage(msg);\n for(JsonRpcMessage extraMsg: extraMessages) {\n notifyMessage(extraMsg);\n }\n }", "public IncomingMsgHandler(OnMessageReceivedListener listener) {\n listenerReference = new WeakReference<>(listener);\n }", "public interface OnMessageReceived {\n\t\tpublic void messageReceived(String message);\n\t}", "@Override\n\t\t\tpublic void onMessage(WebSocket conn, String message) {\n\t\t\t\tif(listener!=null) listener.onMessage(\"\"+message);\n\t\t\t}", "abstract void onMessage(byte[] message);", "public void onMessage(String message) {\n\t\t\t\t\tCometMessage msg = deserializeMessage(message);\n\t\t\t\t\tif(msg != null)\n\t\t\t\t\t\tlistener.onMessage(msg);\n\t\t\t\t}", "public interface OnAboutForMeMessageUpdateListener {\r\n void onAboutForMeMessage(String text);\r\n}", "public void setupSendMessageListener() {\n\t\tetMessage.setOnEditorActionListener(new TextView.OnEditorActionListener() {\n\t\t\tpublic boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n\t\t\t\tif (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_NULL) {\n\t\t\t\t\tupdateHandler.post(sendmsgRunner);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\t\n\t}", "void onMessage(String pattern, String channel, String message);", "@Override\n\tpublic void onMessageReceived(Message m) {\n\t\thandle.addMessage(m);\n\t\trefreshMessages();\n\t}", "public interface MsgListener {\n\n public void handlerMsg(Channel ctx, SocketMsg msg);\n}", "public void onMessage(Session session);", "@Override\n public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) {\n listener.update(String.valueOf(message.getPayload()));\n }", "@Override\n public void onEvent(EMNotifierEvent event) {\n message = (EMMessage) event.getData();\n messageBean.setGetMsgCode(MessageContant.receiveMsgByListChanged);\n messageBean.setEmMessage(message);\n\n eventBus.post(messageBean);\n }", "public void addMessageListener(SocketListener sl_arg){\n\t\tsl = sl_arg;\n\t}", "private void onReceiveChatMessages() {\n\n//\t\tL.debug(\"onReceiveChatMessages\");\n//\n//\t\t// called from NetworkChangeReceiver whenever the user is logged in\n//\t\t// will always be called whenever there is a change in network state,\n//\t\t// will always check if the app is connected to server,\n//\t\tXMPPConnection connection = XMPPLogic.getInstance().getConnection();\n//\n//\t\tif (connection == null || !connection.isConnected()) {\n//\t\t\tSQLiteHandler db = new SQLiteHandler(getApplicationContext());\n//\t\t\tdb.openToWrite();\n//\n//\t\t\t// db.updateBroadcasting(0);\n//\t\t\t// db.updateBroadcastTicker(0);\n//\n//\t\t\tAccount ac = new Account();\n//\t\t\tac.LogInChatAccount(db.getUsername(), db.getEncryptedPassword(), db.getEmail(), new OnXMPPConnectedListener() {\n//\n//\t\t\t\t@Override\n//\t\t\t\tpublic void onXMPPConnected(XMPPConnection con) {\n//\t\t\t\t\t\n//\t\t\t\t\t//addPacketListener(con);\n//\t\t\t\t}\n//\n//\t\t\t});\n//\n//\t\t\tdb.close();\n//\t\t} else {\n//\n//\t\t\t//addPacketListener(connection);\n//\n//\t\t}\n\t}", "@Override\n public void onMessage(Context context, Intent intent) {\n \tNoteApplication app = (NoteApplication) getApplication();\n \tapp.notifyListener(intent);\n }", "public interface SmsListener {\n\n public void messageReceived(String message);\n}", "public interface OnReceiveListener {\n\n /**\n * Called when client receives a message.\n * @param response received message.\n */\n void onReceive( String response );\n }", "public interface MessageReceived {\n void onMessageReceived(String message);\n}", "public interface ClientUpdateListener {\n\n /**\n * This method notify the implementer that a message has been received\n *\n * @param message the received message from the server\n */\n void onUpdate(Message message);\n}", "public TcpClient(OnMessageReceived listener) {\n\n messageListener = listener;\n }", "public void onMessage(Message arg0) {\n\r\n\t}", "public interface SendMessageListener {\n abstract void onSendOK(Message msg);\n\n abstract void onSendFailed(Message msg, String reason);\n}", "@Override\n\tpublic void onMessage(Object arg0) {\n\t\t\n\t}", "public interface SocketMessageListerner {\n void onGetMessageAck(Message message, int type);\n}", "public interface RubiconMessageListener {\n\t\n\t/**\n\t * Message handlers must override this method to handle incoming messages\n\t * @param message the {@Link RubiconMessage} just received\n\t * @param destination the {@Link RubiconAddress} of the intended destination\n\t */\n\tpublic void handleMessageReceived(RubiconMessage message, RubiconAddress destination); \n}", "public interface Listener {\n\n public void onRecievedCustomBroadCast(String msg);\n}", "@Bean\n\tMessageListenerAdapter listenerAdapter(MessageListener receiver) {\n\t\treturn new MessageListenerAdapter(receiver, \"receiveMessage\");\n\t}", "@Override\n\tpublic void onMessage( String message ) {\n\t\tlog.info(\"received: \" + message);\n\t}", "void onMessageRead(byte[] data);", "@OnMessage\n\n public void onMessage(String message) {\n\n System.out.println(\"Received msg: \" + message);\n\n }", "public void onRecvServerChatMsg(WsMessage.ServerPushChatMsg msg) {\n if (msg != null && msg.list != null && msg.list.size() > 0) {\n for (int i = 0; i < msg.list.size(); i++) {\n WsMessage.ChatMsg chatMsg = msg.list.get(i);\n ChatManager.GetInstance().onReceiveChatMsg(chatMsg.username, chatMsg.msg, \"\", chatMsg.userid, chatMsg.admin);\n }\n ((Activity) this.mContext).runOnUiThread(new Runnable() {\n public void run() {\n ChatManager.GetInstance().notifyChatHistoryDataSetChanged();\n }\n });\n }\n }", "public void addListener(IMessageListener newListener) {\n synchronized (listeners) {\n listeners.add(newListener);\n }\n }", "public void onMessage(Session session, Object message) throws IOException {\n\t}", "@EventName(\"receivedMessageFromTarget\")\n EventListener onReceivedMessageFromTarget(EventHandler<ReceivedMessageFromTarget> eventListener);", "private void receiveMessage() {\n ParseQuery<ParseObject> refreshQuery = ParseQuery.getQuery(\"Group\");\n\n refreshQuery.getInBackground(mGroupId, new GetCallback<ParseObject>() {\n @Override\n public void done(ParseObject parseObject, ParseException e) {\n if (e == null) {\n chatMessageArray = parseObject.getList(\"groupMessageArray\");\n\n messageArrayList.clear();\n messageArrayList.addAll(chatMessageArray);\n chatListAdapter.notifyDataSetChanged();\n chatLV.invalidate();\n } else {\n System.out.println(e.getMessage());\n }\n }\n });\n }", "public synchronized void addListener(PeerMessageListener ml)\n\t{\n\t\t_ml = ml;\n\t\tdequeueMessages();\n\t}", "public synchronized void handleMessage(String message) {\n Log.d(TAG, \"incoming message:\" + message);\n OnMessageReceivedListener listener = listenerReference.get();\n if(listener != null) {\n Log.d(TAG, \"listener not null. Handling message..\");\n listener.handleMessage(message);\n }\n else {\n Log.d(TAG, \"listener null!!\");\n }\n }", "public void handleMessageReceived(SessionEvent event) {\n \t\tfor(int i = 0; i < getMessageListeners().size(); i++) {\n \t\t\tIMessageListener l = (IMessageListener) getMessageListeners().get(i);\n \t\t\tID from = makeIDFromName(event.getFrom());\n \t\t\tID to = makeIDFromName(event.getTo());\n \t\t\tl.handleMessage(\n \t\t\t\t\tfrom, \n \t\t\t\t\tto, \n \t\t\t\t\tIMessageListener.Type.NORMAL, \n \t\t\t\t\tevent.getFrom(), \n \t\t\t\t\tevent.getMessage());\n \t\t}\n \t}", "@Override\r\n\t\t\tpublic void onChat(String message) {\n\r\n\t\t\t}", "public void addMessageReceivedEventListener(ILogCatMessageEventListener l) {\n mLogCatMessageListeners.add(l);\n }", "public void setMessageListener(BeaterMessageListener l) {\n\t\tthis.listener = l;\n\t}", "@Override\n\tpublic void onChatReceived(ChatEvent arg0) {\n\t\t\n\t}", "void onMessage(String message) throws IOException;", "SourceMessage onNewMessageReceived(PubsubMessage pubsubMessage, AckReplyConsumer ackReplyConsumer);", "public interface theListener {\n public void itemToSend(String s);\n }", "@Override\n\tpublic void StartListening()\n\t{\n\t\t\n\t}", "@Subscribe(threadMode = ThreadMode.MAIN)\n public void onMessageEvent(MessageEvent event) {\n\n // Display message in TextView\n logMessage(event.getMessage());\n }", "public void onMessage(Message msg) {\r\n if (logger.isLoggable(BasicLevel.DEBUG))\r\n logger.log(BasicLevel.DEBUG, \"MBSConnectionDelegate.onMessage(..): \" + msg);\r\n\r\n if (! (msg instanceof ObjectMessage)) {\r\n logger.log(BasicLevel.ERROR,\r\n \"JMSConnector.onMessage: message received is not an ObjectMessage:\" + msg);\r\n return;\r\n }\r\n\r\n NotificationDesc notificationDesc = null;\r\n try {\r\n notificationDesc = (NotificationDesc) ((ObjectMessage) msg).getObject();\r\n } catch (Exception exc) {\r\n logger.log(BasicLevel.ERROR, \"MBSConnectionDelegate.onMessage:\", exc);\r\n return;\r\n }\r\n\r\n try {\r\n List<NotificationListenerDesc> list = hashTableNotificationListener.get(notificationDesc.name);\r\n if (list != null) {\r\n Iterator<NotificationListenerDesc> it = list.iterator();\r\n while (it.hasNext()) {\r\n try {\r\n NotificationListenerDesc listenerDesc = it.next();\r\n if ((listenerDesc.filter != null) &&\r\n ! listenerDesc.filter.isNotificationEnabled(notificationDesc.not)) {\r\n continue;\r\n }\r\n listenerDesc.listener.handleNotification(notificationDesc.not, listenerDesc.handback);\r\n } catch (Exception exc) {\r\n logger.log(BasicLevel.ERROR,\r\n \"MBSConnectionDelegate.onMessage: Error handling notification\", exc);\r\n }\r\n }\r\n }\r\n } catch (Exception exc) {\r\n logger.log(BasicLevel.ERROR, \"MBSConnectionDelegate.onMessage:\", exc);\r\n }\r\n }", "@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n }", "private void addMessageListener(TransportAddress localAddr, MessageTypeEventHandler<?> messageListener) {\n EventDispatcher child = children.get(localAddr);\n if (child == null) {\n child = new EventDispatcher();\n children.put(localAddr, child);\n }\n child.addMessageListener(messageListener);\n }", "public interface MessageHandler {\n void onMessage(final byte messageType, final int messageId, final byte[] buffer, final int startIndex, final int length);\n}", "@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}", "void onListeningStarted();", "private void listenOnlineUsers() {\n final String username = MyAccount.getInstance().getName();\n new Subscriber(Constants.ONLINE_TOPIC, username)\n .setNewMessageListener(new SubscribedTopicListener() {\n @Override\n public void onReceive(DataTransfer message) {\n // Get current user in chat box\n ChatBox currentChatBox = getCurrentChat();\n final String current = currentChatBox != null ? currentChatBox.getTarget() : null;\n\n boolean isCurrentOnline = current == null;\n\n // Clear all exist chat item\n lvUserItem.getItems().clear();\n\n // Retrieve online users\n List<String> onlineUsers = (List<String>) message.data;\n\n // Clear all offline user chat messages in MessageManager\n MessageManager.getInstance().clearOffline(onlineUsers);\n MessageSubscribeManager.getInstance().clearOffline(onlineUsers);\n\n for (String user : onlineUsers) {\n // Add user (not your self) into listview\n if (!username.equals(user)) {\n ChatItem item = new UserChatItem();\n item.setName(user);\n lvUserItem.getItems().add(item);\n\n // Check whether current user still online\n if (user.equals(current))\n isCurrentOnline = true;\n else {\n String topic = String.format(\"chat/%s\", user);\n if (!MessageSubscribeManager.getInstance().containsKey(topic)) {\n // with other user listen message\n Subscriber subscriber = subscribeMessages(username, topic);\n MessageSubscribeManager.getInstance().put(topic, subscriber);\n }\n }\n }\n }\n\n // In case current user offline\n // Clear chat box\n if (!isCurrentOnline) {\n clearChatBox();\n }\n }\n })\n .listen();\n }", "public interface ClientListener {\n\t/**\n\t * Fired when client list should be updated\n\t * \n\t * @param clients Array of clients\n\t */\n void onClientsUpdated(String[] clients);\n \n /**\n * Fired when a message has been received\n * \n * @param message Message that was received\n */\n void onMessageReceived(Message message);\n \n /**\n * Fired when client has been disconnected from server\n */\n void onDisconnected();\n}", "@Override\r\n\tpublic void onMessage(BmobMsg message) {\n\t\trefreshNewMsg(message);\r\n\t}", "public void messageReceived(Message m) {\n\t\t\r\n\t}", "@Override\n public void receiveMessage(String message) {\n }", "public void addMessageListener(final TidyMessageListener listener)\n {\n this.listener = listener;\n }", "public interface EventListener {\n void onMessage(GenericRequest message);\n}", "public MessageListener getMessageListener() {\n return listener;\n }", "public void addConversationListener(ConversationListener<? super E> listener);", "public void addMessage(EventMessage message) {\n }", "private void hookUpMessageListAdapter(){\n DeviceSingleton deviceSingleton = DeviceSingleton.getInstance();\n this.arrayAdapter = new ArrayAdapter<String>(\n this,\n android.R.layout.simple_list_item_1,\n deviceSingleton.getTempTextArray() );\n// messageList.setAdapter(arrayAdapter);\n\n\n //ADD MessageAdapter here to replace above stuff\n messageObjectList = deviceSingleton.getMessages();\n messageList = (ListView) findViewById(R.id.listView);\n messageObjectAdapter = new MessageAdapter(this, R.layout.single_row, messageObjectList);\n messageList.setAdapter(messageObjectAdapter);\n ///////////////////////////////////////////\n }", "public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }", "abstract public boolean onMessageReceived(MMXMessage message);", "public interface OnMessagingServiceConnetcedListenner {\n void onServiceConnected();\n}", "@Override\n public void onMessageReceived(MessageEvent messageEvent) {\n if(messageEvent.getPath().equals(BTCommType.GET_CONTACTS.toString())) {\n dataMap = DataMap.fromByteArray(messageEvent.getData());\n contacts = new ContactSync(dataMap);\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mAdapter.notifyDataSetChanged();\n loadAdapter();\n }\n });\n }\n\n if(messageEvent.getPath().equals(BTCommType.GET_DRAWINGS.toString())) {\n List<AMessage> messages = new ArrayList<AMessage>();\n DataMap data = DataMap.fromByteArray(messageEvent.getData());\n\n List<String> emojis = data.getStringArrayList(\"emojis\");\n List<Integer> pos = data.getIntegerArrayList(\"emojisPositions\");\n\n int messageAmount = data.getInt(\"amountOfMessages\");\n for (int i = 0; i < messageAmount; i++) {\n if(pos.contains(i)){\n Emoticon emoji = new Emoticon(EmoticonType.valueOf(emojis.get(0)).getRes());\n emojis.remove(0);\n messages.add(emoji);\n } else {\n Drawing drawing = new Drawing(data.getFloatArray(\"y-coordinates \" + i)\n , data.getFloatArray(\"x-coordinates \" + i)\n , data.getLongArray(\"drawing-times \" + i)\n , data.getStringArray(\"actions \" + i)\n , data.getByteArray(\"staticDrawing \" + i));\n messages.add(drawing);\n }\n\n }\n Log.e(\"drawings\", \"new drawings\");\n MessageHolder.getInstance().setDrawings(messages);\n if(messageAmount < 1){\n Toast.makeText(getApplicationContext(), \"No messages found\", Toast.LENGTH_SHORT).show();\n }\n else {\n Intent intent = new Intent(this, ConversationViewActivity.class);\n intent.putExtra(BTCommType.SEND_TO_CONTACT.toString(), contact);\n startActivity(intent);\n this.finish();\n }\n }\n }", "Move listen(IListener ll);", "@Override\n\tpublic void onMessageReceived(List<EMMessage> messages) {\n\t\tsuper.onMessageReceived(messages);\n\t\tconversationListFragment = new ConversationListFragment();\n\t\tconversationListFragment.refresh();\n\t}", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase 1:\n\n\t\t\t\t\tlistView.setAdapter(new ListAdaptersujin(ListActivity.this, app\n\t\t\t\t\t\t\t.getList()));\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void onMessage(Message message) {\n\t\t\t\tTextMessage msg = null;\n\t\t\t\t\n\t\t\t\tif(message instanceof TextMessage){\n\t\t\t\t\tmsg = (TextMessage)message;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.println(\"Consumer:->Receiving message: \"+ msg.getText());\n\t\t\t\t\t} catch (JMSException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"Message of wrong type: \"+message.getClass().getName());\n\t\t\t\t}\n\t\t\t}", "private void addMessageListener(MessageTypeEventHandler<?> messageListener) {\n if (!messageListeners.contains(messageListener)) {\n messageListeners.add(messageListener);\n }\n }", "public void onLogMessage(String message);", "public <MESSAGE extends IMessage>\n void setAdapter(MessagesListAdapter<MESSAGE> adapter, OnMessageGestureListener listener) {\n setAdapter(adapter, true);\n\n final ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {\n\n @Override\n public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {\n return false;\n }\n\n @Override\n public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {\n MESSAGE message = adapter.getMessageByIndex(viewHolder.getAdapterPosition());\n if (direction == ItemTouchHelper.LEFT) {\n listener.onSwipeLeft(message);\n } else if (direction == ItemTouchHelper.RIGHT) {\n listener.onSwipeRight(message);\n }\n\n if (listener.isRestoreSwiped()) {\n adapter.notifyDataSetChanged();\n } else {\n adapter.delete(message);\n }\n }\n });\n itemTouchHelper.attachToRecyclerView(this);\n }" ]
[ "0.76486737", "0.7607106", "0.725911", "0.723076", "0.6966563", "0.6946663", "0.6865775", "0.6861961", "0.68415713", "0.68190736", "0.6737756", "0.6735256", "0.670578", "0.6683428", "0.6664629", "0.664691", "0.6641266", "0.66146946", "0.6604346", "0.65853626", "0.65735894", "0.6556875", "0.65313494", "0.64909065", "0.6484398", "0.64781135", "0.6438562", "0.6428886", "0.6427619", "0.6404139", "0.6397428", "0.63923454", "0.63904893", "0.63881475", "0.63875127", "0.6367484", "0.6360519", "0.63568246", "0.6351588", "0.63483644", "0.6343712", "0.6314983", "0.6312761", "0.6311028", "0.6310754", "0.6305376", "0.629843", "0.6297153", "0.6283561", "0.6275889", "0.6269449", "0.6242227", "0.6235173", "0.6229866", "0.62259495", "0.62227595", "0.62206763", "0.622015", "0.621637", "0.6215327", "0.6209616", "0.61946434", "0.6189474", "0.6184443", "0.61613363", "0.61562836", "0.6149734", "0.6148222", "0.6147963", "0.61462337", "0.61420804", "0.61418927", "0.61380166", "0.6137272", "0.61295855", "0.6126135", "0.6116542", "0.6114345", "0.6109313", "0.6087549", "0.6085656", "0.6074678", "0.6062331", "0.60606307", "0.6054537", "0.60514", "0.6031174", "0.6023201", "0.60181683", "0.6013309", "0.6008905", "0.6000706", "0.5997246", "0.5992634", "0.59916145", "0.5989097", "0.59820837", "0.5976433", "0.59748936", "0.5972141" ]
0.63067585
45
Creates the listener container which connects the listener with the destination
@Bean SimpleMessageListenerContainer container(final MessageListenerAdapter messageListener, final ConnectionFactory connectionFactory) { SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); container.setMessageListener(messageListener); container.setConnectionFactory(connectionFactory); container.setDestinationName(DESTINATION); return container; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createAndListen() {\n\n\t\t\n\t}", "@Override\r\n\tnative long createListenerProxy(EventSink eventSink);", "WithCreate withDestination(EventChannelDestination destination);", "public SimpleMessageListenerContainer() {\n\t}", "Future<CreateListenerResponse> createListener(\n CreateListenerRequest request,\n AsyncHandler<CreateListenerRequest, CreateListenerResponse> handler);", "public void init() {\n ContainerProperties containerProperties = buildContainerProperties();\n this.messageListenerContainer = buildMessageListenerContainer( consumerFactory, containerProperties );\n }", "@Bean\n\tSimpleMessageListenerContainer container(ConnectionFactory connectionFactory,\n\t\t\tMessageListenerAdapter listenerAdapter) {\n\t\tSimpleMessageListenerContainer container = new SimpleMessageListenerContainer();\n\t\tcontainer.setConnectionFactory(connectionFactory);\n\t\tcontainer.setQueueNames(SUBSCRIBE_QUEUE);\n\t\tcontainer.setMessageListener(listenerAdapter);\n\t\treturn container;\n\t}", "public ConversionListener createListener(ConfigProperties cprop){\n\t\tjlog.info(\"Create Listener \"+cprop.getProperty(\"PROJ.id\"));\n\t\treturn new ConversionListener(cprop.getProperty(\"PROJ.id\"));\n\t}", "public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}", "Contender createContender();", "Client(Terminal terminal, String dstHost, int dstPort, int srcPort) {\n\t\ttry {\n\t\t\tthis.terminal= terminal;\n\t\t\tdstAddress= new InetSocketAddress(dstHost, dstPort);\n\t\t\tsocket= new DatagramSocket(srcPort);\n\t\t\tlistener.go();\n\t\t}\n\t\tcatch(java.lang.Exception e) {e.printStackTrace();}\n\t}", "WithCreate withSource(EventChannelSource source);", "@Test\r\n\tpublic void testAddListener() {\r\n\t\t// workspace listener\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\r\n\t\t// cue listener\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addListener(cueListener);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "public ChessclubJinListenerManager(JinChessclubConnection source){\r\n super(source);\r\n\r\n this.source = source;\r\n }", "public BullyMessageListenerFactoryImpl(BullyAlgorithmParticipant self) {\n //We use port as processId since it's coming from the coordinator and guaranteed\n //to be sequential and unique.\n this.self = self;\n }", "public GetConnListener() {\n }", "public void addConnectionListener(ConnectionListener listener);", "public SendContainer(ResourceContainer container, String destination, String senderNickname) {\n super(new MessageBuilder().setCommand(Command.SEND_CONTAINER).setNickname(senderNickname));\n this.container = container;\n this.destination = destination;\n }", "EndPoint createEndPoint();", "public void add(ConnectionListener connectionListener) throws ServerException;", "@Override\n\tpublic void listenerStarted(ConnectionListenerEvent evt) {\n\t\t\n\t}", "private void setupJMS(String destinationName) throws Exception\n { Look up connection factory and destination.\n //\n Context jndiContext = new InitialContext();\n\n ConnectionFactory connectionFactory = \n (ConnectionFactory)jndiContext.lookup(\"jms/ConnectionFactory\");\n \n destination = (Destination)jndiContext.lookup(destinationName);\n\n jndiContext.close();\n\n // Create JMS connection, session, and message consumer\n //\n connection = connectionFactory.createConnection();\n session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n consumer = session.createConsumer(destination);\n consumer.setMessageListener( this );\n connection.start();\n }", "private void ccListenerStarter(){\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t//spin off new ccListener\n\t\t\t\t\n\t\t\t\tThread listenerThread = new Thread(\n\t\t\t\t\t\tnew ClientCommunicatorListener(\n\t\t\t\t\t\t\t\tccSocket.getInputStream(), db, this));\n\t\t\t\t\n\t\t\t\tlistenerThread.start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public void registerConnection(TCPReceiverThread receiverThread, String sourceID, String targetID);", "public abstract void addServiceListener(PhiDiscoverListener listener);", "public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }", "public TcpClient(OnMessageReceived listener) {\n\n messageListener = listener;\n }", "public void start() {\n if ( this.messageListenerContainer == null ) {\n logger.info( \"Listener container is still not assembled. Doing it now for topic {}\", this.topic );\n init();\n }\n logger.info( \"Starting listener: {}\", this.messageListenerContainer );\n this.messageListenerContainer.start();\n }", "private RemoteEventListener getDest()\n throws RemoteException {\n if (!isPrepared) {\n try {\n Object myListener = theMarshalledListener.get();\n\n theListener = (RemoteEventListener)\n GeneratorConfig.getRecoveryPreparer().prepareProxy(myListener);\n isPrepared = true;\n } catch (IOException anIOE) {\n throw new RemoteException(\"Failed to unmarshall listener\",\n anIOE);\n } catch (ClassNotFoundException aCNFE) {\n throw new RemoteException(\"Failed to load class for listener\",\n aCNFE);\n }\n }\n \n return theListener;\n }", "@EventName(\"targetCreated\")\n EventListener onTargetCreated(EventHandler<TargetCreated> eventListener);", "private void addMessageListener(TransportAddress localAddr, MessageTypeEventHandler<?> messageListener) {\n EventDispatcher child = children.get(localAddr);\n if (child == null) {\n child = new EventDispatcher();\n children.put(localAddr, child);\n }\n child.addMessageListener(messageListener);\n }", "Move listen(IListener ll);", "public static void addOnWebSocketConnectionCreatedListener(WebSocketConnectionCreatedListener listener) {\n\t\tif (instance != null) {\n\t\t\tlistener.onWebSocketConnectionCreated(instance);\n\t\t} else {\n\t\t\twebSocketConnectionCreatedListeners.add(listener);\n\t\t}\n\t}", "void subscribeReceiveListener(IDataReceiveListener listener);", "EventChannelDestination destination();", "boolean addConnectionListener(LWSConnectionListener lis);", "public interface DsViaListenInterface extends DsListenInterface {\n\n /** @return port to be used as the source port of outgoing requests */\n public int getSourcePort();\n\n /** @return the interface to be used as the source port of outgoing requests */\n public InetAddress getSourceAddress();\n}", "protected void setup() throws SQLException {\n\t\ttry {\n\t\t\t// get connection factory\n\t\t\tQueueConnectionFactory factory = AQjmsFactory.getQueueConnectionFactory(getOracleDataSource());\n\n\t\t\t// create jms connection\n\t\t\tconn = factory.createQueueConnection();\n\n\t\t\t// set exception listener\n\t\t\tconn.setExceptionListener(this);\n\n\t\t\t// set event listener\n\t\t\t//((com.sun.messaging.jms.Connection) conn).setEventListener(this);\n\n\t\t\t// test if this is a HA connection\n\t\t\t//isHAConnection = ((com.sun.messaging.jms.Connection) conn).isConnectedToHABroker();\n\t\t\t//log(\"Is connected to HA broker cluster: \" + isHAConnection);\n\n\t\t\t// get destination name\n\t\t\tString destName = FailoverQSender.TEST_DEST_NAME;\n\n\t\t\t// create a transacted session\n\t\t\tsession = conn.createQueueSession(true, -1);\n\n\t\t\t// get destination\n\t\t\tqueue = session.createQueue(destName);\n\n\t\t\t// create queue receiver\n\t\t\tqreceiver = session.createReceiver(queue);\n\t\t\t// set isConnected flag to true\n\t\t\tisConnected = true;\n\t\t\t// start the JMS connection\n\t\t\tconn.start();\n\t\t\tlog(\"Ready to receive on destination: \" + destName);\n\t\t} catch (JMSException jmse) {\n\t\t\tisConnected = false;\n\t\t\tlog(jmse);\n\t\t\tclose();\n\t\t}\n\t}", "Container createContainer();", "public void createConnection() {\n final Property targetProperty = getTargetProperty();\n if (targetProperty != null) {\n targetProperty.setSource(getSourceProperty());\n }\n }", "void connectionCreated();", "public void deploy(MDBDescriptor descriptor) throws NamingException, JMSException {\n MessageConsumer consumer;\n Connection connection;\n \n if ( descriptor.isTopic() ){\n \n TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) createJMSObject( \n descriptor.getConnectionFactoryJndiName(), descriptor.isAlreadyBound(), \n new TopicConnectionFactoryImpl()); \n \n Topic topic = (Topic) createJMSObject(descriptor.getDestinationJndiName(), descriptor.isAlreadyBound(),\n new MockTopic(descriptor.getDestinationJndiName())); \n \n TopicConnection topicConnection = topicConnectionFactory.createTopicConnection(this.jmsUsername, this.jmsPassword);\n connection = topicConnection;\n // TODO: implement transactions and acknowledgements\n TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);\n consumer = topicSession.createSubscriber(topic);\n \n }\n else {\n\n QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) createJMSObject( \n descriptor.getConnectionFactoryJndiName(), descriptor.isAlreadyBound(), \n new QueueConnectionFactoryImpl()); \n \n Queue queue = (Queue) createJMSObject(descriptor.getDestinationJndiName(), descriptor.isAlreadyBound(),\n new MockQueue(descriptor.getDestinationJndiName())); \n \n QueueConnection queueConnection = queueConnectionFactory.createQueueConnection(this.jmsUsername, this.jmsPassword);\n connection = queueConnection;\n QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n consumer = queueSession.createReceiver( queue );\n }\n \n // Same routine as for session bean\n MDBHome home = new MDBHome( descriptor );\n MDBHomeIface mdbHome = (MDBHomeIface) home.createProxy();\n \n MessageListener messageListener = mdbHome.create();\n \n consumer.setMessageListener( messageListener );\n connection.start();\n }", "public interface OnServiceConnectionListener {\n}", "EventChannel create();", "public int addListener(Value listener) {\n\n IApplication adapter = new IApplication() {\n private boolean execute(Value jsObject, String memberName, Object... args) {\n if (jsObject == null)\n return true;\n Value member = jsObject.getMember(memberName);\n if (member == null) {\n return true;\n }\n Value result = plugin.executeInContext(member, app);\n return result != null && result.isBoolean() ? result.asBoolean() : true;\n }\n\n @Override\n public boolean appStart(IScope app) {\n return execute(listener, \"appStart\", app);\n }\n\n @Override\n public boolean appConnect(IConnection conn, Object[] params) {\n return execute(listener, \"appConnect\", conn, params);\n }\n\n @Override\n public boolean appJoin(IClient client, IScope app) {\n return execute(listener, \"appJoin\", client, app);\n }\n\n @Override\n public void appDisconnect(IConnection conn) {\n execute(listener, \"appDisconnect\", conn);\n }\n\n @Override\n public void appLeave(IClient client, IScope app) {\n execute(listener, \"appLeave\", client, app);\n }\n\n @Override\n public void appStop(IScope app) {\n execute(listener, \"appStop\", app);\n }\n\n @Override\n public boolean roomStart(IScope room) {\n return execute(listener, \"roomStart\", room);\n }\n\n @Override\n public boolean roomConnect(IConnection conn, Object[] params) {\n return execute(listener, \"roomConnect\", conn, params);\n }\n\n @Override\n public boolean roomJoin(IClient client, IScope room) {\n return execute(listener, \"roomJoin\", client, room);\n }\n\n @Override\n public void roomDisconnect(IConnection conn) {\n execute(listener, \"roomDisconnect\", conn);\n }\n\n @Override\n public void roomLeave(IClient client, IScope room) {\n execute(listener, \"roomLeave\", client, room);\n }\n\n @Override\n public void roomStop(IScope room) {\n execute(listener, \"roomStop\", room);\n }\n };\n this.app.addListener(adapter);\n this.listeners.add(adapter);\n return this.listeners.indexOf(adapter);\n }", "@Test\n public void testShouldNotDuplicateListeners() {\n manager.register(listener);\n manager.publishConnect(\"sessionId\");\n\n verify(listener, only()).onConnect(stringCaptor.capture());\n String id = stringCaptor.getValue();\n assertThat(id, is(equalTo(\"sessionId\")));\n }", "@Bean\n public SimpleMessageListenerContainer containeraaaaa(@Qualifier(\"myqueue\") Queue queue,\n ConnectionFactory connectionFactory) {\n SimpleMessageListenerContainer cont = new SimpleMessageListenerContainer(connectionFactory);\n cont.addQueues(queue);\n return cont;\n }", "interface WithDestination {\n /**\n * Specifies the destination property: Represents the destination of an event channel..\n *\n * @param destination Represents the destination of an event channel.\n * @return the next definition stage.\n */\n WithCreate withDestination(EventChannelDestination destination);\n }", "private DefaultListener() {\n }", "@Bean\n public JmsListenerContainerFactory<?> jmsListenerContainerFactory() {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(connectionFactory());\n factory.setConcurrency(\"1-1\");\n // Potrebno je obezbediti publish/subscribe za topic. Nije neophodno za queue.\n // factory.setPubSubDomain(true);\n return factory;\n }", "public SendContainer(Command command, ResourceContainer container, String destination, int destinationID, String senderNickname) {\n super(new MessageBuilder().setCommand(command).setNickname(senderNickname));\n this.container = container;\n this.destination = destination;\n this.destinationID = destinationID;\n }", "public ConnListener( MasterServerManager serverManager )\n {\n this.serverManager = serverManager;\n }", "private void createMBeanNotificationListener(ObjectName mBeanName, NotificationListener listener) {\n log.debug(\"Adding notification listener for JMXClient \" + url.getURLPath());\n try {\n mbsc.addNotificationListener(mBeanName, listener, null, null);\n } catch (InstanceNotFoundException | IOException e) {\n log.error(\"Unable to add notification listener\", e);\n }\n }", "@Test\r\n\tpublic void testAddWorkspaceListener() {\r\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\t}", "Subscriber create(Subscriber subscriber);", "public synchronized void addConnectionEventListener(ConnectionEventListener connectioneventlistener) {\n/* 130 */ if (this.connectionEventListeners != null) {\n/* 131 */ this.connectionEventListeners.put(connectioneventlistener, connectioneventlistener);\n/* */ }\n/* */ }", "public interface Listener {}", "DelegateContainer() {\n super();\n }", "public interface ConnectionListenerManager extends Serializable\n{\n /**\n * Add a connection listener.\n * \n * @param connectionListener [in] Supplies a reference to the new\n * listener.\n * \n * @throws ServerException if a listener with the same ID already exists.\n */\n public void add(ConnectionListener connectionListener) throws ServerException;\n \n /**\n * Remove a connection listener.\n * \n * @param listenerID [in] Supplies the unique ID of the connection\n * listener to be removed.\n * \n * @return A reference to the removed listener, or null if it didn't\n * exist.\n */\n public ConnectionListener remove(String listenerID);\n \n /**\n * Check to see if the manager is empty.\n * \n * @return True if the manager does not contain any listeners, false if it\n * contains at least one.\n */\n public boolean isEmpty();\n \n /**\n * Check to see if the listeners are active.\n * \n * @return True if the listeners are active, false if not.\n */\n public boolean isRunning();\n\n /**\n * Get a list of all connection listeners.\n * \n * @return A list of listeners.\n */\n public List<String> listeners();\n \n /**\n * Get a reference to a connection listener.\n * \n * @param listenerID [in] Supplies the unique ID of the listener.\n * \n * @return A reference to the listener, null if it does not exist.\n */\n public ConnectionListener getListener(String listenerID);\n \n /**\n * Start all listeners. One or more listener may fail to start due to an\n * IOException. If all listeners fail to start, this method throws a\n * ServerException. If one or more listeners failed to start, but at\n * least one started successfully, this method will return normally, but\n * with a return value of false, so that the caller knows that one or\n * more listener failed to start, and can check the individual listeners\n * to see which failed, and why. The way this would be done would be to\n * iterate over this object's collection of listeners, checking to see which\n * listeners failed to start. When a non-started listener is encountered,\n * the caller would then attempt to start that listener individually, and\n * then handle the resulting IOException individually. Finally, if all\n * listeners start successfully, this method returns true.\n *\n * @return True if all listeners were started successfully, or false if\n * one or more (but not all!) failed to start properly.\n *\n * @throws ServerException if no listeners were started successfully.\n */\n public boolean startAll() throws ServerException;\n \n /**\n * Stop all listeners.\n */\n public void stopAll();\n}", "ConferenceScheduleBuilderService createEventsFromNetworkToEnd();", "public interface OnArrivalListener {\n void onDestinationArrived();\n}", "public interface ServiceConnectionListener {\n /**\n * 服务绑定成功的监听回调\n * 注册或者注销场景TTS回调监听\n *\n * @param callbackListener 返回TTS到客户端的Binder\n */\n void onCallbackNotify(ICallbackListener callbackListener);\n\n /**\n * 服务绑定成功的监听回调\n * 注册或者注销场景回调监听\n *\n * @param sceneNotifyListener 返现场景状态到客户端的Binder\n */\n void onSceneNotifyListener(ISceneNotifyListener sceneNotifyListener);\n}", "public MyEventListenerProxy(MyEventListener listener) {\n super(listener);\n }", "private UDPSender(final URI serverURI) {\n\t\tsuper(serverURI);\n\t\t\n\t\t\t\t\n\t\t//InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());\n\t\tchannelStateListener.addChannelStateAware(this);\n\t\tloggingHandler = new LoggingHandler(InternalLogLevel.ERROR, true);\t\t\n\t\tchannelFactory = new NioDatagramChannelFactory(workerPool);\n\t\tbstrap = new ConnectionlessBootstrap(channelFactory);\n\t\tbstrap.setPipelineFactory(this);\n\t\tbstrap.setOption(\"broadcast\", true);\n\t\tbstrap.setOption(\"localAddress\", new InetSocketAddress(0));\n\t\tbstrap.setOption(\"remoteAddress\", new InetSocketAddress(serverURI.getHost(), serverURI.getPort()));\n\t\tbstrap.setOption(\"receiveBufferSizePredictorFactory\", new FixedReceiveBufferSizePredictorFactory(2048));\n\t\t\n\t\tlisteningSocketAddress = new InetSocketAddress(\"0.0.0.0\", 0);\n\t\t//listeningSocketAddress = new InetSocketAddress(\"127.0.0.1\", 0);\n\t\t\t\n\t\t//senderChannel = (NioDatagramChannel) channelFactory.newChannel(getPipeline());\n\t\tsenderChannel = bstrap.bind();\n\t\tcloseGroup.add(senderChannel);\n\t\tlog(\"Listening on [\" + senderChannel.getLocalAddress()+ \"]\");\t\t\t\t\t\n\t\t\n\t\t\n//\t\tsenderChannel.bind().addListener(new ChannelFutureListener() {\n//\t\t\tpublic void operationComplete(ChannelFuture f) throws Exception {\n//\t\t\t\tif(f.isSuccess()) {\n//\t\t\t\t\tlog(\"Listening on [\" + f.getChannel().getLocalAddress()+ \"]\");\t\t\t\t\t\n//\t\t\t\t} else {\n//\t\t\t\t\tlog(\"Failed to start listener. Stack trace follows\");\n//\t\t\t\t\tf.getCause().printStackTrace(System.err);\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t}\n//\t\t});\n\t\tsenderChannel.getConfig().setBufferFactory(new DirectChannelBufferFactory());\n//\t\tsenderChannel.connect(socketAddress).addListener(new ChannelFutureListener() {\n//\t\t\t@Override\n//\t\t\tpublic void operationComplete(ChannelFuture future) throws Exception {\n//\t\t\t\tconnected.set(true);\t\n//\t\t\t\tsentryState.setState(SentryState.CALLBACK);\n//\t\t\t}\n//\t\t});\n\t\t\n\t\t\n\t\t//socketAddress = new InetSocketAddress(\"239.192.74.66\", 25826);\n\t\tsendHello();\n\t}", "private void initListener()\n {\n listenerTimer = new Timer();\n listenerTimer.schedule(new RemoteListner(this), 1000, 2000);\n }", "public ClientStreamListener delegate() {\n return clientStreamListener;\n }", "public void addIdListener(CardListener listener){\n\t//\tiDListen = listener;\n\t}", "protected abstract void startListener();", "void addVideoListener(CallPeer peer, VideoListener listener);", "public MyListener() {\r\n }", "@Override\n public void registerConnectorListener(RemoteConnectorListener listener) {\n connectorListeners.add(listener);\n }", "protected Listener(){super();}", "public void addConnectionEventListener(ConnectionEventListener listener) {\n eventListener.addConnectorListener(listener);\n }", "public interface Listener {\n}", "public interface Listener {\n}", "public DeliveryHandlerFactory(Collection<MessageListener> listeners)\n\t{\n\t\tthis.listeners = listeners == null ? \n\t\t\tnew ArrayList<MessageListener>() : listeners;\n\t}", "@Override\n public void start(ClientStreamListener listener) {\n listener.onReady();\n }", "@Override\n public void startNotificationListener(DBMSSynchronizer dbmsSynchronizer) {\n Logger.getLogger(ThreadedHousekeeper.class.getName()).setLevel(Level.SEVERE);\n\n this.listener = new PostgresSQLNotificationListener(dbmsSynchronizer);\n\n PGDataSource dataSource = new PGDataSource();\n dataSource.setHost(connectionProperties.getHost());\n dataSource.setPort(connectionProperties.getPort());\n dataSource.setDatabase(connectionProperties.getDatabase());\n dataSource.setUser(connectionProperties.getUser());\n dataSource.setPassword(connectionProperties.getPassword());\n\n try {\n pgConnection = (PGConnection) dataSource.getConnection();\n pgConnection.createStatement().execute(\"LISTEN jabrefLiveUpdate\");\n // Do not use `new PostgresSQLNotificationListener(...)` as the object has to exist continuously!\n // Otherwise the listener is going to be deleted by GC.\n pgConnection.addNotificationListener(listener);\n } catch (SQLException e) {\n LOGGER.error(\"SQL Error: \", e);\n }\n }", "public CopySink() {}", "void createExposedDestinations(List<DestinationTargetModel> destinationTargets,\n\t InboundChannelConfigurationModel inboundChannelConfig,\n\t AbstractCredentialModel credential);", "public void create(yandex.cloud.api.logging.v1.SinkServiceOuterClass.CreateSinkRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateMethod(), responseObserver);\n }", "protected void installListeners() {\n }", "protected void installListeners() {\n }", "public void create(yandex.cloud.api.logging.v1.SinkServiceOuterClass.CreateSinkRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateMethod(), getCallOptions()), request, responseObserver);\n }", "public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);", "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 }", "protected void __listenPostConstruct__() {\n\t\tif(__destinationClass__ == null) {\n\t\t\tClassNameBuilder classNameBuilder = DependencyInjection.inject(ClassNameBuilder.class).setKlass(getClass());\n\t\t\tclassNameBuilder.getSourceNamingModel(Boolean.TRUE).client().controller().entities().setSuffix(\"MapperImpl\");\n\t\t\tclassNameBuilder.getDestinationNamingModel(Boolean.TRUE).server().representation().entities().setSuffix(\"Dto\");\n\t\t\t__destinationClass__ = ValueHelper.returnOrThrowIfBlank(\"representation entity class\"\n\t\t\t\t\t,(Class<DESTINATION>) ClassHelper.getByName(classNameBuilder.execute().getOutput()));\n\t\t}\n }", "Port createPort();", "Port createPort();", "public void initialize() {\r\n\r\n\t\t/** URL of the ActiveMQ broker, prepended by transport protocol **/\r\n\t\tString brokerUrl = config.getConfig().getString(\"broker_url\");\r\n\r\n\t\t/** Topic to subscribe to for receiving access to all notifications **/\r\n\t\tString topicName = config.getConfig().getString(\"topic\");\r\n\r\n\t\t/** Username for authenticating with the ActiveMQ broker **/\r\n\t\tString userName = config.getConfig().getString(\"user\");\r\n\r\n\t\t/** The password corresponding to the username **/\r\n\t\tString password = config.getConfig().getString(\"password\");\r\n\r\n\t\t// Creates a connection\r\n\t\tActiveMQSslConnectionFactory connectionFactory = new ActiveMQSslConnectionFactory(\r\n\t\t\t\tbrokerUrl);\r\n\r\n\t\t// Setting the trust manager to the connection factory\r\n\t\tconnectionFactory.setKeyAndTrustManagers(null, trustedCerts,\r\n\t\t\t\tnew SecureRandom());\r\n\t\tconnectionFactory.setWatchTopicAdvisories(false);\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (logger.isDebugEnabled()){\r\n\t\t\t\tlogger.debug(\"creating connection to \" + brokerUrl);\r\n\t\t\t}\r\n\t\t\t// Connect to the broker\r\n\t\t\tConnection connection = connectionFactory.createConnection(\r\n\t\t\t\t\tuserName, password);\r\n\r\n\t\t\t// Creating session for sending messages\r\n\t\t\tsession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\r\n\t\t\tconnection.start();\r\n\r\n\t\t\t// Creating the topic (i.e. creating a link to the already existing\r\n\t\t\t// one on the broker)\r\n\t\t\tTopic topic = session.createTopic(topicName);\r\n\r\n\t\t\t// MessageConsumer is used for receiving (consuming) messages from\r\n\t\t\t// the topic (above given threshold)\r\n\t\t\tMessageConsumer consumer = session.createConsumer(topic);\r\n\t\t\tconsumer.setMessageListener(this);\r\n\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"Connection to Notification with Id \"\r\n\t\t\t\t\t\t+ connection.getClientID() + \" Listening for messages\");\r\n\t\t\t}\r\n\r\n\t\t} catch (JMSException e) {\r\n\t\t\tsession = null;\r\n\t\t\tlogger.error(\"[JMS Exception] \" + e.getMessage());\r\n\t\t}\r\n\t}", "public ICpDeviceList createListRoot(ICpDeviceListListener aListener)\n\t{\n\t\treturn new CpDeviceListUpnpRoot(aListener);\n\t}", "public IncomingMsgHandler(OnMessageReceivedListener listener) {\n listenerReference = new WeakReference<>(listener);\n }", "@Override\n\tpublic void registListener(IListener listener) throws RemoteException {\n\t\tremoteCallbackList.register(listener);\n\t}", "public interface ConnectionEventListener {\n /** \n * Called on all listeners when a connection is made or broken. \n */\n void connectionActivity(ConnectionEvent ce);\n}", "public void addTarget(Target target) {\n SocketChannel socketChannel = null;\n try {\n socketChannel = SocketChannel.open();\n socketChannel.configureBlocking(false);\n socketChannel.connect(target.address);\n target.socketChannel = socketChannel;\n target.connectStart = System.currentTimeMillis();\n synchronized (targets) {\n targets.add(target);\n }\n selector.wakeup();\n } catch (IOException e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n if (socketChannel != null) {\n try {\n socketChannel.close();\n } catch (IOException e1) {\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n target.failure = e;\n addFinishedTarget(target);\n }\n\n }", "public interface ServerRegisterListener {\r\n \r\n /**\r\n * Register server listener.\r\n *\r\n * @param server the server\r\n */\r\n public void registerServerListener(Server server);\r\n \r\n}", "protected void installListeners() {\n\n\t}", "public ClusterPeerListener( String listenerId, String listenerAddr, int listenerPort){\r\n\r\n\t\tsuper();\r\n\r\n\t\tthis.listenerId = listenerId;\r\n\t\tthis.listenerAddr = listenerAddr;\r\n\t\tthis.listenerPort = listenerPort;\r\n\t}", "public SubscriptionListener() {\n this.protocol = \"stomp\";\n }", "@Before\n public void setUp() throws Exception {\n Map<String, Object> consumerProperties =\n KafkaTestUtils.consumerProps(\"sender\", \"false\",\n embeddedKafka.getEmbeddedKafka());\n\n // create a Kafka consumer factory\n /*\n Next a DefaultKafkaConsumerFactory and ContainerProperties are created, the ContainerProperties contains runtime properties\n (in this case the topic name) for the listener container. Both are then passed to the KafkaMessageListenerContainer constructor.\n */\n DefaultKafkaConsumerFactory<String, Object> consumerFactory =\n new DefaultKafkaConsumerFactory<String, Object>(\n consumerProperties);\n\n // set the topic that needs to be consumed\n ContainerProperties containerProperties =\n new ContainerProperties(SENDER_TOPIC);\n\n // create a Kafka MessageListenerContainer\n\n container = new KafkaMessageListenerContainer<>(consumerFactory,containerProperties);\n\n // create a thread safe queue to store the received messages\n /*\n Received messages need to be stored somewhere. In this example, a thread-safe BlockingQueue is used.\n We create a new MessageListener and in the onMessage() method we add the received message to the BlockingQueue.\n */\n records = new LinkedBlockingQueue<>();\n\n // setup a Kafka message listener\n container\n .setupMessageListener(new MessageListener<String, Object>() {\n @Override\n public void onMessage(\n ConsumerRecord<String, Object> record) {\n LOGGER.debug(\"test-listener received message='{}'\",record.toString());\n records.add(record);\n }\n });\n\n // start the container and underlying message listener\n container.start();\n\n // wait until the container has the required number of assigned partitions\n ContainerTestUtils.waitForAssignment(container,\n embeddedKafka.getEmbeddedKafka().getPartitionsPerTopic());\n }" ]
[ "0.65735394", "0.5930692", "0.5914101", "0.57666457", "0.5678457", "0.5656262", "0.5619613", "0.5604012", "0.53921604", "0.5345176", "0.53274935", "0.53188217", "0.53182876", "0.529274", "0.5271293", "0.5267569", "0.52647835", "0.52456933", "0.5214078", "0.51640326", "0.5159777", "0.5156699", "0.5155725", "0.51551384", "0.5148264", "0.5135614", "0.5122245", "0.5115475", "0.5110174", "0.5103387", "0.51027113", "0.5099766", "0.50889117", "0.5057581", "0.5044797", "0.5027488", "0.5023752", "0.49882558", "0.4983543", "0.49812415", "0.49669936", "0.49465266", "0.49428377", "0.49389756", "0.49314937", "0.49014616", "0.49003732", "0.48949522", "0.48794487", "0.48662785", "0.48509645", "0.48443955", "0.48415703", "0.48270577", "0.48133147", "0.48085898", "0.48061454", "0.48049164", "0.48036942", "0.47972944", "0.4793872", "0.47930992", "0.47888303", "0.47812983", "0.4777902", "0.47713807", "0.47700253", "0.4767926", "0.4765849", "0.47595647", "0.47529095", "0.47429335", "0.4742482", "0.4741242", "0.4741242", "0.47385424", "0.47273085", "0.47200644", "0.4717752", "0.47052595", "0.47012922", "0.46975195", "0.46975195", "0.4696964", "0.4696034", "0.46951205", "0.46940574", "0.4692422", "0.4692422", "0.46910775", "0.4684375", "0.46841788", "0.4673868", "0.4672863", "0.4669217", "0.46652704", "0.46605808", "0.46517304", "0.46467593", "0.46458146" ]
0.612895
1